Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.6
Author Message
Rumbaar
Regular
Regular



Joined: Apr 16, 2004
Posts: 78
Location: Melbourne, Australia

PostPosted: Mon Oct 24, 2005 8:49 pm Reply with quote

Note: Downloaded patched full php-nuke 7.6, 3.1 from RavenScripts.

I'm having and issue with the Survey block/module. I had the default poll there from creation and every time someone would vote it would take them to a blank screen. But I found if you press vote without selecting an entry it would reload the survey module into the middle and then if you voted from there it would function correctly.

Now I've deleted that poll and tried to create a new one, but when I try to create a poll it take me to a blank admin page and doesn't populate all the poll data.

This is the poll I tried to create:
What do you think of the site?
The best
Ok
Ok, needs more content
So-so
Crap!
The worst ever!
What is a site?

Now it only poplutes 'The best' and 'Ok' and not the rest.

Any assistance would be appreciated. I've read that there was a bug and there was a later version of the Survey index.php file?

Thx in advance
Rumbaar

_________________
Victim's aren't we all! 
View user's profile Send private message Visit poster's website
64bitguy
The Mouse Is Extension Of Arm



Joined: Mar 06, 2004
Posts: 1164

PostPosted: Tue Oct 25, 2005 10:41 am Reply with quote

Try removing the comma.

_________________
Steph Benoit
100% Section 508 and W3C HTML5 and CSS Compliant (Truly) Code, because I love compliance. 
View user's profile Send private message
Rumbaar







PostPosted: Tue Oct 25, 2005 5:04 pm Reply with quote

OK I'll try that.

But I think the blank page after voting has to do with this section of code:

Code:
} elseif(isset($forwarder)) {

    pollCollector($pollID, $voteID, addslashes(str_replace("<", "&lt;", str_replace(">", "&gt;", $forwarder))));


As the pollCollector function is called here, with no $forwarder
Code:
} elseif(isset($voteID) AND ($voteID > 0)) {

    pollCollector($pollID, $voteID);


But the function has the $forwarder variable:
Code:
function pollCollector($pollID, $voteID, $forwarder) {


I'm not sure of the purpose of the str_replace in the forwarder URL as it turns the URL into a non functional URL and hence a blank page, but valid 'looking' URL in the browser window.

This is the standard index.php file that is included in the 7.6 3.1 fully patched download.
 
64bitguy







PostPosted: Wed Oct 26, 2005 12:52 am Reply with quote

Because in the context it is used, they would be forbidden tags. The $forwarder variable is valid and does work as was demonstrated by your test example. You have to understand that there are two possible starting points for the result. Within the module or the homepage where the block is. I've recently addressed this elsewhere, but start by removing the comma, then test this with a default theme like DeepBlue. If you don't have the same problems, you know it is a theme issue. If you still experience problems, report back and we'll try to look into it deeper.
 
Rumbaar







PostPosted: Wed Oct 26, 2005 2:36 am Reply with quote

I found the $variable didn't work for me. I had two issues, creating a poll and voting in a poll.

The pollCollector function is only called (from what I can tell) when someone votes and that displayed a blank page each and everytime. So I can't see where that worked.

The creation of a new poll was half an issue. But I'm unable to test with the default theme DeepBlue as I've deleted all those and using a custom theme.

I've since replaced the Survey index.php file with the patched 7.9 version and it all appears to function correctly now. The only major difference I can see in the two files is that $forwarder variable.

Thank you for you time though.
 
64bitguy







PostPosted: Wed Oct 26, 2005 2:39 am Reply with quote

You should be aware that Nuke 7.9 uses a different security and data management model than Nuke 7.6. You are potentially putting yourself at severe risk by mixing 7.9 designed modules on a 7.6 platform.
 
Rumbaar







PostPosted: Wed Oct 26, 2005 8:30 pm Reply with quote

Ok I'll try to get the block working with 7.6

I've found that the:
$boxContent .= "<input type=\"hidden\" name=\"forwarder\" value=\"".$url."\">";

isn't being passed to the Block Content when it's generated on the main page, but if it's access via the polls module directly away from the main poge the <input type=\"hidden\" name=\"forwarder\" value=\"".$url."\"> contents is being sent. Hence able to vote there, but not off the main page.

All other form action and input type=\"hidden\" name=\"pollID\" value=\"".$pollID."\" is being sent just not the second input type that the $forwarder code uses.

It's got me stumped and it look's like I'll have to upload DeepBlue and test on that theme.
 
Rumbaar







PostPosted: Thu Oct 27, 2005 4:36 am Reply with quote

Some extra info.

I've found that it 'refreshes' to a blank page after a vote when using FireFox, but the same action in IE has the page 'refresh' back to the main page.

d*** browsers....
 
64bitguy







PostPosted: Thu Oct 27, 2005 4:41 am Reply with quote

Have you tried this with DeepBlue using the original 7.6 patched 3.1 code yet?
 
Rumbaar







PostPosted: Thu Oct 27, 2005 4:28 pm Reply with quote

Yes I tried it just then. Re-uploaded the 3.1 patched DeepBlue theme. Got the blank page after casting vote. Same as when I was using my custom theme.

The only difference I can tell from the 7.6 and 7.9 file is the inclusion of the $forwarder variable in various functions of the code. I still can't work out the use of the str_replace and checking in that URL. What can be exploited for it to needed?

The 7.9 code does do a check on $pollID <= 0 that 7.6 doesn't do.
 
64bitguy







PostPosted: Thu Oct 27, 2005 6:06 pm Reply with quote

Well, I suspect that your mixing of files hasn't helped this situation at all. There was (as in past tense, months ago) issues with the surverys module and patched; however, again it was fixed and there have been zero reports of problems. I can only suspect that either you were using an old revision or have some other problem associated with playing with the files or otherwise mixing files from different versions. Put simply, you can't do that.

I suggest that you re-download "Patched 3.1" for PHP-Nuke 7.6 from [ Only registered users can see links on this board! Get registered or login! ] and reupload those files. Obviously, you would NOT re-run the update.php as when you installed "Patched 3.1" the first time, you would have run that to update the database tables.

Once you have done all of that, please advise.
 
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Thu Oct 27, 2005 6:12 pm Reply with quote

Just as an FYI, I just did a fresh install of my d/l 7.6pl3.1 (an older pl3.1) and the $forwarder is blank and so it craps out. What's puzzling is that I have installed this on so many sites and never had a problem. Of course I am testing on windoze and all my installs are on *nix. Hmmmm.
 
View user's profile Send private message
Rumbaar







PostPosted: Thu Oct 27, 2005 6:14 pm Reply with quote

Well the files that are in it (Survey Module) are all pure 7.6 3.1 files I can garantee that now.

Also in another recent thread Raven and Chatserv are looking into the $forwarder issue as we speak, so hopefully something will come of that. (here)

Edit: Thx for that Raven. Well I've installed that install on my host which is Apache and MySQL and getting the issue with the blank $forwarder. Please look at the input type for forwarder not showing up in main page block.
 
64bitguy







PostPosted: Thu Oct 27, 2005 6:27 pm Reply with quote

Well, mine is Linux Apache (my 7.6 and 4 of my test domains that are running the various versions of 7.6.3.1) and I can't find a problem. Mine not only doesn't come up blank, the the $forwarder actually has a value. So I can't figure out what the heck is going on. Could the be a windows problem relative the use of sprint and header?

Steph
 
Rumbaar







PostPosted: Thu Oct 27, 2005 6:34 pm Reply with quote

Would I be able to get a copy of the index.php that you have that is working? So I can compare apple with apple, I understand if that's not possible.

Also it does work when the survey is called via the module, but not when it called via the block.

But I'll let those in the know think about it and leave it be for now.

Thx for all your time.
 
64bitguy







PostPosted: Thu Oct 27, 2005 6:35 pm Reply with quote

I have 4 different versions of the block code. Do you want to see the latest?

Are you running this on a M$ server? or is it Linux?
 
Rumbaar







PostPosted: Thu Oct 27, 2005 7:14 pm Reply with quote

Well I'd be happy with latest or the one that is working for you.

My host is running Linux, Apache 1.3.33 (Unix) and PHP 4.3.11
 
chatserv
Member Emeritus



Joined: May 02, 2003
Posts: 1389
Location: Puerto Rico

PostPosted: Sat Oct 29, 2005 11:40 am Reply with quote

Code:
<?php


/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2005 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 ( !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'";
}

list($pollID) = $db->sql_fetchrow($db->sql_query("SELECT pollID FROM ".$prefix."_poll_desc $querylang ORDER BY pollID DESC LIMIT 1"));
$pollID = intval($pollID);
if ($pollID == 0 || empty($pollID)) {
   $content = "";
} else {
   if (!isset($url)) {
           $url = sprintf("modules.php?name=Surveys&amp;op=results&amp;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."\">";
   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>\n";
   $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>\n";
      }
   }
   $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=\"surveys.html\"><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>\n\n";
   } else {
      $content .= "<br>"._VOTES." <strong>".intval($sum)."</strong>\n\n";
   }
   $content .= "</span></center></form>\n\n";
}

?>
 
View user's profile Send private message Visit poster's website
Dacubz
Worker
Worker



Joined: Apr 27, 2004
Posts: 156
Location: Homer Glen, Illinois

PostPosted: Fri Nov 04, 2005 9:59 pm Reply with quote

I just reinstalled 7.6 and the newest Sentinel. I can set my poll options, but clicking to create brings up a blank page. I've searched the forums, but can't find my answer. I've been reintalling my entire site and am almost done. I have re-uploaded all survey related files BTW.
 
View user's profile Send private message Visit poster's website
j_felosi
Regular
Regular



Joined: Oct 17, 2005
Posts: 51

PostPosted: Sat Nov 05, 2005 8:27 am Reply with quote

Well I seen this post and tried mine and had the same problem so I uploaded the cz-enhanced survey block and it fixed it. Its also a better survey block anyway cause it only lets people vote once then they just see the results from then on plus it does random surveys and everything. Give it a try [ Only registered users can see links on this board! Get registered or login! ]

well here is the block in code for your convience

Code:
<?php

/********************************************************/
/* Enhanced Survey Block                                */
/* By: Telli (telli@codezwiz.com)                       */
/* http://www.codezwiz.com                              */
/* Copyright © 2002-2004 by Codezwiz.com                */
/********************************************************/
if (eregi("block-Survey.php", $_SERVER['SCRIPT_NAME'])) {
    Header("Location: index.php");
    die();
}
$make_random = 0; //0- Means NO random polls. 1- Means random poll. 
$number_of_days = 30; //Number of days in between voting per user.

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

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

if ($make_random == 1) {
$result = $db->sql_query("SELECT pollID, pollTitle, voters FROM ".$prefix."_poll_desc $querylang ORDER BY rand() LIMIT 1");
} elseif ($make_random == 0) {
$result = $db->sql_query("SELECT pollID, pollTitle, voters FROM ".$prefix."_poll_desc $querylang ORDER BY pollID DESC LIMIT 1");
}
if ($db->sql_numrows($result) < 1) {
    $content = "<br />No Surveys!<br /><br />";
} else {
    list($pollID, $pollTitle, $voters) = $db->sql_fetchrow($result);
    $url = "modules.php?name=Surveys&amp;op=results&amp;pollID=$pollID";
    $content = "<font class=\"content\"><b>$pollTitle</b></font><br /><br />\n";
    $content .= '<form action="modules.php?name=Surveys" method="post">';
    $content .= '<table border="0" cellpadding="2" cellspacing="0" width="100%">';

    $ip = $_SERVER["REMOTE_ADDR"];
    $past = time()-86400*$number_of_days;
    $result = $db->sql_query("SELECT ip FROM ".$prefix."_poll_check WHERE ip='$ip' AND pollID='$pollID'");
    $result2 = $db->sql_query("SELECT optionText, voteID, optionCount FROM ".$prefix."_poll_data WHERE pollID='$pollID' AND optionText!='' ORDER BY voteID");
    if ($db->sql_numrows($result) > 0) {
        while ($row = $db->sql_fetchrow($result2)) {
            $options[] = $row;
            $sum += (int)$row['optionCount'];
        }
        $ThemeSel = get_theme();
        $leftbar = file_exists("themes/$ThemeSel/images/survey_leftbar.gif") ? 'survey_leftbar.gif' : 'leftbar.gif';
        $mainbar = file_exists("themes/$ThemeSel/images/survey_mainbar.gif") ? 'survey_mainbar.gif' : 'mainbar.gif';
        $rightbar = file_exists("themes/$ThemeSel/images/survey_rightbar.gif") ? 'survey_rightbar.gif' : 'rightbar.gif';
        $l_size = getimagesize("themes/$ThemeSel/images/$leftbar");
        $m_size = getimagesize("themes/$ThemeSel/images/$mainbar");
        $r_size = getimagesize("themes/$ThemeSel/images/$rightbar");
        if (file_exists("themes/$ThemeSel/images/survey_mainbar_d.gif")) $mainbar_d = 'survey_mainbar_d.gif';
        if (isset($mainbar_d)) $m1_size = getimagesize("themes/$ThemeSel/images/$mainbar_d");
       
        foreach ($options as $option) {
            $percent = 100 / $sum * $option['optionCount'];
            $percentInt = (int)$percent * .85;
            $percent2 = (int)$percent;
            $content .= "<tr><td>$option[optionText]<br/>";
            $content .= "<img src=\"themes/$ThemeSel/images/$leftbar\" height=\"$l_size[1]\" width=\"$l_size[0]\" alt=\"$percent2 %\" title=\"$percent2 %\">";
            if ($percent > 0) {
                    $content .= "<img src=\"themes/$ThemeSel/images/$mainbar\" height=\"$m_size[1]\" width=\"$percentInt%\" alt=\"$percent2 %\" title=\"$percent2 %\">";
            } else {
                if (!isset($mainbar_d)) {
                    $content .= "<img src=\"themes/$ThemeSel/images/$mainbar\" height=\"$m_size[1]\" width=\"$m_size[0]\" alt=\"$percent2 %\" title=\"$percent2 %\">";
                }
            }
            $content .= "<img src=\"themes/$ThemeSel/images/$rightbar\" height=\"$r_size[1]\" width=\"$r_size[0]\" alt=\"$percent2 %\" title=\"$percent2 %\"><br/>";
            $content .= "</td></tr>\n";
        }
        $button = '';
    }
    else {
        while ($row = $db->sql_fetchrow($result2)) {
            $content .= "<tr><td valign=\"top\"><input type=\"radio\" name=\"voteID\" value=\"".$row['voteID']."\"></td><td width=\"100%\"><font class=\"content\">".$row['optionText']."</font></td></tr>\n";
            $sum += (int)$row['optionCount'];
        }
        $button .= '<input type="hidden" name="pollID" value="'.$pollID.'">';
        $button .= '<input type="hidden" name="forwarder" value="'.$url.'">';
        $button .= '<input type="submit" value="'._VOTE.'"><br /><br />';
    }
    $db->sql_freeresult($result);
    $db->sql_freeresult($result2);

    $content .= "</table><br /><center>$button
    <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 />
    <br />"._VOTES." <b>$sum</b>\n";
    if ($pollcomm) {
        list($numcom) = $db->sql_fetchrow($db->sql_query("SELECT COUNT(*) FROM ".$prefix."_pollcomments WHERE pollID='$pollID'"));
        $content .= "<br /> "._PCOMMENTS." <b>$numcom</b>\n";
    }
    $content .= "</font></center></form>\n";
}
?>
 
View user's profile Send private message
Dacubz







PostPosted: Sat Nov 05, 2005 10:46 am Reply with quote

That code fixed it. Thanks for the help!
 
pmaryan
Regular
Regular



Joined: Oct 06, 2005
Posts: 76

PostPosted: Sun Nov 13, 2005 12:03 am Reply with quote

I was having the same problem as this, and that code that chatserv posted fixed the problem with voting on a current poll, however now when an admin logs in to create a poll , you can set all the options and then it refreshs to a blank page, just like before.....


Is there a problem with the poll module in the patched??
 
View user's profile Send private message
pmaryan







PostPosted: Sat Nov 19, 2005 11:02 pm Reply with quote

Any ideas out there from anyone???

I will say that I tried pulling in an unpatched block survey.php file to see if it fixed it and it didn't....so I put back in the one from patched......


Any ideas??
 
manunkind
Client



Joined: Apr 26, 2004
Posts: 368
Location: Albuquerque, NM

PostPosted: Wed Nov 23, 2005 11:10 am Reply with quote

Any solutions yet? I just found this problem this morning when trying to create a new Survey.

Same thing......goes to a blank page and only part of the survey hits the database. (First just the question got populated and the second time the question and ONE option got populated.)
 
View user's profile Send private message Visit poster's website
pmaryan







PostPosted: Mon Nov 28, 2005 11:36 pm Reply with quote

This is rather annoying that it seems to be a valid problem that does exist and nobody cares......

Any solution yet?
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.6

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 ©