Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Issues
Author Message
crypto
Worker
Worker



Joined: Aug 02, 2004
Posts: 165

PostPosted: Fri Oct 24, 2008 1:02 pm Reply with quote

Hi!

I cannot get "block-User_Menu.php" -block work with RavenNuke v2.30. It's working fine with v2.02.02.

Below you can see the error message (there are more errors but the first error in row 32).

Fatal error: Call to undefined function sql_fetch_row() in /var/www/customers/xxxxxx/public_html/dev/blocks/block-User_Menu.php on line 32


Code:
...

/************************************************************/
/*                                                          */
/* Updated for PHP-Nuke 5.6 -  18 Jun 2002 NukeScripts      */
/* website http://www.nukescripts.com                       */
/*                                                          */
/* Updated for PHP-Nuke 5.5 - 24/03/2002 Rugeri             */
/* website http://newsportal.homip.net                      */
/*                                                          */
/* (C) 2002                                                 */
/* All rights beyond the GPL are reserved                   */
/*                                                          */
/* Please give a link back to my site somewhere in your own */
/*                                                          */
/************************************************************/
/* Additional security checking code 2003 by chatserv       */
/* http://www.nukefixes.com -- http://www.nukeresources.com */
/************************************************************/

.
.
.
This is row 31, next is row 32 ->
list($lastuser) = sql_fetch_row(sql_query("SELECT username FROM $user_prefix"._users." ORDER BY user_id DESC LIMIT 0,1", $dbi));
list($newid) = sql_fetch_row(sql_query("SELECT user_id FROM $user_prefix"._users." WHERE username='$lastuser'", $dbi));
$numrows = sql_num_rows(sql_query("SELECT user_id FROM $user_prefix"._users."", $dbi));
$numrows = ($numrows - 1); //removes admin as user
$result = sql_query("SELECT uname, guest FROM $prefix"._session." WHERE guest=0", $dbi);
$member_online_num = sql_num_rows($result, $dbi);
$who_online_now = "";
$i = 1;
.
.
.


Could somebody check this out?
 
View user's profile Send private message
fkelly
Former Moderator in Good Standing



Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Fri Oct 24, 2008 1:45 pm Reply with quote

This is an antiquated block and not supported in 2.30. I believe that the problem may lie in the fact that we took out the statement:

Code:
require_once(INCLUDE_PATH.'includes/sql_layer.php');


from mainfile in 2.30 because it is an obsolete way of accessing the database and was rarely used. Just checking and I see that we left sql_layer.php in the distribution in the includes directory so you might have some success by putting that statement back into mainfile. But I'd recommend you use a supported block instead -- one that comes with the 2.30 distribution.
 
View user's profile Send private message Visit poster's website
crypto







PostPosted: Fri Oct 24, 2008 2:09 pm Reply with quote

I have been happy about block-User_Menu.php. I'm just wondering that would it be impossible that RavenNuke will add support also for it?

fkelly wrote:
I'd recommend you use a supported block instead -- one that comes with the 2.30 distribution.

What block do you mean? Is the "Site Info v2.2.2" included to there?
 
fkelly







PostPosted: Fri Oct 24, 2008 2:38 pm Reply with quote

Raven makes the final call on such things but we took the call to sql_layer out because we could not find many if any instances where it was being used. In any such product decisions have to be made about phasing out obsolete code. Removing sql_layer has been discussed over the course of the last couple of releases and we finally decided to do it.

I don't know what block-User_Menu does so it's hard for me to tell you what to use in its place. There is the Site Info block and also whois online block. It would not be rocket science to convert the block-User_Menu to use the more modern SQL calls but you'd need to convince us that it has significant advantages over the other available blocks. Or convert it yourself if you have some PHP and database experience.
 
evaders99
Former Moderator in Good Standing



Joined: Apr 30, 2004
Posts: 3221

PostPosted: Fri Oct 24, 2008 3:01 pm Reply with quote

Any code using $dbi will need to be modified to the new $db layer


sql_fetch_row(sql_query(..., $dbi));

TO

$db->sql_fetchrow($db->sql_query(...));

_________________
- Star Wars Rebellion Network -

Need help? Nuke Patched Core, Coding Services, Webmaster Services 
View user's profile Send private message Visit poster's website
crypto







PostPosted: Sat Oct 25, 2008 1:21 am Reply with quote

fkelly wrote:
There is the Site Info block and also whois online block.

It would not be rocket science to convert the block-User_Menu to use the more modern SQL calls but you'd need to convince us that it has significant advantages over the other available blocks. Or convert it yourself if you have some PHP and database experience.

Thanx, whois online is useless for me but site info could be something that I could consider (needs some manual layout-tuning).
 
crypto







PostPosted: Sat Oct 25, 2008 11:14 am Reply with quote

crypto wrote:
Thanx, whois online is useless for me but site info could be something that I could consider (needs some manual layout-tuning).

Siteinfo-block is ok so I'll use it.

I have two question about it...

1) How can I enable detailed information (numeric values) to be shown also to the anonymous users?

2) How can I change "registered members: 20,000" shown like "registered members 20000" (or 20.000) <--- comma should be removed or replaced with a dot.
 
fkelly







PostPosted: Sat Oct 25, 2008 11:40 am Reply with quote

Okay, let's make sure we are talking the same thing first. The block that I see in the distribution (2.3) that we have been calling site info is really user_info. So if we are talking about that then you would need to go into the blocks section of the ACP and first activate the block, then edit it to make it visible to all users. That should take care of question 1. As to question 2, you would need to edit the code in the block.

Sorry, I just looked at the code. There are some customization options at the top that are easily changeable but the comments area makes it clear that the code was changed to not show details to anonymous. What it does show is the server date and time and a little login box to anonymous. So you'd have to seriously hack the code to get it to show the details to anonymous. I'd recommend leaving it alone and living with it. You really don't want to be showing much to anonymous users anyway or if you do be aware that it is something of a security exposure.
 
crypto







PostPosted: Sat Oct 25, 2008 12:10 pm Reply with quote

fkelly wrote:
So you'd have to seriously hack the code to get it to show the details to anonymous. I'd recommend leaving it alone and living with it. You really don't want to be showing much to anonymous users anyway or if you do be aware that it is something of a security exposure.

Thanks of quick reply! Those stats should be shown as they are shown last six years to all visitors (everything worked up to Raven Nuke v2.02.02).

A) What would be the easiest way to hack the module so that stats would be shown the anonymous users? Any line suggestions?

B) What part I have to modify so that comma (in 20,000) would be removed or replaced with the dot?
 
jakec
Site Admin



Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom

PostPosted: Sat Oct 25, 2008 12:57 pm Reply with quote

You can comment out the User and Admin checks in the file. Starts around line 249 and closes around line 315.

...but please listen to fkelly, he knows what he is talking about.
 
View user's profile Send private message
fkelly







PostPosted: Sat Oct 25, 2008 1:31 pm Reply with quote

You can look up the function number_format in the PHP manual and hack away at that. It is used to format the numbers and it looks to me like you could subsitute a . for the , as the thousands separator. I don't have time to be messing with that ... feel free. You'd probably want to suppress the decimal point or you could wind up with something like 23.000.00 which would look strange.
 
crypto







PostPosted: Sat Oct 25, 2008 2:21 pm Reply with quote

fkelly wrote:
So you'd have to seriously hack the code to get it to show the details to anonymous. I'd recommend leaving it alone and living with it.

I succeeded to edit block-User_Info.php so that it shows the public values (selected stats) also to the anonymous users! Dance-Y

Lets see if the 'comma' issue can be solved somehow!
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN 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 ©