Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Dedicated server web hosting provided by Guru-host.eu.
Plug In Help

 
Post new topic   Reply to topic    Smarty Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
enginemike
Smarty Regular


Joined: 28 Feb 2006
Posts: 51

PostPosted: Thu Nov 12, 2009 7:00 pm    Post subject: Plug In Help Reply with quote

Hello

I've developed a plug in that is a variation of the date function, which I am happy to share if anyone wants it.

The problem is that one tpl program recognizes and it works great and another tpl does not know what I am talking about.

I do not understand why. I have it in the lib/plugins directory.

I am not sure what code to post.

Any help would be appreciated.

Thanks
Back to top
View user's profile Send private message
enginemike
Smarty Regular


Joined: 28 Feb 2006
Posts: 51

PostPosted: Sat Nov 14, 2009 3:33 am    Post subject: Plug In Help Reply with quote

Ok

I got it to work. Sort of. I found out by experimenting

I have the following directory structure (partial)

www in apache -> libs
castle union -> templates
libs
_admin -> templates

what I found out is that the program in _admin/templates will use the version of the function in castle union/libs and that the program in castle union/templates will use a version of the function located in the www/libs directory.

In other words the template wants to go to a libs directory two down.

I grant you maybe I am torturing the smarty system but this seems stupid.

Granted I am doing something wrong but I''ll be darned if I know what it is at this time
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 4199
Location: Hamburg / Germany

PostPosted: Sat Nov 14, 2009 11:45 am    Post subject: Reply with quote

It looks like that you have installed Smarty multiple time at different levels of your folder tree. Just have it in the root and in the scripts of your subfolder load it from there and set the templates_dir to the corresponding template folder.
Back to top
View user's profile Send private message
enginemike
Smarty Regular


Joined: 28 Feb 2006
Posts: 51

PostPosted: Sat Nov 14, 2009 5:14 pm    Post subject: Resolved - Plug In Help Reply with quote

Yes, I just figured it out.

It was a combination of shear dumb luck and taking the smarty examples as gospel rather than illustrative that the thing worked at all. If it were not for the fact that I am far too literal I would really feel dumb!

Anyway after some further reading I came to the same conclusion as you pointed out and now it works great and like I envisioned. Thanks.

By the way, my variation of html_select_date arouse from the need to extract an existing date from a database and update it as needed. However it uses javascript to work properly so maybe it does not meet the proper definition of a smarty plug in; it also gives the correct number of days for each month including February.

I realize that I am probably the 1,978th guy to invent such a thing but do you think it is worth publishing here? I'm thinking with enough eyes the thing an only get better.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Plugins All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP