Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 08-20-2012, 09:15 PM
peugeot405's Avatar
peugeot405 peugeot405 is offline
 
Join Date: Feb 2010
Posts: 312
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SuperTaz View Post
What I am looking for is when a new member registers, a new thread is created in a private forum with the ability to check the IP address of the member to make sure it is not a spam member and also to later add the functionality of checking members via other sites API systems to check if they have been banned or not from gaming, etc.



That is a good mod, however, it is for replies, not the initial post/thread creation that I am looking for.
sorry for the mix-up.
what about this?
Reply With Quote
  #12  
Old 08-20-2012, 09:57 PM
Eosian Eosian is offline
 
Join Date: Feb 2009
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Read through the comments for ways to tweak/adjust and things you need to set.

Create prefixes named Registration_Mult & Registration_BAN
I use [MULT] and [BAN], you can use whatever you want.


**Note these were intended for use in a forum with a table mod, so if you don't have one you'll need to adjust them to some other style of conveying the same info, or install one.

Create templates:
registration_iplog_results
HTML Code:
<vb:if condition="$item[banned] == 'False'">[url="{vb:raw vboptions.bburl}/member.php?u={vb:raw userid}"]{vb:raw username}[/url]|{vb:raw userid}|{vb:raw ipaddress}|{vb:raw firstuse}|{vb:raw lastuse}|{vb:raw banned}<vb:else />[url="{vb:raw vboptions.bburl}/member.php?u={vb:raw userid}"]{vb:raw username}[/url]|{vb:raw userid}|{vb:raw ipaddress}|{vb:raw firstuse}|{vb:raw lastuse}|[BG="RED"]{vb:raw banned}[/BG]</vb:if>
registration_iplog
HTML Code:
UserName : {vb:raw username}
Member Link: [URL="{vb:raw memberlink}"]{vb:raw memberlink}[/URL]
Email Address : {vb:raw email}
IP Address: {vb:raw ipaddress}
Proxy For: {vb:raw proxyfor}

[table="head;"]UserName|UserID|IPAddress|FirstUse|LatestUse|CurrentlyBanned
{vb:raw resultlist}
[/table]
Create a plugin
Hook: register_addmember_complete

PHP Code:
$ipaddress IPADDRESS;
// Declaritive proxy?
$proxyfor $_SERVER['HTTP_X_FORWARDED_FOR'];

$memberlink fetch_seo_url('member|nosession', array('userid' => $userid'username' => htmlspecialchars_uni($vbulletin->GPC['username'])));
$memberlink $vbulletin->options['bburl'] . $memberlink;

$db->hide_errors();

// This query may be slow if you do not have an index on ipaddress in both users and posts.
$query "select u.username, l.userid, l.ipaddress, min(l.firstuse) firstuse, max(l.lastuse) lastuse, case COALESCE((select min(liftdate) from userban where userid = u.userid and (  UNIX_TIMESTAMP() between bandate and liftdate OR liftdate = 0 ) ),1) when 1 then 'False' when 0 then 'Perma' else 'True' end as banned from (select userid, ipaddress, min(joindate) firstuse, max(joindate) lastuse from user group by userid, ipaddress UNION ALL select userid, ipaddress, min(dateline) firstuse, max(dateline) lastuse from post group by userid, ipaddress ) l  left outer join user u on l.userid = u.userid where l.IpAddress = '$ipaddress' group by u.username, l.userid, l.ipaddress order by max(lastuse) desc";

$result $vbulletin->db->query_read$query );
$prefix '';

// Loop through all results
while ($item $vbulletin->db->fetch_array($result))
{
    if ( 
$item[banned] != 'False')
      
$prefix 'Registrations_BAN';

    if (
$prefix == '')
      
$prefix 'Registration_Mult';

    
// Generate Variables to be used
    
$templater vB_Template::create('registration_iplog_results');

    
$templater->register('username'$item[username]);
    
$templater->register('userid'$item[userid]);
    
$templater->register('ipaddress'$item[ipaddress]);
    
$templater->register('firstuse'$item[firstuse]);
    
$templater->register('lastuse'$item[lastuse]);
    
$templater->register('banned'$item[banned]);
    
$resultlist .= $templater->render();
}

// Unset the row returned.
unset($item);

// free the resultset
$db->free_result($result);


$templater vB_Template::create('registration_iplog');
$templater->register_page_templates();
$templater->register('username'$username);
$templater->register('memberlink'$memberlink);
$templater->register('email'$email);
$templater->register('ipaddress'$ipaddress);
$templater->register('proxyfor'$proxyfor);
$templater->register('resultlist'$resultlist);
$postmessage $templater->render();

// The forum you wish to post threads to 
$forumid 9999;
$foruminfo fetch_foruminfo$forumid );

$dataman =& datamanager_init('Thread_FirstPost'$vbulletinERRTYPE_SILENT'threadpost');
$dataman->set_info('forum'$foruminfo);
$dataman->set_info('is_automated'true);
$dataman->set('showsignature'true);
$dataman->set_info('mark_thread_read'true);
$dataman->set('allowsmilie'true);


// We're making them post as themselves to avoid IPs being attributed to the bot in this example

// Uncomment this and assign it to a user id you wish these to show up as being by if you don't want them to show up as the user.
//$posterid = 3;

$dataman->setr('userid'$userid);
$dataman->set('title'$username);
$dataman->setr('pagetext'$postmessage);
$dataman->set('prefixid'$prefix);
// Uncomment this if you want to use a static account instead of the registering account.
//$dataman->set('ipaddress', '127.0.0.1');

$dataman->setr('forumid'$foruminfo['forumid']);
$dataman->set('visible'true);
$threadid $dataman->save(); 
Reply With Quote
  #13  
Old 08-20-2012, 11:48 PM
SuperTaz's Avatar
SuperTaz SuperTaz is offline
 
Join Date: Apr 2007
Location: Pennsylvania
Posts: 744
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmmm...I'll have to give them a try on my test site and see what it looks like.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:23 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.11113 seconds
  • Memory Usage 2,249KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_html
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete