MyBB Community Forums

Full Version: Can it be done?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i want something where when a user signs up at my webpage..in the form action page it creates them a user name and pw based on the $_POST fields...and also creates a forum under a certain catagory and makes that user a moderater for that forum?
and.....be able to set the default style...for any forums someone has moderator access to
Well yes !!

open member.php

find

"language" => addslashes($mybb->input['language']),
			"showcodebuttons" => 1,
			);

below it add

$newforum = array(
	 		"name" => addslashes($username),
			"type" => "f",
			"pid" => '1',
			"disporder" => '1',
			"active" => "yes",
			"open" => "yes",
			"threads" => '0',
			"posts" => '0',
			"lastpost" => '0',
			"lastposter" => '0',
			"allowhtml" => "no",
			"allowmycode" => "yes",
			"allowsmilies" => "yes",
			"allowimgcode" => "yes",
			"allowpicons" => "yes",
			"allowtratings" => "yes",
			"usepostcounts" => "yes",
			"showinjump" => "yes",
			"modposts" => "no",
			"modthreads" => "no",
			"modattachments" => "no",
			"style" => '0',
			"overridestyle" => "no",
				);

$db->insert_query(TABLE_PREFIX."forums", $newforum);
$fid= $db->insert_id();
$parentlist = "1,".$fid;
$db->query("UPDATE ".TABLE_PREFIX."forums SET parentlist='$parentlist' WHERE fid='$fid'"); 
$cache->updateforums();

then find

$userfields['ufid'] = $uid;
		$db->insert_query(TABLE_PREFIX."userfields", $userfields);

below it add

$mod = array( 
"uid" => $uid,
"fid" => $fid,
"caneditposts" => "yes",
"candeleteposts" => "yes",
"canviewips" =>"yes",
"canopenclosethreads" => "yes",
"canmanagethreads" => "yes"
);
			
			$db->insert_query(TABLE_PREFIX."moderators", $mod); 

You will have to use the 1st category you add to ur board, to display all these forums !!
if u wanna change, u will have to get the fid of your new category, and replace it in $parentlist = "1,".$fid; instead of 1

if u face any trouble, for example they are not appear, manually add 1 forum to that category

regards
im alil confused at what this does exactly?

let me be alil more explanitory with what im trying to do:

#1 when a user signs up on my webpage (not on the forums page) but on my actual website i wanted to figure out a way to use the information from the custom input form they signed up at to create a forum inder the Members catagory on the forums... and name of the forums to be pulled from $_POST[forumname]


#2 When the form on my webpage is submitted not only is their user name and pw..etc put into my custom sql table but it also creates them a matching username and pw on the forums and makes them a moderator for the forum name $_POST[forumname].

#3 Moderators having the ability to change the default layout style of the forum they have mod to.

When someone register, it will create a forum under the 1st catergory, this forum called depending on the member's username, and he will be moderating that forum.

regards

*u had to notify me that u have edited ur post!!
ok but will it do that everytime someone joins because iwant people to be able to join and just be registered...the only time i want that to happen where they are mod and a forum is created for them is when they signup from my website and no the forums
what is ur registration system on ur website? i recommend using the same as the one for MyBB.

however in both cases, u will have to make ur registration system, uses mybb db tables

regards
www.usagaming.com/gsite/signup.php?page=1 is the url to the signup page i know more fields will have to be added to match the forum sign ups... but yea i wanted to make it where the information from that form can be pulled to make a matching forum user and pass...create a forum and mod that user to it

and then im assuming something would have to be customly created to allow mods to set the default style of that forum?
Well this will have to be written again, you will have to use mybb database so that who register on ur site, will be also registred on ur board. so u will be the same table mybb_users for your site and your board
at the moment , many of ur fileds doesn't match the fields in mybb database, u will whether edit the mybb_users table, or remove them. and just stick on the info needed for the board.

i have read ur edit up in post 3. well if only u want to disable all registration from ur board, and replacing it by this from ur site, u will save a lot of time. however it's not what u want.


in case you also need to use a login form that uses the board's users on ur site, read here

I guess u know about php and sql. anyway if u needed help making ur form (signup page) adds the info to the mybb data base , ask us.

many regards
ty for the help...im still kinda at square one tho