|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
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?
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
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.
|
|
|
|
Joined: Oct 2003
Posts: 2,305
Old Hand
|
Old Hand
Joined: Oct 2003
Posts: 2,305 |
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...
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
doh, yeah, i meant usernames
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
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.
|
|
|
|
Joined: Oct 2003
Posts: 2,305
Old Hand
|
Old Hand
Joined: Oct 2003
Posts: 2,305 |
you need to put `U_Groups` LIKE '%-9-%'
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
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.
|
|
|
|
Joined: Oct 2003
Posts: 2,305
Old Hand
|
Old Hand
Joined: Oct 2003
Posts: 2,305 |
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-%'
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
superb! thanks m8!
|
|
|
|
Joined: Oct 2003
Posts: 2,305
Old Hand
|
Old Hand
Joined: Oct 2003
Posts: 2,305 |
np would have gotten it faster if I hadn't had this brain fart
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
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!
|
|
|
|
Joined: Oct 2003
Posts: 2,305
Old Hand
|
Old Hand
Joined: Oct 2003
Posts: 2,305 |
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.
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
ahhhhh, i see. works a treat 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: 1,157
Joined: July 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|