To learn more about the Plugin Manager (a new 1.5.7 feature), and how to create plugins that work with it, please see
https://docs.zen-cart.com/dev/plugin...lated_plugins/
Remember, in v1.5.7 it only supports Admin plugins, not Catalog.
To learn more about the Plugin Manager (a new 1.5.7 feature), and how to create plugins that work with it, please see
https://docs.zen-cart.com/dev/plugin...lated_plugins/
Remember, in v1.5.7 it only supports Admin plugins, not Catalog.
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
What's the best way to set a file path within the zc_plugins directory pathways!
This the old path,
New path works but is hard coded,Code:$blockmail = DIR_FS_CATALOG . $emailfile;
The more I look at it, I think soft coding the version folder is all I need to fix...Code:$blockmail = DIR_FS_CATALOG . '/zc_plugins/BlockEmailManager/v1.2.0/catalog/' . $emailfile;
Dave
Always forward thinking... Lost my mind!
What happens when you use the old path ?
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
Dave
Always forward thinking... Lost my mind!
At this point the catalog-side functionality isn't fully implemented. But your use-case certainly raises an important feature. While rare, there is definitely a need to support files whose purpose is intended to be an actual endpoint for site visitors to hit. It doesn't do that yet. So in the meantime you can put the file there manually by hand or by some script.
If possible it may be beneficial to make it a .php file that acts as a handler (see other handlers in the webroot of zc core already, although I recommend much briefer, merely a proxy) to call the "actual" script located in the plugin's proper directory, which might be locatable using a global var/constant defined in the bootstrapping process (eg perhaps an extra_datafile for the plugin).
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
Hi,
As mentioned already, for v157 there is not that much support for plugins are used catalog side, that will come in v158.
Note also that code within the zc_plugin directory is protected by an .htaccess file so, can never be run directly anyway.
That said...
You can get the path to a plugin using
$pluginManager and $installedPlugins are available in the global scope, so if you want to use them in a function/class method you will need to bring them into scope.Code:$path = $pluginManager->getPluginVersionDirectory('myPluginKey', $installedPlugins)
For v158 (and we have this working already) you will be able to have URI's like
which will resolve to code within the plugin directoryCode:https://mdomain.com/index.php?cmd=someplugincode
Thanks, I figured there would be a easy way to format the path way into the folder. The files in question are simple text files storing spammer email addresses and domains. The text is created/maintained by the mod and placed at the site root for access by others seeking spam lists.
Dave
Always forward thinking... Lost my mind!
I was hoping we could override include. No such luck.![]()
https://www.php.net/manual/en/functi...e-function.php
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
Here's another bit... Will the catalog side be fully disabled when the admin side is! Or can we control some of it..
Disabling the mod in admin plugin manager hides all the admin pages for the mod but leaves it all active on the catalog side!
As an example, Testimonials manager has a submit page and of course testimonials.. Submit page is still active with no abilities to manage them on the admin side if its disabled. I added on this version a switch to disable the submit process. This also allows for testing admin for a disabled condition turning off the submit process. Leaving testimonials visible while disabling the submitting of new ones is what I was after.
page header_php.php file;
Then $tmStatus is acted on if the switch is off or admin is disabled.Code:$tm_plugin = $db->Execute("SELECT status FROM " . TABLE_PLUGIN_CONTROL . " WHERE unique_key = 'TestimonialManager'"); $tmStatus = ($tm_plugin->fields['status'] == '2') ? 'off' : TM_DISPLAY_SUBMIT;
Dave
Always forward thinking... Lost my mind!
Bookmarks