PDA

View Full Version : where can i put this Code .. ??


Almotmaiz.Net
08-02-2006, 06:14 AM
heloo every one ..

i have i small code ..

and i dont now where i can put it .. (hook)

i build a littel Hack ANd i Hava a littel repalce in some template

see my Code :

//################### Editor Clientscript ###################//
$vbulletin->templatecache['editor_clientscript'] = str_replace(
array(
'vbphrase["insert_all"] = "$vbphrase[insert_all]";'
),
array(
'vbphrase["insert_all"] = "$vbphrase[insert_all]";
$vbulletin->templatecache['Alzaabi_editor_clientscript']'
),
$vbulletin->templatecache['editor_clientscript']
);
//################### Headinclude ###################//
$vbulletin->templatecache['headinclude'] = str_replace(
array(
'<script type="text/javascript" src="clientscript/vbulletin_global.js?v=$vboptions[simpleversion]"></script>'
),
array(
'<script type="text/javascript" src="clientscript/vbulletin_global.js?v=$vboptions[simpleversion]"></script>
$vbulletin->templatecache['Alzaabi_headinclude']'
),
$vbulletin->templatecache['headinclude']
);
//################### Quickreply ###################//
$vbulletin->templatecache['showthread_quickreply'] = str_replace(
array(
' <td><div class="imagebutton" id="{$editorid}_cmd_switchmode"><img src="$stylevar[imgdir_editor]/switchmode.gif" width="21" height="20" alt="$vbphrase[switch_editor_mode]" /></div></td>
</if>'
),
array(
'<script type="text/javascript" src="clientscript/vbulletin_global.js?v=$vboptions[simpleversion]"></script>
$vbulletin->templatecache['Alzaabi_showthread_quickreply']'
),
$vbulletin->templatecache['showthread_quickreply']
);

wait Help ..

Steven Gibbons
08-02-2006, 09:22 AM
What does the code actually do?

Almotmaiz.Net
08-02-2006, 09:30 AM
this code to add buttons in tool box .. in posts and new threads and replays ..

and sing edit ..

Paul M
08-02-2006, 09:34 AM
Try using the parse_templates or global_start hooks.

Almotmaiz.Net
08-02-2006, 02:35 PM
Not work ..

in global_start , parse_templates , global_complete and cache_templates

what can i do ?

Paul M
08-02-2006, 03:12 PM
I didn't mention cache_templates or global_complete, I wouldn't expect it to work in them. I see no obvious reason it wouldn't work in the others, are you sure the code actually works at all ? (looking at what you are trying to replace, I doubt it does, you certainly cannot search for </if> in cached templates).

BTW, Why don't you just edit your templates ?