Forums / All Other Contributions/Addons / News Box Manager v3.0.0 [Support Thread]

News Box Manager v3.0.0 [Support Thread]

Views: 31,831

Results 21 to 40 of 164
29 Feb 2020, 3:17 AM
#21
gernot avatar

gernot

Zen Follower

Join Date:
Feb 2017
Location:
Tokyo, Japan
Posts:
334
Plugin Contributions:
0

News Box Manager v3.0.0 [Support Thread]

Hello,
I've tried to install this add-on, v3.0.2, for the first time on my test site, hopefully according to the instructions (I did not have a tpl_index_default.php file yet, so all the files in the add-on could be copied as-is, I merely ensured they had correct ownership and permissions on my linux system).

The problem is that the DB initialization did not seem to work, so although the Admin menus for the add-on all appear fine, and I have the ability to create articles, which I did: a single Type 1 article in both English and Japanese (my two site languages). Unfortunately, when I activate the sidebox for New Type 1 in order to actually display on storefront, I get a "An error appeared, please refresh page" type of error in the location where the sidebox should appear.

Interestingly, no debug log is produced. However, when I set strict debugging, the on-page warning turns into the very clear indication that the DB tables were not created as expected:

1146 Table 'zencartshoptest.TABLE_BOX_NEWS_CONTENT' doesn't exist
in:
[SELECT nc.news_title, nc.news_content, n.* FROM TABLE_BOX_NEWS_CONTENT nc INNER JOIN TABLE_BOX_NEWS n ON n.box_news_id = nc.box_news_id AND nc.languages_id = 3 WHERE n.news_status = 1 AND now() >= n.news_start_date AND (n.news_end_date IS NULL OR now() <= n.news_end_date) ORDER BY n.news_start_date DESC, n.box_news_id DESC LIMIT 5]
```Obviously, something went wrong, but I am unsure what best to do to fix the situation.
I also noticed that there was a file in the add-on not listed in the HTML instructions:

YOUR_ADMIN/includes/classes/observers/NewsBoxManagerAdminObserver.php


Any other information required, please ask. I will wait before uninstalling and trying to re-install.

Zen Cart 1.5.6c modified for Japanese language support. Upgraded incrementally from initial 1.5.5d. Currently planning direct upgrade to 2.1.0

29 Feb 2020, 7:16 AM
#22
gernot avatar

gernot

Zen Follower

Join Date:
Feb 2017
Location:
Tokyo, Japan
Posts:
334
Plugin Contributions:
0

Re: News Box Manager v3.0.0 [Support Thread]

Hi lat9,
I did a comparison of the files described in the docs folder of the add-on for News Box Manager v3.0.2, and what files are actually included.
I think the main problem might be an incorrectly-named definition file? Not sure about the mismatch of the various files, so will wait for confirmation.

As listed in docs
(I marked as OK if the described files were actually there)
OK: /includes/classes/observers/auto.news_box_manager_metatags.php
Does not exist---wrong Name?: /includes/extra_datafiles/news_box_manager_file_database_names.php
OK: /includes/languages/english/all_articles.php
OK: /includes/languages/english/article.php
OK: /includes/languages/english/extra_definitions/news_box_manager_defines.php
OK: /includes/modules/news_box_format.php
OK: /includes/modules/pages/all_articles/header_php.php
OK: /includes/modules/pages/article/header_php.php
OK: /includes/modules/pages/more_news/header_php.php
OK: /includes/modules/pages/news_archive/header_php.php
OK: /includes/modules/sideboxes/news_box_sidebox.php
OK: /includes/templates/template_default/sideboxes/tpl_news_box_sidebox.php
Does not exist: /includes/templates/template_default/sideboxes/tpl_news_box_sidebox2.php
OK: /includes/templates/template_default/templates/tpl_modules_news_box_format.php
OK: /includes/templates/template_default/templates/tpl_all_articles_default.php
OK: /includes/templates/template_default/templates/tpl_article.php
OK: /includes/templates/YOUR_TEMPLATE/css/stylesheet_news_box_manager.css
OK: /includes/templates/YOUR_TEMPLATE/templates/tpl_index_default.php
OK: /YOUR_ADMIN/news_box_manager.php
OK: /YOUR_ADMIN/includes/auto_loaders/config.news_box_manager.php
OK: /YOUR_ADMIN/includes/extra_datafiles/news_box_manager_file_database_names.php
OK: /YOUR_ADMIN/includes/extra_datafiles/news_box_manager_sanitization.php
OK: /YOUR_ADMIN/includes/init_includes/init_news_box_manager_admin.php
OK: /YOUR_ADMIN/includes/languages/english/news_box_manager.php
OK: /YOUR_ADMIN/includes/languages/english/extra_definitions/news_box_manager_menu_name.php

Files existing but not described in docs:
/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/classes/observers/NewsBoxManagerAdminObserver.php
/YOUR_ADMIN/includes/functions/news_box_manager_functions.php
/YOUR_ADMIN/includes/init_includes/init_news_box_manager_install.pph
/YOUR_ADMIN/includes/init_includes/init_news_box_manager_update.php
Possibly wrong name?: /includes/extra_datafiles/news_box_file_database_names.php
/includes/modules/sideboxes/news_box_sidebox2.php
/includes/templates/YOUR_TEMPLATE/jscript/jscript_sidebox_slider.js

Zen Cart 1.5.6c modified for Japanese language support. Upgraded incrementally from initial 1.5.5d. Currently planning direct upgrade to 2.1.0

29 Feb 2020, 2:37 PM
#23
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: News Box Manager v3.0.0 [Support Thread]

@gernot, thanks for pointing out the issues with the documentation. I'll be getting that updated.

Since there are no core-file overwrites in the plugin, you can safely copy all the files from the plugin's distribution to apply those updates.

That TABLE_BOX_NEWS_CONTENT value is defined in the admin's /extra_datafiles module.

29 Feb 2020, 3:45 PM
#24
gernot avatar

gernot

Zen Follower

Join Date:
Feb 2017
Location:
Tokyo, Japan
Posts:
334
Plugin Contributions:
0

Re: News Box Manager v3.0.0 [Support Thread]

Hi lat9,
Can you confirm whether the extra_datafiles file has a name issue? As I wrote, I did copy all the files that were in the plugin, but the DB was not properly initialized, and I wonder if that might be caused by the file name not having the word "manager" in its name?

Zen Cart 1.5.6c modified for Japanese language support. Upgraded incrementally from initial 1.5.5d. Currently planning direct upgrade to 2.1.0

29 Feb 2020, 5:21 PM
#25
k1979 avatar

k1979

New Zenner

Join Date:
Dec 2010
Posts:
29
Plugin Contributions:
0

Re: News Box Manager v3.0.0 [Support Thread]

Hi,

Thank you for the mod, I updated from v2 to v3:smile:

I got error log as below.

PHP Warning: constant(): Couldn't find constant BOX_NEWS_NAME_TYPE in /home/****/www/admin/news_box_manager.php on line 719.

news_box_manager.php line719

<div class="col-sm-2"><?php echo constant("BOX_NEWS_NAME_TYPE$news_content_type"); ?></div>

It will be used in a preview page, if I update or add a news from [All Types], it's OK.
But if I do from [Type1] or [Type2] ,[Type*] menu, it shows nothing in the "News Type:" column.

29 Feb 2020, 6:31 PM
#26
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: News Box Manager v3.0.0 [Support Thread]

Those BOX_NEWS_NAME_TYPE[1-4] constants are provided in the distribution's storefront /includes/languages/english/extra_definitions/news_box_manager_defines.php. That file (or your template's version thereof) is used in *both *the admin and storefront processing.

Check to see if you have an older version of that file present in /includes/languages/english/extra_definitions/YOUR_TEMPLATE that doesn't have those additional defines.

29 Feb 2020, 6:32 PM
#27
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: News Box Manager v3.0.0 [Support Thread]

gernot:

Hi lat9,
Can you confirm whether the extra_datafiles file has a name issue? As I wrote, I did copy all the files that were in the plugin, but the DB was not properly initialized, and I wonder if that might be caused by the file name not having the word "manager" in its name?
It has nothing to do with the filenames, just their locations. Were there any logs generated?

1 Mar 2020, 3:52 AM
#28
k1979 avatar

k1979

New Zenner

Join Date:
Dec 2010
Posts:
29
Plugin Contributions:
0

Re: News Box Manager v3.0.0 [Support Thread]

Thank you for your reply.

My explanation was not enough.
I have removed all v2 files when I update for my test website.
I haven't changed the definition in the "news_box_manager_defines.php" yet, but I think it works because I can see the word Type1 not BOX_NEWS_NAME_TYPE1.

If I insert a news from Tools -> News Box Manager[All Types] -> Insert -> Preview, "News Type:" shows its type.
Attachment 18884

And if I insert a news from Tools -> News Box Manager[Type1(or 2,3,4)] -> Insert -> Preview, "News Type:" shows nothing and I get error log.
Attachment 18885

PHP Warning: constant(): Couldn't find constant BOX_NEWS_NAME_TYPE in /home/****/www/admin/news_box_manager.php on line 719.

I'm right in the middle of learning PHP, so if you have any suggestions please let me know.
Thank you,

1 Mar 2020, 7:48 AM
#29
gernot avatar

gernot

Zen Follower

Join Date:
Feb 2017
Location:
Tokyo, Japan
Posts:
334
Plugin Contributions:
0

Re: News Box Manager v3.0.0 [Support Thread]

Hi lat9,
No, no logs were generated, which I thought was a bit strange, but strict error checking enabled shows up the error on the screen, as I pasted in my initial post.
I have the file in the admin extra datafiles places as instructed:

test-admin# cat includes/extra_datafiles/news_box_manager_file_database_names.php 
<?php
// -----
// Part of the News Box Manager plugin, re-structured for Zen Cart v1.5.6 and later by lat9.
// Copyright (C) 2015-2019, Vinos de Frutas Tropicales
//
// +----------------------------------------------------------------------+
// | Do Not Remove: Coded for Zen-Cart by geeks4u.com                     |
// | Dedicated to Memory of Amelita "Emmy" Abordo Gelarderes              |
// +----------------------------------------------------------------------+
//
define('TABLE_BOX_NEWS', DB_PREFIX . 'box_news');
define('TABLE_BOX_NEWS_CONTENT', DB_PREFIX . 'box_news_content');

define('FILENAME_NEWS_BOX_MANAGER', 'news_box_manager');
define('FILENAME_NEWS_BOX_MANAGER1', 'news_box_manager1');
define('FILENAME_NEWS_BOX_MANAGER2', 'news_box_manager2');
define('FILENAME_NEWS_BOX_MANAGER3', 'news_box_manager3');
define('FILENAME_NEWS_BOX_MANAGER4', 'news_box_manager4');
```Both the box_news and box_news_content tables do exist apparently:

