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 -> RN v2.10.01 - All Issues
Author Message
HAMM3R
New Member
New Member



Joined: Jun 14, 2006
Posts: 22
Location: New Mexico, USA

PostPosted: Fri Dec 21, 2007 7:09 pm Reply with quote

I have a php script that uses fsockopen to retrieve stats from a game server. I have this script in a separate php file and It works perfect. However, when I integrate the code into a phpnuke module, the socket doesn't open and I get an error. Below is the socket code and the error. Any ideas?

Code:
   if (!isset($ip))

      $ip = '123.123.123.123';
   if (!isset($port))
      $port = 7776;

   $fp = fsockopen('udp://' . $ip, $port, $errno, $errstr);
   if (!$fp)
   {
      echo "<tr><td bgcolor=\"#2B5486\">Socket Error: $errno - $errstr</td></tr>\n";
   }
   else
   {


Quote:
Socket Error: 137599788 -


HAMM3R
 
View user's profile Send private message
Gremmie
Former Moderator in Good Standing



Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Fri Dec 21, 2007 9:06 pm Reply with quote

There is nothing unique to nuke that would prevent fsockopen() from failing. However, some hosts don't allow fsockopen() calls. Does the separate php file work on the same server where the module is failing?

_________________
GCalendar - An Event Calendar for PHP-Nuke
Member_Map - A Google Maps Nuke Module 
View user's profile Send private message
HAMM3R







PostPosted: Fri Dec 21, 2007 9:40 pm Reply with quote

Yes, it is locacted at /novserver.php and nuke is at root (/)

Same server, same domain, only difference is that it's run through nuke. Very odd indeed.
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Fri Dec 21, 2007 10:30 pm Reply with quote

Maybe there is a variable name collision. Give these variables a very unique name and see if that changes anything.

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
HAMM3R







PostPosted: Fri Dec 21, 2007 10:35 pm Reply with quote

YES! Excellent idea, I added a prefix to all the variables and it worked like a charm.

Thanks so much!
 
Gremmie







PostPosted: Fri Dec 21, 2007 10:35 pm Reply with quote

That's a very bizarre error number.
 
Gremmie







PostPosted: Fri Dec 21, 2007 10:36 pm Reply with quote

Good one montego. $ip or $port must have already been used for something?
 
montego







PostPosted: Sat Dec 22, 2007 8:35 am Reply with quote

Yeah, I had a feeling that it was $ip. Glad this worked!
 
HAMM3R







PostPosted: Sat Dec 22, 2007 9:56 pm Reply with quote

Got a problem regarding this module that maybe you can help with. I have made a subdirectory inside the modules folder, called "sampmonitor". I have my index.php in there that has the code in it. The module works perfect for myself as an admin. I activated the module in the admin panel, but 10 minutes later it was deactivated again.

This is an exact copy of index.php: [ Only registered users can see links on this board! Get registered or login! ]

Every time I activate this module, it's only a few minutes later when all of a sudden, without myself doing anything, it becomes deactivated again. I don't have any problems with any other modules.

Any ideas what may be causing this?

Thanks!
 
Gremmie







PostPosted: Sat Dec 22, 2007 10:09 pm Reply with quote

So when you try to execute it, Nuke reports "Sorry, this module isn't activated" or something like that?
 
HAMM3R







PostPosted: Sat Dec 22, 2007 10:11 pm Reply with quote

Exactly. As an admin, I can always view it, however everyone else encounters that error you described.
 
Gremmie







PostPosted: Sat Dec 22, 2007 11:14 pm Reply with quote

And you have it set for registered users?
 
HAMM3R







PostPosted: Sat Dec 22, 2007 11:22 pm Reply with quote

It is set for All Visitors. After I activate the module it will work fine for everyone. Then a few minutes later it is deactivated again and only admins can view it.
 
montego







PostPosted: Sun Dec 23, 2007 7:18 am Reply with quote

Was an extension of ".phps" just a typo above? If not, why is it not ".php"? doubt that is it, but since I've never experienced this issue, we need to rule out what we can...
 
HAMM3R







PostPosted: Sun Dec 23, 2007 10:49 am Reply with quote

I made a copy of index.php and renamed it to .phps so that you could see the php source code and the server wouldn't attempt to run the code. The index.php file is still there.
 
Gremmie







PostPosted: Sun Dec 23, 2007 12:03 pm Reply with quote

The actual module code seems fine, it would more likely be something in your modules.php file. What version of Nuke? Is it patched?
 
HAMM3R







PostPosted: Sun Dec 23, 2007 12:18 pm Reply with quote

RavenNuke v2.10.01
 
Gremmie







PostPosted: Sun Dec 23, 2007 1:36 pm Reply with quote

Never heard this one before. So activate it, then log completely out of admin. And get everyone else who might be admin to log out. After say 30 minutes is it still active? The only code that I know of to deactivate a module is in an admin function.
 
HAMM3R







PostPosted: Sun Dec 23, 2007 2:37 pm Reply with quote

OK I've done this. As of the time of this post, it is active without me being logged into admin.
[ Only registered users can see links on this board! Get registered or login! ]
 
HAMM3R







PostPosted: Sun Dec 23, 2007 2:43 pm Reply with quote

And now... "Sorry, this Module isn't active!"

:S

Edit: Checked the nuke_modules table in phpMyAdmin and found that the module is NOT listed in the table. So it seems that the module is not being deactivated ("active" field being set to 0) but in fact it is disappearing from the mysql table completely.
 
Gremmie







PostPosted: Sun Dec 23, 2007 3:21 pm Reply with quote

This happens when RavenNuke thinks that the module has been removed. It does this by checking to see if the directory exists under modules. Perhaps Nuke can't read the directory name due to a permissions problem. What are the permissions on your sampmonitor directory?
 
HAMM3R







PostPosted: Sun Dec 23, 2007 4:14 pm Reply with quote

The permissions on the sampmonitor directory are the same as all the rest of the modules, 755 (recursive, includes index.php file).
 
Gremmie







PostPosted: Sun Dec 23, 2007 5:01 pm Reply with quote

Please post the structure of your modules table.
 
Gremmie







PostPosted: Sun Dec 23, 2007 5:03 pm Reply with quote

And do you still have the modules/Groups directory?
 
HAMM3R







PostPosted: Sun Dec 23, 2007 5:41 pm Reply with quote

Here is the table now:
Image

Now I go into admin.php -> Modules -> Activate "sampmonitor"
And the table now looks like this:

Image

Then a few seconds/minutes later, it's back to looking like the first image.

I'm so confused!


Edit: Yes I have a modules/Groups folder.
 
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 -> RN v2.10.01 - All Issues

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 ©