require_once './include/fnc_admin.inc.php'; session_control(); // switch blog mode and binary mode if ($session_status == 'on') { if (isset($_REQUEST['id']) && $_REQUEST['id'] !== NULL) { $id = $_REQUEST['id']; // query to pull out the recent articles. $sql = 'SELECT' . " `id`, `href`, `name`, `date`, DATE_FORMAT(`mod`, '%Y-%m-%d %T') as `mod`, `comment`, `category`, `draft`" . " FROM `{$log_table}` WHERE `id` = '{$id}'"; $res = mysql_query($sql); $row = mysql_fetch_array($res); $row = convert_to_utf8($row); if ($cfg['show_date_title'] == 'yes') { format_date($row_name = 'date'); $title_date = $formatted_date; $date_section_begin = '<div class="section">' . "\n" . '<h2 class="date-title">' . $title_date . "</h2>\n"; $date_section_end = "\n</div><!-- End .section -->"; } else { $date_section_begin = ''; $date_section_end = ''; } $contents = $date_section_begin; $contents .= display_article_box($row); $contents .= $date_section_end; } else { $contents = display_by_id_form('article'); } xhtml_output(''); } else { header('Location: ' . $http . '://' . $_SERVER['HTTP_HOST'] . $cfg['root_path'] . 'index.php'); exit; }
do { format_date($row_name = 'date'); $tmp_date = $formatted_date; if ($title_date != $tmp_date) { $title_date = $tmp_date; $section_content .= '</div><!-- End .section -->' . "\n\n" . '<div class="section">' . "\n" . '<h2 class="date-title">' . $title_date . "</h2>\n"; } $row = convert_to_utf8($row); $section_content .= display_article_box($row); } while ($row = mysql_fetch_array($res)); //------------- WITHOUT-DATE-TITLE MODE -------------- } else { $section_content = ''; while ($row = mysql_fetch_array($res)) { $row = convert_to_utf8($row); $section_content .= display_article_box($row); } } } else { $flip_link = ''; $section_content = '<h2>' . $lang['no_matches'] . "</h2>"; } } else { $flip_link = ''; $section_content = '<h2>' . $lang['no_matches'] . "</h2>"; } } else { $hit_result = ''; $flip_link = ''; $section_content = '<h2>' . $lang['category'] . "</h2>\n" . '<p>' . $lang['status_idle'] . "</p>\n"; }
$prev_title = htmlspecialchars(strip_tags($row_prev['name'])); $next_entry = <<<EOD <p class="flip-link"> <span class="prev"><a href="./article.php?id={$row_prev['id']}" title=""{$prev_title}"">{$lang['prev']}</a></span> <span class="next"><a href="./article.php?id={$row_next['id']}" title=""{$next_title}"">{$lang['next']}</a></span> </p> EOD; } } else { $next_entry = ''; } if ($row) { $row = convert_to_utf8($row); format_date($row_name = 'date'); $title_date = $formatted_date; $article_box = display_article_box($row); $contents = <<<EOD <div class="section"> {$next_entry} <h2 class="date-title">{$title_date}</h2> {$article_box} </div> EOD; } else { header('Location: ' . $http . '://' . $_SERVER['HTTP_HOST'] . $cfg['root_path'] . 'var/contents/index.php?id=error404'); exit; } } else { $id_form = display_by_id_form('article'); $contents = <<<EOD <div class="section">