MariaDB [zencartshoptest]> desc box_news;
+--------------------+------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------------+------------+------+-----+---------------------+----------------+
| box_news_id | int(11) | NO | PRI | NULL | auto_increment |
| news_added_date | datetime | YES | | 0001-01-01 00:00:00 | |
| news_modified_date | datetime | YES | | NULL | |
| news_start_date | datetime | YES | | NULL | |
| news_end_date | datetime | YES | | NULL | |
| news_status | tinyint(1) | YES | | 0 | |
| news_content_type | tinyint(1) | NO | | 1 | |
+--------------------+------------+------+-----+---------------------+----------------+
7 rows in set (0.014 sec)

MariaDB [zencartshoptest]> desc box_news_content;
+---------------------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+--------------+------+-----+---------+-------+
| box_news_id | int(11) | NO | PRI | 0 | |
| languages_id | int(11) | NO | PRI | 1 | |
| news_title | varchar(255) | NO | | | |
| news_content | text | NO | | NULL | |
| news_metatags_title | varchar(255) | NO | | | |
| news_metatags_keywords | text | YES | | NULL | |
| news_metatags_description | text | YES | | NULL | |
+---------------------------+--------------+------+-----+---------+-------+
7 rows in set (0.001 sec)

Zen Cart 1.5.6c modified for Japanese language support. Upgraded incrementally from initial 1.5.5d. Currently planning direct upgrade to 2.1.0

