|
Post by nate on Jan 5, 2012 1:12:35 GMT
Right I know I sound like a complete noob, but I've created a website using drupal 7, I'm not sure if any of you are familiar with it but I was wondering, too separate normal users from administrators.I was hoping you guys would know how you change the colours of names, preferably like the ones here. Thanks a bunch
|
|
|
Post by Fringe Pioneer on Jan 5, 2012 23:15:27 GMT
Well, the way the code (authored from a ProBoards user named Ross) does it is by defining a function that takes a string representing a username and a string representing a display name for the person represented by the username, getting an array of all anchor tags (i.e. <a> tags, e.g. <a href="URL_goes_here"></a>), seeing if the href property of the anchor tag matches a regular expression that looks to see if the href property is a link to the user's profile, and then changes the innerHTML of the anchor tag to be the display name. After that function is defined, you just make calls to the function for each person you want to have a custom display name.
Does that help enough, or is that not quite clear?
|
|
|
Post by izacque on Jan 6, 2012 16:11:27 GMT
is your website hosted yet? Can you host it from dropbox so we can see it?
|
|
|
Post by nmagain on Jan 6, 2012 23:44:42 GMT
Hosting from Dropbox, I can already feel myself abusing this.
|
|
|
Post by izacque on Jan 7, 2012 9:04:09 GMT
Fogs does this. As do I, sorta.
|
|
|
Post by nate on Jan 8, 2012 12:33:35 GMT
The domain is www.mythicaluk.comI need help changing the colours of names and or inserting html
|
|
|
Post by Fringe Pioneer on Jan 8, 2012 20:45:39 GMT
Okay, it seems that names aren't linked to accounts, so looking for href properties that link to accounts would be useless. It seems that, instead of looking for anchor tags that have href properties that lead to profile pages, you just have to see what all the usernames have in common in relation to the surrounding code (e.g. Is it always the tenth cell of every table? Are usernames the only content surrounded by a certain DIV tag or CSS class? et cetera), use JavaScript to find places in the page where the code matches the kind of code that surrounds usernames, use regular expressions in JavaScript to search for the usernames themselves within that snippet of code, likely using the dot operator inside a regex group, and then doing something with that.
Does that help?
|
|
|
Post by nate on Jan 8, 2012 22:56:03 GMT
Thanks for all your help, but I feel this isn't the host I need. I think i'm gonna switch to proboards, afterall, all I want is a decent forum lol. Thanks again FP
|
|
|
Post by Fringe Pioneer on Jan 9, 2012 1:41:05 GMT
Well, for ProBoards, you can look at the source of any web page on the Dan-Ball Forum and do a search for <!-- Multi-Colored Names --> to find the portion of the code that gives users custom display names. I already summarized what the code does in my first reply to your opening post...
|
|
|
Post by izacque on Jan 16, 2012 3:14:07 GMT
how much did you pay for that domain name?
|
|
|
Post by nmagain on Jan 17, 2012 11:05:13 GMT
not much, last time i checked, some people sell domains for 0.50 dollars a year or something
|
|