vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   New thread on new registration. (https://vborg.vbsupport.ru/showthread.php?t=32911)

Joe 12-03-2001 07:08 PM

I would like to start a new thread in a private forum each time a new member registers on the forums, the title would be the new users username, and the post would have same type of information as the new member email i recieve.

Anyone know how to set this up, or create this hack for me?

Scott MacVicar 12-03-2001 08:54 PM

Yeah, i'll whip that up.

I'll add a bit in the admin options to turn it on or off and what forumid to post it to.

Last question is it to do it on register or when they click the activate link in the email?

Joe 12-03-2001 09:35 PM

On registration would be awesome! thanks for your help :)

Joe 12-05-2001 06:05 PM

Let me know if you need help testing this :)

amykhar 12-05-2001 06:15 PM

Joe,
If he doesn't get back to you, I can tell you right now how to do this. :D

Go to releases and get the robot moderator hack. Modify it so that it posts to the forum of your choice, and change the subject line and message. Note: You can pass parameters to the script and include them in the message.

Then, open up registration.php

Find this:

PHP Code:

$DB_site->query("INSERT INTO user (userid,username,password,email,".$newstylefield."parentemail,coppauser,homepage,icq,aim,yahoo,signature,adminemail,showemail,invisible,usertitle,joindate,cookieuser,daysprune,lastvisit,lastactivity,usergroupid,timezoneoffset,emailnotification,receivepm,emailonpm,options,birthday,maxposts,startofweek,ipaddress,pmpopup,referrerid,nosessionhash,avatarid) VALUES (NULL,'".addslashes(htmlspecialchars($username))."','".addslashes(md5($password))."','".addslashes(htmlspecialchars($email))."',".$newstyleval."'".addslashes(htmlspecialchars($parentemail))."','$coppauser','".addslashes(htmlspecialchars($homepage))."','".addslashes(htmlspecialchars($icq))."','".addslashes(htmlspecialchars($aim))."','".addslashes(htmlspecialchars($yahoo))."','".addslashes($signature)."','$adminemail','$showemail','$invisible','".addslashes($usertitle)."','".time()."','$cookieuser','".addslashes($prunedays)."','".time()."','".time()."','$newusergroupid','".addslashes($timezoneoffset)."','$emailnotification','$receivepm','$emailonpm','$options','".addslashes($birthday)."','".addslashes($umaxposts)."','".addslashes($startofweek)."','".addslashes($ipaddress)."','$pmpopup','".addslashes($testreferrerid['userid'])."','$nosessionhash','$avatarid')");
  
$userid=$DB_site->insert_id(); 

Right after that, insert a call to the robot moderator script., passing it parameters such as $username, etc.

That SHOULD do it for you. :)

Amy

Joe 12-05-2001 07:43 PM

Thanks! I'll give it a try tonite :)

Joe 12-07-2001 04:17 AM

Hmm, i cant figure this out... im a total php newbie, and none of this makes sense...

PPN, any word on this hack? thanks! :)

Joe 12-15-2001 06:19 PM

bump? :)

Joe 12-28-2001 07:26 PM

i'll donate $20 to your forum / website if you make this for me :) PLEASE!! :)

Scott MacVicar 12-28-2001 11:48 PM

This hack was done in about 10mins before i went to bed so hope it works ok, worked fine on my test forums.

run these two sql queries, they will create two fields under user and registration options.

INSERT INTO setting (settingid, settinggroupid, title, varname, value, description, optioncode, displayorder) VALUES (NULL, '6', 'New Thread on Registration', 'newregthread', '1', 'Post a new thread to the forum identified below when a user registers', 'yesno', '18')
INSERT INTO setting (settingid, settinggroupid, title, varname, value, description, optioncode, displayorder) VALUES (NULL, '6', 'Forum to post to for a new registration', 'newregthreadforumid', '1', 'The Forumid to post a new thread to when a user registers', '', '19')

you should immediately go change the forumid specified via the admin panel so new users won't have problems when registering

Open register.php go to line 489
look for

PHP Code:

  $DB_site->query("UPDATE session SET userid=$userid WHERE sessionhash='".addslashes($session['dbsessionhash'])."'"); 

below it add

PHP Code:

  //Start Hack to Post userinfo to a forum
  
if($newregthread) {
    
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,postusername,postuserid,lastposter,dateline,iconid,visible,attach) VALUES (NULL,'".addslashes(htmlspecialchars("$username"))."','".time()."','$newregthreadforumid','1','0','".addslashes("Auto Poster")."','0','".addslashes("Auto Poster")."','".time()."','0','1','0')");
    
$threadid=$DB_site->insert_id();
    eval(
"\$message = \"".gettemplate("email_newuser")."\";");
    
$message=parseurl($message);
    
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars("$username"))."','".addslashes("Auto Poster")."','0','".time()."','0','".addslashes($message)."','0','','','0','1')");
    
$postid=$DB_site->insert_id();
    
$foruminfo=getforuminfo($newregthreadforumid);
    
$DB_site->query("UPDATE forum SET replycount=replycount+1,threadcount=threadcount+1,lastpost='".time()."',lastposter='".addslashes("Auto Poster")."' WHERE forumid IN ($foruminfo[parentlist])");
  }
  
//End Hack to post userinfo to a forum 



All times are GMT. The time now is 10:03 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.01023 seconds
  • Memory Usage 1,762KB
  • 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)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete