|
Post by deadlyassassin on Feb 4, 2006 13:26:22 GMT
The following code allows you to change the color of the stickies and announcement thread links if you want them to stand out more than usual. Enjoy ! If your using the normal stick/lock images, then all you need to do is edit the hex color codes and place it in your Global Footer. If not, then take your stick image url, it'll be something like yourhost.com/yourfolder/sticky.gif Take the red part and place it: take your sticklock image url, it'll be something like yourhost.com/yourfolder/stickylock.gif Global or Board Footers<script type="text/javascript"> <!-- /* Diiferent Color Links For Sticky Threads, Announcements By {XF}Äs$@§sîñ™, www.xf-clan.net/ */
// Edit where neccessary var stickcolor = "Hex Color"; // Sticky Link Color var stickyhovercolor = "Hex Color"; // Sticky Hover Link Color var stickyImageRE = /(sticky|stickylock).(gif|png|jpg)$/i; // For Custom Images
var td = document.getElementsByTagName('td'); if(location.href.match(/\?board=\w+&?((mod\w+|page)=\d+)?$/)) { for (i=0; i<td.length; i++) { var iTarget = td.item(i).getElementsByTagName('img').item(0); if (td.item(i).width == "5%" && iTarget && iTarget.src.match(stickyImageRE)) { var lTarget = td.item(i).nextSibling.nextSibling.getElementsByTagName('a').item(0); lTarget.style.color = stickcolor; lTarget.onmouseover = function() { this.style.color = stickyhovercolor; } lTarget.onmouseout = function() { this.style.color = stickcolor; } } } } //--> </script>
|
|
|
Post by Katey on Feb 4, 2006 16:36:49 GMT
That's a good idea. I will try it out
|
|
|
Post by Katey on Feb 4, 2006 16:41:48 GMT
Hmmm...doesn't seem to work
|
|
|
Post by deadlyassassin on Feb 4, 2006 17:09:05 GMT
Where did you put it and how did you edit the code? Here a preview: Click Here
|
|
cmm225
Junior Member
Posts: 64
|
Post by cmm225 on Feb 4, 2006 17:15:29 GMT
it worked for me on my test board, but it didn't fully work on my board.
I have different images, it was in my global footer, and I had it like this:
<script type="text/javascript"> <!-- /* Diiferent Color Links For Sticky Threads, Announcements By {XF}Äs$@§sîñ™, http://www.xf-clan.net/ */
// Edit where neccessary var stickcolor = "66FFCC"; // Sticky Link Color var stickyhovercolor = "CC00CC"; // Sticky Hover Link Color var stickyImageRE = /(sticky29es|stickylock2jz).(gif|png|jpg)$/i; // For Custom Images
var td = document.getElementsByTagName('td'); if(location.href.match(/\?board=\w+&?((mod\w+|page)=\d+)?$/)) { for (i=0; i<td.length; i++) { var iTarget = td.item(i).getElementsByTagName('img').item(0); if (td.item(i).width == "5%" && iTarget && iTarget.src.match(stickyImageRE)) { var lTarget = td.item(i).nextSibling.nextSibling.getElementsByTagName('a').item(0); lTarget.style.color = stickcolor; lTarget.onmouseover = function() { this.style.color = stickyhovercolor; } lTarget.onmouseout = function() { this.style.color = stickcolor; } } } } //--> </script>
everything worked except for the hover part.
|
|
|
Post by deadlyassassin on Feb 4, 2006 17:18:23 GMT
Could i have a link to your forum, just so i can run it through the js console and pinpoint the error.
|
|
cmm225
Junior Member
Posts: 64
|
Post by cmm225 on Feb 4, 2006 17:20:50 GMT
I took it out, but I can put it back in: jarlylove.proboards70.com/I'll let the announcement's board be open to guests if you'd like to see the nonhoverness.
|
|
|
Post by deadlyassassin on Feb 4, 2006 17:22:30 GMT
PLease if you can do that, thank you.
|
|
cmm225
Junior Member
Posts: 64
|
Post by cmm225 on Feb 4, 2006 17:24:31 GMT
it's done.
it could just be conflicting w/ another code, but it is at the top of my GF.
|
|
|
Post by deadlyassassin on Feb 4, 2006 17:28:21 GMT
Hmmm...doesn't seem to work The reason why it didn't work for you is because it requires the last part of the image url, i.e., /(http://h1.ripway.com/Ultimate%20Dog/Ultimate%20Dog/Sticky.gif| h1.ripway.com/Ultimate%20Dog/Ultimate%20Dog/Stickshould have just been var stickyImageRE = /(Sticky|StickyLocked).(gif|png|jpg)$/i; I should make that much clearer it's done. it could just be conflicting w/ another code, but it is at the top of my GF. You have the thread starter in the same box as the thread link, could you save that part of the code to notepad and then see if the my code works, thanks.
|
|
cmm225
Junior Member
Posts: 64
|
Post by cmm225 on Feb 4, 2006 17:30:41 GMT
you have to have the .gif?
alright, I'll try that.
that made it worse
Edit:
Taking out "Thread Starter..." worked.
|
|
|
Post by deadlyassassin on Feb 4, 2006 17:33:24 GMT
you have to have the .gif? Yes i do, all that is need is the bit before the .gif and after the last / so www.4d5.net/v4images/stickylock.gifall that is needed is: stickylock Edit: Cool, then maybe just change the order that the thread starter code and sticky color code are in.
|
|
cmm225
Junior Member
Posts: 64
|
Post by cmm225 on Feb 4, 2006 17:37:39 GMT
I just meant you had:
var stickyImageRE = /(Sticky.gif|StickyLocked.gif).(gif|png|jpg)$/i; before you changed it.
I didn't have it that way, changed it, then changed it back when I realized I had it right the first time.
Anyway, the code works well, but Not really needed on my board since I have the sticky thread divider. I would just be beating a stick over my members heads if I added extra. lol ;D
|
|
|
Post by deadlyassassin on Feb 4, 2006 17:39:19 GMT
Oh, not a problem, i am glad that it worked!
|
|
cmm225
Junior Member
Posts: 64
|
Post by cmm225 on Feb 4, 2006 17:53:21 GMT
o.... ok, this is cool. So, surprisingly... or maybe not... it works after the "Thread Started" code. You should place a note that says if you're using that code, that your code should go after it I guess. I guess I'll keep it then ;D Break this line up so the page doesn't spread: /(http://h1.ripway.com/Ultimate%20Dog/Ultimate%20Dog/Sticky.gif| h1.ripway.com/Ultimate%20Dog/Ultimate%20Dog/Stick
|
|