vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Page Numbers with Mod_Rewrite (https://vborg.vbsupport.ru/showthread.php?t=59774)

Ian Cunningham 01-06-2004 07:55 AM

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. :)

Dean C 01-06-2004 10:04 AM

I had this exact same problem. In the end I decided just to leave the spider to index the first page only.

Ian Cunningham 01-06-2004 03:32 PM

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 :)

NTLDR 01-06-2004 05:58 PM

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.

Ian Cunningham 01-07-2004 04:49 PM

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?

Ian Cunningham 01-07-2004 05:51 PM

I've given it a go, but I cant find constuct_page_nav anywhere in the functions.php file (2.2.8)

Dean C 01-07-2004 06:11 PM

That's because Lee assumed you were using vB3 :) Look for getpagenav :)

Ian Cunningham 01-07-2004 06:14 PM

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?

NTLDR 01-07-2004 06:22 PM

You'd want to change it to somthing similar to:

PHP Code:

function getpagenav($results,$address$threadid 0) { 

and then in showthread.php modify the call to the function to pass the threadid across. Note the = 0 on the end which means it won't generate errors if you don't send a threadid for example on the members list.

Ian Cunningham 01-07-2004 07:00 PM

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
  • Page Generation 0.02228 seconds
  • Memory Usage 1,735KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete