PHP Web Host - Quality Web Hosting For All PHP Applications $35/month $250/year (Unlimited) - $25/month - 200,000 impressions - Your Ad Could be Here - Click For Details
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
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 Back to top

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 Back to top

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?
View user's profile Send private message
HAMM3R
New Member
New Member


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

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

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.
View user's profile Send private message
montego
Site Admin


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

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

Maybe there is a variable name collision. Give these variables a very unique name and see if that changes anything.
View user's profile Send private message Visit poster's website
HAMM3R
New Member
New Member


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

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

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

Thanks so much!
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 10:35 pm Reply with quote Back to top

That's a very bizarre error number.
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 10:36 pm Reply with quote Back to top

Good one montego. $ip or $port must have already been used for something?
View user's profile Send private message
montego
Site Admin


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

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

Yeah, I had a feeling that it was $ip. Glad this worked!
View user's profile Send private message Visit poster's website
HAMM3R
New Member
New Member


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

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

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 to the forums!


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!
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


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

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

So when you try to execute it, Nuke reports "Sorry, this module isn't activated" or something like that?
View user's profile Send private message
HAMM3R
New Member
New Member


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

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

Exactly. As an admin, I can always view it, however everyone else encounters that error you described.
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


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

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

And you have it set for registered users?
View user's profile Send private message
HAMM3R
New Member
New Member


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

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

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.
View user's profile Send private message
montego
Site Admin


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

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

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...
View user's profile Send private message Visit poster's website
HAMM3R
New Member
New Member


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

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

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.
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


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

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

The actual module code seems fine, it would more likely be something in your modules.php file. What version of Nuke? Is it patched?
View user's profile Send private message
HAMM3R
New Member
New Member


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

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

RavenNuke v2.10.01
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


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

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

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.
View user's profile Send private message
HAMM3R
New Member
New Member


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

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

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 to the forums!
View user's profile Send private message
HAMM3R
New Member
New Member


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

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

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.
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


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

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

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?
View user's profile Send private message
HAMM3R
New Member
New Member


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

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

The permissions on the sampmonitor directory are the same as all the rest of the modules, 755 (recursive, includes index.php file).
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


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

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

Please post the structure of your modules table.
View user's profile Send private message
Gremmie
Former Moderator in Good Standing


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

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

And do you still have the modules/Groups directory?
View user's profile Send private message
HAMM3R
New Member
New Member


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

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

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.
View user's profile Send private message
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.

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum