Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks
Author Message
Blues
Regular
Regular



Joined: Jun 17, 2006
Posts: 81
Location: MD

PostPosted: Fri Dec 28, 2007 11:13 pm Reply with quote

Running Nuke 7.8 I have a Survey block that for some reason is displaying the Donations at the top of the surveys. The wierd thing is when viewing the polls by clicking the "Polls" link or "Voting Booth" it no longer displays the Donations information.

The Donate-O-Meter block is also loaded, but in its own block. I searched the forums and found that others had this problem in the past, but I saw no resolution. In this case I noted that you can vote, and it retains the information, but for some strange reason the donations data replicates to the top of the survey block.

Anyone seen and resolved this in the past?

Here is my block-survey.php code

Code:


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'";
}

$row = $db->sql_fetchrow($db->sql_query("SELECT pollID FROM ".$prefix."_poll_desc $querylang ORDER BY pollID DESC LIMIT 1"));
$pollID = intval($row['pollID']);
if ($pollID == 0 || $pollID == "") {
    $content = "";
} else {
    if (!isset($url)) {
   $url = sprintf("modules.php?name=Surveys&op=results&pollID=%d", $pollID);
    }
    $content .= "<form action=\"surveys.html\" method=\"post\">";
    $content .= "<input type=\"hidden\" name=\"pollID\" value=\"".$pollID."\">";
    $content .= "<input type=\"hidden\" name=\"forwarder\" value=\"".$url."\">";
    $row2 = $db->sql_fetchrow($db->sql_query("SELECT pollTitle, voters FROM ".$prefix."_poll_desc WHERE pollID='$pollID'"));
    $pollTitle = $row2['pollTitle'];
    $voters = intval($row2['voters']);
    $boxTitle = _SURVEY;
    $content .= "<font class=\"content\"><b>$pollTitle</b></font><br><br>\n";
    $content .= "<table border=\"0\" width=\"100%\">";
    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";
       }
   }
    }
    $content .= "</table><br><center><font class=\"content\"><input type=\"submit\" value=\""._VOTE."\"></font><br>";
    if (is_user($user)) {
   cookiedecode($user);
    }
    for($i = 0; $i < 12; $i++) {
   $row4 = $db->sql_fetchrow($db->sql_query("SELECT optionCount FROM ".$prefix."_poll_data WHERE (pollID='$pollID') AND (voteID='$i')"));
   $optionCount = intval($row4['optionCount']);
   $sum = (int)$sum+$optionCount;
    }
    $content .= "<br><font class=\"content\"><a href=\"modules.php?name=Surveys&amp;op=results&amp;pollID=$pollID&amp;mode=$cookie[4]&amp;order=$cookie[5]&amp;thold=$cookie[6]\"><b>"._RESULTS."</b></a><br><a href=\"surveys.html\"><b>"._POLLS."</b></a><br>";

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

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



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sat Dec 29, 2007 12:12 am Reply with quote

The solution provided in the forums has worked 100% of the time for me.
 
View user's profile Send private message
Blues







PostPosted: Sat Dec 29, 2007 12:47 am Reply with quote

In my case the Treasury block is modified and not via paypal but a store front.

However, I did finally locate Only registered users can see links on this board! Get registered or login! where it advised to delete $content variable from global. At first when I ran across this earlier I didn't know where to look, but I finally found it.

Thanks!
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks

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 ©