Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

custom plugin not working

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


Joined: 22 Jun 2006
Posts: 3
Location: New Jersey , USA

PostPosted: Thu Jun 22, 2006 2:16 pm    Post subject: custom plugin not working Reply with quote

i am tring to use custom plugins. the fckeditor is one of them. now at the risk of sounding like an newbie ass i need help getting the to work.
i am setting the plugins_dir
array_unshift($t->plugins_dir, dirname(__FILE__).'/smarty/plugins') ;

including the file
include (dirname(__FILE__).'/smarty/plugins/function.fckeditor.php');

and registering it
$t->register_function('fckeditor', 'fckeditor');

When i run the template no error just a blank area where the editor should be.
what am i doing wrong.
Thanks
Todd
Back to top
View user's profile Send private message
my_elygen
Smarty n00b


Joined: 22 Jun 2006
Posts: 3
Location: New Jersey , USA

PostPosted: Mon Jun 26, 2006 5:17 pm    Post subject: ? Reply with quote

is it a stupid question?
Back to top
View user's profile Send private message
TGKnIght
Smarty Junkie


Joined: 07 Sep 2005
Posts: 580
Location: Philadelphia, PA

PostPosted: Mon Jun 26, 2006 5:27 pm    Post subject: Reply with quote

You don't need to include your plugins if you are putting them in the plugins directory... They will be auto-included as long as they can be found in the $smarty->plugins_dir variable.

Regarding how you set your plugins directory.. It looks correct if you want to make your custom plugins_dir the first to be searched instead of the one located off the smarty class directory.

what is "dirname(__FILE__).'/smarty/plugins'" ?

Is this your custom directory or are you simply pointing back to the one located in the same directory as your smarty.class.php??
_________________
Smarty site with one index.php controller file
Working with MySQL and Smarty
SmartyColumnSort
Custom Smarty Javascript Debug Template
Back to top
View user's profile Send private message Visit poster's website
my_elygen
Smarty n00b


Joined: 22 Jun 2006
Posts: 3
Location: New Jersey , USA

PostPosted: Mon Jun 26, 2006 7:04 pm    Post subject: Reply with quote

i used what is "dirname(__FILE__).'/smarty/plugins'" because i put a plugins directory in the rootfolder>smarty>plugins just for testing. i originally put the plugin in the directory with the rest of the plug-ins that came with smarty.

From what i've read i assumed the plugins autoloaded but since it was not working i tried to include them. i assumed with it in both directory and both being called it would have to work, but apparently i was wrong.
there are no errors but the fckeditor does not display anything.

It should work this way (correct me if im wrong) with the fckeditor (or any plugin) if i put it in the plugins directory. then i just have to call {fckeditor ....} in the template and this should just then display. Or is there an _init i have to add
Back to top
View user's profile Send private message
mjs
Smarty Rookie


Joined: 13 May 2006
Posts: 9
Location: Lithuania, Vilnius

PostPosted: Fri Aug 04, 2006 1:17 pm    Post subject: Reply with quote

Same problem I have... I got just blank page... with code:
Code:
{fckeditor BasePath="/modules/fckeditor/" InstanceName="test" Width="650px" Height="300px"}
and if I deleting that string everything works fine....

Where is the problem?
Back to top
View user's profile Send private message Visit poster's website
mjs
Smarty Rookie


Joined: 13 May 2006
Posts: 9
Location: Lithuania, Vilnius

PostPosted: Fri Aug 04, 2006 2:13 pm    Post subject: Reply with quote

LOL Embarassed

function.fckeditor.php file was not in right plugins directory...

It must be here:
{smarty_dir}/libs/plugins/function.fckeditor.php
Back to top
View user's profile Send private message Visit poster's website
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