require_once "modules/{$module_name}/comments.php"; if (isset($_POST['postreply'])) { replyPost($sid); // store the reply } else { if (isset($_GET['reply'])) { reply($sid); // reply to comment } elseif (isset($_POST['preview'])) { replyPreview($sid); // Preview the reply before storage } else { if (isset($_GET['comment'])) { // Show comment X if (!isset($_GET['pid'])) { singlecomment(intval($_GET['comment']), $sid); } else { DisplayComments($sid, '', intval($_GET['pid']), intval($_GET['comment'])); } } else { $storynum = is_user() && $userinfo['storynum'] && $MAIN_CFG['member']['user_news'] ? $userinfo['storynum'] : $MAIN_CFG['global']['storyhome']; if (isset($_GET['page']) && intval($_GET['page']) > 1) { $page = intval($_GET['page']); $pagetitle .= '- ' . _PAGE . ' ' . $page; } else { $page = 1; } $offset = ($page - 1) * $storynum; $querylang = $MAIN_CFG['global']['multilingual'] ? "(alanguage='{$currentlang}' OR alanguage='')" : ''; if ($MAIN_CFG['global']['multilingual']) { $querylang = "AND {$querylang}";
// store the reply replyPost($poll_id); } require_once 'header.php'; OpenTable(); if (isset($_GET['reply'])) { // reply to comment reply($poll_id); } elseif (isset($_POST['preview'])) { // Preview the reply before storage replyPreview($poll_id); } else { if (isset($_GET['comment'])) { // Show comment X if (!isset($_GET['pid'])) { singlecomment(intval($_GET['comment']), $poll_id); } else { DisplayComments($poll_id, '', intval($_GET['pid']), intval($_GET['comment'])); } } elseif ($op == 'results' && $poll_id > 0) { echo '<div style="text-align:center;" class="title">' . _CURRENTPOLLRESULTS . '</div>'; CloseTable(); echo '<table border="0" width="100%" cellpadding="0" cellspacing="0"><tr><td width="70%" valign="top">'; OpenTable(); $title = pollResults($poll_id); CloseTable(); echo '</td><td> </td><td width="30%" valign="top">'; OpenTable(); echo '<b>' . _LAST5POLLS . " {$MAIN_CFG['global']['sitename']}</b><br /><br />"; $resu = $db->sql_query("SELECT poll_id, poll_title, voters FROM " . $prefix . "_poll_desc WHERE artid=0 AND poll_id<>{$poll_id} ORDER BY time_stamp DESC LIMIT 5"); while (list($id, $ptitle, $votes) = $db->sql_fetchrow($resu)) {
$ip = $_SERVER['REMOTE_ADDR']; if (strlen($q) > 20 && $row['last_moderation_ip'] != $ip) { $db->sql_query($q); $db->sql_query("UPDATE " . $prefix . "_pollcomments SET last_moderation_ip='{$ip}' WHERE tid='{$tdw}'"); } } } } } Header("Location: modules.php?name={$module_name}&op=results&pollID={$pollID}"); break; case "showreply": DisplayTopic($pollID, $pid, $tid, $mode, $order, $thold); break; default: global $module_name, $mode, $userinfo, $order, $thold; if (isset($tid) && !isset($pid)) { singlecomment($tid, $pollID, $mode, $order, $thold); } elseif (!isset($pid)) { Header("Location: modules.php?name={$module_name}&op=results&pollID={$pollID}&mode={$mode}&order={$order}&thold={$thold}"); } else { if (!isset($pid)) { $pid = 0; } if (!isset($tid)) { $tid = 0; } DisplayTopic($pollID, $pid, $tid, $mode, $order, $thold); } break; }
$q .= " score=score+1, reason={$emp['1']} where tid='{$tdw}'"; } elseif ($emp[1] < 5 && $emp[0] > -1) { $q .= " score=score-1, reason={$emp['1']} where tid='{$tdw}'"; } elseif ($emp[0] == -1 || $emp[0] == 5) { $q .= " reason={$emp['1']} where tid='{$tdw}'"; } if (strlen($q) > 20) { $db->sql_query($q); } } } } } Header("Location: modules.php?name={$module_name}&file=article&sid={$sid}&mode={$mode}&order={$order}&thold={$thold}"); break; case "showreply": DisplayTopic($sid, $pid, $tid, $mode, $order, $thold); break; default: if (isset($tid) && !isset($pid)) { singlecomment($tid, $sid, $mode, $order, $thold); } elseif ($mainfile xor $pid == 0 and !isset($pid)) { Header("Location: modules.php?name={$module_name}&file=article&sid={$sid}&mode={$mode}&order={$order}&thold={$thold}"); } else { if (!isset($pid)) { $pid = 0; } DisplayTopic($sid, $pid, $tid, $mode, $order, $thold); } break; }