if ($story['ratings'] > 0) { $rate = substr($story['score'] / $story['ratings'], 0, 4); $r_image = round($rate); $the_image = '<br /><br /><img src="' . (file_exists('themes/' . $CPG_SESS['theme'] . '/images/news/stars-' . $r_image . '.gif') ? 'themes/' . $CPG_SESS['theme'] . '/images/news/stars-' . $r_image . '.gif' : 'images/news/stars-' . $r_image . '.gif') . '" alt="" /><br />'; } else { $rate = 0; $the_image = '<br />'; } $content = "<div style=\"text-align:center;\">" . _AVERAGESCORE . ": <b>{$rate}</b><br />" . _VOTES . ": <b>{$story['ratings']}</b>{$the_image}" . _RATETHISARTICLE . "</div><br />"; $content .= '<form action="' . URL::index() . '" method="post"><div>'; $content .= '<input type="hidden" name="sid" value="' . $sid . '" />'; $content .= '<input type="radio" name="score" value="5" /> <img src="' . (file_exists('themes/' . $CPG_SESS['theme'] . '/images/news/stars-5.gif') ? 'themes/' . $CPG_SESS['theme'] . '/images/news/stars-5.gif' : 'images/news/stars-5.gif') . '" alt="' . _EXCELLENT . '" title="' . _EXCELLENT . '" /><br />'; $content .= '<input type="radio" name="score" value="4" /> <img src="' . (file_exists('themes/' . $CPG_SESS['theme'] . '/images/news/stars-4.gif') ? 'themes/' . $CPG_SESS['theme'] . '/images/news/stars-4.gif' : 'images/news/stars-4.gif') . '" alt="' . _VERYGOOD . '" title="' . _VERYGOOD . '" /><br />'; $content .= '<input type="radio" name="score" value="3" /> <img src="' . (file_exists('themes/' . $CPG_SESS['theme'] . '/images/news/stars-3.gif') ? 'themes/' . $CPG_SESS['theme'] . '/images/news/stars-3.gif' : 'images/news/stars-3.gif') . '" alt="' . _GOOD . '" title="' . _GOOD . '" /><br />'; $content .= '<input type="radio" name="score" value="2" /> <img src="' . (file_exists('themes/' . $CPG_SESS['theme'] . '/images/news/stars-2.gif') ? 'themes/' . $CPG_SESS['theme'] . '/images/news/stars-2.gif' : 'images/news/stars-2.gif') . '" alt="' . _REGULAR . '" title="' . _REGULAR . '" /><br />'; $content .= '<input type="radio" name="score" value="1" /> <img src="' . (file_exists('themes/' . $CPG_SESS['theme'] . '/images/news/stars-1.gif') ? 'themes/' . $CPG_SESS['theme'] . '/images/news/stars-1.gif' : 'images/news/stars-1.gif') . '" alt="' . _BAD . '" title="' . _BAD . '" /><br /><br /></div>'; $content .= '<div style="text-align:center;"><input type="submit" value="' . _CASTMYVOTE . '" /></div></form>'; $block = array('bid' => 10003, 'view' => 0, 'side' => 'r', 'title' => _RATEARTICLE, 'content' => $content); $Blocks->custom($block); $content = '<br /> <img src="images/news/print.gif" style="width:16px; height:11px;" alt="' . _PRINTER . '" title="' . _PRINTER . '" /> <a href="' . URL::index('&file=print&sid=' . $sid) . '">' . _PRINTER . '</a><br /><br />'; if (can_admin('news')) { $content .= '<div style="text-align:center;"><b>' . _ADMIN . '</b><br />[ <a href="' . URL::admin('&mode=add') . '">' . _ADD . '</a> | <a href="' . URL::admin('&edit=' . $sid) . '">' . _EDIT . '</a> | <a href="' . URL::admin('&del=' . $sid) . '">' . _DELETE . '</a> ]</div>'; } $block = array('bid' => 10004, 'view' => 0, 'side' => 'r', 'title' => _OPTIONS, 'content' => $content); $Blocks->custom($block); require_once 'header.php'; $cpgtpl->display('body'); if ($story['acomm'] && $MAIN_CFG['global']['articlecomm'] && $userinfo['umode'] != 'nocomments') { require_once "modules/{$module_name}/comments.php"; DisplayComments($sid, $story['title']); }
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}"; } $topic = isset($_GET['topic']) ? intval($_GET['topic']) : (isset($_GET['new_topic']) ? intval($_GET['new_topic']) : 0);
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)) { echo "<b>•</b> {$ptitle} ({$votes} " . _LVOTES . ")<br /><br />"; } $db->sql_freeresult($resu); echo '<a href="' . URL::index() . '"><b>' . _MOREPOLLS . '</b></a>'; CloseTable(); echo '</td></tr></table>'; if ($MAIN_CFG['global']['pollcomm'] && $userinfo['umode'] != 'nocomments') { DisplayComments($poll_id, $title); } } elseif ($poll_id != pollLatest()) { echo '<div style="text-align:center;" class="option">' . _SURVEY . '</div>'; CloseTable(); echo '<br /><br /><table border="0" style="margin:auto;"><tr><td>'; if (pollVoted($poll_id)) { pollResults($poll_id); } else { pollMain($poll_id); } echo '</td></tr></table>'; } else { echo '<div style="text:align:center;" class="option">' . _CURRENTSURVEY . '</div>'; CloseTable(); echo '<br /><br /><table border="0" style="margin:auto;"><tr><td>';