Results 1 to 3 of 3

Thread: TUTORIAL - How to get ip of the author

  1. #1
    Thread Starter
    Junior Member
    Not a Verified Customer
    anunturi's Avatar
    Join Date
    Apr 2009
    Location
    bucharest romania
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    TUTORIAL - How to get ip of the author

    ok, so many of us need to have the ip of the poster because sometimes posters=spammers and they must be banned.
    i created a little tutorial to get the ip of the author.
    ok so let's go
    open classipress/post-form.php
    search for this with Ctrl+F
    Code:
    <label for="post_tags"><?php _e('URL','cp'); ?> <?php _e('(i.e. http://www.mysite.com)','cp'); ?></label>
    <input type="text" id="cp_adURL" class="adfields" name="cp_adURL" size="60" maxlength="250" value="<?php echo $_POST['cp_adURL']; ?>" />
    after add the following code
    Code:
    <label for="post_tags"><?php _e('IP','cp'); ?> <?php _e('(To prevent the abuse the IPs are logged)','cp'); ?></label>
    <input disabled="disabled" readonly="readonly" type="text" name="ip" size="13" maxlength="250" value="<?php echo $ip=$_SERVER['REMOTE_ADDR'];?>" /">
    then save and exit
    open classipress/form_process.php
    search for
    Code:
    $cp_adURL 		= cp_filter($_POST['cp_adURL']);
    $featured_ad	= cp_filter($_POST['featured_ad']);
    and paste after this
    Code:
    $ip			= cp_filter($ip=$_SERVER['REMOTE_ADDR']);
    then search
    Code:
    add_post_meta($post_id, 'images', $images, true);
    add_post_meta($post_id, 'expires', $expires, true);
    and paste this
    Code:
    add_post_meta($post_id, 'ip', $ip, true);
    save and exit.
    upload the new files and if you post an add and go to the admin panel and click edit you'll see a field named IP with the ip of the author.
    !!!! First backup those 2 files !!!

  2. #2
    Senior Member
    Not a Verified Customer
    chanders's Avatar
    Join Date
    Jul 2009
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TUTORIAL - How to get ip of the author

    Nice mod!

  3. #3
    Thread Starter
    Junior Member
    Not a Verified Customer
    anunturi's Avatar
    Join Date
    Apr 2009
    Location
    bucharest romania
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TUTORIAL - How to get ip of the author

    thank you. with this mod the problem of spammers is resolved.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Related ads by author link not working...
    By jschodde in forum ClassiPress General Discussion
    Replies: 6
    Last Post: July 17th, 2009, 10:13 AM
  2. Tutorial:Change place to Currency Symbol
    By chifen in forum ClassiPress General Discussion
    Replies: 1
    Last Post: May 25th, 2009, 12:37 PM