UBB.Dev
Posted By: monkeyra MySQL Command to change title colour? - 05/12/2004 2:04 PM
I've created a special usergroup called "Gold" for my paying gold members.
I want to change all theur titles to be Gold in colour.
is there a mysql command to do this automatically?
Posted By: JoshPet Re: MySQL Command to change title colour? - 05/13/2004 5:45 AM
Do you mean name color? Titles don't have a color attribute. You could probably put the <font color= etc... HTML in the title field, but the field isn't very long in the database, so it might not be long enough without modifing the database to make the field longer.
Posted By: scroungr Re: MySQL Command to change title colour? - 05/13/2004 6:56 AM
First off do a
SELECT * FROM `w3t_Groups`
to find the group number of the titles you wish to change, then do a
UPDATE `w3t_Users` SET `U_Color` to '#B2B42E' WHERE `U_Groups` LIKE '%-NUMBERYOUFOUNDOFGROUP-%'

this will change all the User names to Gold but thats all

the only way to alter the Titleswould be to find every occurence of U_Title in every template and add a font tag to it, or you could try

UPDATE `w3t_Users` SET `U_Title` to '<font color = "#B2B42E">Gold Member</font>' WHERE `U_Groups` LIKE '%-NUMBERYOUFOUNDOFGROUP-%'

but that would change also.. what I would do is write a little code that changed the font color in the templates but thats me...
Posted By: monkeyra Re: MySQL Command to change title colour? - 05/13/2004 8:47 AM
doh, yeah, i meant usernames
Posted By: monkeyra Re: MySQL Command to change title colour? - 05/13/2004 8:50 AM
UPDATE `w3t_Users` SET `U_Color` to '#B2B42E' WHERE `U_Groups` LIKE '9'

Thats the command I tried entering.
( 9 being the usergroup i want to change the colour of)

but i got an sql syntax error
SQL ERROR: Unable to do_query: UPDATE `w3t_Users` SET `U_Color` to '#B2B42E' WHERE `U_Groups` LIKE '9'
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'to '#B2B42E' WHERE `U_Groups` LIKE '9'' at line 1 row(s) affected by your query.
Posted By: scroungr Re: MySQL Command to change title colour? - 05/13/2004 3:55 PM
you need to put `U_Groups` LIKE '%-9-%'
Posted By: monkeyra Re: MySQL Command to change title colour? - 05/13/2004 4:28 PM
ok, just tried that, but still getting errors.

SQL ERROR: Unable to do_query: UPDATE `w3t_Users` SET `U_Color` to '#B2B42E' WHERE `U_Groups` LIKE '%-9-%'
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'to '#B2B42E' WHERE `U_Groups` LIKE '%-9-%'' at line 1 row(s) affected by your query.
Posted By: scroungr Re: MySQL Command to change title colour? - 05/13/2004 4:58 PM
I see what the issue is.. I put the word to.. brain fart!
should be

UPDATE `w3t_Users` SET `U_Color` = '#B2B42E' WHERE `U_Groups` LIKE '%-9-%'
Posted By: monkeyra Re: MySQL Command to change title colour? - 05/13/2004 5:13 PM
superb!
thanks m8!
Posted By: scroungr Re: MySQL Command to change title colour? - 05/13/2004 6:52 PM
np would have gotten it faster if I hadn't had this brain fart
Posted By: monkeyra Re: MySQL Command to change title colour? - 05/14/2004 1:05 PM
UPDATE `w3t_Users` SET `U_RatingImage` = 'http://www.fordmondeo.org/ubbthreads/images/ratingimages/A5gold.gif' SET `U_Color` = '#B2B42E' WHERE `U_Groups` LIKE '%-9-%'

Can you help with this one?
I want it to change the colour and add an image at the same time.
I can get them to work on their own, but when i join them like the above command, i get a syntax error.
Probably something simple i know, but i dont know!
Posted By: scroungr Re: MySQL Command to change title colour? - 05/14/2004 2:47 PM
you don't use the second SET you use a comma so it would be

UPDATE `w3t_Users` SET `U_RatingImage` = 'http://www.fordmondeo.org/ubbthreads/images/ratingimages/A5gold.gif', `U_Color` = '#B2B42E' WHERE `U_Groups` LIKE '%-9-%'

try that.
Posted By: monkeyra Re: MySQL Command to change title colour? - 05/14/2004 3:42 PM
ahhhhh, i see.
works a treat
thanks!
© UBB.Developers