Previous Thread
Next Thread
Print Thread
Rate Thread
#236816 02/17/2003 11:55 PM
Joined: Feb 2003
Posts: 64
Power User
Power User
Offline
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?

Sponsored Links
bhlaws #236817 02/18/2003 12:05 AM
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'

Daine #236818 02/18/2003 12:51 AM
Joined: Feb 2003
Posts: 64
Power User
Power User
Offline
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?

bhlaws #236819 02/18/2003 1:20 AM
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.

Daine #236820 02/18/2003 10:37 AM
Joined: Feb 2003
Posts: 64
Power User
Power User
Offline
Joined: Feb 2003
Posts: 64
I gotcha. Thanx again for the help.

Sponsored Links
bhlaws #236821 02/18/2003 8:55 PM
Joined: Aug 2002
Posts: 109
Journeyman
Journeyman
Offline
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.

#236822 02/18/2003 9:01 PM
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'

Daine #236823 02/18/2003 9:02 PM
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
You can also do this

UPDATE w3t_Users SET U_StartPage='mi' WHERE U_StartPage='cp'

sf49rminer #236824 02/18/2003 9:03 PM
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.

Daine #236825 02/18/2003 9:06 PM
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
true that

Sponsored Links
Daine #236826 02/18/2003 11:25 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
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`

joeuser #236827 02/18/2003 11:27 PM
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.



Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)