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)

filburt1 05-13-2003 01:18 PM

For one thing, break it up with some whitespace so it's readable...

Try this:
Code:

...
<?
if (empty($page)) $page = "default";
include("$page.html");
?>

Also include and require may cause unpredictable results; you'll probably need to play with the output buffering settings and that'll destroy gzip.

zajako 05-14-2003 04:12 AM

>.< It made me go cross eyed :]
But quite usefull, if you want to have templates be more useful

cirisme 05-14-2003 09:09 PM

It doesn't work. :(

PHP code goes through (somewhat) unparsed. I can say:
[code]<? if ($post[usergroupid] != 5) {
$var = "..."
}
?>

And it would show up as...

Code:

<? if (6 != 5) {
$var = "..."
}

With the 6 being the correct usergroup id. :ermm:

Wildthinks 05-17-2003 01:08 PM

I'm to stupid...

That what i get after insert the code. .... in functions...
Quote:

Parse error: parse error in /homepages/22/d65974721/htdocs/vb/index.php(463) : eval()'d code on line 1

Parse error: parse error in /homepages/22/d65974721/htdocs/vb/index.php(550) : eval()'d code on line 1

Parse error: parse error in /homepages/22/d65974721/htdocs/vb/index.php(571) : eval()'d code on line 1

Parse error: parse error in /homepages/22/d65974721/htdocs/vb/index.php(571) : eval()'d code on line 1

Parse error: parse error in /homepages/22/d65974721/htdocs/vb/index.php(571) : eval()'d code on line 1

Parse error: parse error in /homepages/22/d65974721/htdocs/vb/index.php(571) : eval()'d code on line 1

Parse error: parse error in /homepages/22/d65974721/htdocs/vb/index.php(571) : eval()'d code on line 1
Any hints for me?

filburt1 05-17-2003 01:31 PM

Quote:

05-14-03 at 06:09 PM cirisme said this in Post #23
It doesn't work. :(

PHP code goes through (somewhat) unparsed. I can say:
[code]<? if ($post[usergroupid] != 5) {
$var = "..."
}
?>

And it would show up as...

Code:

<? if (6 != 5) {
$var = "..."
}

With the 6 being the correct usergroup id. :ermm:

Are you sure you installed it correctly? In what template are you using that code?

Katana Myronson 05-18-2003 03:47 AM

FILBURT I LOVE YOU!!!

*cliks install*

(Yes i know i spelt click wrong i spelt it that way on purpose ;))

mossyuk 05-19-2003 02:18 PM

Im getting the page full of Parse error's as well. Running 2.2.7 if thats making any differance?

cirisme 05-19-2003 04:37 PM

Quote:

05-17-03 at 08:31 AM filburt1 said this in Post #25
Are you sure you installed it correctly? In what template are you using that code?
Yes, I triple checked it and it doesn't work. :( That was in postbit, but I've tried it in the header as well.

gmarik 05-21-2003 02:00 PM

Quote:

05-12-03 at 02:04 AM filburt1 said this in Post #15
Pseudo-code of what it does:

1. Find every occurance of <? and ?> (and what's inbetween them)
2. For each occurance, make every variable within in the global scope, and then eval what's in the occurance
3. Remove the original occurances from the template.


What do you mean by point 2?
No php working for me. The require function just hangs on the IE browser. Can you fix that, fil?

filburt1 05-21-2003 03:15 PM

What is the exact code you're using?


All times are GMT. The time now is 11:55 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.01062 seconds
  • Memory Usage 1,739KB
  • 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_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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