vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Welcome post for new members (https://vborg.vbsupport.ru/showthread.php?t=286719)

LewisTheobald 08-16-2012 02:05 PM

Welcome post for new members
 
Hello,

I'm looking for something to allow me to automatically welcome new members in their own intro threads.
I've found a couple of mods that allow my bot to create a new thread when a new member joins, but I want my bot to automatically post in any thread that is made in my introductions section.

I hope that makes sense, thanks to anybody who can help!

Eosian 08-16-2012 04:54 PM

Create a plugin on newthread_post_complete

PHP Code:


if ( in_array$foruminfo['forumid'], Array( /* Set any forum ids you want this to apply to here */ ) ) )
{
    
$posterid 3// Set your bot ID here.
    
$posttitle 'Welcome Aboard!'// Set your reply title here.
    
$template_name 'auto_greet_template'// create or use your own.

    
$templater vB_Template::create($template_name);
        
$templater->register_page_templates();
/* Add any variables you want the template to have */
        
$templater->register('username'$vbulletin->userinfo['username']);
        
$templater->register('forumname'$vbulletin->options['bbtitle'] );
    
$postmessage $templater->render();



    
$dataman =& datamanager_init('Post'$vbulletinERRTYPE_STANDARD'threadpost');
    
$dataman->set_info('thread'$newpost);
    
$dataman->set_info('forum'$foruminfo);
    
$dataman->set_info('is_automated'true); 
    
$dataman->set('threadid'$newpost['threadid']);
    
$dataman->set('userid'$posterid);
    
$dataman->set('allowsmilie'false);
    
$dataman->set('visible'true);
    
$dataman->set('title'$posttitle);
  
$dataman->set('ipaddress''127.0.0.1'); 
    
$dataman->set('pagetext'$postmessage);

    
$postid $dataman->save();
    unset(
$dataman);


You can easily modify this to work on several forums with different templates, or to work on all forums to automatically add a second post of some sort, such as an advertisement post.

My sample template looks like this;
Code:

Welcome to {vb:raw forumname}, {vb:raw username}!

LewisTheobald 08-20-2012 12:48 PM

Thank you so much! I really appreciate it.


All times are GMT. The time now is 11:21 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.01570 seconds
  • Memory Usage 1,726KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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