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