vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Change showthread by showthread_2 in some forums (https://vborg.vbsupport.ru/showthread.php?t=183839)

chicote 06-28-2008 09:39 PM

Change showthread by showthread_2 in some forums
 
I am creating a product that depending on the forum he changes the Showthread, ah I would like to know, how do I get in the forum that I've chosen, instead of Showthread he shows a template Showthread_2?

Someone could give me a tip for that plugin, I created a plugin with the following code:
PHP Code:

if ($this->forum['forumnumber'])
{
$vbulletin->templatecache['showthread'] = $vbulletin->templatecache['showthread_2'];


But is not working, I could fix that indicate how plugin, recalling that forumnumber is an option that I created empowered the manager of forums, to define which will use the forum shothread_2;

If I can help.

Opserty 06-29-2008 10:15 AM

The data manager only controls the data during adding/editing/deleting.

It would be best to look at the showthread.php PHP code and see what is happening and what variables are involved.

You probably want a condition like if($forum['forumid'] == X) or something.

Amenadiel 06-29-2008 05:23 PM

I believe you could do pretty much everything just by calling another template. I mean, I was using both postbit and postbit legacy depending on the forum using a condition like the one Opserty told you.

You could do the same for showthread template.

Opserty 06-29-2008 05:30 PM

Postbits are created using a class, showthread is done by procedural code.

Amenadiel 06-30-2008 12:03 PM

yes, but even so, his showthread template could have a condicional

Code:

<if condition="in_array($forumid, array(1,2,3))">

showthread2 template

<else />

normal showthread template

</if>

of course, I know what you mean, the showthread.php will be the same, but manipulating the template should allow to change pretty much everything about the way the data is displayed.

You see that in the first post his concern is how to display the showthread 2 template, he doesn't want to change the core.

Opserty 06-30-2008 12:33 PM

There is no need to change the core... this could probably be done using the Plugin System.

Using that conditional would mean the showthread template would be extremely long (twice the length of what it normally). It is probably more efficient to create a second separate template and overwrite the original one at runtime, as suggested by the OP.


All times are GMT. The time now is 06:33 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.01019 seconds
  • Memory Usage 1,722KB
  • 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_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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