vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   [REQUEST] Different "Showthread" template based on forumid (https://vborg.vbsupport.ru/showthread.php?t=51015)

Rose 03-31-2003 01:26 AM

[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.

filburt1 03-31-2003 01:28 AM

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.

amykhar 03-31-2003 01:29 AM

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

filburt1 03-31-2003 01:30 AM

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.

Rose 03-31-2003 01:31 AM

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.

Brad 03-31-2003 03:58 AM

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")."\");");



Rose 03-31-2003 11:52 AM

Thanks, Brad! :D 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.


All times are GMT. The time now is 08:29 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.01009 seconds
  • Memory Usage 1,741KB
  • 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
  • (4)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete