vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Embed PHP in Templates (https://vborg.vbsupport.ru/showthread.php?t=52775)

DraX 06-14-2003 09:49 AM

The problem with file inclusion is that this is completely contrary to the way in which vBulletin handles it's output buffering.

It doesn't generate line after line, it generates the entire page, and then sends that to the browser once it's compiled it.

For includes to work properly, anything (echos, output, etc.) would have to be stored as variables within the include, which are then echoed by the template itself.

gmarik 06-14-2003 10:28 AM

DraX - and what is the solution? Any code ideas?

Rob - PROMISE 06-19-2003 07:29 AM

Hello, sorry if this has been answered, I have read through and can't find anyhting relating to my problem.

I have installed the hack, I then dropped '<? ?>' (without the quotes) into the header of one of our templates. When I view the page it's not parsing the php, I can see the php tags in the source.

I then tried dropping an include in the same place but I then just get a blank page. I read that there are issues with using includes in the templates and I can live without using them although it would be very useful if I could.

Can you shead any light, let me know if you need any more details.

Thanks for your help people :)

gmarik 06-19-2003 08:43 AM

You're not the only one.
I can't get php working in my 2.3 templates too.
Any solutions in v3? Anybody, Fil, xenon?!

Veg 06-26-2003 10:54 AM

Can you retrive information from the database with this hack?

gmarik 06-26-2003 12:15 PM

Theoreticaly it operates template DB. Theoreticaly.

Importhookup 07-07-2003 11:45 AM

Great hack!

I am so glad that I found this hack, but the problem is that I'm having trouble installing it. I did exactly what is written in the file, the simple replacement of the code but this is what I get on the top of myVBindex.php.

Warning: Failed opening 'randomride.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/importhookup/public_html/forums/admin/functions.php(1095) : eval()'d code on line 1

Parse error: parse error, unexpected T_INCLUDE in /home/importhookup/public_html/forums/admin/functions.php(1095) : eval()'d code on line 1

Parse error: parse error, unexpected T_INCLUDE in /home/importhookup/public_html/forums/admin/functions.php(1095) : eval()'d code on line 1

Can someone help me with this? Thanks!

ChurchMedia 08-05-2003 04:26 AM

If I use include statements, it works but always puts the include file at the top of the page. Any way around this?

Thanks for the cool hack!

Link14716 09-08-2003 08:18 PM

Not working... at least not in the postbit.

Code used:
PHP Code:

<?
if (!empty($post[field7])) {
$postfollower = "<br><br>";
$postfollower = $postfollower."".bbcodeparse2($post[field7],0,1,1,1);
}
if (!empty($post[field5])) {
$posttextcolor = "color='".$post[field5]."'";
}
if (!empty($post[field6])) {
$postfontface = "face='".$post[field6]."'";
}
if (!empty($postfontface) || !empty($posttextcolor)) {
?>
<font $postfontface $posttextcolor>
<? } ?>
$post[message] 
<? if (!empty($postfontface) || !empty($posttextcolor)) { ?>
</font>
<? } ?>
$postfollower

View Source gives me this, of course on the page the code didn't work:
Code:

<?
if (!empty([b]Official[/b] Code +++++)) {
 = "<br><br>";
 = ."".bbcodeparse2([b]Official[/b] Code +++++,0,1,1,1);
}
if (!empty(blue)) {
 = "color='".blue."'";
}
if (!empty(WingDings)) {
 = "face='".WingDings."'";
}
if (!empty() || !empty()) {
?>
<font  >
<? } ?>
I've nailed the store, arcade, increased the arcade's number of games to 41, installed quick reply, and installed zajako's RPG hack. I'm done for tonight.
<? if (!empty() || !empty()) { ?>
</font>
<? } ?>


gmarik 09-09-2003 03:06 PM

Is it working in v3?


All times are GMT. The time now is 03:26 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.01138 seconds
  • Memory Usage 1,738KB
  • 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_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete