PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
draxx
Worker
Worker


Joined: Nov 19, 2003
Posts: 186

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

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: 16976
Location: Kansas

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

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 Visit poster's website AIM Address Yahoo Messenger
NeapolitanWorld
Involved
Involved


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

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

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

jc
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16976
Location: Kansas

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

Please do not use this forum for comments/discussions. All discussion should be in
Only registered users can see links on this board!
Get registered or login to the forums!
Thanks!
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum