New Users auto redirect to page

Forum
Last Post
Threads / Messages

mapleblade

Epicness sausage
Premium Member
Joined
May 4, 2009
Messages
180
Points
0
Age
27
Mysidian Dollar
12,231
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:
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
PHP:
runquery("INSERT INTO {$prefix}users VALUES ('', '$username', '$pass1','$email','3','1', '$date', '0', '0' ,'0','0','','','','','', '{$GLOBALS['settings']['startmoney']}','','','$avatar', '', '', '', '0', 'Unknown', '')");

with:

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

Attachments

  • newbie.php
    848 bytes · Views: 20
Last edited:
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?
 
Last edited:
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.
 
That seemed not to change nothing im assuming something somewhere is off as not even reseting passwords will work
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,118
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top