|
Joined: Feb 2003
Posts: 64
Power User
|
Power User
Joined: Feb 2003
Posts: 64 |
I would like to know if there is a way to make the Main Index the default for all of my users. I know that they can go into their profile and change it themselves, but I want to do it for them. My users are VERY illiterate (did I spell that right?) and I know that when they click the button to enter the forum, login, and are not taken to the forum but to the My Home page, they'll freak.
I found this on the UBB boards that was supposed to do it, but it doesn't seem to work (I tried creating new users and logging in, but it still defaults to the My Home page):
UPDATE w3t_Users SET U_StartPage='mi' WHERE U_Username='username'
Any suggestions?
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
That command will only update existing users. The 'cp' default is the default hardcoded into the database. You could change the default....
I would recommend backing up your database first, then do this:
ALTER TABLE w3t_Users CHANGE 'U_StartPage' 'U_StartPage' CHAR(2) DEFAULT 'mi'
|
|
|
|
Joined: Feb 2003
Posts: 64
Power User
|
Power User
Joined: Feb 2003
Posts: 64 |
Thanks Josh. I will definately back up the db first, but i'm just curious as to what could happen by running query? Anything permanent?
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
That query that I just posted changes the default... so new records created will default to 'mi' (main index) instead of 'cp' (control panel/my home) which is the default. So that query I just posted is a permanent change to the defaults and will apply to new users.
|
|
|
|
Joined: Feb 2003
Posts: 64
Power User
|
Power User
Joined: Feb 2003
Posts: 64 |
I gotcha. Thanx again for the help.
|
|
|
|
Joined: Aug 2002
Posts: 109
Journeyman
|
Journeyman
Joined: Aug 2002
Posts: 109 |
Hmmm I get this...
SQL ERROR: Unable to do_query: ALTER TABLE w3t_Users CHANGE 'U_StartPage' 'U_StartPage' CHAR(2) DEFAULT 'mi' You have an error in your SQL syntax near ''U_StartPage' 'U_StartPage' CHAR(2) DEFAULT 'mi' ' at line 2 row(s) affected by your query.
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
Whoops... my bad. Didn't need the little quotes around the field name. Do it like this: ALTER TABLE w3t_Users CHANGE U_StartPage U_StartPage CHAR(2) DEFAULT 'mi'
|
|
|
|
Joined: Apr 2001
Posts: 3,266
Member
|
Member
Joined: Apr 2001
Posts: 3,266 |
You can also do this
UPDATE w3t_Users SET U_StartPage='mi' WHERE U_StartPage='cp'
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
Yeah, that'll just update existing users. Altering the tables default will make it "stick" for all new users to come.
|
|
|
|
Joined: Apr 2001
Posts: 3,266
Member
|
Member
Joined: Apr 2001
Posts: 3,266 |
|
|
|
|
Joined: Apr 2002
Posts: 1,768
Addict
|
Addict
Joined: Apr 2002
Posts: 1,768 |
In cases where column names have to be quoted (e.g., if you're insane, and use spaces in them), I think you have to use backquotes: `foo bar`
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
Ah OK That makes sense. In threads then we are pretty safe without quotes then. Thanks Ea... Nevermind. Thanks.
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 87
Joined: December 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|