1 Mar 2020, 8:02 AM
#30
gernot avatar

gernot

Zen Follower

Join Date:
Feb 2017
Location:
Tokyo, Japan
Posts:
334
Plugin Contributions:
0

Re: News Box Manager v3.0.0 [Support Thread]

lat9,
It's official: I am retarded. After you asked about logs again, I did look again, and just for, you know, dumb*ss checking, I looked at my production shop logs, and there I see error logs related to my test shop!
So of course I realize I screwed up something... turns out in the storefront includes/configure.php I had the DIR_FS_CATALOG set to my production shop.
All other defines were fine in the storefront configure, just that one was wrong. Ouch! The admin configure file was completely fine.
That explains why the admin side worked but the display did not.
So sorry for the hassle.

Remaining questions:
Are there missing files in the plugin, for sideboxes? Or is it merely the documentation that needs updating?

Zen Cart 1.5.6c modified for Japanese language support. Upgraded incrementally from initial 1.5.5d. Currently planning direct upgrade to 2.1.0

1 Mar 2020, 12:19 PM
#31
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: News Box Manager v3.0.0 [Support Thread]

gernot:

lat9,
It's official: I am retarded. After you asked about logs again, I did look again, and just for, you know, dumb*ss checking, I looked at my production shop logs, and there I see error logs related to my test shop!
So of course I realize I screwed up something... turns out in the storefront includes/configure.php I had the DIR_FS_CATALOG set to my production shop.
All other defines were fine in the storefront configure, just that one was wrong. Ouch! The admin configure file was completely fine.
That explains why the admin side worked but the display did not.
So sorry for the hassle.

Remaining questions:
Are there missing files in the plugin, for sideboxes? Or is it merely the documentation that needs updating?
It's the documentation that's incorrect; I've updated the version provided on my website. Thanks again for pointing out those omissions and "misspellings"!

2 Mar 2020, 4:39 AM
#32
gernot avatar

gernot

Zen Follower

Join Date:
Feb 2017
Location:
Tokyo, Japan
Posts:
334
Plugin Contributions:
0

Re: News Box Manager v3.0.0 [Support Thread]

Thanks lat9,
Glad some good came out of all my confusion! Happily adding the plugin to my production cart tonight.

Zen Cart 1.5.6c modified for Japanese language support. Upgraded incrementally from initial 1.5.5d. Currently planning direct upgrade to 2.1.0

2 Mar 2020, 12:44 PM
#33
k1979 avatar

k1979

New Zenner

Join Date:
Dec 2010
Posts:
29
Plugin Contributions:
0

Re: News Box Manager v3.0.0 [Support Thread]

K1979:

Thank you for your reply.

My explanation was not enough.
I have removed all v2 files when I update for my test website.
I haven't changed the definition in the "news_box_manager_defines.php" yet, but I think it works because I can see the word Type1 not BOX_NEWS_NAME_TYPE1.

If I insert a news from Tools -> News Box Manager[All Types] -> Insert -> Preview, "News Type:" shows its type.
Attachment 18884

And if I insert a news from Tools -> News Box Manager[Type1(or 2,3,4)] -> Insert -> Preview, "News Type:" shows nothing and I get error log.
Attachment 18885

PHP Warning: constant(): Couldn't find constant BOX_NEWS_NAME_TYPE in /home/****/www/admin/news_box_manager.php on line 719.

I'm right in the middle of learning PHP, so if you have any suggestions please let me know.
Thank you,

I will correct the post, when I insert a news, it's OK.
But If I modify a news from "News Box Manager[Type1(or 2,3,4)]", I got the error.

2 Mar 2020, 12:56 PM
#34
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: News Box Manager v3.0.0 [Support Thread]

K1979:

I will correct the post, when I insert a news, it's OK.
But If I modify a news from "News Box Manager[Type1(or 2,3,4)]", I got the error.
Ah, thanks for that! I've replicated on my local test site and should have a correction real-soon-now.

