Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Certification - Submit Scripts For RavenNuke(tm) Certification
Author Message
draxx
Involved
Involved



Joined: Nov 19, 2003
Posts: 282

PostPosted: Sat Mar 14, 2009 11:24 pm Reply with quote

Code:


<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/*         Additional security & Abstraction layer conversion           */
/*                           2003 chatserv                              */
/*      http://www.nukefixes.com -- http://www.nukeresources.com        */
/************************************************************************/
/************************************************************************/
/* Additional code clean-up, performance enhancements, and W3C and      */
/* XHTML compliance fixes by Raven and Montego.                         */
/************************************************************************/

if ( !defined('BLOCK_FILE') ) {
   Header('Location: ../index.php');
   die();
}

global $prefix, $multilingual, $currentlang, $db, $boxTitle, $content, $pollcomm, $user, $cookie, $userinfo;

if ($multilingual == 1) {
   $querylang = 'WHERE planguage=\''.$currentlang.'\' AND artid=\'0\'';
} else {
   $querylang = 'WHERE artid=\'0\'';
}

/** added for random - Random stuff from chatserv **/

mt_srand((double)microtime()*1000000);
$total = $db->sql_numrows($db->sql_query("select * from ".$prefix."_poll_desc"));
if ($total==0) $artrand=0;
else
$artrand = mt_rand(0,($total-1));
$pollID = $artrand;

// OLD list($pollID) = $db->sql_fetchrow($db->sql_query('SELECT pollID FROM '.$prefix.'_poll_desc '.$querylang.' ORDER BY pollID DESC LIMIT 1'));
list($pollID) = $db->sql_fetchrow($db->sql_query('SELECT pollID FROM '.$prefix.'_poll_desc '.$querylang.' ORDER BY pollID DESC LIMIT '.$artrand.', 1'));

/** end add -- translated by draxx **/

$pollID = intval($pollID);
if ($pollID == 0 || empty($pollID)) {
   $content = '';
} else {
   $content = '';
   if (!isset($url)) {
      $url = 'modules.php?name=Surveys&amp;op=results&amp;pollID='.$pollID;
   }
   $content .= '<form action="modules.php?name=Surveys" method="post">';
   $content .= '<input type="hidden" name="pollID" value="'.$pollID.'" />';
   $content .= '<input type="hidden" name="forwarder" value="'.$url.'" />';
   list($pollTitle, $voters) = $db->sql_fetchrow($db->sql_query('SELECT pollTitle, voters FROM '.$prefix.'_poll_desc WHERE pollID=\''.$pollID.'\''));
   $pollTitle = check_html($pollTitle, 'nohtml');
   $voters = intval($voters);
   $boxTitle = _SURVEY;
   $content .= '<span class="content"><strong>'.$pollTitle.'</strong></span><br /><br />';
   $content .= '<table border="0" width="100%">';
   for($i = 1; $i <= 12; $i++) {
      $sql = 'SELECT pollID, optionText, optionCount, voteID FROM '.$prefix.'_poll_data WHERE pollID=\''.$pollID.'\' AND voteID=\''.$i.'\'';
      $query = $db->sql_query($sql);
      list($pollID, $optionText, $optionCount, $voteID) = $db->sql_fetchrow($query);
      $pollID = intval($pollID);
      $voteID = intval($voteID);
      $optionCount = intval($optionCount);
      if (!empty($optionText)) {
         $content .= '<tr><td valign="top"><input type="radio" name="voteID" value="'.$i.'" /></td><td width="100%"><span class="content">'.$optionText.'</span></td></tr>';
      }
   }
   $content .= '</table><br /><center><span class="content"><input type="submit" value="'._VOTE.'" /></span><br />';
   if (is_user($user)) {
      cookiedecode($user);
      getusrinfo($user);
   }
   $sum = 0;
   for($i = 0; $i < 12; $i++) {
      $sql = 'SELECT optionCount FROM '.$prefix.'_poll_data WHERE pollID=\''.$pollID.'\' AND voteID=\''.$i.'\'';
      $query = $db->sql_query($sql);
      list($optionCount) = $db->sql_fetchrow($query);
      $optionCount = intval($optionCount);
      $sum = (int)$sum+$optionCount;
   }

   if (!isset($mode) OR empty($mode)) {
      if(isset($userinfo['umode'])) {
         $mode = $userinfo['umode'];
      } else {
         $mode = 'thread';
      }
   }
   if (!isset($order) OR empty($order)) {
      if(isset($userinfo['uorder'])) {
         $order = $userinfo['uorder'];
      } else {
         $order = 0;
      }
   }
   if (!isset($thold) OR empty($thold)) {
      if(isset($userinfo['thold'])) {
         $thold = $userinfo['thold'];
      } else {
         $thold = 0;
      }
   }
   $r_options = '';
   $r_options .= '&amp;mode='.$mode;
   $r_options .= '&amp;order='.$order;
   $r_options .= '&amp;thold='.$thold;
   $content .= '<br /><span class="content"><a href="modules.php?name=Surveys&amp;op=results&amp;pollID='.$pollID.$r_options.'"><strong>'
      ._RESULTS.'</strong></a><br /><a href="modules.php?name=Surveys"><strong>'._POLLS.'</strong></a><br />';

   if ($pollcomm) {
      $sql = 'SELECT * FROM '.$prefix.'_pollcomments WHERE pollID=\''.$pollID.'\'';
      $query = $db->sql_query($sql);
      $numcom = $db->sql_numrows($query);
      $content .= '<br />'._VOTES.': <strong>'.intval($sum).'</strong> <br /> '._PCOMMENTS.' <strong>'.intval($numcom).'</strong>';
   } else {
      $content .= '<br />'._VOTES.' <strong>'.intval($sum).'</strong>';
   }
   $content .= '</span></center></form>';
}

?>
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sun Mar 15, 2009 5:06 pm Reply with quote

Thank you for your submission! I/We will get to this just as soon as we can and will let you know if there are any issues.
 
View user's profile Send private message
NeapolitanWorld
Involved
Involved



Joined: Nov 06, 2005
Posts: 339
Location: Los Angeles, USA

PostPosted: Mon Mar 16, 2009 1:13 pm Reply with quote

So far this block is working great for me! props for the nice work draxx Very Happy

jc

_________________
My Raven Site Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message
Raven







PostPosted: Mon Mar 16, 2009 5:46 pm Reply with quote

Please do not use this forum for comments/discussions. All discussion should be in http://www.ravenphpscripts.com/forum216.html. Thanks!
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Certification - Submit Scripts For RavenNuke(tm) Certification

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©