View Full Version : replace edit.gif from plugin?
mooreaa
08-23-2008, 11:37 PM
Hello,
As an exercise I wanted to replace edit.gif from a plugin...
so I made a plugin with hook location: showthread_complete
and did:
$vbulletin->templatecache['SHOWTHREAD'] = str_replace('edit.gif', 'mynewimg.gif', $vbulletin->templatecache['SHOWTHREAD']);
but it doesn't replace the string...
The plug is being called, but its just not replacing the string for some reason.... any help?
Dismounted
08-24-2008, 05:11 AM
Why don't you just physically replace the edit.gif image?
mooreaa
08-24-2008, 05:58 AM
I'm trying to figure out plugins. Like I said this was an exercise in trying to figure out the hook system.
I don't understand why the replace in this case wouldn't work... its as if edit.gif doesn't exist on the page SHOWTHREAD... maybe I am trying in the wrong template block? Is there another way to do this?
The reason I wanted to play with this is to be able to use templates to easily/quickly replace or change various images based on the forum.
--------------- Added 1219561282 at 1219561282 ---------------
I was also hoping to replace text strings in the same fashion in some places...
Some of my forums are articles.... so instead of saying "rate this thread" I wanted it to say rate this article...
I just wanted to use a plugin to do the replacement ... just not sure how I can get at the fully completed template...
Dismounted
08-24-2008, 07:44 AM
Have a look at these two articles:
[How-To] Using Plugins for Automatic Template Edits (https://vborg.vbsupport.ru/showthread.php?t=151254)
[How-To] Plugins for Template Edits (Adv. Version) (https://vborg.vbsupport.ru/showthread.php?t=151332)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.