GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   How I can add in a php include into a TPL template file? (https://gfy.com/showthread.php?t=632271)

Jace 07-11-2006 07:35 PM

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?

jwerd 07-11-2006 07:40 PM

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

sarettah 07-11-2006 08:32 PM

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.

sarettah 07-11-2006 08:37 PM

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 :)

Jace 07-11-2006 08:40 PM

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

Serge Litehead 07-11-2006 08:51 PM

Why can't you use include before calling tpl?

offsubject, smarty is great! i'm loving it :)

sarettah 07-11-2006 09:18 PM

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.

sarettah 07-11-2006 09:19 PM

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

Serge Litehead 07-11-2006 09:22 PM

cool it worked out that way =)

Jace 07-11-2006 09:32 PM

thanks so much sarettah, that worked perfectly....you rock as usual!


All times are GMT -7. The time now is 06:03 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123