Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x
Author Message
thumpn8974
Worker
Worker



Joined: Feb 09, 2011
Posts: 188
Location: US

PostPosted: Tue Feb 28, 2012 2:29 pm Reply with quote

I was looking on my site and noticed this error below:
Quote:

Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /homepages/xx/xxxxxxxx/htdocs/h3llclan/html/blocks/block-PlayerOfTheMonth.php on line 44


This is the address to download the module:
http://h3llclan.com/Assets/CT-Player_Of_The_Month_v2.zip

The block doesn't work which is causing this error.
I am running RN V2.5.
 
View user's profile Send private message Visit poster's website Yahoo Messenger
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6795
Location: Ha Noi, Viet Nam

PostPosted: Tue Feb 28, 2012 2:48 pm Reply with quote

The code is using a reference to a native mySQL function mysql_numrows() and RN doesn't use a mySQL connection it uses mysqli, though there was a lot of backward compatibility built in, it's falling over because it isn't using the $db method.
Give me a second to download the thing and check it
 
View user's profile Send private message Send e-mail
Guardian2003







PostPosted: Tue Feb 28, 2012 2:50 pm Reply with quote

I think this line
Code:
$num = mysql_numrows($result);
needs changing to
Code:
$num = $db->sql_numrows($result);
 
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1015
Location: Netherland

PostPosted: Tue Feb 28, 2012 5:07 pm Reply with quote

The whole module needs to be modified.
 
View user's profile Send private message Visit poster's website
Guardian2003







PostPosted: Tue Feb 28, 2012 5:54 pm Reply with quote

Yeah, your right, there are several other places that need some changes. Unfortunately I just don't have the time to re-write this and send it back to the original author for at least another week as I'm already tied up with other projects for users here.
 
thumpn8974







PostPosted: Tue Feb 28, 2012 7:22 pm Reply with quote

Guardian, thank you, but I am in no hurry. I disabled it and the site will be fine without it. If you can get to it, sometime, that would be great. If you can't, then that is cool, I understand you guys are busy. Thanks again.
 
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Tue Feb 28, 2012 10:08 pm Reply with quote

if Guardian2003 does not get too it I will try and take look at it.

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
Anders
Worker
Worker



Joined: Jun 16, 2004
Posts: 159
Location: Sweden

PostPosted: Wed Feb 29, 2012 12:10 pm Reply with quote

hi i have about the same problems with mysql_real_escape_string
any clue what i can use instead??
 
View user's profile Send private message
Palbin







PostPosted: Wed Feb 29, 2012 12:33 pm Reply with quote

Anders, take a look at this. [ Only registered users can see links on this board! Get registered or login! ]
 
Anders







PostPosted: Wed Feb 29, 2012 2:01 pm Reply with quote

thanks darn did not see it but it did solve my problem
 
Guardian2003







PostPosted: Wed Feb 29, 2012 2:48 pm Reply with quote

Just to let you know, I'll be installing and looking at this module tomorrow. I'll send you it when it's completed and of course send a copy to the original author.
 
Guardian2003







PostPosted: Thu Mar 01, 2012 2:38 pm Reply with quote

I've re-written a lot of the module to replace some tables, W3C and accessibility compliance, now just waiting to here from the original author but if you can send me a PM (Anders) with an email address, I'll send you a copy.
 
Anders







PostPosted: Thu Mar 01, 2012 2:50 pm Reply with quote

hmm its not me you want send any module probly this guy thumpn8974 you want instead!
but thanks any way hehe
 
thumpn8974







PostPosted: Sat Mar 03, 2012 12:07 pm Reply with quote

I am sorry it has taken me a bit to get back, but any help would be greatly appreciated.
 
thumpn8974







PostPosted: Tue Mar 13, 2012 5:29 pm Reply with quote

I have an error message now at the bottom of my page when I click on the Player of the Month icon under admin area and that is:


Quote:
Fatal error: Cannot redeclare footmsg() (previously declared in /homepages/xx/xxxxxxx/htdocs/h3llclan/html/footer.php:30) in /homepages/xx/xxxxxxxxx/htdocs/h3llclan/html/footer.php on line 60


I honestly have no idea what I did to effect it.

What it is doing, when I click on player of the month icon under admin, it takes me to the player of the month area, but every block that is on the right side is bunched up to the left side, and everything is there for me to use that is part of the player of the month, but my block for the player of the month doesn't show the picture or anything in it. I tried deleting the database entries and reinstalling it, deleting the player of the month and re-uploading it, so I don't know what is up. I even deleted the footer.php file and re-uploaded it. Same thing is still going on. The error message only shows up when I click on the Player of the Month icon.
 
Palbin







PostPosted: Tue Mar 13, 2012 6:34 pm Reply with quote

What is happening is that your script is trying to include footer.php multiple times. If Guardian2003 sent you new files we will need them to help.
 
thumpn8974







PostPosted: Tue Mar 13, 2012 7:39 pm Reply with quote

Yeah, I am sorry. Here is a link to the file.

http://h3llclan.com/Assets/POTM_v2_rv1.zip
 
thumpn8974







PostPosted: Wed Mar 14, 2012 9:59 am Reply with quote

