Support Forums

Old 03-12-2008, 08:46 AM   #1
Member
 
marketingsolutions's Avatar
 
Join Date: Sep 2006
Location: Ilfracombe - England
Posts: 58
Rep Power: 12
marketingsolutions is on a distinguished road
Send a message via Skype? to marketingsolutions
Default Module smarty plugins are not available

Hi All

I have been commisioned to create a simple module for 68, allowing ONLY administrators to be able to create and manage advertising banners.

Everything is working as it should be bar one thing - in Module Requirements it states that "...The plugins directory is the place for Smarty plugins.."

Having placed my custom plugin into this directory, the front site load fails, because it cannot find the plugin to use {getadvert location="1"}.

Without dropping the plugin directly into the includes/classes/smarty/plugins directory, how do i get the template engine to see the modules plugin dir?

The only place i can find that seems to specifiy how additional plugin dirs are included in in includes/classes/kernal/Template.php, and the class constructor can take an additional parameter called module, which then goes on to check in the modules dir for available plugin dirs. (lines 67 - 71)

But since there is only one instance of the template class, and it doesnt take the module name param during the init, then Smarty cannot know about my modules/adme/plugins directory.

Has anyone else noticed this problem, or am I missing something that loads the plugin dir into Smarty?

I would appreciate any comments or help on this as I have come to a complete stand still!

Regards

Ben
marketingsolutions is offline   Reply With Quote
Old 03-12-2008, 08:59 AM   #2
68 Classifieds Staff
 
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 4,776
Rep Power: 110
Eric Barnes is a jewel in the rough
Default

I would have to double check this. But I believe the module/plugin directory is only called when viewing the index.php or admin.php file within the module.
__________________
Eric Barnes
68 Classifieds Developer
Please do not send me a private message asking for support. Instead use these open forums or our ticket system.

Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 03-12-2008, 09:16 AM   #3
Member
 
marketingsolutions's Avatar
 
Join Date: Sep 2006
Location: Ilfracombe - England
Posts: 58
Rep Power: 12
marketingsolutions is on a distinguished road
Send a message via Skype? to marketingsolutions
Default I found a hack to fix it...

Hi again

Please disregard the last post.

I have added a small check at the start of the load in the admin area that tests for the existance of the plugin in the smarty/plugins dir and if it does not find the file then it copies the plugin into the dir thus:

Code:
$testforplugin = '../includes/classes/smarty/plugins/function.getadvert.php';
$sourcepath = '../modules/adme/plugins/function.getadvert.php';
$destinationpath = '../includes/classes/smarty/plugins/function.getadvert.php';
if(!file_exists($testforplugin)){
	if(!copy($sourcepath,$destinationpath)){
		die("Could not copy the required plugin to $destinationpath");
	}
}
Thank you for your extremely quick response, keep up the good work!

PS: If you can see any problems with the solution i have come up with please let me know!

Ben

Last edited by marketingsolutions; 03-12-2008 at 09:18 AM.
marketingsolutions is offline   Reply With Quote
Old 03-12-2008, 09:33 AM   #4
68 Classifieds Staff
 
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 4,776
Rep Power: 110
Eric Barnes is a jewel in the rough
Default

Ben,

I don't see any issues right off with doing that. Actually pretty nice outside the box thinking.
__________________
Eric Barnes
68 Classifieds Developer
Please do not send me a private message asking for support. Instead use these open forums or our ticket system.

Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Smarty Templates and You. Posted BY Lhotch Eric Barnes HTML, CSS, and Design Help 13 10-02-2007 08:06 AM


All times are GMT -4. The time now is 09:37 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0