I know that their are performance issues with the Surveys block and the ammount of querys it puts on the database. Does anyone know a fix for this, or code that I can patch to lessen the strain on the server?
edogs Lieutenant
Joined: Sep 10, 2003
Posts: 172
Location: Russia
Posted:
Tue Sep 28, 2004 8:12 am
ryanrbftp wrote:
I know that their are performance issues with the Surveys block and the ammount of querys it puts on the database. Does anyone know a fix for this, or code that I can patch to lessen the strain on the server?
For example, in block, you can make next thing
Code:
//onchange1
$result_z=$db->sql_query("SELECT pollID, optionText, optionCount, voteID FROM ".$prefix."_poll_data WHERE pollID='$pollID' order by voteID ");
while($row3 = $db->sql_fetchrow($result_z)) {
$optionText = $row3['optionText'];
if ($optionText != "") {
$content .= "<tr><td valign=\"top\"><input type=\"radio\" name=\"voteID\" value=\"".$i."\"></td><td width=\"100%\"><font class=\"content\">$optionText</font></td></tr>\n";
}
}
//onchange2
/*
for($i = 1; $i <= 12; $i++) {
$row3 = $db->sql_fetchrow($db->sql_query("SELECT pollID, optionText, optionCount, voteID FROM ".$prefix."_poll_data WHERE (pollID='$pollID') AND (voteID='$i')"));
if(isset($row3)) {
$optionText = $row3['optionText'];
if ($optionText != "") {
$content .= "<tr><td valign=\"top\"><input type=\"radio\" name=\"voteID\" value=\"".$i."\"></td><td width=\"100%\"><font class=\"content\">$optionText</font></td></tr>\n";
}
}
}
*/
You see higher commented lines, these lines you have to find and comment. And insert right higher these lines the code which here writen higher that lines. It'll save a lot of queries.
It's one part of our optimized php-nuke which working great:-)
another option, you can get very good survey script at www.eklon.com , called Opros
ryanrbftp Private
Joined: Aug 08, 2003
Posts: 43
Posted:
Tue Sep 28, 2004 9:01 am
I can't seem to find the "onchange" you mentioned. Here is my surveys block code:
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. */
/************************************************************************/
if (eregi("block-Survey.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
global $prefix, $multilingual, $currentlang, $db, $boxTitle, $content, $pollcomm, $user, $cookie;
if ($multilingual == 1) {
$querylang = "WHERE planguage='$currentlang' AND artid='0'";
} else {
$querylang = "WHERE artid='0'";
}
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