The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Need help with including php files using image vars
I have studied the tutorial section on how to included php files.
I want to include my header template as a file on my server, instead of pasting it into the area in the style manager. So I have created a plug-in attached to the global_start hook: PHP Code:
PHP Code:
HTML Code:
<img src="$stylevar[imgdir_misc]/nav_welcome.gif" width="251" height="29" alt="" />
Also, there are some php variables in the header template, that are just getting printed out, instead of the actual php code. Do I need to put an eval() somewhere in the above code? Kind of lost on this... thanks. --------------- Added [DATE]1214187596[/DATE] at [TIME]1214187596[/TIME] --------------- Actually, looking at the HTML source shows that the php in the header is not being executed. the URL of the images still show up as $stylevar[...], so obviously I need to be doing something different to get the php in the header.php file to actually execute, but what? |
#2
|
|||
|
|||
Try this in your plugin.
PHP Code:
|
#3
|
|||
|
|||
Thanks for the reply - but I tried it and it doesn't get any different result. The php is still not executing. Here is a slightly simplified version of the kl_templates/header.php file:
HTML Code:
<div id="back-gradient"> <!-- set below for skin width--> <table id="main-table" width="970px" border="0" align="center" cellpadding="0" cellspacing="0" style="padding-bottom:15px"> <tr> <td width="100%" align="left" valign="top"> <!-- begin logo and graphic --> <div id="hdr"> <table id="logo" cellspacing="0" cellpadding="0" align="center"> <tr> <td rowspan="2"><img src="iSkin_Black/misc/klf_logo.jpg" alt="Karma-Lab Forums" height="111" width="268" /></td> <td><img src="iSkin_Black/misc/klf_graphic.jpg" alt="KARMA Technology and the products incorporating it" height="86" width="685" /></td> </tr> </table> </div> <div id="brd_outer"> <div id="brd_in"> <!-- begin top black nav bar --> <div id="nav_back"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr valign="top"> <td width="172" height="29" align="left"><img src="$stylevar[imgdir_misc]/nav_ls.gif" width="70" height="29" alt="" /></td> <td align="center"><img src="$stylevar[imgdir_misc]/nav_welcome.gif" width="251" height="29" alt="" /></td> <td width="172" height="29" align="right"> <table width="182" border="0" align="center" cellpadding="0" cellspacing="0"> <!-- begin navigation buttons table --> <tr> <if condition="$show['registerbutton']"> <td width="87" height="29"><a href="register.php$session[sessionurl_q]" rel="nofollow"><img id="nav_reg" src="$stylevar[imgdir_misc]/nav_reg.gif" width="87" height="29" alt="" /></a></td> <else /> <td width="87" height="29" id="usercptools"><a href="$show[nojs_link]#usercptools" accesskey="3"><img id="nav_menu" src="$stylevar[imgdir_misc]/nav_menu.gif" width="87" height="29" alt="" /></a> <script type="text/javascript"> vbmenu_register("usercptools", 1); </script> </td> </if> <td width="75" height="29" id="navbar_search"><a href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow"><img id="nav_search" src="$stylevar[imgdir_misc]/nav_search.gif" width="75" height="29" alt="" /></a> <if condition="$show['quicksearch']"> <script type="text/javascript"> vbmenu_register("navbar_search" ,1); </script></if> </td> <!-- End navigation buttons table --> <td width="20" height="29" align="right" valign="top"><img src="$stylevar[imgdir_misc]/nav_rs_end.gif" width="20" height="29" alt="" /></td> </tr> </table> </td> </tr> </table> </div> <!-- content table --> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td> $spacer_open $_phpinclude_output $ad_location[ad_header_end] |
#4
|
||||
|
||||
PHP Code:
|
#5
|
|||
|
|||
Thank you for you reply, but again (sadly), it did not work. Same result. Very strange, I agree. I also believe an eval() is needed, but so far, it is not working....
|
#6
|
||||
|
||||
Does "$stylevar" actually appear when you view the source? Try:
PHP Code:
|
#7
|
|||
|
|||
Try the global_setup_complete hook and see if you get any errors or anything.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|