Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-31-2003, 01:26 AM
Rose's Avatar
Rose Rose is offline
 
Join Date: Nov 2001
Location: K-Town, Germany
Posts: 619
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default [REQUEST] Different "Showthread" template based on forumid

Hello all!

I am requesting something that should be rather simple, but I've not figured out how to do it. I'm wanting threads in a certain forum to look different than other forums. I've installed [profile]Firefly[/profile]'s "Change Style of First Post" hack which is doing most of what I need to be done. This hack calls a separate template "postbit_first" for all threads in the forum I specified.

(note - Yes, I know this hack applies to only the first post in the thread, but I don't imagine any threads will be longer than one post, so it works)

What I would like to do is call a separate showthread template based on forumid.

I looked into editing FIrefly's hack to make it work myself, but I don't think I quite understand how to do it alone.
Reply With Quote
  #2  
Old 03-31-2003, 01:28 AM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If I'm concious tomorrow during school I'll try making an admin CP based way of doing it, but remember the bit templates will be the same too. showthread is only the container for the bits like postbit.
Reply With Quote
  #3  
Old 03-31-2003, 01:29 AM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Rose, if you don't have a lot of different styles, what about creating a custom style for the forum and then modifying the showthread template for that style? You can force the forum to use the style and it makes life pretty darn easy.

Otherwise, it's just a matter of finding the code in showthread.php that evaluates the showthread template and putting an if clause around it. (and any of the other sub-templates if you need them different as well)

Amy
Reply With Quote
  #4  
Old 03-31-2003, 01:30 AM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

With vB3's inheritable templates it should be reasonably easy, too, with Amy's method, although if your board has a ton of styles it'll be hell.
Reply With Quote
  #5  
Old 03-31-2003, 01:31 AM
Rose's Avatar
Rose Rose is offline
 
Join Date: Nov 2001
Location: K-Town, Germany
Posts: 619
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 09:29 PM amykhar said this in Post #3
Rose, if you don't have a lot of different styles, what about creating a custom style for the forum and then modifying the showthread template for that style? You can force the forum to use the style and it makes life pretty darn easy.

Otherwise, it's just a matter of finding the code in showthread.php that evaluates the showthread template and putting an if clause around it. (and any of the other sub-templates if you need them different as well)

Amy
D'oh! Because I didn't even think of that. I generally use the same template set for all styles, but I think I'll give this a try. In fact, I'll work on it right now. But Filburt, if you get what you were going to do done I'd be interested, too.
Reply With Quote
  #6  
Old 03-31-2003, 03:58 AM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is ugly, and not tested, but you can try something like:

in showthread.php find:

PHP Code:
eval("dooutput(\"".gettemplate("showthread")."\");"); 
Replace with:

PHP Code:
if ($forumid==*custom forum id number here*) {
eval(
"dooutput(\"".gettemplate("showthread_custom")."\");");
} else { 
eval(
"dooutput(\"".gettemplate("showthread")."\");");

you'll need to replace [high]*custom forum id number here*[/high] with the forum you want to have a new showthread template displayed for. And create a showthread_custom template, Also you will have to do something like this for all the bit templates if you want more custimization.

if you want to do this with multiple forums, showing the same custom template, do this.

PHP Code:
if ($forumid==*custom forum id number here* or $forumid==*anthor custom forum id*) {
eval(
"dooutput(\"".gettemplate("showthread_custom")."\");");
} else { 
eval(
"dooutput(\"".gettemplate("showthread")."\");");

or if you want multiple forums to display multiple custom templates do this:

PHP Code:
if ($forumid==*custom forum id number here*) {
eval(
"dooutput(\"".gettemplate("showthread_custom")."\");");
} elseif (
$forumid==*anthor custom forumid number here*) {
 eval(
"dooutput(\"".gettemplate("showthread_custom2")."\");");
} else {
eval(
"dooutput(\"".gettemplate("showthread")."\");");

Reply With Quote
  #7  
Old 03-31-2003, 11:52 AM
Rose's Avatar
Rose Rose is offline
 
Join Date: Nov 2001
Location: K-Town, Germany
Posts: 619
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, Brad! I spent a while working on it last night until the host decided to go down - that usually means its bedtime anyway. For the purposes I need, I think Amy's idea will work grand. But I've made note of your changes so I might use them in the future, probably near future. *hehe*

Thanks again, all! If everything works right, I'll have a pretty neat hackless(ish) gallery for my members.
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 09:54 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04382 seconds
  • Memory Usage 2,231KB
  • Queries Executed 11 (?)
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
  • (4)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete