PDA

View Full Version : How to: Re color pagenav links



RobAC
Mon 30th Jul '01, 8:59pm
The new page nav. links are miscolored on my site: you can see an example here: http://corvetteactioncenter.com/forums/showthread.php?s=&threadid=1713



<td width="100%"><font face="verdana,arial,helvetica" size="1" color="#FFFFFF" class="thtcolor"><b>Topic &nbsp;&nbsp; Pages (2): <b>[ 1 &nbsp; <a href="showthread.php?s=&threadid=1713&perpage=25&pagenumber=2">2</a> &nbsp; <a href="showthread.php?s=&threadid=1713&perpage=25&pagenumber=2">&gt;</a> ]</b></b></font></td>



My guess is that a class is not specified within the link tag?

Kier
Mon 30th Jul '01, 9:35pm
Yes, there is no class defined by default for those links... I figured that seeing as people would invariably want to re-style the templates, I would leave CSS definitions up to the administrators' discretion.

Kier
Mon 30th Jul '01, 9:45pm
I'll explain...

I assume that you want to have the pagelinks sitting in the bar at the top and the bottom of the showthread page, so the colours they are currently using don't look right...?

You can solve it like this:

First, edit your headinclude template, and find the stuff that looks like #all A:link .... #all A:active (etc). For all of these, simply delete the #all text. This will leave you with something like this:
A:link, A:visited, A:active {
COLOR: {linkcolor};
}
A:hover {
COLOR: {hovercolor};
}Next, open up the showthread template, then find the two instances of $pagenav. In each instance, replace $pagenav with
<span class="theadpnav">$pagenav</span> Now, go up to the <head> section of the showthread template, and add this:
<style type="text/css">
.theadpnav A:link, .theadpnav A:visited, .theadpnav A:active, .theadpnav A:hover {
color: {tableheadtextcolor};
}
</style> This will define a special nested class, which will colour your links correctly :)



The above image shows the same pagenav template being used, the one on the white background is simply $pagenav, while the one in the table header is <span class="theadpnav">$pagenav</span>.

RobAC
Mon 30th Jul '01, 10:14pm
Kier,

That worked. Thanks! :)

-Rob

tubedogg
Tue 31st Jul '01, 1:42am
Here's another example...This is an idea I got from a request in the hacks forum. I hacked it into 2.0.1 but now with 2.0.2 it's all done in the templates. :) The current number is highlighted, as seen in the first pic, and others change color on mouseover, as seen in the second. All done with CSS/A:hover. :)

RobAC
Tue 31st Jul '01, 1:52am
Nice! :)

eva2000
Wed 1st Aug '01, 10:03pm
better yet move the pagenav variable out of the cell table and just above the start of the showthread main table :)

Freddie Bingham
Wed 1st Aug '01, 10:19pm
<whisper> Look at tubedoggs pagelinks in Netscape :eek: </whisper>

tubedogg
Wed 1st Aug '01, 10:41pm
:eek:

:p

Yeah I kind of figured. I hate Netscape so very, very much. At least I got the board semi-usable in it...for me that's an accomplishment. :D

Freddie Bingham
Wed 1st Aug '01, 10:44pm
Not that I use netscape but I wouldn't call it useable considering you can not change the page.

tubedogg
Wed 1st Aug '01, 11:02pm
Yeah, now it's not. I meant before I did that. Other than that I think it works ok...

Freddie Bingham
Wed 1st Aug '01, 11:04pm
Post a little note saying If you use nutscrape and wish to turn the page, append &pagenumber=2 to your url. :)

tubedogg
Wed 1st Aug '01, 11:08pm
Somehow, if they're still using Netscape, I'm not sure they'd be able to figure that one out. ;)

Before I get flamed, I'm JOKING! :D I would use Netscape except for the crappy CSS and table support...

XiXora
Thu 2nd Aug '01, 10:48am
ewww netscape. nothing looks nice in that.

Solution.... DONT USE IT BAN IT FROM THE FACE OF THE EARTH!

:)

Kier
Thu 2nd Aug '01, 11:21am
Invaluable code snippet for any PHP script:
if (stristr($HTTP_USER_AGENT,"gecko") {
echo "Sorry, your browser is a turd";
exit;
}:D

Nicholas Brown
Thu 2nd Aug '01, 2:31pm
Originally posted by Kier
Invaluable code snippet for any PHP script:
if (stristr($HTTP_USER_AGENT,"gecko") {
echo "Sorry, your browser is a turd";
exit;
}:D

<evil grin> ;)

eva2000
Thu 2nd Aug '01, 3:18pm
Originally posted by Kier
Invaluable code snippet for any PHP script:
if (stristr($HTTP_USER_AGENT,"gecko") {
echo "Sorry, your browser is a turd";
exit;
}:D actually understood that lol