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 04-19-2008, 08:19 PM
XTF XTF is offline
 
Join Date: Sep 2004
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 04-19-2008, 08:23 PM
John3971 John3971 is offline
 
Join Date: Sep 2007
Location: Sweden
Posts: 258
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is totally wrong forum.
Reply With Quote
  #3  
Old 04-19-2008, 08:29 PM
XTF XTF is offline
 
Join Date: Sep 2004
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by John3971 View Post
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?
Reply With Quote
  #4  
Old 04-20-2008, 07:00 AM
Mosh's Avatar
Mosh Mosh is offline
 
Join Date: Aug 2004
Location: Melbourne, Australia
Posts: 1,968
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #5  
Old 04-20-2008, 08:51 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 04-20-2008, 10:59 AM
XTF XTF is offline
 
Join Date: Sep 2004
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Marco van Herwaarden View Post
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?
Reply With Quote
  #7  
Old 04-20-2008, 11:05 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 04-21-2008, 11:56 AM
XTF XTF is offline
 
Join Date: Sep 2004
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Marco van Herwaarden View Post
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.
Reply With Quote
  #9  
Old 04-22-2008, 03:46 PM
XTF XTF is offline
 
Join Date: Sep 2004
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mosh View Post
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.
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 04: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.04335 seconds
  • Memory Usage 2,249KB
  • 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
  • (4)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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_postinfo_query
  • fetch_postinfo
  • 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