vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Miscellaneous Hacks - Ad Information (IP Hash, Country, Username) (https://vborg.vbsupport.ru/showthread.php?t=311962)

VA6DAH 06-06-2014 10:00 PM

Ad Information (IP Hash, Country, Username)
 
1 Attachment(s)
This plugin will look like this, without the callsign field though. I wrote it for my forums (for the most part) and now sharing it with you. It is licensed to you under the standard MIT licence everyone knows and loves (Seriously... Do anything you want with the below. I don't care if you print it out, roll it up with your drug of choice, and smoke it) << - This is a joke

Also while I did make this for my Swap "n" Shop you can modify the code below to make if say just about anything. As for support I will try an help whenever possible.

https://vborg.vbsupport.ru/external/2014/06/59.png

How to install :
Admincp >> Plugins & Products >> Add New Plugin
  • Product : VBulletin
  • Hook Location : postbit_display_complete
  • Title : Anything that you want
  • Execution Order : 5
  • Plugin PHP Code

You may also want to change:
  • "<site>" to your sites url. (occurs twice in code)
  • "__HASH__" This is the salt for your hash, changing this value will make it much more harder to brute-force the hash. (occurs once in code)

PHP Code:

$show_hashed_ip_forumid = array();/* fill with nothing to enable on all section */     
if (isset($post) && isset($thread) && isset($post['ip']) && isset($thread['forumid'])) {     
    
$show_hashed_ip false;     
    if (array() == 
$show_hashed_ip_forumid) {     
        
$show_hashed_ip true;     
    } else if (
in_array($thread['forumid'], $show_hashed_ip_forumid)) {     
        
$show_hashed_ip true;     
    }     
    if (
$show_hashed_ip) {     
    
  
//do curl call to api for getting country name by ip   
  
$geo_api_url 'http://www.geoplugin.net/php.gp?ip='.$post['ip'];     
  
$ch curl_init();   
  
$timeout 5;   
  
curl_setopt($chCURLOPT_URL$geo_api_url);   
  
curl_setopt($chCURLOPT_USERAGENT"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)");   
  
curl_setopt($chCURLOPT_RETURNTRANSFER1);   
  
curl_setopt($chCURLOPT_SSL_VERIFYHOST,false);   
  
curl_setopt($chCURLOPT_SSL_VERIFYPEER,false);   
  
curl_setopt($chCURLOPT_MAXREDIRS10);   
  
curl_setopt($chCURLOPT_FOLLOWLOCATION1);   
  
curl_setopt($chCURLOPT_CONNECTTIMEOUT$timeout);   
  
$data curl_exec($ch);   
  
curl_close($ch);   
    
  
$geo_code unserialize($data);     
  
$country $geo_code['geoplugin_countryName'];     
    
        
$post['message'] .= '   
<div style="margin-top: 25px;     
border: 1px solid green;     
padding: 8px;line-height: 20px;   
font-size: 11px;">   
    
<strong>This ad was posted by:</strong>  '
.$post['username'].'     
<strong>Country:</strong> '
.$country.'   
<strong>IP Hash:</strong> '
.md5(__HASH__.':'.$post['ip']).' <br />   
    
To inquire about this listing, please contact the seller directly as specified in the ad. <br />   
If no email address or phone was given, <a href="http://<site>/forums/member.php?'
.$post['userid'].'-'.$post['username'].'">click HERE to send '.$post['username'].' a private message</a>. <br />   
    
<site> assumes no responsibility for the accuracy of this listing</div>   
    
'
;     
    }     




Note : to enable it only on some subforums, replace this
PHP Code:

$show_hashed_ip_forumid = array();/* fill with nothing to enable on all section */ 

With this (for example sub forum ids are 5, 6, 10)
PHP Code:

$show_hashed_ip_forumid = array(5610);/* fill with nothing to enable on all sec 



All times are GMT. The time now is 01:20 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01236 seconds
  • Memory Usage 1,739KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete