Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 07-11-2006, 07:35 PM   #1
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
How I can add in a php include into a TPL template file?

because it is a template file it won't allow me to insert the php include directly into it

someone told me I could create a call function and place the php include into the config files and call that function from the config files

how do I do that?
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-11-2006, 07:40 PM   #2
jwerd
Confirmed User
 
Industry Role:
Join Date: Jun 2003
Location: Costa Rica
Posts: 1,953
The simplest way I would think is (apache only example) to just have your server parse php within .tpl extensions. I'm not sure the directive offhand, but if you search around, you'll find what you are looking for!

Goodluck
__________________
Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com
jwerd is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-11-2006, 08:32 PM   #3
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,197
Quote:
Originally Posted by Jace
because it is a template file it won't allow me to insert the php include directly into it

someone told me I could create a call function and place the php include into the config files and call that function from the config files

how do I do that?
I usually do the logic in the php program calling the tpl file and then just include it as a tag.

The apache directive would be an addtype but because the tpl files are not usually called directly, they are used by the php program to format the output, that will probably not work.
__________________
All cookies cleared!

Last edited by sarettah; 07-11-2006 at 08:34 PM..
sarettah is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-11-2006, 08:37 PM   #4
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,197
Also, the best way to do it can depend on the system using the tpl file. In smarty templates, you can do a certain amount of logic within the template itself. In something like phpBB it is usually just tags that are filled in without logic within the template.

So, if you told me what you are trying to do with what kind of system it might help
__________________
All cookies cleared!

Last edited by sarettah; 07-11-2006 at 08:38 PM..
sarettah is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-11-2006, 08:40 PM   #5
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
Quote:
Originally Posted by sarettah
Also, the best way to do it can depend on the system using the tpl file. In smarty templates, you can do a certain amount of logic within the template itself. In something like phpBB it is usually just tags that are filled in without logic within the template.

So, if you told me what you are trying to do with what kind of system it might help
it is a smarty run site

esyndicat is the script
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-11-2006, 08:51 PM   #6
Serge Litehead
Confirmed User
 
Serge Litehead's Avatar
 
Industry Role:
Join Date: Dec 2002
Location: Behind the scenes
Posts: 5,190
Why can't you use include before calling tpl?

offsubject, smarty is great! i'm loving it
__________________
Serge Litehead is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-11-2006, 09:18 PM   #7
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,197
Quote:
Originally Posted by Jace
it is a smarty run site

esyndicat is the script

Good icq session...lol. Glad we got it working. Yeah smarty is pretty easy to work with.
__________________
All cookies cleared!
sarettah is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-11-2006, 09:19 PM   #8
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,197
Quote:
Originally Posted by holograph
Why can't you use include before calling tpl?

offsubject, smarty is great! i'm loving it

You could do that and just suck it into a tag but we just used a smarty include {include file="jdjdjdj"} It did the trick
__________________
All cookies cleared!
sarettah is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-11-2006, 09:22 PM   #9
Serge Litehead
Confirmed User
 
Serge Litehead's Avatar
 
Industry Role:
Join Date: Dec 2002
Location: Behind the scenes
Posts: 5,190
cool it worked out that way =)
__________________
Serge Litehead is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-11-2006, 09:32 PM   #10
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
thanks so much sarettah, that worked perfectly....you rock as usual!
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.