Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 05-11-2009, 05:51 PM
testbot testbot is offline
 
Join Date: Feb 2009
Posts: 373
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Call a template within a template

i would like to combine two mods. what's the easiest way to do this? i was thinking maybe i can call the one template from within the main mods template?

thanks for your help
Reply With Quote
  #2  
Old 05-11-2009, 06:05 PM
RLShare RLShare is offline
 
Join Date: Jun 2008
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What mods are you talking about?

And you cannot call a template from within another template, but you can grab a template from within a plugin and store the data into a variable that you can display in another template. But if you are talking about combining two mods I doubt it will be as simple as that.
Reply With Quote
  #3  
Old 05-11-2009, 06:08 PM
testbot testbot is offline
 
Join Date: Feb 2009
Posts: 373
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks for your quick reply.

i would like Latest Album Pictures (https://vborg.vbsupport.ru/showthrea...ighlight=album)

to display in All Albums (https://vborg.vbsupport.ru/showthread.php?t=172215)

Reply With Quote
  #4  
Old 05-11-2009, 06:13 PM
RLShare RLShare is offline
 
Join Date: Jun 2008
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You would have to modify the way both mods work in order to do it, if you are not a coder then you may find this difficult.

Basically you have to change the plugin that generates the latest albums and have it execute on the all albums page first. Then change it from making automatic template edits and have it store the data in a variable. And last you would have to modify a template from the all albums mod to add that variable in.
Reply With Quote
  #5  
Old 05-11-2009, 06:28 PM
testbot testbot is offline
 
Join Date: Feb 2009
Posts: 373
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i was looking at the plugins but i didn't see an All Albums hook. i thought maybe i could make a new plugin based off of Latest Album and then make it use an All Albums hook or something.

idk, i might have to revisit this another time. i just don't have the time to research and make this happen right now i guess.

thanks again for your replies.
Reply With Quote
  #6  
Old 05-11-2009, 06:33 PM
RLShare RLShare is offline
 
Join Date: Jun 2008
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There isn't an 'all albums' hook... The best way would be to change the hook location to 'global_start' or one of the global hooks, check the THIS_SCRIPT define and only allow the rest of the code to execute when THIS_SCRIPT is defined as what it is defined as in the all albums file. You would also have to modifify the 'Latest Album Picture' plugin that executes on the hook location 'cache_templates' and change the THIS_SCRIPT check against that value as well instead of 'index' as it does now.
Reply With Quote
  #7  
Old 05-11-2009, 07:06 PM
RLShare RLShare is offline
 
Join Date: Jun 2008
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here I just made some quick tests and here is a quick fix for the Album Pictures mod with changes to make it work on the all albums page...

You will need to edit the 'album_all_album_list' template and add '$pblatestalbums' to where you want the Album Pictures mod to display at. I have also attached a modified version of the 'all albums' product which has it showing right below the navbar if that is where you want it to display.
Attached Files
File Type: xml product-afm_allalbums.xml (7.3 KB, 4 views)
File Type: xml product-abe1_all_albums.xml (12.9 KB, 2 views)
Reply With Quote
  #8  
Old 05-12-2009, 03:26 AM
testbot testbot is offline
 
Join Date: Feb 2009
Posts: 373
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

DUDE!!! THAT'S PERFECT!!!

you rock, bro! best thread and answer i've experienced in vbulletin
Reply With Quote
  #9  
Old 05-12-2009, 03:46 AM
RLShare RLShare is offline
 
Join Date: Jun 2008
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

lol.. your welcome
Reply With Quote
Reply

Thread Tools
Display Modes

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 01:36 PM.


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.07629 seconds
  • Memory Usage 2,250KB
  • Queries Executed 12 (?)
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
  • (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
  • (2)postbit_attachment
  • (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_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
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete