Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 02:34 pm EDT

Geeklog Forums

Tracking IP adress for comments (GL 1.3.9sr3)


JapioF

Anonymous
caffeinated

Here how you can make your comments track the IP of the poster (I couldn't find a topic for this, so I'm posting it here).

Create a new field in your gl_comments table called ip with the following setings: varchar(20), NULL default=0.0.0.0

Next, open your comments.php in ./public_html and find change to following code:

Text Formatted Code
DB_save ($_TABLES['comments'], 'sid,uid,comment,date,title,pid,type', "'$sid',$uid,'$comment',now(),'$title',$pid,'$type'")
 


into:

Text Formatted Code
DB_save ($_TABLES['comments'], 'sid,uid,comment,date,title,pid,type,ip', "'$sid',$uid,'$comment',now(),'$title',$pid,'$type','$ip'");
 


For now, it just saves the code into the table. It doesn't show when viewing a comment, I'm still working on that. I know that the Visitor Stats pluging does a similar thing, but I didn't have that installed at the time.

Use PhpMyAdmin to view the stored IP per comment.

Good luck,

JapioF
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
You could, of course, simply upgrade to 1.3.11 which has all that built in ... Mr. Green

bye, Dirk
 Quote

JapioF

Anonymous
caffeinated
Dirk, ofcourse I could... but what's the fun in that Very Happy
This is much more fun...

JapioF
 Quote

All times are EDT. The time is now 02:34 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content