PDA

View Full Version : New thread on new registration.


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:


$DB_site->query("INSERT INTO user (userid,username,password,email,".$newstylefield."parentemail,coppauser,homepage,icq,aim,yahoo,signa ture,adminemail,showemail,invisible,usertitle,join date,cookieuser,daysprune,lastvisit,lastactivity,u sergroupid,timezoneoffset,emailnotification,receiv epm,emailonpm,options,birthday,maxposts,startofwee k,ipaddress,pmpopup,referrerid,nosessionhash,avata rid) 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

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

below it add

//Start Hack to Post userinfo to a forum
if($newregthread) {
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,p ostusername,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,at tachmentid,pagetext,allowsmilie,showsignature,ipad dress,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

Joe
12-31-2001, 06:16 AM
That is perfect! Do you have a paypal acct? I'll honestly pay you for this hack, its simple, but works! :)