vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   [Solved] Add Code On Beginning Template newpost_attachment (https://vborg.vbsupport.ru/showthread.php?t=297839)

omardealo 05-05-2013 12:48 PM

[Solved] Add Code On Beginning Template newpost_attachment
 
Hello ,

I try to add code on Beginning Template newpost_attachment by this

Hook : global_start
PHP Code:

$code "SOME HTML CODE";
$vbulletin->templatecache['newpost_attachment'] = $code.$templatecache['newpost_attachment']; 

But , not worked well ... it Replacing all template
i want add code only on Beginning this template

thnx ...

Lynne 05-05-2013 01:17 PM

On the left side, you use:
$vbulletin->templatecache['newpost_attachment']

On the right side, you use:
$templatecache['newpost_attachment']

I would guess the left side is correct and you need to use it in both places.

omardealo 05-05-2013 01:38 PM

Quote:

Originally Posted by Lynne (Post 2420054)
On the left side, you use:
$vbulletin->templatecache['newpost_attachment']

On the right side, you use:
$templatecache['newpost_attachment']

I would guess the left side is correct and you need to use it in both places.

okay , u mean

PHP Code:

$vbulletin->templatecache['newpost_attachment'] = $code.$templatecache['newpost_attachment']; 

but not worked too , it's same problem
Variable $code Shows but the template does not exist

THNX !

Lynne 05-05-2013 02:57 PM

Try the parse_templates hook.

omardealo 05-05-2013 03:26 PM

Quote:

Originally Posted by Lynne (Post 2420071)
Try the parse_templates hook.

Already i try it and global_start too ... it's same
thnx .

Lynne 05-05-2013 04:41 PM

What page are you doing this on (the exact php page url)?

omardealo 05-05-2013 04:51 PM

Quote:

Originally Posted by Lynne (Post 2420093)
What page are you doing this on (the exact php page url)?

on newreply.php
i want add code above attachment , it already add but attachment template not exist

--------------- Added [DATE]1367858696[/DATE] at [TIME]1367858696[/TIME] ---------------

Any one have solutions ?

omardealo 05-06-2013 06:45 PM

i solved it by another way

PHP Code:

$code "SOME HTML CODE";
$find '<fieldset class="blockrow" id="attachfiles">';
$vbulletin->templatecache['newpost_attachment'] = str_replace($find$code.$find $vbulletin->templatecache['newpost_attachment']); 



All times are GMT. The time now is 06:49 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.02132 seconds
  • Memory Usage 1,729KB
  • 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
  • (3)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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