Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-06-2004, 07:55 AM
Ian Cunningham Ian Cunningham is offline
 
Join Date: Feb 2002
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 01-06-2004, 10:04 AM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I had this exact same problem. In the end I decided just to leave the spider to index the first page only.
Reply With Quote
  #3  
Old 01-06-2004, 03:32 PM
Ian Cunningham Ian Cunningham is offline
 
Join Date: Feb 2002
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 01-06-2004, 05:58 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 01-07-2004, 04:49 PM
Ian Cunningham Ian Cunningham is offline
 
Join Date: Feb 2002
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #6  
Old 01-07-2004, 05:51 PM
Ian Cunningham Ian Cunningham is offline
 
Join Date: Feb 2002
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've given it a go, but I cant find constuct_page_nav anywhere in the functions.php file (2.2.8)
Reply With Quote
  #7  
Old 01-07-2004, 06:11 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's because Lee assumed you were using vB3 Look for getpagenav
Reply With Quote
  #8  
Old 01-07-2004, 06:14 PM
Ian Cunningham Ian Cunningham is offline
 
Join Date: Feb 2002
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #9  
Old 01-07-2004, 06:22 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 01-07-2004, 07:00 PM
Ian Cunningham Ian Cunningham is offline
 
Join Date: Feb 2002
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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", ""));"
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:55 AM.


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.04424 seconds
  • Memory Usage 2,248KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete