Welcome, Guest. Please Login or Register.
June 17, 2024, 02:13:49 PM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  English User Help  |  English Help  |  Parsing PHP in template.html « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Parsing PHP in template.html  (Read 988 times)
mattward2k
Guest
Parsing PHP in template.html
« on: December 22, 2001, 10:07:54 PM »
Reply with quote

YaBB 1 Gold was brill - but combine it with PHP and its amazing. (There ain't anything better than PHP and mySQL combined). What I wanna know is - I've got loads of PHP I wanna parse in the main template, but how do I do it? Simply typing in PHP commands in template.html seems to do nothing...
Logged
PHPlugin
Sr. Member
****
Posts: 465


WWW
Re:Parsing PHP in template.html
« Reply #1 on: December 23, 2001, 10:48:15 PM »
Reply with quote

yeah cause its an html not an php file!

Im asking me why they dont use a template.php?
 ???
Logged
Dave Smulders
YaBB SE Developer
YaBB God
*****
Posts: 608


WWW
Re:Parsing PHP in template.html
« Reply #2 on: December 24, 2001, 12:44:36 AM »
Reply with quote

Why do you need it?

You can make your own <yabb something> tags, and have a function called on that spot.
Then you can have the function to include php files.

See this post from Joseph for details:
http://www.yabb.info/community/index.php?board=134;action=display;threadid=2518
Logged

mattward2k
Guest
Re: Parsing PHP in template.html
« Reply #3 on: December 24, 2001, 10:35:02 AM »
Reply with quote

Because having it would make life a lot simpler, and since the whole thing works on PHP there must be a way of getting it to parse it in template.html. The Subs.php thing is a solution but a drawn out and difficult one...what if I just want to print the persons username, or include several files? Things like if() statements can't be possible, and if they are, they must be a nightmare because you have to plan everything in the yyMyFunction() statement in advance.
Logged
alexrolko
Guest
Re:Parsing PHP in template.html
« Reply #4 on: December 24, 2001, 06:15:27 PM »
Reply with quote

You've answered your won question why you cant use <?PHP?> tags in the template, is beacause YaBB parses the template, not PHP.

PHP parses YaBB to parse the template.

Anyway Joseph explained it:
QuoteA final note is that the function captures the output of your program - not the return value.  So all you need to do is print or echo what you want to display - and it'll be captured and inserted at the right spot.

so you have your own script, say your own poll, and all u have to do is just a print(), echo() for variables or a require(), require_once(), include() you know them all use the right one.
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  English User Help  |  English Help  |  Parsing PHP in template.html « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.073 seconds with 21 queries.