2 Mar 2020, 1:22 PM
#35
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: News Box Manager v3.0.0 [Support Thread]

@K1979, you can correct that issue by editing your /YOUR_ADMIN/news_box_manager.php, locating this code section (starting at line 537):

// -----
// Editing an existing article or inserting a new one ... noting that we can also come back here
// from an article's insert/update "Preview" to make changes prior to saving in the database.
//
if ($action == 'modify' || $action == 'updateedit' || $action == 'new' || $action == 'newedit') {
    if ($action == 'modify' || $action == 'updateedit') {
        $form_action = 'updatepreview' . "&nID=$nID";
        $hidden_field = zen_draw_hidden_field('nID', $nID);
        $cancel_link = zen_href_link($news_box_script_name, $page_get_params . "nID=$nID");
    } else {

and adding the highlighted line:

// -----
// Editing an existing article or inserting a new one ... noting that we can also come back here
// from an article's insert/update "Preview" to make changes prior to saving in the database.
//
if ($action == 'modify' || $action == 'updateedit' || $action == 'new' || $action == 'newedit') {
    if ($action == 'modify' || $action == 'updateedit') {
        $form_action = 'updatepreview' . "&nID=$nID";
        $hidden_field = zen_draw_hidden_field('nID', $nID);
        [B]$hidden_field .= ($all_news_types) ? '' : zen_draw_hidden_field('news_content_type', $news_box_type);[/B]
        $cancel_link = zen_href_link($news_box_script_name, $page_get_params . "nID=$nID");
    } else {

I'll be getting v3.0.3 of News Box Manager released, containing this change as well as the documentation updates identified by @gernot.

2 Mar 2020, 1:31 PM
#36
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: News Box Manager v3.0.0 [Support Thread]

v3.0.3 has been submitted to the Zen Cart moderators for review; I'll post back here once it's available for download.

2 Mar 2020, 1:37 PM
#37
k1979 avatar

k1979

New Zenner

Join Date:
Dec 2010
Posts:
29
Plugin Contributions:
0

Re: News Box Manager v3.0.0 [Support Thread]

Thank you for your very quick reply and work!
It does work well:smile:

2 Mar 2020, 3:49 PM
#38
k1979 avatar

k1979

New Zenner

Join Date:
Dec 2010
Posts:
29
Plugin Contributions:
0

Re: News Box Manager v3.0.0 [Support Thread]

Hello again,

I test some cases.

Case1
Sidebox #1: Category to Show -> 1
Sidebox #2: Category to Show -> 2
Home Page: Display Mode -> Categories
The home-page news(index page) shows category 2 only.

Case2
Sidebox #1: Category to Show -> All
Sidebox #2: Category to Show -> 2
Home Page: Display Mode -> Categories
The home-page news(index page) shows category 2 only.

Case3(changed sidebox order by "Tools->Layout Boxes Controller")
Sidebox #2: Category to Show -> 2
Sidebox #1: Category to Show -> All
Home Page: Display Mode -> Categories
**The home-page news(index page) shows all categories.
**

I will reconfirm by vanilla files later.
I have already customized some codes, so that might cause this.

3 Mar 2020, 5:04 PM
#39
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,858
Plugin Contributions:
18

Re: News Box Manager v3.0.0 [Support Thread]

More informational as we had a cpanel crash during the upgrade of NBM to 3.0.2. Not sure what version was loaded.

Got the can't connect error and no connect to admin.

Log had ```
PHP Fatal error: 1054:Unknown column 'news_content_type' in 'where clause' :: UPDATE box_news SET news_content_type = 1
WHERE news_content_type = 0 ==> (as called by) /home/roiweji/public_html/kSJbdgf/includes/init_includes/news_box_manager_update.php on line 258 <== in /home/russradi/public_html/includes/classes/db/mysql/query_factory.php on line 171.


Added news_contnent_type to news_box as tinyint 1 and all works.

Sorry for brevity.  Late for appointment

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

3 Mar 2020, 9:46 PM
#40
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,858
Plugin Contributions:
18

Re: News Box Manager v3.0.0 [Support Thread]

More info:

Was an upgrade from 2.0

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com