vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How to modify original vB templates via product? (https://vborg.vbsupport.ru/showthread.php?t=176647)

XTF 04-19-2008 08:19 PM

How to modify original vB templates via product?
 
Hi,

I've got a 'product' that modified original vB templates. At the moment it just appears to overwrite them and when I uninstall my product, the original templates are gone too. So now, forumhome is missing for example.
This doesn't appear to be the right way. What is the right way?

Greetings

John3971 04-19-2008 08:23 PM

This is totally wrong forum.

XTF 04-19-2008 08:29 PM

Quote:

Originally Posted by John3971 (Post 1494716)
This is totally wrong forum.

Yes, hehe, sorry, I noticed when it asked me all the extra details. Could a mod move it or do I have to repost it?

Mosh 04-20-2008 07:00 AM

Hey Olaf,

Download a couple of my hacks and have a quick look at the some of the plugins. You should get the idea pretty quickly on how to do it.

But if you use vBulletin's template hooks, which are in most templates now adays, it would look something like this:
Code:

$template_hook['navbar_search_menu'] .= '<tr><td class="vbmenu_option"><a href="tags.php'.$session['sessionurl_q'].'" rel="nofollow">'.$vbphrase['bookmarksnavlink'].'</a></td></tr>';
If you are finding a location and pasting it exactly then it would be something like this:
Code:

$vbulletin->templatecache['FORUMDISPLAY'] = str_replace($vbulletin->options['sfutbf_ati_text'],$vbulletin->options['sfutbf_ati_text'].fetch_template('UnansweredThreadsByForum'),$vbulletin->templatecache['FORUMDISPLAY']);
Most hacks use either one or the other method for the most part for their hacks, so take a few to pieces and see how they flow. You will soon work out how to do it.

Mosh :)

Marco van Herwaarden 04-20-2008 08:51 AM

If you have questions/problems with a modification or style, then please post in the thread (or support forum/board) about that modification/style. Best chance to receive a reply from either the author or another member using the same modification/style.

XTF 04-20-2008 10:59 AM

Quote:

Originally Posted by Marco van Herwaarden (Post 1495015)
If you have questions/problems with a modification or style, then please post in the thread (or support forum/board) about that modification/style. Best chance to receive a reply from either the author or another member using the same modification/style.

I'm the author of this product. ;)

Template hooks sound nice. When did they get introduced?

Marco van Herwaarden 04-20-2008 11:05 AM

Template hooks where introduced in 3.6.

You should never modify a default vBulletin template and ship that modified template with a product. It will overwrite the template in teh master style and will not revert anymore to default vB when uninstalled.

XTF 04-21-2008 11:56 AM

Quote:

Originally Posted by Marco van Herwaarden (Post 1495079)
Template hooks where introduced in 3.6.

You should never modify a default vBulletin template and ship that modified template with a product. It will overwrite the template in teh master style and will not revert anymore to default vB when uninstalled.

I noticed. vB shouldn't allow this. ;)

However, the methods posted by Mosh aren't very flexible.

XTF 04-22-2008 03:46 PM

Quote:

Originally Posted by Mosh (Post 1494968)
Hey Olaf,

Download a couple of my hacks and have a quick look at the some of the plugins. You should get the idea pretty quickly on how to do it.

But if you use vBulletin's template hooks, which are in most templates now adays, it would look something like this:
Code:

$template_hook['navbar_search_menu'] .= '<tr><td class="vbmenu_option"><a href="tags.php'.$session['sessionurl_q'].'" rel="nofollow">'.$vbphrase['bookmarksnavlink'].'</a></td></tr>';
If you are finding a location and pasting it exactly then it would be something like this:
Code:

$vbulletin->templatecache['FORUMDISPLAY'] = str_replace($vbulletin->options['sfutbf_ati_text'],$vbulletin->options['sfutbf_ati_text'].fetch_template('UnansweredThreadsByForum'),$vbulletin->templatecache['FORUMDISPLAY']);
Most hacks use either one or the other method for the most part for their hacks, so take a few to pieces and see how they flow. You will soon work out how to do it.

Mosh :)

For example, I'd like to add a stats block to FORUMHOME. It should be at the end of this '<tbody id="collapseobj_forumhome_stats" style="$vbcollapse[collapseobj_forumhome_stats]">' tbody.
There's no hook, so only method 1 could be used.
However, method 1 isn't easy either in this case. Flexibility is also low.


All times are GMT. The time now is 10:05 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.00967 seconds
  • Memory Usage 1,738KB
  • 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_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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