Welcome, Guest. Please Login or Register.
March 29, 2024, 03:29:20 PM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Completed mods  |  [Beta] View username @ View forum access log « previous next »
Pages: [1] 2 3 Reply Ignore Print
Author Topic: [Beta] View username @ View forum access log  (Read 16034 times)
sylvester
YaBB God
*****
Posts: 525


[Beta] View username @ View forum access log
« on: August 06, 2002, 06:01:00 PM »
Reply with quote

<id>
View username @ View forum access log
</id>

<version>
1
</version>

<author>
sylvester ([email protected])
</author>

<mod info>
With this 'mod', you'll see the username AND the ip-adress instead of only the ip-adress
</mod info>

<homepage>
http://www.computerfreakz.net
</homepage>

<edit file>
Index.php
</edit file>

<search for>
/* ### Log this click ### */
ClickLog();

/* ### Load the user's cookie (or set to guest) ### */
LoadCookie();

/* ### Load user settings ### */
LoadUserSettings();
</search for>

<replace>
/* ### Load the user's cookie (or set to guest) ### */
LoadCookie();

/* ### Load user settings ### */
LoadUserSettings();

/* ### Log this click ### */
ClickLog();
</replace>

<edit file>
Sources/Admin.php
</edit file>

<search for>
function ShowClickLog (){
   global $yytitle,$txt,$color,$imagesdir,$img,$boardurl,$db_prefix;
</search for>

<add after>
   global $cgi;
</add after>

<search for>
foreach($iplist as $key=>$value)
   print "$key &nbsp;(<i>$value</i>)<BR>\n";
</search for>

<replace>
   $showrealname = 0;
/* Set $showrealname to 1 if you want to see the realname of that user, else set it to 0
Please note: if you set it to 1, it will use a lot of queries!
*/
foreach($iplist as $key=>$value) {
   list($name,$addr) = explode("|",$key);
   $clickname = ($showrealname && $name != 'Guest') ? LoadRealName($name) : $name;
   $profile = ($name == "Guest") ? $txt[28] : "<A HREF=\"$cgi;action=viewprofile;user=$name\">$clickname</A>";
   print "$addr &nbsp;(<i>$value</i>) ($profile)<br>\n";
}
</replace>

<edit file>
Sources/Subs.php
</edit file>

<search for>
function ClickLog (){
   global $HTTP_REFERER,$HTTP_USER_AGENT,$REMOTE_ADDR,$REQUEST_URI,$ClickLogTime,$db_prefix;
   $logTime = time();
   $threshold = time() - ($ClickLogTime*60);
   $request = mysql_query("INSERT INTO {$db_prefix}log_clicks (ip,logTime,agent,fromUrl,toUrl) VALUES ('$REMOTE_ADDR',$logTime,'$HTTP_USER_AGENT','$HTTP_REFERER','$REQUEST_URI')");
   $request = mysql_query("DELETE FROM {$db_prefix}log_clicks WHERE logTime<$threshold");
}
</search for>

<replace>
function ClickLog (){
   global $username,$HTTP_REFERER,$HTTP_USER_AGENT,$REMOTE_ADDR,$REQUEST_URI,$ClickLogTime,$db_prefix;
   $username = ($username == '') ? 'Guest' : $username;
   $logTime = time();
   $threshold = time() - ($ClickLogTime*60);
   $request = mysql_query("INSERT INTO {$db_prefix}log_clicks (ip,logTime,agent,fromUrl,toUrl) VALUES ('$username|$REMOTE_ADDR','$logTime','$HTTP_USER_AGENT','$HTTP_REFERER','$REQUEST_URI')");
   $request = mysql_query("DELETE FROM {$db_prefix}log_clicks WHERE logTime<$threshold");
}
</replace>
« Last Edit: August 06, 2002, 10:12:11 PM by sylvester » Logged

I'm back
keysers0ze
Jr. Member
**
Posts: 65


I'm the Dali Llama!

ICQ - 159547275 WWW
Re:View username @ View forum access log
« Reply #1 on: August 06, 2002, 06:33:11 PM »
Reply with quote

Um... Just tried to install and it said:
Fatal error: Call to undefined function: mysqlquery() in /home/virtual/public_html/community/Sources/Subs.php on line 1030
Any idea how to fix it? I have 'IM popup', 'member actions' and 'bio' mods installed...
Logged

sylvester
YaBB God
*****
Posts: 525


Re:View username @ View forum access log
« Reply #2 on: August 06, 2002, 07:03:57 PM »
Reply with quote

Quote from: keysers0ze on August 06, 2002, 06:33:11 PMUm... Just tried to install and it said:
Fatal error: Call to undefined function: mysqlquery() in /home/virtual/public_html/community/Sources/Subs.php on line 1030
Any idea how to fix it? I have 'IM popup', 'member actions' and 'bio' mods installed...
oops... :-[ :-[ :-X :-X :-X
Sorry, I've got a new function that counts the number of queries. I didn't remove them  :-[
Try it again
or just replace MySQLquery with mysql_query ;) :P :) :D
Logged

I'm back
keysers0ze
Jr. Member
**
Posts: 65


I'm the Dali Llama!

ICQ - 159547275 WWW
Re:[Beta] View username @ View forum access log
« Reply #3 on: August 06, 2002, 09:09:22 PM »
Reply with quote

Well... It's getting better... ::)
I've tried it again and there weren't any errors. BUT...
Although I'm logged in, it shows me (and I suppose all other members too) as a guest in the 'Users Online' section. Weird.
And also, in the 'View Forum Access Log' it doesn't show the user name of the IP. It says, for example:
(128) (195.93.49.151)
(82) (195.93.48.13)
(22) (12.84.32.39)
(2) (208.59.199.233)
No usernames and the IP address is a link, but when you click on it, it cant find the user named '195.93.49.151' (coz there isn't one, of course)...
But at least my forum works again... ;D
Logged

sylvester
YaBB God
*****
Posts: 525


Re:[Beta] View username @ View forum access log
« Reply #4 on: August 06, 2002, 09:47:50 PM »
Reply with quote

My log:
Total Clicks: 22
Total Unique Visitors: 1

xx.xx.xx.xxx (22) (Webmaster)

But I think I've got the problem. wait a few minutes
Logged

I'm back
sylvester
YaBB God
*****
Posts: 525


Re:[Beta] View username @ View forum access log
« Reply #5 on: August 06, 2002, 09:51:30 PM »
Reply with quote

problem is solved.
I use SSI.php, so the user settings are loaded BEFORE it logs the click :) :P
You have to modify Index.php as well.

<edit file>
Index.php
</edit file>

<search for>
/* ### Log this click ### */
ClickLog();

/* ### Load the user's cookie (or set to guest) ### */
LoadCookie();

/* ### Load user settings ### */
LoadUserSettings();
</search for>

<replace>
/* ### Load the user's cookie (or set to guest) ### */
LoadCookie();

/* ### Load user settings ### */
LoadUserSettings();

/* ### Log this click ### */
ClickLog();
</replace>
has been added to the mod.
Logged

I'm back
Nossie
Full Member
***
Posts: 192


If it aint broke, you haven't played with it enuff

ICQ - 18967293IanHarvie@Hotmail.com WWW
Re:[Beta] View username @ View forum access log
« Reply #6 on: August 06, 2002, 10:01:35 PM »
Reply with quote

great mod...


I have a q tho..

is it possible to link the ip to something other than the ip? or to completely delete the ip link entirely ?
Logged

Nossie
Full Member
***
Posts: 192


If it aint broke, you haven't played with it enuff

ICQ - 18967293IanHarvie@Hotmail.com WWW
Re:[Beta] View username @ View forum access log
« Reply #7 on: August 06, 2002, 10:05:13 PM »
Reply with quote

one problem tho I am having is that when i click on the username... it just comes up a blank page? it would apear to be meant to bring up the users profile no?
Logged

sylvester
YaBB God
*****
Posts: 525


Re:[Beta] View username @ View forum access log
« Reply #8 on: August 06, 2002, 10:06:20 PM »
Reply with quote

Quote from: Nossie on August 06, 2002, 10:01:35 PMgreat mod...


I have a q tho..

is it possible to link the ip to something other than the ip? or to completely delete the ip link entirely ?
there is a line in admin.php
 print "$addr &nbsp;(<i>$value</i>) ($profile)<br>\n";I'll explain the variables in that line.
$addr = IP
$value = number of entries from that username&ip
$profile = username OR if you enabled showrealname, it shows the realname.
if you want to link the ip to http://bla.com?bla=ip
replace that line with:
 print "<A HREF=\"http://bla.com?bla=$addr\">$addr</A> &nbsp;(<i>$value</i>) ($profile)<br>\n";
Logged

I'm back
Nossie
Full Member
***
Posts: 192


If it aint broke, you haven't played with it enuff

ICQ - 18967293IanHarvie@Hotmail.com WWW
Re:[Beta] View username @ View forum access log
« Reply #9 on: August 06, 2002, 10:08:25 PM »
Reply with quote

naw I've just realised that as time goes by it should disable the ip links yes?

I'm quite happy with that... although i'm puzzled with why the profile brings up a blank page... seems simple enough..
Logged

Nossie
Full Member
***
Posts: 192


If it aint broke, you haven't played with it enuff

ICQ - 18967293IanHarvie@Hotmail.com WWW
Re:[Beta] View username @ View forum access log
« Reply #10 on: August 06, 2002, 10:18:24 PM »
Reply with quote

found something dunno if its meant to do this...

if i click on the user from the index page then its this

http://www.3dhomeworld.com/yabbse/index.php?action=viewprofile;user=Nossie
but if I click on it from admin its the following...
http://www.3dhomeworld.com/yabbse/;action=viewprofile;user=Nossie
are those meant to be different?
Logged

sylvester
YaBB God
*****
Posts: 525


Re:[Beta] View username @ View forum access log
« Reply #11 on: August 06, 2002, 11:14:49 PM »
Reply with quote

Quote from: Nossie on August 06, 2002, 10:18:24 PMfound something dunno if its meant to do this...

if i click on the user from the index page then its this

http://www.3dhomeworld.com/yabbse/index.php?action=viewprofile;user=Nossie
but if I click on it from admin its the following...
http://www.3dhomeworld.com/yabbse/;action=viewprofile;user=Nossie
are those meant to be different?
I've modified my first post in this thread.
I thought $cgi was already globalized in this function, but it wasn't.
<edit file>
Sources/Admin.php
</edit file>

<search for>
function ShowClickLog (){
   global $yytitle,$txt,$color,$imagesdir,$img,$boardurl,$db_prefix;
</search for>

<add after>
   global $cgi;
</add after>
Logged

I'm back
Nossie
Full Member
***
Posts: 192


If it aint broke, you haven't played with it enuff

ICQ - 18967293IanHarvie@Hotmail.com WWW
Re:[Beta] View username @ View forum access log
« Reply #12 on: August 06, 2002, 11:22:09 PM »
Reply with quote

you are a star

thanks  ;D

works purrfectly now ;)
Logged

sylvester
YaBB God
*****
Posts: 525


Re:[Beta] View username @ View forum access log
« Reply #13 on: August 06, 2002, 11:45:42 PM »
Reply with quote

Quote from: Nossie on August 06, 2002, 11:22:09 PMyou are a star

thanks  ;D

works purrfectly now ;)
no, I am not a star :P :)

no thnx

great
Logged

I'm back
keysers0ze
Jr. Member
**
Posts: 65


I'm the Dali Llama!

ICQ - 159547275 WWW
Re:[Beta] View username @ View forum access log
« Reply #14 on: August 07, 2002, 01:24:57 PM »
Reply with quote

I've done the most recent changes and it's now showing some IP addresses and some usernames in the 'Access Log', but as mentioned earlier, the IP addresses will dissapear eventually...

However, I'm still having the problem of being displayed as a guest in the 'Users Online' section at the bottom, even though I'm logged in... :-\
Any idea how to fix this...?
Logged

Pages: [1] 2 3 Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  [Beta] View username @ View forum access log « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.037 seconds with 19 queries.