![]() |
Page Numbers with Mod_Rewrite
I have created a mod_rewrite hack for my site, and I can get the main thread to appear in the form thread-xxx.php (where xxx is the threadid). Example : http://www.pcreview.co.uk/thread-3930.php
I have a problem in the temlates when I want to call each new page thread-xxx-y.php (where y is the page number). I have coded this fine in Mod_Rewrite, but I can't find out how to mod this in the VB templates. In the pagenav_pagelink template, there is the following code: [b]<a href="$address&pagenumber=$curpage">$curpage</a>[b] I want this changed to this format: [b]<a href="thread-$thread[threadid]-$curpage">$curpage</a>[b] I have tried using this code, but $thread[threadid] is not recognised. Can anyone tell me how to allow this to be called, or any other ideas? Once I have the mod_rewrite hack complete, I'll release it onto the forums. :) |
I had this exact same problem. In the end I decided just to leave the spider to index the first page only.
|
Oh poo - I'll keep working on it, and I'll let you know here if I can get it working. If anyone has any ideas that would be great :)
|
The page nav templates are used in places other than threads which is why the variable isn't avalible. I'd take a look at functions.php (in particular the constuct_page_nav() function, and the information that is passed to the function in showthread.php for example.
|
OK, I will take a look at that, but I am php novice, so I hope it is easy to understand :) Should it be simple to do?
|
I've given it a go, but I cant find constuct_page_nav anywhere in the functions.php file (2.2.8)
|
That's because Lee assumed you were using vB3 :) Look for getpagenav :)
|
Cheers Dean! I found that section and tried adding $threadid into the "function getpagenav($results,$address) {" part, but I got an error. Would you be able to point me in the right direction?
|
You'd want to change it to somthing similar to:
PHP Code:
|
I do appologise for keeping asking you questions, I just can't get my head round this :) I have modified the line in functions.php which you told me, but I don't understand the showthread part.
Would I add something to this line in showthread.php? "$pagenav = getpagenav($totalposts,"showthread.php?threadid=$t hreadid&perpage=$perpage".iif(isset($highlight), "&highlight=$highlight", ""));" |
All times are GMT. The time now is 07:59 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|