PDA

View Full Version : Thread Whois


Neo
03-03-2002, 10:00 PM
This was requested at this link.

https://vborg.vbsupport.ru/showthread.php?s=&threadid=32134

Yes I know it will take up a huge amount of space in the database, but I added a fuction so that after 6 hours it will be deleted. from the database...

I cant really show you a image of it.. but you will see it if you install it.

Have fun

updated: 04/03/03

(Look Below a few posts)

neal
03-04-2002, 02:26 PM
What does this do?

neal
03-04-2002, 02:28 PM
woops, nm

Admin
03-04-2002, 02:34 PM
Sorry but what's the point in deleting it after 6 hours? Either use the hack and bear with the load, or don't use it at all. :)

Neo
03-04-2002, 03:09 PM
True, but this adds a less of load.. it is used to track people that go into threads they shouldnt. But I guess you have a point.. I think 2 days would be good enough for it dont you think?

Twig Deez
03-04-2002, 03:33 PM
i'm gonna give this a try, just to see how it works.

there's a missing comma in the instructions tho,
right at the end of the `threadname` VARCHAR(60) NOT NULL line,
in the create table part.

Neo
03-04-2002, 03:36 PM
Ok, I have updated it so that it will be deleted after 3 days and has the ip address stored.

Twig Deez
03-04-2002, 03:43 PM
here's the output i got the very first time i checked it...

Neo
03-04-2002, 03:44 PM
try the one above.

Twig Deez
03-04-2002, 03:55 PM
dude, i got the same exact result,
with the obvious exception of the ip's being logged.

no forum id or name shown?

i'll check back here in a few hours, i gotta go earn my keep now.
nice work on this hack tho, it's definitely something i'd like to have.

Neo
03-04-2002, 04:19 PM
Heh... it works on mine perfectly.

LaNder
03-04-2002, 06:19 PM
if i select "next page" in the "Thread Whois Viewer Page", the next page shown is one from the admin-log?

LaNder

Neo
03-04-2002, 06:29 PM
ummm so is that the only problem now?

Neo
03-04-2002, 06:36 PM
Ok I fixed that.. sorry for the errors, I have been doing alot.

LaNder
03-04-2002, 06:54 PM
now it seems to work correct :)

thanx!


LaNder

Neo
03-04-2002, 07:19 PM
Yeah, Glad it finally works.

Twig Deez
03-04-2002, 11:10 PM
hey, now it works just fine. sweet! :)

now, i wonder is there a way to limit it's output to one usergroup,
or preferably for an individual user?

Neo
03-05-2002, 12:11 AM
yup. I will give you the version tomorrow

Twig Deez
03-05-2002, 12:15 AM
primo, dude. much obliged! :)

Twig Deez
03-06-2002, 03:54 PM
any luck on this addition, my man?

also, i was getting a bucketload of database errors regarding apostrophes,
so in the changes in showthread.php...

i replaced

threadname='$thread[title]'

with

threadname='".addslashes($thread[title])."'

and

username='$bbuserinfo[username]'

with

username='".addslashes($bbuserinfo[username])."'

i totally hope that's the right syntax and everything,
but it seems to have worked so far.

cheers! :)

Admin
03-06-2002, 04:08 PM
Twig Deez, that's correct. You *always* need to addslashes() when storing strings in database.

Neo
03-06-2002, 04:32 PM
Ok Twig.

Instead of

$timeoutsecondswhois = 260000;
$timestampwhois = time();
$timeoutwhois = $timestampwhois-$timeoutsecondswhois;

$DB_site->query("INSERT INTO threadwhois SET timestamp='$timestampwhois',threadid='$thread[threadid]',threadname='".addslashes($thread[title])."',username='".addslashes($bbuserinfo[username])."', ip='$REMOTE_ADDR'");
$DB_site->query("DELETE FROM threadwhois WHERE timestamp<$timeoutwhois");


use

if ($bbuserinfo[usergroupid]==XX) {
$timeoutsecondswhois = 260000;
$timestampwhois = time();
$timeoutwhois = $timestampwhois-$timeoutsecondswhois;

$DB_site->query("INSERT INTO threadwhois SET timestamp='$timestampwhois',threadid='$thread[threadid]',threadname='".addslashes($thread[title])."',username='".addslashes($bbuserinfo[username])."', ip='$REMOTE_ADDR'");
$DB_site->query("DELETE FROM threadwhois WHERE timestamp<$timeoutwhois");
}



