vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   edit template with plugin (https://vborg.vbsupport.ru/showthread.php?t=98949)

harmor19 10-21-2005 03:05 PM

edit template with plugin
 
Is it possible to edit a template with a plugin?
Here's a code from another BBS that uses the plugin system

PHP Code:

require "./inc/adminfunctions_templates.php";
    
find_replace_templatesets("header"'#help</a></li>#'"help</a></li><li><a href=\"\$settings[bburl]/\$settings[cpphpfn]\"><img src=\"\$theme[imgdir]/star.gif\" border=\"0\" alt=\"Custom Pages\">Custom Pages</a></li>"); 

"header" is the template it's editing,
It changes "#help</a></li>#" to help</a></li><li><a href=\"\$settings[bburl]/\$settings[cpphpfn]\"><img src=\"\$theme[imgdir]/star.gif\" border=\"0\" alt=\"Custom Pages\">Custom Pages</a></li>

Marco van Herwaarden 10-21-2005 08:06 PM

I am doing it with some of my hacks.

The report PM module of the PM Workbench for example.

harmor19 10-21-2005 08:15 PM

Thank you, I will look into take a look at them.

Paul M 10-21-2005 08:53 PM

It is possible to do string replacements on the fly to templates in the cache, it's something I saw done quite a while ago and have included in one hack so far, and intend to update into a few others eventually.


All times are GMT. The time now is 02:58 PM.

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.01008 seconds
  • Memory Usage 1,712KB
  • 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