vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   PHPInclude Variables in Formbit Templates (https://vborg.vbsupport.ru/showthread.php?t=53137)

gmarik 05-21-2003 01:56 PM

Guys, how can I include php in every template I need?
I mean require and so on. Tried a hack called PHP Embed - it does not works for me. Sos!

filburt1 05-21-2003 03:04 PM

Please start your own thread, don't hijack somebody else's...

Boeman 05-22-2003 03:17 AM

Quote:

Yesterday at 01:47 PM Logician said this in Post #20
ok before Xenon gets angry let's listen to him: :glasses: So edit index.php, find:

PHP Code:

global $bbforumview

After that add:
PHP Code:

global $testing


As per your instructions (and Xenon's) I was able to display some text using the variable. Thank you both.

With the usefulness of the simple example now past, I attempted to add in some php code in the phpinclude template but it seems I pushed my luck a bit too far. It was a basic count script to display TESTING 123 three times:

$testing =

($i = 0; $i < 3) {

echo "TESTING 123"

}

I know this breaks the no echo rule for phpinclude but what would be a way to incorporate external php in this manner?

Thanks again.

Xenon 05-22-2003 01:55 PM

that is no valid php code here.

You should really learn to code php correctly before trying to hack vb.
There are good books out to learn the basics of php, you won't get it by just try and whenever there is an error ask here...

Boeman 05-22-2003 02:13 PM

Quote:

Today at 03:55 PM Xenon said this in Post #24
that is no valid php code here.

You should really learn to code php correctly before trying to hack vb.
There are good books out to learn the basics of php, you won't get it by just try and whenever there is an error ask here...


I have written some php code on an external file that DOES WORK. My only problem here as I see it, is that I'm having difficulties implementing it within formbit templates. I have created similar variables all linked to other php files within phpinclude which work correctly on the header and footer templates. Formbit, as I'm lead to believed, works differently and that is now my only hurdle.

No, I'm certainly no expert in PHP, but little examples are all the push I need here.

Thanks in advance.

Xenon 05-22-2003 02:17 PM

PHP Code:

$testing =

(
$i 0$i 3) {

echo 
"TESTING 123"



this code has more than one error in just 4 lines, so don't tell me that would work somewhere else.

to write valid php it should look somehow like that:

PHP Code:

for ($i 0$i 3$i++) {

echo 
"TESTING 123";




Boeman 05-22-2003 02:38 PM

Quote:

Today at 04:17 PM Xenon said this in Post #26
PHP Code:

$testing =

(
$i 0$i 3) {

echo 
"TESTING 123"



this code has more than one error in just 4 lines, so don't tell me that would work somewhere else.

to write valid php it should look somehow like that:

PHP Code:

for ($i 0$i 3$i++) {

echo 
"TESTING 123";




I wasn't actually referring to that block of code in my last post but nonetheless, it still doesn't work in phpinclude. How do you get that to work correctly in phpinclude so I can use it in formbit templates?

Boeman 05-26-2003 09:38 PM

bump


All times are GMT. The time now is 05: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.01084 seconds
  • Memory Usage 1,749KB
  • 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
  • (6)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete