PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
voddkaman
New Member
New Member


Joined: May 03, 2005
Posts: 7

PostPosted: Tue May 03, 2005 12:50 pm Reply with quote Back to top

Hi,

I want to change the stats module so that my visits are counted as hits. Can this be done? Sad I'm new to Nuke so any detailed help would be appreicated.
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 14943
Location: Kansas

PostPosted: Wed May 04, 2005 6:16 am Reply with quote Back to top

What version of nuke are you using? I can't see where your hits wouldn't be counted?
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
voddkaman
New Member
New Member


Joined: May 03, 2005
Posts: 7

PostPosted: Fri May 06, 2005 10:42 pm Reply with quote Back to top

sorry for the delay: i'm using version 7.5....and I don't want my visits to count.
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 14943
Location: Kansas

PostPosted: Fri May 06, 2005 11:11 pm Reply with quote Back to top

You say in your first post
Quote:
I want to change the stats module so that my visits are counted as hits
but in your second you say
Quote:
and I don't want my visits to count
Confused
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
voddkaman
New Member
New Member


Joined: May 03, 2005
Posts: 7

PostPosted: Sat May 07, 2005 12:07 am Reply with quote Back to top

LOL...sorry about that...I meant for my visits NOT to count. Embarassed
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 14943
Location: Kansas

PostPosted: Sat May 07, 2005 11:41 pm Reply with quote Back to top

In includes/counter.php, your beginning code should look something like this
Code:
if (stristr($_SERVER['SCRIPT_NAME'], "counter.php")) {
    Header("Location: index.php");
    die();
}
global $prefix, $db;

And then the rest of the script, ending with a PHP closing tag of ?>
Code:
if (stristr($_SERVER['SCRIPT_NAME'], "counter.php")) {
    Header("Location: index.php");
    die();
}
global $prefix, $db;
// REST OF SCRIPT
?>


Starting with the "global" statement, modify the text above to this
Code:
global $prefix, $db, $user;
$userinfo = getusrinfo($user);
if (strtolower($userinfo['username'])!='yourusername') {

Then, add this line just before the closing PHP ?> tag
Code:
}
so that it looks like
Code:
if (stristr($_SERVER['SCRIPT_NAME'], "counter.php")) {
    Header("Location: index.php");
    die();
}
global $prefix, $db, $user;
$userinfo = getusrinfo($user);
if (strtolower($userinfo['username'])!='yourusername') {
    // REST OF SCRIPT
}
?>


You will change the value for "yourusername" to your nuke user name using lowercase.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
voddkaman
New Member
New Member


Joined: May 03, 2005
Posts: 7

PostPosted: Mon May 09, 2005 2:08 pm Reply with quote Back to top

Thanks much Very Happy
View user's profile Send private message
sprithansi
New Member
New Member


Joined: May 02, 2008
Posts: 3

PostPosted: Sun Jun 15, 2008 12:07 pm Reply with quote Back to top

Will this works in version 2.20.01?
View user's profile Send private message
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 4578
Location: Slovakia - working my way around Eastern Europe

PostPosted: Sun Jun 15, 2008 12:49 pm Reply with quote Back to top

Try it and see Wink
View user's profile Send private message Send e-mail Visit poster's website
sprithansi
New Member
New Member


Joined: May 02, 2008
Posts: 3

PostPosted: Tue Jul 01, 2008 3:35 am Reply with quote Back to top

Tested, and it's not working.
It would be nice to have an option too choose if e.g. not to count hits from admin
View user's profile Send private message
montego
Site Admin


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

PostPosted: Tue Jul 01, 2008 6:22 am Reply with quote Back to top

Well, that thread was three years old and not based upon RN. So, maybe try this instead:

Code:

if (stristr($_SERVER['SCRIPT_NAME'], "counter.php")) {
    Header("Location: index.php");
    die();
}
global $prefix, $db, $admin;
if (!is_admin($admin)) {
    // REST OF SCRIPT
}
?>
View user's profile Send private message Visit poster's website
sprithansi
New Member
New Member


Joined: May 02, 2008
Posts: 3

PostPosted: Wed Jul 02, 2008 12:56 am Reply with quote Back to top

Thanks. It works Smile
Is it possible to add more users to this? E.g. Admin and user...
View user's profile Send private message
montego
Site Admin


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

PostPosted: Wed Jul 02, 2008 6:24 am Reply with quote Back to top

Well, every admin will be excluded (i.e., those you set up in Edit Admins). If you want to also exclude certain regular users than you have to combine the two concepts. Maybe something like this:

Code:

if (stristr($_SERVER['SCRIPT_NAME'], "counter.php")) {
    Header("Location: index.php");
    die();
}
global $prefix, $db, $admin, $user;
$userinfo = getusrinfo($user);
$userName = strtolower($userinfo['username']);
if (!is_admin($admin) && !in_array($userName, array('username1', 'username2', ...)) {
    // REST OF SCRIPT
}
?>


Just remember to lower-case the user names. If you do not wish to do that (thinking you may have duplicates after you lower-case them), then remove the strtolower() function around the $userinfo assignment.
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

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-2008 by Raven
Proud to be listed at Lobo Links Web Directory

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 Recoded To 100% W3C CSS & HTML 4.01 Transitional Compliance by Raven and 64bitguy ::

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

zerosum