vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Adding a $post "call-able" template. (https://vborg.vbsupport.ru/showthread.php?t=172073)

carcomp 03-04-2008 02:32 PM

Adding a $post "call-able" template.
 
First time poster here. I want to apologize beforehand if I have this posted in the wrong forum, but I figured it was programming related. Anyways...

I want to duplicate the FUNCTION of postbit_onlinestatus template with a new template called postbit_txtonlinestatus. I want to have my red/green/grey gif as well as some text that says "Status: OFFLINE" etc, but call-able from two different places in postbit. My Question is this...

Where is the eval for the onlinestatus template? I know its probably somewhere in the multitude of php files. I just can't find it. I figured once I found it, i could copy it and paste it, modify it to reflect my new template, and then I could call "$post[txtonlinestatus]" from the postbit template.

Hopefully someone can help. I've done a lot of searching and i'm really not coming up with much, probably b/c I don't really know what to call this kind of mod.

EDIT: I do believe this is called a template hook now, after more searching. I think i might be on the right track thinking about plugins, hooks, etc...

shovel 03-04-2008 06:08 PM

Call a hook from "postbit_display_complete" location. Within that hook, use this call..

PHP Code:

eval('$post[txtonlinestatus]= "' fetch_template('postbit_txtonlinestatus') . '";'); 

This will allow you to call $post[txtonlinestatus] from the postbit and use the template you made.

carcomp 03-04-2008 07:41 PM

Excellent!

--------------- Added [DATE]1204673484[/DATE] at [TIME]1204673484[/TIME] ---------------

Ok now I wonder, how do I get the the "onlinestatus" conditional in my customtemplate? Everything I "call" is coming back 0. Do I need to globalize that variable somewhere?

shovel 03-05-2008 12:21 PM

No I wouldn't think so.


All times are GMT. The time now is 05:02 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.01096 seconds
  • Memory Usage 1,716KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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