PDA

View Full Version : New Users auto redirect to page


mapleblade
10-19-2011, 02:21 PM
when a new users join, they will get redirected to a newbie page, they cannot leave, until they click the button: i understand, or something like that, its also usefull for guiding the newbies



first off run this mysql query:


CREATE TABLE IF NOT EXISTS `adopts_users` (
`uid` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(20) COLLATE latin1_general_ci DEFAULT NULL,
`password` varchar(200) COLLATE latin1_general_ci DEFAULT NULL,
`email` varchar(60) COLLATE latin1_general_ci DEFAULT NULL,
`usergroup` int(11) DEFAULT NULL,
`newmessagenotify` varchar(10) COLLATE latin1_general_ci DEFAULT NULL,
`membersince` varchar(20) COLLATE latin1_general_ci DEFAULT NULL,
`isbanned` int(11) DEFAULT NULL,
`tradeforbidden` int(11) DEFAULT NULL,
`pmstatus` int(11) DEFAULT NULL,
`tradestatus` int(11) DEFAULT NULL,
`website` varchar(80) COLLATE latin1_general_ci DEFAULT NULL,
`profilepic` varchar(80) COLLATE latin1_general_ci DEFAULT NULL,
`aim` varchar(80) COLLATE latin1_general_ci DEFAULT NULL,
`yahoo` varchar(80) COLLATE latin1_general_ci DEFAULT NULL,
`msn` varchar(80) COLLATE latin1_general_ci DEFAULT NULL,
`money` int(11) DEFAULT NULL,
`friends` varchar(500) COLLATE latin1_general_ci DEFAULT NULL,
`theme` varchar(20) COLLATE latin1_general_ci DEFAULT NULL,
`avatar` varchar(120) COLLATE latin1_general_ci DEFAULT NULL,
`profile` varchar(500) COLLATE latin1_general_ci DEFAULT NULL,
`color` varchar(20) COLLATE latin1_general_ci DEFAULT NULL,
`about` varchar(200) COLLATE latin1_general_ci DEFAULT NULL,
`favpet` int(11) DEFAULT NULL,
`gender` varchar(10) COLLATE latin1_general_ci DEFAULT NULL,
`nickname` varchar(40) COLLATE latin1_general_ci DEFAULT NULL,
`newmember` int(11) DEFAULT '1',
PRIMARY KEY (`uid`),
UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=2 ;



Then go to register.php, replace

runquery("INSERT INTO {$prefix}users VALUES ('', '$username', '$pass1','$email','3','1', '$date', '0', '0' ,'0','0','','','','','', '{$GLOBALS['settings']['startmoney']}','','','$avatar', '', '', '', '0', 'Unknown', '')");



with:


runquery("INSERT INTO {$prefix}users VALUES ('', '$username', '$pass1','$email','3','1', '$date', '0', '0' ,'0','0','','','','','', '{$GLOBALS['settings']['startmoney']}','','','$avatar', '', '', '', '0', 'Unknown', '', '1')");



Then go to functions.php, at the very ENDING (not after the ?>)put this code:

if($isloggedin == "yes"){

$query = "SELECT * FROM ".$GLOBALS['prefix']."users WHERE username='".$GLOBALS['loggedinname']."'";

$result = mysql_query($query);

$newbie=@mysql_result($result,0,"newmember");

if($newbie == 1 & $newbiepage != 1){

header( 'Location: /newbie.php' ) ;

}

}


And place the newbie.php in your root of your adoptables folder (where everything is)

the newbie.php is kinda clean atm, its up to you to customize it, but just keep the code intact.

mapleblade
10-20-2011, 01:27 PM
theres also an demo @ http://epicmiro.99webs.info

Hall of Famer
10-21-2011, 12:41 AM
This looks quite good so far, thanks for posting it Mapleblade.

Sophie
10-21-2011, 12:49 AM
I love this! :happyc:

keliptis
02-05-2012, 11:38 AM
So xD I did this add on however it didnt work instead now every page to my site is a blank white screen, So I tryed to revert to old renewed the 2 phps that got edited however that doesnt work im assumeing its the mysql and I never had that saved?

Or a answer as to why it did that D:


~~~~~~~~~~~~

Ok figured out why it was blank however its still messed up register
Do I need to find a way to replace mysql users table?

mapleblade
02-09-2012, 02:00 AM
maybe the script is interfering with other scripts wich use the user table, if so, add a new row called newmember (int 1) with default 1, and adding an , '' at the end of the register query.

keliptis
02-09-2012, 09:47 AM
That seemed not to change nothing im assuming something somewhere is off as not even reseting passwords will work