![]() |
replacing everything between a div in a template
Say I want to replace this snippit in showthread_quickreply:
Code:
<div class="controlbar" style="padding-$stylevar[right]:8px"> I've tried a few combinations similar to: Code:
$test = '<div class=\"controlbar\" style=\"padding-$stylevar[right]:8px\">.*</div>'; |
Don't escape the double quotes, it isn't required in the test string because the string is enclosed in single quotes.
|
Code:
$test = '<div class="controlbar" style="padding-$stylevar[right]:8px">.*</div>'; |
Here's what I do when I am trying to edit a template via a plugin and experiencing difficulty...first I look at the template code before any alterations at runtime, and copy/paste that code into a text editor.
Next, I manually edit the template to make the desired change, and look at this at runtime and copy/paste that below the previous paste into my text editor. Then, revert the template back to its original state. Now I have the desired before/after to inspect in my text editor, and it is easier to see what I need to do to make the desired change using PHP. |
i went about doing it pretty much that way lol, with a bunch of minor changes
things are not named the final name this is just my build procedure lol, i know... sloppy =) it'll be sexy and make sence in the end example: Code:
//showthread_quickreply Code:
$vbulletin->templatecache['editor_toolbar_on'] = $vbulletin->templatecache['drc_iiu_editor_toolbar_on']; but grabbing things that SHOULD be there no matter how custom a theme is ...SHOULD work for everyone lol |
preg_replace -_- lmao, too bad the products done now, will come in handy in the future though =)
|
All times are GMT. The time now is 04:09 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|