vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Templatecache vB 3.8 to vB 4.0 (https://vborg.vbsupport.ru/showthread.php?t=243282)

RobDog888 05-25-2010 08:17 PM

Templatecache vB 3.8 to vB 4.0
 
Im in the process of upgrading my custom plugins from vB 3.8 to 4.0 and the fetch_template doesnt exist anymore. Not a problem but replacing/modifying templates that are cached is now a problem. There are no hooks where I need them so this still has to be the way I have to do it. It works in 3.8

This is a simplified example of a plugin in parse_templates:
Code:

$find = '{vb:rawphrase all_times_are_gmt_x_time_now_is_y}';
$replace = ' Blah';
$vbulletin->templatecache['footer'] = str_replace($find, $find.$replace, $vbulletin->templatecache['footer']));

But for some reason the text isnt appending.

RobDog888 05-27-2010 03:43 AM

Wow, a whole day and not a single response. This site really isnt what t used to be.
Ive been searching and reading and the examples dont work for me.

Zachery 05-27-2010 06:01 AM

Do you want to elaborate how they are not working? Any reason you you can't just piggy back the phrase and add more information to it?

RobDog888 05-27-2010 07:33 AM

Thanks for the reply.

It wasnt matching on the phrase like posted. Which template field should I be using to match upon? The "template" field or the "template_un" field as the phrase constant is in different format between the two? I tried both.

I got around it for now by matching some html instead but Im sure I cant rely upon that for the other plugins. Phrase replacement variables are better place markers.


All times are GMT. The time now is 05:46 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.02345 seconds
  • Memory Usage 1,708KB
  • 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)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