The link should work, now. I don't know what happened, but it worked at the beginning, then stopped, now started back working. Must be a hosting issue...lol.
 
Guardian2003







PostPosted: Wed Mar 14, 2012 4:41 pm Reply with quote

I'll re-check the code and send any updates if I make any but I always use include_once so it shouldn't be trying to include the footer multiple times. There are still quite a few improvements I could make on that module but I was waiting to hear back from the original author. As he hasn't mailed me back in over two weeks, I'll probably make a formal release toward the end of next week.
 
thumpn8974







PostPosted: Wed Mar 14, 2012 5:46 pm Reply with quote

That would be great, Guardian! I look forward to seeing it, just let me know if you find anything.
 
thumpn8974







PostPosted: Sat Mar 17, 2012 6:08 pm Reply with quote

Hey, I did some looking and some thinking about it. One thing I noticed is that when I edit my Tournament Champion module it gives me the error listed at the beginning of this post, but I will put it in here again:
Quote:

Fatal error: Cannot redeclare head() (previously declared in /homepages/xx/xxxxxxxxxx/htdocs/h3llclan/html/header.php:33) in /homepages/xx/xxxxxxxxxx/htdocs/h3llclan/html/header.php on line 110


Something I remembered that I changed recently before I noticed this code (may not have anything to do with because I really didn't do anything with the Player of the Month module recently) was I had an issue with the sub admins not seeing anything that they were authorized to edit in the admin control panel. I used an edit to the mainfile.php from here:
http://www.ravenphpscripts.com/postt20373.html I can't think of anything else.
 
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Sun Mar 18, 2012 12:52 am Reply with quote

I'm pretty sure that issue is due to missing break within the case statements. Since guardian is already working on this I would wait for his improvements Wink

But if you are curious to learn open
modules/PlayerOfTheMonth/admin/case.php

then see: [ Only registered users can see links on this board! Get registered or login! ]

What is happening is since break is missing after the includes, all the files end up getting included. Even though include_once 'header.php'; is used in all those files, I have a feeling some variation of the include_path is causing header.php to be included more than once anyway.
I think something like this would cause the same issue:
include_once 'header.php';
include_once './header.php';

There may be more at play here, and may be related to how the module is written... only had a brief look. Smile
 
View user's profile Send private message Visit poster's website
thumpn8974







PostPosted: Sun Mar 18, 2012 10:18 am Reply with quote

Well, above was not the same, the one for the player of the month is calling for the footer.php twice, and now that my brain is working I believe that somewhere in the tournament champion module it is calling for the header twice.

Does break have to be after every include of the footer.php and footer.php?

update: I am looking at the files, and at the bottom of allot of the .php files it says
Quote:
include_once 'modules/'.$module_name.'/copyright/ct_by.php';
include_once 'footer.php';
, so do I go add "break;" after each one of those instances or just on a specific one?
 
Guardian2003







PostPosted: Sun Mar 18, 2012 1:39 pm Reply with quote

I'll try and look at this tomorrow. I didn't go through the entire logic of the module since it was written by someone else and had intended to pass back the changes I made for W3C compliance, SQL etc. Guess I'll re-write it just to be sure Smile
 
spasticdonkey







PostPosted: Sun Mar 18, 2012 2:17 pm Reply with quote

@guardian your back! hope your trip was good Smile

@thumpn8974 I would wait for guardian but this is was I was talking about.

modules/PlayerOfTheMonth/admin/case.php
Code:
switch ($op) {

    case 'PlayerOfTheMonthMain':
        include_once 'modules/PlayerOfTheMonth/admin/index.php';
        break;
    case 'EditSettings':
        include_once 'modules/PlayerOfTheMonth/admin/editsettings.php';
        break;
    case 'UpdatePOTMTags':
    case 'UpdatePOTMAnnouncement':
    case 'UpdatePOTMAwards':
    case 'UpdatePOTMImgUrl':
    case 'UpdatePOTMPhoto':
        include_once 'modules/PlayerOfTheMonth/admin/update-settings.php';
        break;
    case 'EditPlayers':
        include_once 'modules/PlayerOfTheMonth/admin/editplayers.php';
        break;
    case 'DeletePlayer':
    case 'DeletePlayers':
    case 'UpdatePlayer':
        include_once 'modules/PlayerOfTheMonth/admin/update-players.php';
        break;
    case 'AwardPlayer':
        include_once 'modules/PlayerOfTheMonth/award-player.php';
        break;
}

Previously, if you were to use the "EditSettings" function, you would end up including all of the files. ,, Which in turn include header.php and footer.php in each file..
Code:
        include_once 'modules/PlayerOfTheMonth/admin/editsettings.php';

        include_once 'modules/PlayerOfTheMonth/admin/update-settings.php';
        include_once 'modules/PlayerOfTheMonth/admin/editplayers.php';
        include_once 'modules/PlayerOfTheMonth/admin/update-players.php';
        include_once 'modules/PlayerOfTheMonth/award-player.php';


The were some changes to the include path logic in 2.5.. Not sure if it has any effect on this issue, but since include once is used in all those files; I have to wonder why the functions are ultimately included more than once. Assuming this is the problem, does your AwardPlayer function work, prior to making any changes?
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x

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 ©