Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Mys v1.2.x Mods (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=38)
-   -   New Users auto redirect to page (http://www.mysidiaadoptables.com/forum/showthread.php?t=2449)

mapleblade 10-19-2011 02:21 PM

New Users auto redirect to page
 
1 Attachment(s)
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.

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


All times are GMT -5. The time now is 01:19 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.