Make the XX the number of the group id you want to have use this.

Twig Deez
03-07-2002, 01:35 AM
Originally posted by FireFly
Twig Deez, that's correct. You *always* need to addslashes() when storing strings in database.

thanks firefly. i hadn't even read thru the code that thoroughly,
and i ended up with something like 400 database errors in my inbox from overnight, heh.
i remember the addslashes thing from a fix for another hack anyway,
so that's sorted that out. thanks for the confirmation!

and neo, thanks a lot for that addition! perfect for what i was thinking of.
i can also now figure out how to restrict the output to one particular user,
since i have it in mind to do something with that also.

again, thanks! :D

Joshua Clinard
03-08-2002, 03:16 AM
This looks like a pretty good hack, with the exception of the load, and that's not your fault. Does anyone know if there would be a way to do this hack without adding so much to the database?

Neo
03-08-2002, 11:59 AM
Twig Deez: No problem man.

Joshua Clinard: Make it for a specific user group, (like above)

LaNder
03-13-2002, 12:21 PM
hi,

i found out, that the function "sort by Thread Name" or "sort by IP" isn't working.

it's always sorted by Username. is there a fix possible?

LaNder

Neo
03-13-2002, 12:52 PM
I believe this is sorted by start date

Jawelin
05-16-2002, 02:16 PM
Neo, very nice hack. Very very cool!
Simple but great idea.

I implemented it with a couple of enhancements. Just to give you an extend-idea... :D
- stored a little bit more infos coming from user and thread (for example: forumid, number of posts in thread that moment, proxyip, etc).
- I already have a weekly scheduled "dump, archive and flush" of all four (now five) log tables. So I removed the in-code delete timeout.
- To make that table not too fast grown up, I added a field to forum tables (managed in forum.php) to choose either if log accesses to that particular forum or not.
This way, I could focus the logging to most 'sensitive' areas of my board.

If someone needed, I could post the delta instructions.
Any way, many thanks to your idea and clear implementation.

Bye

StarBuG
05-24-2002, 01:01 PM
Hmmm!

This hack could be usefull but not in this way for me!
Is it possible to change the hack to this?

If a user clicks on the Hit counter of a thread that a popup opens and shows the users who viewed this thread?

That is what I realy need!

Greetings

StarBuG

NeRilkA
06-14-2002, 03:18 PM
Thanks a lot i was just looking for this hack !! great :)

Boofo
07-14-2002, 02:31 AM
I'd be interested in see what you added and the instructions for the db. :)

Originally posted by Jawelin
Neo, very nice hack. Very very cool!
Simple but great idea.

I implemented it with a couple of enhancements. Just to give you an extend-idea... :D
- stored a little bit more infos coming from user and thread (for example: forumid, number of posts in thread that moment, proxyip, etc).
- I already have a weekly scheduled "dump, archive and flush" of all four (now five) log tables. So I removed the in-code delete timeout.
- To make that table not too fast grown up, I added a field to forum tables (managed in forum.php) to choose either if log accesses to that particular forum or not.
This way, I could focus the logging to most 'sensitive' areas of my board.

If someone needed, I could post the delta instructions.
Any way, many thanks to your idea and clear implementation.

Bye

Craznik
08-25-2002, 05:43 PM
Could the date and time someone viewed the thread be added to this log? If its a simple addition, please tell me how.

Also, and this may sound confusing, I need to log these IP's for each viewer in the same place and same way an IP is logged when someone makes a post. On my forum members have been known to give non-members their username and password. I am using this hack to try and stop this. It would make life much easier for me if when I went into the admin CP and used the "find other users with this IP" feature, it would be able to see the IPs logged from people who only view the boards as well as post on it. Of coarse in the "find more IP's for this user" feature, it only lists each IP address once, not for ever single post.

I like this hack since it shows all accesses for a period of time but just want to add each separate IP someone views with to the same log as the ones who make posts.

This hack is great btw. I installed it and it works perfectly. I was desperately looking for a way to log IPs that viewed without posting. I am so much closer to what I need now.

Thanks again!!! :banana: