'; ## jquery $styles .= ''. ''; $styles .= ''. ''; include_once ('global_header.php'); $template->set('box_top', box_top('Financial Bridges')); $template->set('box_issue_top', box_top('Archive Issues')); $template->set('box_bottom', box_bottom()); if (!$session->value('user_id')) { $can_download = false; $template->set('button', button('Login To View Latest Issue', 200)); } else if ($session->value('can_download')) { $can_download = true; } else { if(!$session->value('free_trial')) { $template->set('button', button('Free Trial', 100)); } else $template->set('button', button('Subscribe', 100)); } $id = (int)$_REQUEST['issue']; $query = "SELECT * FROM " . DB_PREFIX . "fb_issue WHERE live=1"; if(is_numeric($id) && $id>0) { $query .= " AND id='" . $id . "'"; ## addthis $addthis_link = $setts['site_path'].'financialbridges.php?id='.$id; ## } else $addthis_link = $setts['site_path'].'financialbridges.php'; $query .= " ORDER BY id DESC LIMIT 1"; $sql_select_issue = $db->get_sql_row($query); if($sql_select_issue['issue']!=null) { $template->set('issue_name', $sql_select_issue['issue']); // issue name if($sql_select_issue['image']) $image = ''; else $image = ''; $template->set('issue_image', $image); // issue image $sql_select_section = $db->query("SELECT * FROM " . DB_PREFIX . "fb_section WHERE issue_id='" . $sql_select_issue['id'] . "' AND hidden='0' ORDER BY the_order ASC, id ASC"); (string) $browse_issue_content = null; //g while ($section_details = $db->fetch_array($sql_select_section)) { $browse_issue_content .= ' '. $section_details['section_name'].' '; $sql_select_articles = $db->query("SELECT * FROM " . DB_PREFIX . "fb_articles WHERE section_id='" . $section_details['id'] . "' AND hidden='0' ORDER BY the_order ASC, id ASC"); while ($article_details = $db->fetch_array($sql_select_articles)) { if($can_download && $article_details['path']!='') $url_link = '» '.$db->add_special_chars($article_details['name']).' [download]'; else $url_link = '» '.$db->add_special_chars($article_details['name']); $browse_issue_content .= ''.$url_link.''; } $browse_issue_content .= ''; } //end WHILE } //end IF ## archive issues $query = "SELECT * FROM " . DB_PREFIX . "fb_issue WHERE live=1"; $query .= " ORDER BY id DESC"; /* $query = "SELECT id FROM " . DB_PREFIX . "fb_issue WHERE live=1 AND id >= COALESCE((SELECT id FROM ". DB_PREFIX . "fb_issue WHERE id < ".$id." ORDER BY id DESC LIMIT 1 OFFSET 4), '') ORDER BY id LIMIT 5";*/ $sql_issue = $db->query($query); $archive_issue_content = null; //g while ($issue_details = $db->fetch_array($sql_issue)) { if($issue_details['image']) $image = ''; else $image = ''; $archive_issue_content .= '
'.$image.'
'.$issue_details['issue'].'
'; } //end WHILE ## addthis button $addthis = ' Bookmark and Share '; ## $template->set('archive_issue_content', $archive_issue_content); $template->set('browse_issue_content', $browse_issue_content); $template->set('addthis', $addthis); $template_output .= $template->process('financialbridges.tpl.php'); include_once ('global_footer.php'); echo $template_output; ?>