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)
-   -   Any Smarty Programmers Around? (https://gfy.com/showthread.php?t=821045)

Big_D 04-10-2008 04:09 AM

Any Smarty Programmers Around?
 
got a question guys if you got the time. Trying to include a html file into a NATS (smarty) template. I tried the usual

{include} {/include}

still doesnt seem to work. any ideas?

Thurbs 04-10-2008 04:13 AM

try {literal}{/literal} around the regular include.

- thurbs

jimb 04-10-2008 04:25 AM

http://www.smarty.net/manual/en/lang...on.include.php

{include file='page_footer.tpl'}

Did you try it like that above?

Jim

Thurbs 04-10-2008 04:33 AM

Quote:

Originally Posted by jimb (Post 14050495)
http://www.smarty.net/manual/en/lang...on.include.php

{include file='page_footer.tpl'}

Did you try it like that above?

Jim

nice Jim - the true pimpness of nats

k0nr4d 04-10-2008 04:46 AM

Smarty in NATS has including disabled. {include file='page_footer.tpl'} will not work.
You need to use a smarty plugin. Hit up TheDoc, i wrote one for him some time ago.

jimb 04-10-2008 06:00 AM

Quote:

Originally Posted by k0nr4d (Post 14050542)
Smarty in NATS has including disabled. {include file='page_footer.tpl'} will not work.
You need to use a smarty plugin. Hit up TheDoc, i wrote one for him some time ago.

Yeah your right,

Here's what someone would need to do if they wanted the custom plugin function:

Goto your nats/smarty-2.6.18/libs/plugins (or whatever version of smarty you have) and create a file called: function.fileinc.php then enter this into the file:

<?php
function smarty_function_fileinc($params)
{ include($params['file']); }
?>

After that file is created and the code inserted, you can use this smarty tag on any of the NATS Templates:
{fileinc file="path/to/file"}

Hope this helps everyone, and people in the future :)

Jim

Big_D 04-10-2008 06:03 AM

nailed it,

thanks for the guidance on writing the plugin jim!


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

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