View Single Post
  #1  
Old 10-19-2011, 02:21 PM
mapleblade mapleblade is offline
Epicness sausage
 
Join Date: May 2009
Posts: 180
Gender: Male
Credits: 19,872
mapleblade
Default New Users auto redirect to page

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:
PHP Code:

CREATE TABLE 
IF NOT EXISTS `adopts_users` (
  `
uidint(11NOT NULL AUTO_INCREMENT,
  `
usernamevarchar(20COLLATE latin1_general_ci DEFAULT NULL,
  `
passwordvarchar(200COLLATE latin1_general_ci DEFAULT NULL,
  `
emailvarchar(60COLLATE latin1_general_ci DEFAULT NULL,
  `
usergroupint(11) DEFAULT NULL,
  `
newmessagenotifyvarchar(10COLLATE latin1_general_ci DEFAULT NULL,
  `
membersincevarchar(20COLLATE latin1_general_ci DEFAULT NULL,
  `
isbannedint(11) DEFAULT NULL,
  `
tradeforbiddenint(11) DEFAULT NULL,
  `
pmstatusint(11) DEFAULT NULL,
  `
tradestatusint(11) DEFAULT NULL,
  `
websitevarchar(80COLLATE latin1_general_ci DEFAULT NULL,
  `
profilepicvarchar(80COLLATE latin1_general_ci DEFAULT NULL,
  `
aimvarchar(80COLLATE latin1_general_ci DEFAULT NULL,
  `
yahoovarchar(80COLLATE latin1_general_ci DEFAULT NULL,
  `
msnvarchar(80COLLATE latin1_general_ci DEFAULT NULL,
  `
moneyint(11) DEFAULT NULL,
  `
friendsvarchar(500COLLATE latin1_general_ci DEFAULT NULL,
  `
themevarchar(20COLLATE latin1_general_ci DEFAULT NULL,
  `
avatarvarchar(120COLLATE latin1_general_ci DEFAULT NULL,
  `
profilevarchar(500COLLATE latin1_general_ci DEFAULT NULL,
  `
colorvarchar(20COLLATE latin1_general_ci DEFAULT NULL,
  `
aboutvarchar(200COLLATE latin1_general_ci DEFAULT NULL,
  `
favpetint(11) DEFAULT NULL,
  `
gendervarchar(10COLLATE latin1_general_ci DEFAULT NULL,
  `
nicknamevarchar(40COLLATE latin1_general_ci DEFAULT NULL,
  `
newmemberint(11) DEFAULT '1',
  
PRIMARY KEY (`uid`),
  
UNIQUE KEY `username` (`username`)
ENGINE=MyISAM  DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=

Then go to register.php, replace
PHP Code:
runquery("INSERT INTO {$prefix}users VALUES ('', '$username', '$pass1','$email','3','1', '$date', '0', '0' ,'0','0','','','','','', '{$GLOBALS['settings']['startmoney']}','','','$avatar', '', '', '', '0', 'Unknown', '')"); 
with:

PHP Code:
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:
PHP 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 == $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.
Attached Files
File Type: php newbie.php (848 Bytes, 20 views)
__________________
Need coding help? send me a PM! :)

Last edited by mapleblade; 10-21-2011 at 02:11 AM.
Reply With Quote