Author Topic: Register Ip  (Read 18264 times)

0 Members and 1 Guest are viewing this topic.

Offline __G__

  • Sr. Member
  • ****
  • Posts: 286
    • View Profile
Register Ip
« on: January 29, 2007, 05:15:21 PM »
hi can we record ip of people who registers the account on 4images ?

Offline CeJay

  • Sr. Member
  • ****
  • Posts: 425
    • View Profile
Re: Register Ip
« Reply #1 on: January 30, 2007, 12:42:37 AM »
There use to be a mod for this. I think from The Oracle?

I have not seen it in a while and can not find it.

Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Re: Register Ip
« Reply #2 on: February 02, 2007, 06:32:40 PM »
Well, just create a new field in your database and use for example

Code: [Select]
 
    $user_ip = $site_sess->user_ip;
    $additional_field_sql .= ", user_ip";
    $additional_value_sql .= ", '$user_ip'";

in your register.php ... of course you have to include it in your adminarea etc, but that wouldnt be difficult ;)

Offline __G__

  • Sr. Member
  • ****
  • Posts: 286
    • View Profile
Re: Register Ip
« Reply #3 on: February 02, 2007, 06:44:06 PM »
bro i am not really a coder can u gimme instructions step by step please

Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Re: Register Ip
« Reply #4 on: February 02, 2007, 06:50:10 PM »
use the search for "additional user field", there was a large thread somewhere ... use "user_ip" as your new userfield. After you've done that open your register.php,
and find:

Code: [Select]
  if (!$error) {
    $additional_field_sql = "";
    $additional_value_sql = "";
    if (!empty($additional_user_fields)) {
      $table_fields = $site_db->get_table_fields(USERS_TABLE);
      foreach ($additional_user_fields as $key => $val) {
        if (isset($HTTP_POST_VARS[$key]) && isset($table_fields[$key])) {
          $additional_field_sql .= ", $key";
          $additional_value_sql .= ", '".un_htmlspecialchars(trim($HTTP_POST_VARS[$key]))."'";
        }
      }
    }

right after add:

Code: [Select]
    // IP Logging of new user
    $user_ip = $site_sess->user_ip;
    $additional_field_sql .= ", user_ip";
    $additional_value_sql .= ", '$user_ip'";

save it, and you should see the IP in the admin area under "edit user" (if you followed the thread for the add. user field)




Offline __G__

  • Sr. Member
  • ****
  • Posts: 286
    • View Profile
Re: Register Ip
« Reply #5 on: February 02, 2007, 09:42:08 PM »
bro when i run the run it in php my admin it shows this

Error

There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem

ERROR: Unknown Punctuation String @ 22
STR: -&
SQL: $user_ip = $site_sess->user_ip

SQL query:

$user_ip = $site_sess->user_ip

MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$user_ip = $site_sess->user_ip' at line 1

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.420
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: Register Ip
« Reply #6 on: February 03, 2007, 09:28:23 AM »
Well, just create a new field in your database

Do you have done it bevor?

Quote
$user_ip = $site_sess->user_ip

And this is not for phpmyamdin!!!


Offline __G__

  • Sr. Member
  • ****
  • Posts: 286
    • View Profile
Re: Register Ip
« Reply #7 on: February 03, 2007, 09:42:07 AM »
how do we do that bro

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.420
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: Register Ip
« Reply #8 on: February 03, 2007, 10:15:28 AM »
Quote
ALTER TABLE `XXXX_users` ADD `user_ip` VARCHAR( 20 ) NOT NULL ;

Use the SQL Snippet (in phpmyadmin) to create a new Field (user_ip) in the User Table (rename XXXX_users)...

Good speed....

Offline __G__

  • Sr. Member
  • ****
  • Posts: 286
    • View Profile
Re: Register Ip
« Reply #9 on: February 05, 2007, 09:31:05 AM »
i am still lost abt this database thingy :(

Offline __G__

  • Sr. Member
  • ****
  • Posts: 286
    • View Profile
Re: Register Ip
« Reply #10 on: February 07, 2007, 07:51:41 AM »
 SQL query:

ALTER TABLE `XXXX_users` ADD `user_ip` VARCHAR( 20 ) NOT NULL


.XXXX_users' doesn't exist

Offline impss

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Cusstom.net
Re: Register Ip
« Reply #11 on: February 07, 2007, 03:41:15 PM »
The XXXX is inteded for you to change.

Depending on what you use in your database.

I believe if you did not make any changes to that on install it would be 4Images_users

So then you would run:
Code: [Select]
ALTER TABLE `4Images_users` ADD `user_ip` VARCHAR( 20 ) NOT NULL ;

Offline __G__

  • Sr. Member
  • ****
  • Posts: 286
    • View Profile
Re: Register Ip
« Reply #12 on: February 07, 2007, 03:53:36 PM »
wow thanks a lot >:D< it worked

Offline __G__

  • Sr. Member
  • ****
  • Posts: 286
    • View Profile
Re: Register Ip
« Reply #13 on: February 07, 2007, 04:02:03 PM »
i did everything i dont see the ip :( Username    Email    Date of registration    Last activity    Options
   testaccount    lol@lol.com    07.02.2007 06:59    07.02.2007 06:59    

[Edit]  [Delete]    [Permissions]  [User Groups] 

Offline Foto-Portal

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Register Ip
« Reply #14 on: February 08, 2007, 10:24:46 AM »
hi erveryone.

its the same problem for me.
i can only see:

Username - Date - Date of registry - last action - options

???

thx for reply

 

Post your comments here