Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks
Author Message
Malkavian
New Member
New Member



Joined: Nov 02, 2004
Posts: 7

PostPosted: Mon Nov 08, 2004 6:11 pm Reply with quote

I have been trying to get this resolved for the past month with Nukecops to no avail... I'm hoping I might have better luck here. Everyone else seems to, which is a good sign.

I downloaded Raven's Site Info Block in hopes it would solve an outdated Block's problem but alas I am still faced with a Login Block that fails to reflect the number of members who registered yesterday.

Could someone please look over the php below and tell me where I am going wrong?

Thanks in advance.

- Malk

[Edited for brevity by Raven]
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Mon Nov 08, 2004 6:25 pm Reply with quote

That is the EXACT code I use here and as you can see, it works. So, I don't believe it's the block.
 
View user's profile Send private message
Malkavian







PostPosted: Mon Nov 08, 2004 6:30 pm Reply with quote

It could very well be a DB error.

Could you check out my SQL and be sure? (this is an area im not too strong in)

And thank you for your timely response.

- Malkavian
 
Malkavian







PostPosted: Wed Nov 10, 2004 5:14 pm Reply with quote

Raven wrote:
That is the EXACT code I use here and as you can see, it works. So, I don't believe it's the block.


Ok I went back, looked at the block code and made the following conclusions.

This is block-Site_Info.php included in the Zip file available for download here, listed as "Site Info Block Used Here - phpnuke v6.5 and later"

It was pulling Today's date from the DB without a problem and Yesterday's date is pulled from the SAME row in the database. So why wasn't it showing? Here's why.

When declaring the SQL parameter, "Yesterday" is looking for the following:

Code:
$curDate3 = "%".$premonth[0].$premonth[1].$premonth[2]."%".$pmday."%".$preyear."%";


Unfortunately $premonth and $preyear was not been previously declared.

Instead the following was:

Code:
//Formatting Previous Date

$pmonth = $Today['month'];
$pmday = $Today['mday'];
$pmday = $mday-1;
$pyear = $Today['year'];


So I changed the code from this:

Code:
$curDate3 = "%".$premonth[0].$premonth[1].$premonth[2]."%".$pmday."%".$preyear."%";


To this:

Code:
$curDate3 = "%".$pmonth[0].$pmonth[1].$pmonth[2]."%".$pmday."%".$pyear."%";


And it now reflects the correct number of users who registered yesterday instead of "0".

Also,

Code:
$test = mktime (0,0,0,$pmonth,$pmday,$pyear,1);


was declared twice. Once, outside the SQL parameter.

Thanks Raven.

- Malk
 
Raven







PostPosted: Wed Nov 10, 2004 5:46 pm Reply with quote

You must have had an old copy:
[ Only registered users can see links on this board! Get registered or login! ] [ Only registered users can see links on this board! Get registered or login! ]
 
Malkavian







PostPosted: Wed Nov 10, 2004 5:55 pm Reply with quote

No as i stated above the version i used was called "Site Info Block Used Here - phpnuke v6.5 and later" and was the only one available. I made sure of it so as to remove that variable from the equation. Yesterday wasn't reflecting 2 Days ago it was reflecting 0.

Ie.

Code:
<?php

/************************************************************/
/* Added $gfx_chk code to allow disabling as per v6.9 code. */
/* 21 October 2003  Gaylen Fraley                           */
/*                                                          */
/* Added 3 new hyperlink things :).  First off, if my block */
/* detects that you are using the Resend_Email module, it   */
/* will hyperlink the 'Waiting' text to the Resend_Email    */
/* block automatically.  Then, there is a new module        */
/* UserInfoAddons that the block will check for and if found*/
/* will hyperlink the New Today and New Yesterday text and  */
/* will display the new users from today and yesterday!     */
/* 30 Sept 2003 Gaylen Fraley                               */
/* website http://www.ravenphpscripts.com                   */
/*                                                          */
/* Corrected code that displays New Users Yesterday         */
/* 11 Nov 2004 Gaylen Fraley                                */
/* website http://www.ravenphpscripts.com                   */
/*                                                          */
/* Added Sam Spade lookup for registered users for Admins   */
/* only - 24 Sept 2003 Gaylen Fraley                        */
/* website http://www.ravenphpscripts.com                   */
/*                                                          */
/* Added 4 user settings - 20 Sept 2003 Gaylen Fraley       */
/* Added Hidden User Count - 20 Sept 2003 Gaylen Fraley     */
/* website http://www.ravenphpscripts.com                   */
/*                                                          */
/* Added user_avatar - 18 July 2003 Gaylen Fraley           */
/* website http://www.ravenphpscripts.com                   */
/*                                                          */
/* Update for PHP-Nuke 6.5 - 30 July 2003 Gaylen Fraley     */
/* website http://www.ravenphpscripts.com                   */
/*                                                          */
/* Update for PHP-Nuke 6.5 - 05 March 2003 Gaylen Fraley    */
/* website http://www.ravenphpscripts.com                   */
/*                                                          */
/* 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 */
/*                                                          */
/************************************************************/


In post http://www.ravenphpscripts.com/posts3555-highlightpmday.html the code correction you made indicates the only changed needed was here.

$curDate3 = "%".$premonth[0].$premonth[1].$premonth[2]."%".$pmday."%".$preyear."%";

But I needed the string to reflect the following changes instead because "$pre" wasn't declared.

$curDate3 = "%".$pmonth[0].$pmonth[1].$pmonth[2]."%".$pmday."%".$pmyear."%";

Thanks though. It's fixed.

- Malk


Last edited by Malkavian on Wed Nov 10, 2004 6:07 pm; edited 1 time in total 
Raven







PostPosted: Wed Nov 10, 2004 6:05 pm Reply with quote

Whatever works. The d/l one is the same one I am using. I renamed it when I corrected the code.
 
Malkavian







PostPosted: Wed Nov 10, 2004 6:09 pm Reply with quote

I just added the headed to the file so you can see where I'm coming from. it has your notes from the correction you made regarding the 2 days issue.

I'm not trying to give you a hard time Raven lol, just please go back and check the version you do have available for download, because this is what i got when i downloaded it.

- Malk
 
Raven







PostPosted: Wed Nov 10, 2004 7:55 pm Reply with quote

I appreciate the hard time because sometimes I am hard headed ROTFL. I have now uploaded the User Info block that I use here (for real). It contains many enhancements in performance and more. Please try this and see if it works for you Smile.
 
Malkavian







PostPosted: Wed Nov 10, 2004 8:03 pm Reply with quote

Hey I wish i could help you more sometimes.

But anyway, l did get the other one to work for me but is this "new" one any different from what I am running now @ [ Only registered users can see links on this board! Get registered or login! ] ?

- Malk
 
Raven







PostPosted: Wed Nov 10, 2004 8:12 pm Reply with quote

In performance, yes
 
Malkavian







PostPosted: Wed Nov 10, 2004 8:27 pm Reply with quote

Thank Raven. I'll let you know if it needs tweaking. Wink

- Malk
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks

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 ©