vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   where can i put this Code .. ?? (https://vborg.vbsupport.ru/showthread.php?t=122802)

Almotmaiz.Net 08-02-2006 06:14 AM

where can i put this Code .. ??
 
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 :

PHP 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 ?


All times are GMT. The time now is 07:33 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.01031 seconds
  • Memory Usage 1,726KB
  • 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
  • (6)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