News Box Manager — for Zen Cart v1.5.8a and Later
Version 3.2.1
Current Support Thread at Zen Cart Forums: News Box Manager v3.0.0 [Support Thread]
GitHub repository: https://github.com/lat9/news_box_manager_v3
This plugin represents a restructuring of the News Box Manager -- v2.x.x for Zen Cart v1.5.x, enabling the plugin to support current Zen Cart and PHP versions.
For additional information (including integration with Sitemap XML), please refer to the plugin's online documentation.
Purpose
This plugin enables you to write news-related content for your Zen Cart store, displaying the most recent articles in sideboxes for your customers to view.
The plugin provides two side-boxes and an optional home-page center-box with an admin-level news editor to your Zen Cart. You create news articles using the tools provided, e.g. Tools :: News Box Manager [All Types], which are displayed in the side- and center-boxes (based on your chosen configuration).
Note: To include the optional center-box to your home-page, refer to this Wiki article on the plugin's GitHub repository.
News articles you write have a Start Date and End Date (which can be set to "--none--"), which determine whether or not the article is displayed to your customers. Articles are displayed if the article's status is Enabled, the Start Date is on or after the current date and the End Date is either "--none--" or on or before the current date. That way, you can write an article today that isn't displayed to your customers until sometime next week.
You can define article-specific metatags using the plugin's admin tool. Your customizations appear in an article's storefront rendering on the article
page.
Admin Interfaces
Once you have copied the admin-level files to your cart's file system, you will see two new menu items:
- Configuration :: News Box Manager [All Types], where you control the plugin's settings.
- Tools :: News Box Manager, where you write and manage your store's news articles. If you have an HTML editor installed in your admin, you can use that editor to edit/create your news articles. If you have multiple languages in your store, you can write language-specific content, too.
Note: For previous versions, this tool was located under the "Localization" menu.
Customer Interfaces
On your store-side, once you have installed and enabled the plugin there are various new elements to be shown to your customers:
- Two Latest [News Type] sideboxes. Displays the titles of the most-recent news articles, if enabled by your admin's Tools->Layout Box Controller.
- The Latest News [News Type] centerbox on your home page. Displays the release date and title of the most-recent news articles, if enabled by the setting in Configuration->News Box Manager [All Types].
- The All Articles page. Displays the full list of all active news articles.
- The Article page. Displays the contents of a selected news article.
Note: If you have defined metatags for a news-article, those entries (if not empty) will be used instead of the Zen Cart defaults when the article is viewed on the article
page.
Installation
This plugin has no core-file overwrite; you should always backup your cart's database and files prior to making any changes.
- Unzip the plugin's package file, which you've most likely already done if you're reading this!
- Rename the /YOUR_ADMIN directory to match your Zen Cart's secret admin-folder name.
- If you want to display a centerbox of news-articles on your storefront home-page, follow the instructions in this GitHub Wiki article.
- Log into your Zen Cart's admin-console.
- Copy the plugin's files to your store's file system.
- /includes/classes/observers/auto.news_box_manager_metatags.php (Added in v2.2.0)
- /includes/extra_datafiles/news_box_file_database_names.php
- /includes/languages/english/lang.all_articles.php
- /includes/languages/english/lang.article.php
- /includes/languages/english/extra_definitions/lang.news_box_manager_defines.php
- /includes/modules/news_box_format.php
- /includes/modules/pages/all_articles/header_php.php
- /includes/modules/pages/article/header_php.php
- /includes/modules/pages/more_news/header_php.php
- /includes/modules/pages/news_archive/header_php.php
- /includes/modules/pages/sitemapxml/sitemapxml_boxnews3.php (Added in v3.1.0)
- /includes/modules/sideboxes/news_box_sidebox.php
- /includes/modules/sideboxes/news_box_sidebox2.php
- /includes/templates/template_default/sideboxes/tpl_news_box_sidebox.php
- /includes/templates/template_default/templates/tpl_modules_news_box_format.php
- /includes/templates/template_default/templates/tpl_all_articles_default.php
- /includes/templates/template_default/templates/tpl_article_default.php
- /includes/templates/YOUR_TEMPLATE/css/stylesheet_news_box_manager.css
- /YOUR_ADMIN/news_box_manager.php
- /YOUR_ADMIN/news_box_manager1.php
- /YOUR_ADMIN/news_box_manager2.php
- /YOUR_ADMIN/news_box_manager3.php
- /YOUR_ADMIN/news_box_manager4.php
- /YOUR_ADMIN/includes/auto_loaders/config.news_box_manager.php
- /YOUR_ADMIN/includes/classes/observers/NewsBoxManagerAdminObserver.php
- /YOUR_ADMIN/includes/extra_datafiles/news_box_manager_file_database_names.php
- /YOUR_ADMIN/includes/extra_datafiles/news_box_manager_sanitization.php (Added in v2.1.1)
- /YOUR_ADMIN/includes/functions/news_box_manager_functions.php
- /YOUR_ADMIN/includes/init_includes/init_news_box_manager_admin.php
- /YOUR_ADMIN/includes/init_includes/news_box_manager_install.php
- /YOUR_ADMIN/includes/init_includes/news_box_manager_update.php
- /YOUR_ADMIN/includes/languages/english/lang.news_box_manager.php
- /YOUR_ADMIN/includes/languages/english/extra_definitions/lang.news_box_manager_menu_name.php
- Click the "Admin Home" link in the admin header; that will cause this plugin's initialization script to run, creating the necessary database tables and configuration items.
Go to your admin's Configuration :: News Box Manager [All Types] to view and change any settings, then to to Tools :: News Box Manager [All Types] to start writing!
Follow the instructions above if you are upgrading, too. If you've made template-override versions of the plugin's template-files, you'll need to merge your changes with any updates provided by the plugin itself.
Un-Installing
To un-install this plugin, first remove all the new files introduced by this plugin and restore the template-override file. Then open the plugin's /uninstall_news_box_manager.sql
, copy and paste the file's contents into your admin's Tools :: Install SQL Patches and click "Send". That will remove all configuration settings and plugin-specific tables from your database.
Version History
- v3.2.1, 2024-08-03:
- BUGFIX: Correct PHP 8.3 Fatal error when generating news additions to SitemapXML.
- BUGFIX: Correct article pages' breadcrumbs to include current article name.
- BUGFIX: Correct PHP error when loading admin tools' base language file for type-specific usage.
- The following files were changed:
- /includes/modules/pages/article/header_php.php
- /includes/modules/pages/sitemapxml/sitemapxml_boxnews3.php
- /YOUR_ADMIN/news_box_manager.php
- /YOUR_ADMIN/includes/init_includes/init_news_box_manager_admin.php
- v3.2.0, 2024-02-05:
- CHANGE: Updated to support zc158a (and zc200) as well as PHP 8.2/8.3.
- BUGFIX: Making See All a language constant.
- BUGFIX: Correct PHP Warning when creating new article in the admin.
- CHANGE: Add publish-date/title sort on the all_articles page.
- CHANGE: Add article-search feature to the all_articles page.
- CHANGE: Removing sample change for the home-page news centerbox.
- CHANGE: Use zen_cfg_read_only instead of trim for the plugin's version saved in configuration settings.
- The following files were changed/added/removed:
- /includes/classes/observers/auto.news_box_manager_metatags.php
- /includes/extra_datafiles/news_box_file_database_names.php
- /includes/languages/english/all_articles.php
- /includes/languages/english/article.php
- /includes/languages/english/lang.all_articles.php
- /includes/languages/english/lang.article.php
- /includes/languages/english/extra_definitions/lang.news_box_manager_defines.php
- /includes/languages/english/extra_definitions/news_box_manager_defines.php
- /includes/modules/news_box_format.php
- /includes/modules/pages/all_articles/header_php.php
- /includes/modules/pages/article/header_php.php
- /includes/modules/pages/more_news/header_php.php
- /includes/modules/pages/news_archive/header_php.php
- /includes/modules/pages/sitemapxml/sitemapxml_boxnews3.php
- /includes/modules/sideboxes/news_box_sidebox.php
- /includes/modules/sideboxes/news_box_sidebox2.php
- /includes/templates/template_default/sideboxes/tpl_news_box_sidebox.php
- /includes/templates/template_default/templates/tpl_modules_news_box_format.php
- /includes/templates/template_default/templates/tpl_all_articles_default.php
- /includes/templates/template_default/templates/tpl_article_default.php
- /includes/templates/YOUR_TEMPLATE/css/stylesheet_news_box_manager.css
- /includes/templates/YOUR_TEMPLATE/templates/tpl_index_default.php
- /YOUR_ADMIN/news_box_manager.php
- /YOUR_ADMIN/news_box_manager1.php
- /YOUR_ADMIN/news_box_manager2.php
- /YOUR_ADMIN/news_box_manager3.php
- /YOUR_ADMIN/news_box_manager4.php
- /YOUR_ADMIN/includes/auto_loaders/config.news_box_manager.php
- /YOUR_ADMIN/includes/classes/observers/NewsBoxManagerAdminObserver.php
- /YOUR_ADMIN/includes/extra_datafiles/news_box_manager_file_database_names.php
- /YOUR_ADMIN/includes/extra_datafiles/news_box_manager_sanitization.php
- /YOUR_ADMIN/includes/functions/news_box_manager_functions.php
- /YOUR_ADMIN/includes/init_includes/init_news_box_manager_admin.php
- /YOUR_ADMIN/includes/init_includes/news_box_manager_install.php
- /YOUR_ADMIN/includes/init_includes/news_box_manager_update.php
- /YOUR_ADMIN/includes/languages/english/lang.news_box_manager.php
- /YOUR_ADMIN/includes/languages/english/news_box_manager.php
- /YOUR_ADMIN/includes/languages/english/extra_definitions/lang.news_box_manager_menu_name.php
- /YOUR_ADMIN/includes/languages/english/extra_definitions/news_box_manager_menu_name.php
- v3.1.1, 2021-05-27:
- BUGFIX: Clean-up multi-use sidebox/centerbox variables so that they don't affect follow-on display.
- BUGFIX: Correct MySQL fatal error when Home Page Display Mode is 'Categories' on strict MySQL installations.
- BUGFIX: No description included when sidebox is configured to use "GridTitleDateDesc" formatting.
- The following files were changed:
- /includes/modules/news_box_format.php
- /includes/modules/sideboxes/news_box_sidebox.php
- /includes/templates/template_default/sideboxes/tpl_news_box_sidebox.php
- /YOUR_ADMIN/includes/init_includes/init_news_box_manager_admin.php
- v3.1.0, 2021-01-22:
- CHANGE: Add Sitemap XML integration.
- The following files were changed or added:
- /includes/modules/pages/sitemapxml/sitemapxml_boxnews3.php
- /YOUR_ADMIN/includes/init_includes/init_news_box_manager_admin.php
- v3.0.5, 2020-07-02:
- ZC-157: Need to declare variable as 'global' due to change in "extra_definitions" loading in the admin.
- BUGFIX: Correct PHP duplicate constant notice.
- ZC-157: Use in-script CSS styles for action icons (since that styling was removed from the zc157 distribution).
- BUGFIX: Individual article title overwritten, if news-sidebox is on the left-hand side.
- The following files were changed:
- /includes/templates/template_default/sideboxes/tpl_news_box_sidebox.php
- /YOUR_ADMIN/news_box_manager.php
- /YOUR_ADMIN/includes/languages/english/news_box_manager.php
- /YOUR_ADMIN/includes/languages/english/extra_definitions/news_box_manager_menu_name.php
- /YOUR_ADMIN/includes/init_includes/init_news_box_manager_admin.php
- v3.0.4, 2020-03-29:
- BUGFIX: Correct MySQL "Invalid datetime value." error on installation/upgrade (MySQL 5.7 interoperation).
- The following files were changed:
- /YOUR_ADMIN/includes/init_includes/init_news_box_manager_admin.php
- /YOUR_ADMIN/includes/init_includes/news_box_manager_update.php
- v3.0.3a, 2020-03-15:
- BUGFIX: (Documentation only) Correct distributed file list (again!). Also removes unused file from the distribution.
- v3.0.3, 2020-03-02:
- BUGFIX: PHP missing-constant warning when updating a specific article type in the admin.
- The following files were changed:
- /YOUR_ADMIN/news_box_manager.php
- /YOUR_ADMIN/includes/init_includes/init_news_box_manager_admin.php
- v3.0.2a, 2020-02-29:
- BUGFIX: (Documentation only), correct file-list in installation instructions.
- v3.0.2, 2020-02-12:
- BUGFIX: Correct constant name used on 'article' page when the requested article is not found.
- The following files were changed:
- /includes/modules/pages/article/header_php.php
- /YOUR_ADMIN/includes/init_includes/init_news_box_manager_admin.php
- v3.0.1, 2019-11-19:
- BUGFIX: Correct mismatched parens on
news_archive
redirect.
- BUGFIX: Correct MySQL error on initial plugin install.
- The following files were changed:
- /includes/modules/pages/news_archive/header_php.php
- /YOUR_ADMIN/includes/init_includes/init_news_box_manager_admin.php
- /YOUR_ADMIN/includes/init_includes/news_box_manager_install.php
- v3.0.0, 2019-10-28:
- CHANGE: Totally restructured for continued operation for Zen Carts v1.5.6 and later.
- The following files were changed/added/removed:
- /includes/classes/observers/auto.news_box_manager_metatags.php (Added in v2.2.0)
- /includes/extra_datafiles/news_box_manager_file_database_names.php
- /includes/languages/english/all_articles.php
- /includes/languages/english/article.php
- /includes/languages/english/more_news.php
- /includes/languages/english/news_archive.php
- /includes/languages/english/extra_definitions/news_box_manager_defines.php
- /includes/languages/german/more_news.php
- /includes/languages/german/news_archive.php
- /includes/languages/german/extra_definitions/news_box_manager_defines.php
- /includes/modules/news_box_format.php
- /includes/modules/pages/all_articles/header_php.php
- /includes/modules/pages/article/header_php.php
- /includes/modules/pages/more_news/header_php.php
- /includes/modules/pages/news_archive/header_php.php
- /includes/modules/sideboxes/news_box_sidebox.php
- /includes/modules/sideboxes/news_box_sidebox2.php
- /includes/templates/template_default/sideboxes/tpl_news_box_sidebox.php
- /includes/templates/template_default/templates/tpl_all_articles_default.php
- /includes/templates/template_default/templates/tpl_article_default.php
- /includes/templates/template_default/templates/tpl_modules_news_box_format.php
- /includes/templates/template_default/templates/tpl_more_news_default.php
- /includes/templates/template_default/templates/tpl_news_archive.php
- /includes/templates/YOUR_TEMPLATE/css/stylesheet_news_box_manager.css
- /includes/templates/YOUR_TEMPLATE/jscript/jscript_sidebox_slider.js
- /includes/templates/YOUR_TEMPLATE/templates/tpl_index_default.php
- /YOUR_ADMIN/news_box_manager.php
- /YOUR_ADMIN/news_box_manager1.php
- /YOUR_ADMIN/news_box_manager2.php
- /YOUR_ADMIN/news_box_manager3.php
- /YOUR_ADMIN/news_box_manager4.php
- /YOUR_ADMIN/includes/auto_loaders/config.news_box_manager.php
- /YOUR_ADMIN/includes/extra_datafiles/news_box_manager_file_database_names.php
- /YOUR_ADMIN/includes/extra_datafiles/news_box_manager_sanitization.php
- /YOUR_ADMIN/includes/functions/news_box_manager_functions.php
- /YOUR_ADMIN/includes/init_includes/init_news_box_manager_admin.php
- /YOUR_ADMIN/includes/init_includes/news_box_manager_install.php
- /YOUR_ADMIN/includes/init_includes/news_box_manager_update.php
- /YOUR_ADMIN/includes/languages/english/news_box_manager.php
- /YOUR_ADMIN/includes/languages/english/extra_definitions/news_box_manager_menu_name.php
- /YOUR_ADMIN/includes/languages/german/news_box_manager.php
- /YOUR_ADMIN/includes/languages/german/extra_definitions/news_box_manager_menu_name.php
- v2.2.1, 2019-04-22:
- BUGFIX: Correct initial-install issue introduced in v2.2.0 (missing meta-tags fields).
- BUGFIX: Correct unwanted <br />'s added on
more_news
page.
- The following files were changed:
- /includes/modules/pages/more_news/header_php.php
- /YOUR_ADMIN/init_includes/init_news_box_manager_admin.php
- v2.2.0, 2018-09-17:
- BUGFIX: Dates stored as
0000-00-00
; need correction for more recent versions of MySQL.
- CHANGE: Updates to include article-specific metatag definitions.
- The following files were changed/added:
- /includes/classes/observers/auto.news_box_manager_metatags.php
- /includes/modules/news_box_format.php
- /includes/modules/pages/more_news/header_php.php
- /includes/modules/sideboxes/news_box_sidebox.php
- /includes/templates/template_default/templates/tpl_more_news_default.php
- /YOUR_ADMIN/news_box_manager.php
- /YOUR_ADMIN/init_includes/init_news_box_manager_admin.php
- /YOUR_ADMIN/languages/english/news_box_manager.php
- /YOUR_ADMIN/languages/english/extra_definitions/news_box_manager_menu_name.php
- uninstall_news_box_manager.sql
- v2.1.1, 2016-10-12:
- BUGFIX: Additional "sanitization" needed for Zen Cart 1.5.5 and later.
- The following files were changed/added:
- /YOUR_ADMIN/news_box_manager.php
- /YOUR_ADMIN/includes/extra_datafiles/news_box_manager_sanitization.php
- v2.1.0, 2015-03-31:
- BUGFIX: Correct messaging and article-replication issues within the admin tool after an error is detected during an article's save action.
- BUGFIX: Pick up previously-missed change to the store-side language file.
- CHANGE: Add configuration switches to allow some, all or none of an article's content to be displayed in the home-page center-box and the "News Archive" page.
- The following files were changed:
- /includes/languages/english/extra_definitions/news_box_manager_defines.php
- /includes/modules/news_box_format.php
- /includes/modules/pages/news_archive/header_php.php
- /includes/templates/template_default/templates/tpl_modules_news_box_format.php
- /includes/templates/template_default/templates/tpl_news_archive.php
- /YOUR_ADMIN/news_box_manager.php
- /YOUR_ADMIN/includes/init_includes/init_news_box_manager_admin.php
- v2.0.0, 2015-03-03:
- Initial release for Zen Cart v1.5.1 through v1.5.4.