Log in

View Full Version : Pagination script question...selected page?



Kihon
01-04-2009, 04:41 PM
Question RE: Pagination here: http://www.dynamicdrive.com/style/csslibrary/item/css_pagination_links/

I have implemented this here: http://www.makeuptalk.com/reviews/brands/1/Makeup.html

My question is this. How can I get the "SELECTED" corresponding letter to stay selected? For example, if I am on this page: http://www.makeuptalk.com/reviews/brands/1/D/Makeup.html, how can I get the letter "D" to remain highlighted or selected?

Here is my php code used:



print "<div align='center'><font class='bigreviewtoptext2'><a href='/reviews/brands/$cate_id/$seo_title_cat.html'>$cate_name</a>"; if($w_reviewid[5]) print " - Brands that begin with $brand_initial"; else print " - Browse by Brands"; print "</font></div><br />";
print "<div class='pagination'>
<ul>
<li><a href='/reviews/brands/$cate_id/A/$seo_title_cat.html'>A</a></li>
<li><a href='/reviews/brands/$cate_id/B/$seo_title_cat.html'>B</a></li>
<li><a href='/reviews/brands/$cate_id/C/$seo_title_cat.html'>C</a></li>
<li><a href='/reviews/brands/$cate_id/D/$seo_title_cat.html'>D</a></li>
<li><a href='/reviews/brands/$cate_id/E/$seo_title_cat.html'>E</a></li>
<li><a href='/reviews/brands/$cate_id/F/$seo_title_cat.html'>F</a></li>
<li><a href='/reviews/brands/$cate_id/G/$seo_title_cat.html'>G</a></li>
<li><a href='/reviews/brands/$cate_id/H/$seo_title_cat.html'>H</a></li>
<li><a href='/reviews/brands/$cate_id/I/$seo_title_cat.html'>I</a></li>
<li><a href='/reviews/brands/$cate_id/J/$seo_title_cat.html'>J</a></li>
<li><a href='/reviews/brands/$cate_id/K/$seo_title_cat.html'>K</a></li>
<li><a href='/reviews/brands/$cate_id/L/$seo_title_cat.html'>L</a></li>
<li><a href='/reviews/brands/$cate_id/M/$seo_title_cat.html'>M</a></li>
<li><a href='/reviews/brands/$cate_id/N/$seo_title_cat.html'>N</a></li>
<li><a href='/reviews/brands/$cate_id/O/$seo_title_cat.html'>O</a></li>
<li><a href='/reviews/brands/$cate_id/P/$seo_title_cat.html'>P</a></li>
<li><a href='/reviews/brands/$cate_id/Q/$seo_title_cat.html'>Q</a></li>
<li><a href='/reviews/brands/$cate_id/R/$seo_title_cat.html'>R</a></li>
<li><a href='/reviews/brands/$cate_id/S/$seo_title_cat.html'>S</a></li>
<li><a href='/reviews/brands/$cate_id/T/$seo_title_cat.html'>T</a></li>
<li><a href='/reviews/brands/$cate_id/U/$seo_title_cat.html'>U</a></li>
<li><a href='/reviews/brands/$cate_id/V/$seo_title_cat.html'>V</a></li>
<li><a href='/reviews/brands/$cate_id/W/$seo_title_cat.html'>W</a></li>
<li><a href='/reviews/brands/$cate_id/X/$seo_title_cat.html'>X</a></li>
<li><a href='/reviews/brands/$cate_id/Y/$seo_title_cat.html'>Y</a></li>
<li><a href='/reviews/brands/$cate_id/Z/$seo_title_cat.html'>Z</a></li>
</ul>
</div>";

Thank you for your time.

Nile
01-04-2009, 06:27 PM
On each page you'd have to apply the current class. For example if you were on page 'W,' then in the code for page W you would wanna add the highlighted:


<li><a href='/reviews/brands/$cate_id/W/$seo_title_cat.html' class="currentpage">W</a></li>


Hope this helps,
Nile

Kihon
01-04-2009, 06:36 PM
Oh I knew this. My pages are dynamically generated. What I don't know is how to code that up for dynamically generated pages. It's php.



On each page you'd have to apply the current class. For example if you were on page 'W,' then in the code for page W you would wanna add the highlighted:


<li><a href='/reviews/brands/$cate_id/W/$seo_title_cat.html' class="currentpage">W</a></li>


Hope this helps,
Nile

Nile
01-04-2009, 06:37 PM
Are you using modRewrite? It looks like you are... If you are, can you post what the real address for:


/reviews/brands/$cate_id/A/$seo_title_cat.html

Would look like please. :)

Kihon
01-04-2009, 07:26 PM
Are you using modRewrite? It looks like you are... If you are, can you post what the real address for:


/reviews/brands/$cate_id/A/$seo_title_cat.html

Would look like please. :)
I tried to contact you on MSN messenger. I added you. Maybe you can help me out there? Let me know.

Nile
01-04-2009, 07:35 PM
I am not available on MSN right now.. Please tell me if your using modRewrite - and if you are the normal URL instad of the rewrited URL.

Kihon
01-04-2009, 11:29 PM
Hi Nile, thanks very much for helping me, that worked!

Nile
01-04-2009, 11:29 PM
I'm glad to help you Kihon.