Guestbook current page highlight

More
10 years 6 months ago #13500 by igorlaszlo
Hello,
sorry to disturb you again, i just can not get over of some small things... :) i would like to highlight the current page number but i do not know how to do.
How do you change the following code that it gives a background color of the current <a> ? :
Code:
for ($i = 1; $i<=$totalpages; $i++) { echo " <div class='commentspages'><a href=\"list.php?page=$i&order=$order\"><b>$i</b></a></div> "; } echo "</center>";

(list.php)

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #13513 by Pete
It looks like you found the answer to this already, but you can basically either surround the page number with a "Span" tag and give that span a background color using the style attribute or define a class in the CSS file to do that for you.

Pete

DigiOz Webmaster
www.digioz.com
The following user(s) said Thank You: TestUser334

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #13516 by igorlaszlo
It seems today is a hard day, nothing works :)


I have two pages of messages... I added a class to the <a> tag as follows :
Code:
for ($i = 1; $i<=$totalpages; $i++) { echo " <div class='commentspages'><a class='current' href=\"list.php?page=$i&order=$order\"><b>$i</b></a></div> "; } echo "</center>";

But in this case both page numbers will be the same color... what i would like that when i read the messages of the first page, the number "1" gets a different colour. When i read the messages of the second page, the number "2" changes the initial colour.
Is it possible to do it ? Or too complicated ? :whistle:

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #13519 by Pete
You would have to add a PHP code to check the current page number, and set a different span color based on what page you are on. So I guess you tell me if it sounds complicated or not. :)

DigiOz Webmaster
www.digioz.com

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #13533 by igorlaszlo
Hello pete,

thanks for all your replies... however i was very busy and now i can not check what you told me because all my websites are inaccessible, my host server is down since a week.
I will let you know the outcome later..;

Thanks again !

Please Log in or Create an account to join the conversation.

Time to create page: 0.122 seconds
Powered by Kunena Forum