You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 46 guest(s) and 1 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Check my code again (2) User Info Block [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
ravernews
Premium
Premium


Joined: Jan 26, 2003
Posts: 230

Location: USA

PostPosted: Sat Mar 08, 2003 5:14 am Reply with quoteBack to top

I got the bug worked out on my site with I found that
Code:
//Executing SQL Today
$sql = "SELECT COUNT(user_id) AS userCount FROM $user_prefix"._users." WHERE user_regdate LIKE '$curDate2'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$userCount = $row[userCount];
//end

//Executing SQL Today
$sql = "SELECT COUNT(user_id) AS userCount FROM $user_prefix"._users." WHERE user_regdate LIKE '$curDateP'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$userCount2 = $row[userCount];
//end


In the Excuting SQL Today part I see that $curDateP well I couldnt find that anywhere. SO I change it to

Code:
$sql = "SELECT COUNT(user_id) AS userCount FROM $user_prefix"._users." WHERE user_regdate LIKE '$curDate3'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$userCount2 = $row[userCount];


As you can see I added the 3 instead of the P and now it works grrrreat!
So then I got this great idea to change some code around with your info block to add the security block. I FAIL!!!!!!!!!!!

Parse error: parse error in /usr/home/raver/www/htdocs/blocks/block-User_Info.php on line 157

Okay I said to myself what the F@!# did I do wrong. Here is the code worked as I see it. Can you please look at it and hook me up. Line 157 is the last line of code FYI


Code:
<?php

/************************************************************/
/* Update for PHP-Nuke 6.5 - 08 March 2003 RaverNews        */
/* website http://ravernews.com                             */
/*                                                          */
/* Update for PHP-Nuke 6.5 - 01 March 2003 Nukecops         */
/* website http://www.nukecops.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 */
/*                                                          */
/************************************************************/

if (eregi("block-block-User_Info.php",$_SERVER['PHP_SELF'])) {
    Header("Location: index.php");
}

$content = "";

global $user, $cookie, $prefix, $user_prefix, $db, $anonymous, $mode, $t, $f, $redirect, $random_num;
cookiedecode($user);
mt_srand ((double)microtime()*1000000);
$maxran = 1000000;
$random_num = mt_rand(0, $maxran);
$datekey = date("F j");
$rcode = hexdec(md5($_SERVER[HTTP_USER_AGENT] . $sitekey . $random_num . $datekey));
$code = substr($rcode, 2, 10);
cookiedecode($user);
$uname = $cookie[1];

$sql = "SELECT username,user_id FROM $user_prefix"._users." ORDER BY user_id DESC LIMIT 0,1";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);

$lastusername = $row[username];
$lastuser = $row[user_id];
$numrows = $db->sql_numrows($db->sql_query("SELECT user_id FROM $user_prefix"._users.""));

$sql = "SELECT uname, guest FROM $prefix"._session." WHERE guest=0";
$result = $db->sql_query($sql);
$member_online_num = $db->sql_numrows($result);
$who_online_now = "";
$i = 1;
while ($session = $db->sql_fetchrow($result)) {
    if ($i < 10) {
         $sql = "select user_id, username from ".$user_prefix."_users where username='$session[uname]'";
            $member_result =  $db->sql_query($sql);
            if (sql_num_rows($member_result, $dbi) == 1) {
                $memberinfo = sql_fetch_array($member_result, $dbi);
            }
         $who_online_now .= "0$i:&<A HREF=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=$memberinfo[user_id]\">$session[uname]</a><br>\n";
        } else {
            $who_online_now .= "$i:&<A HREF=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=$memberinfo[user_id]\">$session[uname]</a><br>\n";
        }
      $who_online_now .= ($i != $member_online_num ? "  " : "");
        $i++;
      
}
$Today = getdate();
//Formatting Current Date
$month = $Today['month'];
$mday = $Today['mday'];
$year = $Today['year'];
//Formatting Previous Date
$pmonth = $Today['month'];
$pmday = $Today['mday'];
$pmday = $mday-1;
$pyear = $Today['year'];
//Month conversion into numeric mode
if ($pmonth=="January") { $pmonth=1; } else
if ($pmonth=="February") { $pmonth=2; } else
if ($pmonth=="March") { $pmonth=3; } else
if ($pmonth=="April") { $pmonth=4; } else
if ($pmonth=="May") { $pmonth=5; } else
if ($pmonth=="June") { $pmonth=6; } else
if ($pmonth=="July") { $pmonth=7; } else
if ($pmonth=="August") { $pmonth=8; } else
if ($pmonth=="September") { $pmonth=9; } else
if ($pmonth=="October") { $pmonth=10; } else
if ($pmonth=="November") { $pmonth=11; } else
if ($pmonth=="December") { $pmonth=12; };
$test = mktime (0,0,0,$pmonth,$pmday,$pyear,1);

//Creating SQL parameter
$curDate2 = "%".$month[0].$month[1].$month[2]."%".$mday."%".$year."%";
$curDate3 = "%".$month[0].$month[1].$month[2]."%".$pmday."%".$year."%";

//Executing SQL Today
$sql = "SELECT COUNT(user_id) AS userCount FROM $user_prefix"._users." WHERE user_regdate LIKE '$curDate2'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$userCount = $row[userCount];
//end

//Executing SQL Yesterday
$sql = "SELECT COUNT(user_id) AS userCount FROM $user_prefix"._users." WHERE user_regdate LIKE '$curDate3'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$userCount2 = $row[userCount];
//end

$guest_online_num = $db->sql_numrows($db->sql_query("SELECT uname FROM ".$prefix."_session WHERE guest=1"));
$member_online_num = $db->sql_numrows($db->sql_query("SELECT uname FROM ".$prefix."_session WHERE guest=0"));

$who_online_num = $guest_online_num + $member_online_num;
$content .= "<form action=\"modules.php?name=Your_Account\" method=\"post\">";

if (is_user($user)) {
    $content .= "<br><img src=\"images/blocks/group-4.gif\" height=\"14\" width=\"17\"> "._BWEL.", <b>$uname</b>.<br>\n<hr>\n";
    $sql = "SELECT user_id FROM $user_prefix"._users." WHERE username='$uname'";
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
    $uid = $row[user_id];
    $newpms = $db->sql_numrows($db->sql_query("SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND privmsgs_type='5'"));
    $oldpms = $db->sql_numrows($db->sql_query("SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND privmsgs_type='0'"));
    $content .= "<img src=\"images/blocks/email-y.gif\" height=\"10\" width=\"14\"> <a href=\"modules.php?name=Private_Messages\"><b>"._BPM."</b></a><br>\n";
    $content .= "<img src=\"images/blocks/email-r.gif\" height=\"10\" width=\"14\"> "._BUNREAD.": <b>$newpms</b><br>\n";
    $content .= "<img src=\"images/blocks/email-g.gif\" height=\"10\" width=\"14\"> "._BREAD.": <b>$oldpms</b><br>\n<hr>\n";
} else {
    $content .= "<img src=\"images/blocks/group-4.gif\" height=\"14\" width=\"17\"> "._BWEL.", <b>$anonymous</b>\n<hr>";
    $content .= ""._NICKNAME." <input type=\"text\" name=\"username\" size=\"10\" maxlength=\"25\"><br>";
    $content .= ""._PASSWORD." <input type=\"password\" name=\"user_password\" size=\"10\" maxlength=\"20\"><br>";
       if (extension_loaded("gd")) {
       mt_srand ((double)microtime()*1000000);
       $maxran = 1000000;
      $random_num = mt_rand(0, $maxran);
      $content .=""._SECURITYCODE.": <img src='modules.php?name=Your_Account&op=gfx&random_num=$random_num' border='1' alt='"._SECURITYCODE."' title='"._SECURITYCODE."'>\n<br>";
      $content .=""._TYPESECCODE.": <input type=\"text\" NAME=\"gfx_check\" SIZE=\"11\" MAXLENGTH=\"10\"><br>\n";
      $content .= "<input type=\"hidden\" name=\"random_num\" value=\"$random_num\">";
    $content .= "<input type=\"hidden\" name=\"gfx_check\" value=\"$code\">";
    $content .= "<input type=\"hidden\" name=\"op\" value=\"login\">";
    $content .= "<input type=\"submit\" value=\""._LOGIN."\">\n (<a href=\"modules.php?name=Your_Account&op=new_user\">"._BREG."</a>)<hr>";
}
$content .= "<img src=\"images/blocks/group-2.gif\" height=\"14\" width=\"17\"> <b><u>"._BMEMP.":</u></b><br>\n";
$content .= "<img src=\"images/blocks/ur-moderator.gif\" height=\"14\" width=\"17\"> "._BLATEST.": <A HREF=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=$lastuser\"><b>$lastusername</b></a><br>\n";
$content .= "<img src=\"images/blocks/ur-author.gif\" height=\"14\" width=\"17\"> "._BTD.": <b>$userCount</b><br>\n";
$content .= "<img src=\"images/blocks/ur-admin.gif\" height=\"14\" width=\"17\"> "._BYD.": <b>$userCount2</b><br>\n";
$content .= "<img src=\"images/blocks/ur-guest.gif\" height=\"14\" width=\"17\"> "._BOVER.": <b>$numrows</b><br>\n<hr>\n";
$content .= "<img src=\"images/blocks/group-3.gif\" height=\"14\" width=\"17\"> <b><u>"._BVISIT.":</u></b>\n<br>\n";
$content .= "<img src=\"images/blocks/ur-anony.gif\" height=\"14\" width=\"17\"> "._BVIS.": <b>$guest_online_num</b><br>\n";
$content .= "<img src=\"images/blocks/ur-member.gif\" height=\"14\" width=\"17\"> "._BMEM.": <b>$member_online_num</b><br>\n";
$content .= "<img src=\"images/blocks/ur-registered.gif\" height=\"14\" width=\"17\"> "._BTT.": <b>$who_online_num</b><br>\n";
if ($member_online_num > 0) {
    $content .= "<hr>\n<img src=\"images/blocks/group-1.gif\" height=\"14\" width=\"17\"> <b><u>"._BON.":</u></b><br>$who_online_now";
}
$content .= "</form>";

?>

_________________
I am new at this, give me time.


PHPNUKE = Less Code
NukeCops = More power
PhpNuke + NukeCops = "less code more power"
Find all posts by ravernewsView user's profileSend private messageVisit poster's websiteAIM AddressYahoo Messenger
ArtificialIntel



Joined: Jan 31, 2004
Posts: -88


PostPosted: Sat Mar 08, 2003 5:39 am Reply with quoteBack to top

Look at this bit of code from the User Info block I have:
Code:
$curDate2 = "%".$month[0].$month[1].$month[2]."%".$mday."%".$year."%";
$preday = strftime ("%d",$test);
$premonth = strftime ("%B",$test);
$preyear = strftime ("%Y",$test);
$curDateP = "%".$premonth[0].$premonth[1].$premonth[2]."%".$preday."%".$preyear."%";

What do you see on the bottom line???? That's where CurDateP is defined. That's above the SQL block above the SQL block that CurDateP is in.

On Another Note: My User Info block works fine and has done since me and Chatserv were working on it.

AI
Find all posts by ArtificialIntelView user's profileSend private message
ArtificialIntel



Joined: Jan 31, 2004
Posts: -88


PostPosted: Sat Mar 08, 2003 5:42 am Reply with quoteBack to top

also, if you download the User Info block that's been in our downloads section for over a week, you'd know that I've already done the security block mod on it.

Just to save you some time.

AI
Find all posts by ArtificialIntelView user's profileSend private message
ravernews
Premium
Premium


Joined: Jan 26, 2003
Posts: 230

Location: USA

PostPosted: Sat Mar 08, 2003 5:57 am Reply with quoteBack to top

Yeah I have used your block but for some reason the yesterday sign ups are the same as the total sign ups. Something is jacked up somewhere in my site. Thanks for you time.

_________________
I am new at this, give me time.


PHPNUKE = Less Code
NukeCops = More power
PhpNuke + NukeCops = "less code more power"
Find all posts by ravernewsView user's profileSend private messageVisit poster's websiteAIM AddressYahoo Messenger
ArtificialIntel



Joined: Jan 31, 2004
Posts: -88


PostPosted: Sat Mar 08, 2003 6:00 am Reply with quoteBack to top

have you got the one I posted last week? cause it had a couple of code changes in it.

AI
Find all posts by ArtificialIntelView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next 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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.241 Seconds - 307 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::