home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 April / PCWorld_2005-04_cd.bin / akce / web / unitednuke / unitednuke.exe / html / modules / Surveys / index.php < prev   
PHP Script  |  2004-02-19  |  19KB  |  408 lines

  1. <?php
  2.  
  3. /************************************************************************/
  4. /* PHP-NUKE: Web Portal System                                          */
  5. /* ===========================                                          */
  6. /*                                                                      */
  7. /* Copyright (c) 2002 by Francisco Burzi                                */
  8. /* http://phpnuke.org                                                   */
  9. /*                                                                      */
  10. /* This program is free software. You can redistribute it and/or modify */
  11. /* it under the terms of the GNU General Public License as published by */
  12. /* the Free Software Foundation; either version 2 of the License.       */
  13. /************************************************************************/
  14.  
  15. if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
  16.     die ("You can't access this file directly...");
  17. }
  18.  
  19. require_once("mainfile.php");
  20. $module_name = basename(dirname(__FILE__));
  21. get_lang($module_name);
  22.  
  23. $pagetitle = "- "._SURVEYS."";
  24.  
  25. if(isset($pollID)) {
  26. $pollID = intval($pollID);
  27. }
  28.  
  29. if(!isset($pollID)) {
  30.     include ('header.php');
  31.     pollList();
  32.     include ('footer.php');
  33. } elseif(isset($forwarder)) {
  34.     pollCollector($pollID, $voteID, $forwarder);
  35. } elseif($op == "results" && $pollID > 0) {
  36.     include ("header.php");
  37.     OpenTable();
  38.     echo "<center><font class=\"title\"><b>"._CURRENTPOLLRESULTS."</b></font></center>";
  39.     CloseTable();
  40.     echo "<br>";
  41.     echo "<table border='0' width='100%'><tr><td width='70%' valign='top'>";
  42.     OpenTable();
  43.     pollResults($pollID);
  44.     CloseTable();
  45.     echo "</td><td> </td><td width='30%' valign='top'>";
  46.     OpenTable();
  47.     echo "<b>"._LAST5POLLS." $sitename</b><br><br>";
  48.     if (isset($cookie[4])) { $r_options .= "&mode=$cookie[4]"; }
  49.     if (isset($cookie[5])) { $r_options .= "&order=$cookie[5]"; }
  50.     if (isset($cookie[6])) { $r_options .= "&thold=$cookie[6]"; }
  51.     $result = $db->sql_query("SELECT pollID, pollTitle, voters FROM ".$prefix."_poll_desc where artid='0' order by timeStamp DESC limit 1,6");
  52.     while ($row = $db->sql_fetchrow($result)) {
  53.     $plid = intval($row['pollID']);
  54.     $pltitle = $row['pollTitle'];
  55.     $plvoters = $row['voters'];
  56.     if ($pollID == $plid) {
  57.         echo "<img src='images/arrow.gif' border='0'> $pltitle ($plvoters "._LVOTES.")<br><br>";
  58.     } else {
  59.         echo "<img src='images/arrow.gif' border='0'> <a href='modules.php?name=$module_name&op=results&pollID=$plid$r_options'>$pltitle</a> ($plvoters "._LVOTES.")<br><br>";
  60.     }
  61.     }
  62.     echo "<a href='modules.php?name=$module_name'><b>"._MOREPOLLS."</b></a>";
  63.     CloseTable();
  64.     echo "</td></tr></table>";
  65.     cookiedecode($user);
  66.     if (($pollcomm) AND ($mode != "nocomments")) {
  67.     echo "<br><br>";
  68.     include("modules/Surveys/comments.php");
  69.     }
  70.     include ("footer.php");
  71. } elseif($voteID > 0) {
  72.     pollCollector($pollID, $voteID);
  73. } elseif($pollID != pollLatest()) {
  74.     include ('header.php');
  75.     OpenTable();
  76.     echo "<center><font class=\"option\"><b>"._SURVEY."</b></font></center>";
  77.     CloseTable();
  78.     echo "<br><br>";
  79.     echo "<table border=\"0\" align=\"center\"><tr><td>";
  80.     pollMain($pollID);
  81.     echo "</td></tr></table>";
  82.     include ('footer.php');
  83. } else {
  84.     include ('header.php');
  85.     OpenTable();
  86.     echo "<center><font class=\"option\"><b>"._CURRENTSURVEY."</b></font></center>";
  87.     CloseTable();
  88.     echo "<br><br><table border=\"0\" align=\"center\"><tr><td>";
  89.     pollNewest();
  90.     echo "</td></tr></table>";
  91.     include ('footer.php');
  92. }
  93.  
  94. /*********************************************************/
  95. /* Functions                                             */
  96. /*********************************************************/
  97.  
  98. function pollMain($pollID) {
  99.     global $boxTitle, $boxContent, $pollcomm, $user, $cookie, $prefix, $dbi, $module_name, $db;
  100.     $pollID = intval($pollID);
  101.     if(!isset($pollID))
  102.     $pollID = 1;
  103.     if(!isset($url))
  104.     $url = sprintf("modules.php?name=$module_name&op=results&pollID=%d", $pollID);
  105.     $boxContent .= "<form action=\"modules.php?name=$module_name\" method=\"post\">";
  106.     $boxContent .= "<input type=\"hidden\" name=\"pollID\" value=\"".$pollID."\">";
  107.     $boxContent .= "<input type=\"hidden\" name=\"forwarder\" value=\"".$url."\">";
  108.     $result_a = $db->sql_query("SELECT pollTitle, voters FROM ".$prefix."_poll_desc WHERE pollID='$pollID'");
  109.     list($pollTitle, $voters) = $db->sql_fetchrow($result_a);
  110.     $boxTitle = _SURVEY;
  111.     $boxContent .= "<font class=\"content\"><b>$pollTitle</b></font><br><br>\n";
  112.     $boxContent .= "<table border=\"0\" width=\"100%\">";
  113.     for($i = 1; $i <= 12; $i++) {
  114.     $result = sql_query("SELECT pollID, optionText, optionCount, voteID FROM ".$prefix."_poll_data WHERE pollID='$pollID' AND voteID='$i'", $dbi);
  115.     $object = sql_fetch_object($result, $dbi);
  116.     if(is_object($object)) {
  117.         $optionText = $object->optionText;
  118.         if($optionText != "") {
  119.         $boxContent .= "<tr><td valign=\"top\"><input type=\"radio\" name=\"voteID\" value=\"".$i."\"></td><td width=\"100%\"><font class=\"content\">$optionText</font></td></tr>\n";
  120.         }
  121.     }
  122.     }
  123.     $boxContent .= "</table><br><center><font class=\"content\"><input type=\"submit\" value=\""._VOTE."\"></font><br>";
  124.     if (is_user($user)) {
  125.         cookiedecode($user);
  126.     }
  127.     for($i = 0; $i < 12; $i++) {
  128.     $result2 = sql_query("SELECT optionCount FROM ".$prefix."_poll_data WHERE pollID='$pollID' AND voteID='$i'", $dbi);
  129.     $object = sql_fetch_object($result2, $dbi);
  130.     $optionCount = $object->optionCount;
  131.     $sum = (int)$sum+$optionCount;
  132.     }
  133.     $boxContent .= "<br><font class=\"content\"><a href=\"modules.php?name=$module_name&op=results&pollID=$pollID&mode=$cookie[4]&order=$cookie[5]&thold=$cookie[6]\"><b>"._RESULTS."</b></a><br><a href=\"modules.php?name=$module_name\"><b>"._OTHERPOLLS."</b></a><br>";
  134.  
  135.     if ($pollcomm) {
  136.     list($numcom) = $db->sql_fetchrow($db->sql_query("select count(*) from ".$prefix."_pollcomments where pollID='$pollID'"));
  137.     $boxContent .= "<br>"._VOTES.": <b>$sum</b> <br> "._PCOMMENTS." <b>$numcom</b>\n\n";
  138.     } else {
  139.         $boxContent .= "<br>"._VOTES." <b>$sum</b>\n\n";
  140.     }
  141.     $boxContent .= "</font></center></form>\n\n";
  142.     themesidebox($boxTitle, $boxContent);
  143. }
  144.  
  145. function pollLatest() {
  146.     global $prefix, $multilingual, $currentlang, $db;
  147.     if ($multilingual == 1) {
  148.     $querylang = "WHERE planguage='$currentlang' AND artid='0'";
  149.     } else {
  150.     $querylang = "WHERE artid='0'";
  151.     }
  152.     $pollID = $db->sql_fetchrow($db->sql_query("SELECT pollID FROM ".$prefix."_poll_desc $querylang ORDER BY pollID DESC LIMIT 1"));
  153.     return($pollID[0]);
  154. }
  155.  
  156. function pollNewest() {
  157.     $pollID = pollLatest();
  158.     pollMain($pollID);
  159. }
  160.  
  161. function pollCollector($pollID, $voteID, $forwarder) {
  162.     global $HTTP_COOKIE_VARS, $prefix, $db;
  163.     /* Fix for lamers that like to cheat on polls */
  164.     if (empty($ip)) {
  165.     $ip = $_SERVER["REMOTE_ADDR"];
  166.     }
  167.     $past = time()-1800;
  168.     $db->sql_query("DELETE FROM ".$prefix."_poll_check WHERE time < '$past'");
  169.     $pollID = intval($pollID);
  170.     $row = $db->sql_fetchrow($db->sql_query("SELECT ip FROM ".$prefix."_poll_check WHERE (ip='$ip') AND (pollID='$pollID')"));
  171.     $ips = $row['ip'];
  172.     $ctime = time();
  173.     $pollID = intval($pollID);
  174.     if ($ip == $ips) {
  175.     $voteValid = 0;
  176.     } else {
  177.     $db->sql_query("INSERT INTO ".$prefix."_poll_check (ip, time, pollID) VALUES ('$ip', '$ctime', '$pollID')");
  178.     $voteValid = "1";
  179.     }
  180.     /* Fix end */
  181.     /* update database if the vote is valid */
  182.     if($voteValid>0) {
  183.         $db->sql_query("UPDATE ".$prefix."_poll_data SET optionCount=optionCount+1 WHERE pollID='$pollID' AND voteID='$voteID'");
  184.         if ($voteID != "") {
  185.         $db->sql_query("UPDATE ".$prefix."_poll_desc SET voters=voters+1 WHERE pollID='$pollID'");
  186.         }
  187.     Header("Location: $forwarder");
  188.     } else {
  189.         Header("Location: $forwarder");
  190.     }
  191.     /* a lot of browsers can't handle it if there's an empty page */
  192.     echo "<html><head></head><body></body></html>";
  193. }
  194.  
  195. function pollList() {
  196.     global $user, $cookie, $prefix, $multilingual, $currentlang, $admin, $dbi, $module_name, $db;
  197.     if (isset($cookie[4])) { $r_options .= "&mode=$cookie[4]"; }
  198.     if (isset($cookie[5])) { $r_options .= "&order=$cookie[5]"; }
  199.     if (isset($cookie[6])) { $r_options .= "&thold=$cookie[6]"; }
  200.     if ($multilingual == 1) {
  201.         $querylang = "WHERE planguage='$currentlang' AND artid='0'";
  202.     } else {
  203.         $querylang = "WHERE artid='0'";
  204.     }
  205.     $result = sql_query("SELECT pollID, pollTitle, timeStamp, voters FROM ".$prefix."_poll_desc $querylang ORDER BY timeStamp DESC", $dbi);
  206.     $counter = 0;
  207.     OpenTable();
  208.     OpenTable();
  209.     echo "<center><font class=\"title\"><b>"._PASTSURVEYS."</b></font></center>";
  210.     CloseTable();
  211.     echo "<table border=\"0\" cellpadding=\"8\"><tr><td>";
  212.     while($object = sql_fetch_object($result, $dbi)) {
  213.     $resultArray[$counter] = array($object->pollID, $object->pollTitle, $object->timeStamp, $object->voters);
  214.     $counter++;
  215.     }
  216.     for ($count = 0; $count < count($resultArray); $count++) {
  217.     $id = $resultArray[$count][0];
  218.     $pollTitle = $resultArray[$count][1];
  219.     $voters = $resultArray[$count][3];
  220.     for($i = 0; $i < 12; $i++) {
  221.         $result2 = sql_query("SELECT optionCount FROM ".$prefix."_poll_data WHERE pollID='$id' AND voteID='$i'", $dbi);
  222.         $object = sql_fetch_object($result2, $dbi);
  223.         $optionCount = $object->optionCount;
  224.         $sum = (int)$sum+$optionCount;
  225.     }
  226.     echo "<strong><big>·</big></strong> <a href=\"modules.php?name=$module_name&pollID=$id\">$pollTitle</a> ";
  227.     if (is_admin($admin)) {
  228.         $editing = " - <a href=\"admin.php?op=polledit&pollID=$id\">"._EDIT."</a>";
  229.     } else {
  230.         $editing = "";
  231.     }
  232.     echo "(<a href=\"modules.php?name=$module_name&op=results&pollID=$id$r_options\">"._RESULTS."</a> - $sum "._LVOTES."$editing)<br>\n";
  233.     $sum = 0;
  234.     }
  235.     echo "</td></tr></table>"
  236.     ."<br>";
  237.     OpenTable();
  238.     echo "<center><font class=\"title\"><b>"._SURVEYSATTACHED."</b></font></center>";
  239.     CloseTable();
  240.     echo "<table border=\"0\" cellpadding=\"8\"><tr><td>";
  241.     if ($multilingual == 1) {
  242.         $querylang = "WHERE planguage='$currentlang' AND artid!='0'";
  243.     } else {
  244.         $querylang = "WHERE artid!='0'";
  245.     }
  246.     $counter = 0;
  247.     $result3 = sql_query("SELECT pollID, pollTitle, timeStamp, voters FROM ".$prefix."_poll_desc $querylang ORDER BY timeStamp DESC", $dbi);
  248.     while($object = sql_fetch_object($result3, $dbi)) {
  249.     $resultArray2[$counter] = array($object->pollID, $object->pollTitle, $object->timeStamp, $object->voters);
  250.     $counter++;
  251.     }
  252.     for ($count = 0; $count < count($resultArray2); $count++) {
  253.     $id = $resultArray2[$count][0];
  254.     $pollTitle = $resultArray2[$count][1];
  255.     $voters = $resultArray2[$count][3];
  256.     for($i = 0; $i < 12; $i++) {
  257.         $result4 = sql_query("SELECT optionCount FROM ".$prefix."_poll_data WHERE pollID='$id' AND voteID='$i'", $dbi);
  258.         $object = sql_fetch_object($result4, $dbi);
  259.         $optionCount = $object->optionCount;
  260.         $sum = (int)$sum+$optionCount;
  261.     }
  262.     echo "<strong><big>·</big></strong> <a href=\"modules.php?name=$module_name&pollID=$id\">$pollTitle</a> ";
  263.     if (is_admin($admin)) {
  264.         $editing = " - <a href=\"admin.php?op=polledit&pollID=$id\">"._EDIT."</a>";
  265.     } else {
  266.         $editing = "";
  267.     }
  268.     $res = $db->sql_query("select sid, title from ".$prefix."_stories where pollID='$id'");
  269.     list($sid, $title) = $db->sql_fetchrow($res);
  270.     echo "(<a href=\"modules.php?name=$module_name&op=results&pollID=$id$r_options\">"._RESULTS."</a> - $sum "._LVOTES."$editing)<br>\n"
  271.         .""._ATTACHEDTOARTICLE." <a href=\"modules.php?name=News&file=article&sid=$sid$r_options\">$title</a><br><br>\n";
  272.     $sum = "";
  273.     }
  274.     echo "</td></tr></table>";
  275.     CloseTable();
  276. }
  277.  
  278. function pollResults($pollID) {
  279.     global $resultTableBgColor, $resultBarFile, $Default_Theme, $user, $cookie, $prefix, $dbi, $admin, $module_name, $db;
  280.     if(!isset($pollID)) $pollID = 1;
  281.     $pollID = intval($pollID);
  282.     $result = $db->sql_query("SELECT pollID, pollTitle, timeStamp, artid FROM ".$prefix."_poll_desc WHERE pollID='$pollID'");
  283.     $holdtitle = $db->sql_fetchrow($result);
  284.     echo "<b>$holdtitle[1]</b><br><br>";
  285.     for($i = 0; $i < 12; $i++) {
  286.     $pollID = intval($pollID);
  287.     $result2 = sql_query("SELECT optionCount FROM ".$prefix."_poll_data WHERE pollID='$pollID' AND voteID='$i'", $dbi);
  288.     $object = sql_fetch_object($result2, $dbi);
  289.     $optionCount = $object->optionCount;
  290.     $sum = (int)$sum+$optionCount;
  291.     }
  292.     echo "<table border=\"0\">";
  293.     /* cycle through all options */
  294.     for($i = 1; $i <= 12; $i++) {
  295.     /* select next vote option */
  296.     $pollID = intval($pollID);
  297.     $result3 = sql_query("SELECT pollID, optionText, optionCount, voteID FROM ".$prefix."_poll_data WHERE pollID='$pollID' AND voteID='$i'", $dbi);
  298.     $object = sql_fetch_object($result3, $dbi);
  299.     if(is_object($object)) {
  300.         $optionText = $object->optionText;
  301.         $optionCount = $object->optionCount;
  302.         if($optionText != "") {
  303.         echo "<tr><td>";
  304.         echo "$optionText";
  305.         echo "</td>";
  306.         if($sum) {
  307.             $percent = 100 * $optionCount / $sum;
  308.         } else {
  309.             $percent = 0;
  310.         }
  311.         echo "<td>";
  312.         $percentInt = (int)$percent * 4 * 1;
  313.         $percent2 = (int)$percent;
  314.         if(is_user($user)) {
  315.             if($cookie[9]=="") $cookie[9]=$Default_Theme;
  316.             if(!$file=@opendir("themes/$cookie[9]")) {
  317.             $ThemeSel = $Default_Theme;
  318.             } else {
  319.             $ThemeSel = $cookie[9];
  320.             }
  321.         } else {
  322.             $ThemeSel = $Default_Theme;
  323.         }
  324.         if (file_exists("themes/$ThemeSel/images/survey_leftbar.gif") AND file_exists("themes/$ThemeSel/images/survey_mainbar.gif") AND file_exists("themes/$ThemeSel/images/survey_rightbar.gif")) {
  325.             $l_size = getimagesize("themes/$ThemeSel/images/survey_leftbar.gif");
  326.                 $m_size = getimagesize("themes/$ThemeSel/images/survey_mainbar.gif");
  327.             $r_size = getimagesize("themes/$ThemeSel/images/survey_rightbar.gif");
  328.             $leftbar = "survey_leftbar.gif";
  329.             $mainbar = "survey_mainbar.gif";
  330.             $rightbar = "survey_rightbar.gif";
  331.         } else {
  332.             $l_size = getimagesize("themes/$ThemeSel/images/leftbar.gif");
  333.                 $m_size = getimagesize("themes/$ThemeSel/images/mainbar.gif");
  334.             $r_size = getimagesize("themes/$ThemeSel/images/rightbar.gif");
  335.             $leftbar = "leftbar.gif";
  336.             $mainbar = "mainbar.gif";
  337.             $rightbar = "rightbar.gif";
  338.         }
  339.         if (file_exists("themes/$ThemeSel/images/survey_mainbar_d.gif")) {
  340.             $m1_size = getimagesize("themes/$ThemeSel/images/survey_mainbar_d.gif");
  341.             $mainbar_d = "survey_mainbar_d.gif";
  342.             if ($percent2 > 0 AND $percent2 <= 23) {
  343.             $salto = "<img src=\"themes/$ThemeSel/images/$mainbar\" alt=\"$percent2 %\" title=\"$percent2 %\" height=\"$m_size[1]\" width=\"$percentInt\">";
  344.             } elseif ($percent2 > 24 AND $percent2 < 50) {
  345.             $a = $percentInt - 100;
  346.             $salto = "<img src=\"themes/$ThemeSel/images/$mainbar\" alt=\"$percent2 %\" title=\"$percent2 %\" height=\"$m_size[1]\" width=\"70\">"
  347.                 ."<img src=\"themes/$ThemeSel/images/$mainbar_d\" alt=\"$percent2 %\" title=\"$percent2 %\" height=\"$m1_size[1]\" width=\"30\">"
  348.                 ."<img src=\"themes/$ThemeSel/images/$mainbar\" alt=\"$percent2 %\" title=\"$percent2 %\" height=\"$m_size[1]\" width=\"$a\">";
  349.             } elseif ($percent2 > 49 AND $percent2 < 75) {
  350.             $a = $percentInt - 200;
  351.             $salto = "<img src=\"themes/$ThemeSel/images/$mainbar\" alt=\"$percent2 %\" title=\"$percent2 %\" height=\"$m_size[1]\" width=\"70\">"
  352.                 ."<img src=\"themes/$ThemeSel/images/$mainbar_d\" alt=\"$percent2 %\" title=\"$percent2 %\" height=\"$m1_size[1]\" width=\"30\">"
  353.                 ."<img src=\"themes/$ThemeSel/images/$mainbar\" alt=\"$percent2 %\" title=\"$percent2 %\" height=\"$m_size[1]\" width=\"70\">"
  354.                 ."<img src=\"themes/$ThemeSel/images/$mainbar_d\" alt=\"$percent2 %\" title=\"$percent2 %\" height=\"$m1_size[1]\" width=\"30\">"
  355.                 ."<img src=\"themes/$ThemeSel/images/$mainbar\" alt=\"$percent2 %\" title=\"$percent2 %\" height=\"$m_size[1]\" width=\"$a\">";
  356.             } elseif ($percent2 > 74 AND $percent2 <= 100) {
  357.             $a = $percentInt - 300;
  358.             $salto = "<img src=\"themes/$ThemeSel/images/$mainbar\" alt=\"$percent2 %\" title=\"$percent2 %\" height=\"$m_size[1]\" width=\"70\">"
  359.                     ."<img src=\"themes/$ThemeSel/images/$mainbar_d\" alt=\"$percent2 %\" title=\"$percent2 %\" height=\"$m1_size[1]\" width=\"30\">"
  360.                 ."<img src=\"themes/$ThemeSel/images/$mainbar\" alt=\"$percent2 %\" title=\"$percent2 %\" height=\"$m_size[1]\" width=\"70\">"
  361.                 ."<img src=\"themes/$ThemeSel/images/$mainbar_d\" alt=\"$percent2 %\" title=\"$percent2 %\" height=\"$m1_size[1]\" width=\"30\">"
  362.                 ."<img src=\"themes/$ThemeSel/images/$mainbar\" alt=\"$percent2 %\" title=\"$percent2 %\" height=\"$m_size[1]\" width=\"70\">"
  363.                 ."<img src=\"themes/$ThemeSel/images/$mainbar_d\" alt=\"$percent2 %\" title=\"$percent2 %\" height=\"$m1_size[1]\" width=\"30\">"
  364.                 ."<img src=\"themes/$ThemeSel/images/$mainbar\" alt=\"$percent2 %\" title=\"$percent2 %\" height=\"$m_size[1]\" width=\"$a\">";
  365.             }
  366.         }
  367.         if ($percent > 0) {
  368.             echo "<img src=\"themes/$ThemeSel/images/$leftbar\" height=\"$l_size[1]\" width=\"$l_size[0]\" alt=\"$percent2 %\" title=\"$percent2 %\">";
  369.             if (file_exists("themes/$ThemeSel/images/survey_mainbar_d.gif")) {
  370.             echo "$salto";
  371.             } else {
  372.             echo "<img src=\"themes/$ThemeSel/images/$mainbar\" height=\"$m_size[1]\" width=\"$percentInt\" alt=\"$percent2 %\" title=\"$percent2 %\">";
  373.             }
  374.             echo "<img src=\"themes/$ThemeSel/images/$rightbar\" height=\"$r_size[1]\" width=\"$r_size[0]\" alt=\"$percent2 %\" title=\"$percent2 %\">";
  375.         } else {
  376.             echo "<img src=\"themes/$ThemeSel/images/$leftbar\" height=\"$l_size[1]\" width=\"$l_size[0]\" alt=\"$percent2 %\" title=\"$percent2 %\">";
  377.             if (!file_exists("themes/$ThemeSel/images/survey_mainbar_d.gif")) {
  378.             echo "<img src=\"themes/$ThemeSel/images/$mainbar\" height=\"$m_size[1]\" width=\"$m_size[0]\" alt=\"$percent2 %\" title=\"$percent2 %\">";
  379.             }
  380.             echo "<img src=\"themes/$ThemeSel/images/$rightbar\" height=\"$r_size[1]\" width=\"$r_size[0]\" alt=\"$percent2 %\" title=\"$percent2 %\">";
  381.         }
  382.                 printf(" %.2f%% (%s)", $percent, $optionCount);
  383.         echo "</td></tr>";
  384.         }
  385.     }
  386.  
  387.     }
  388.     echo "</table><br>";
  389.     echo "<center><font class=\"content\">";
  390.     echo "<b>"._TOTALVOTES." $sum</b><br>";
  391.     echo "<br><br>";
  392.     $booth = $pollID;
  393.     $booth = intval($booth);
  394.     if ($holdtitle[3] > 0) {
  395.     $article = "<br><br>"._GOBACK."</font></center>";
  396.     } else {
  397.     $article = "</font></center>";
  398.     }
  399.     echo "[ <a href=\"modules.php?name=$module_name&pollID=$booth\">"._VOTING."</a> | "
  400.     ."<a href=\"modules.php?name=$module_name\">"._OTHERPOLLS."</a> ] $article";
  401.     if (is_admin($admin)) {
  402.     echo "<br><center>[ <a href=\"admin.php?op=create\">"._ADD."</a> | <a href=\"admin.php?op=polledit&pollID=$pollID\">"._EDIT."</a> ]</center>";
  403.     }
  404.     return(1);
  405. }
  406.  
  407. ?>
  408.