Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Community Contributed Add-Ons / All Other Contributions/Addons / News Box Manager v2.0.0 [Support Thread]

News Box Manager v2.0.0 [Support Thread]

7 Apr 2017, 1:26 PM
#21
bonheddwr avatar

bonheddwr

Zen Follower

Join Date:
Jun 2007
Location:
Cymru
Posts:
124
Plugin Contributions:
0

Post #21 by bonheddwr

Hi, where exactly is the information for the News items stored? I need to change the Article Date(s): on a few of the news items. I cannot do this via backend, so I tried searching the database but no luck. It's probably 'news_last_modified' that I need to change for the articles, but where is this info stored? Thanks.

7 Apr 2017, 2:03 PM
#22
lat9 avatar

lat9

Administrator

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

Post #22 by lat9

A news article has two components:

  1. The non-language components, like dates and status, are stored in the box_news table
  2. The language-specific component(s), i.e. an article's title and content, are stored in the box_news_contents table (using the article's ID and the associated language ID as the "key").

The "Article Date(s)" section on the storefront displays an article's start_date (and, if defined, the associated end_date) ... so those values should be changeable via the admin panel.

7 Apr 2017, 2:53 PM
#23
bonheddwr avatar

bonheddwr

Zen Follower

Join Date:
Jun 2007
Location:
Cymru
Posts:
124
Plugin Contributions:
0

Post #23 by bonheddwr

Thank you. On my site the value in news_added_date was used. I've edited those dates to the correct opnes now in the database and all is fine. Thanks again.

21 Aug 2017, 4:14 PM
#24
giuly avatar

giuly

Zen Follower

Join Date:
May 2007
Location:
Italy
Posts:
438
Plugin Contributions:
0

Post #24 by giuly

Thanks for this great plugin, I needed it!!! :smile:

27 Nov 2017, 2:02 AM
#25
pudzpud avatar

pudzpud

Zen Follower

Join Date:
May 2009
Posts:
156
Plugin Contributions:
0

Post #25 by pudzpud

Sorry cant delete post but problem solved

17 Sep 2018, 3:52 PM
#26
lat9 avatar

lat9

Administrator

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

Post #26 by lat9

lat9:

I've created a GitHub issue (https://github.com/lat9/news_box_manager/issues/5) for your request to add meta-tag support (great idea, by the way). I'll post back when the change has been made.
I've just submitted v2.2.0 of the News Box Manager to the Zen Cart plugins for review. That version now has the capability to define article-specific meta-tags and also corrects the database values stored for the various date fields (required for more recent versions of MySQL).

I'll post back here once it's approved.

25 Sep 2018, 3:58 PM
#27
honda_crunch avatar

honda_crunch

New Zenner

Join Date:
Jul 2011
Posts:
22
Plugin Contributions:
0

Post #27 by honda_crunch

Hi,
Just tried installing the latest version 2.2.0 with the added metadata.
Installation was very simple, just had to edit my tpl_index_default file. However, there apears to be a problem with the auto install. The result was; that after you have created a news article then press update, you get a white page with an error message at the top of the page.

After searching the logs, I found that the installer (in my case) didn't add the meta tag columns to the (box_news_content) database table.

I made many backups, exported a sql of the table then added the missing headers. Part the of sql now looks like the version below. The original stopped at 'news_content` text NOT NULL':

DROP TABLE IF EXISTS box_news_content;
CREATE TABLE box_news_content (
box_news_id int(11) NOT NULL DEFAULT '0',
languages_id int(11) NOT NULL DEFAULT '1',
news_title varchar(255) NOT NULL DEFAULT '',
news_content text NOT NULL,
news_metatags_title text NOT NULL,
news_metatags_keywords text NOT NULL,
news_metatags_description text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

The application now works perfectly. Just wondered if all other users are having the same problem.
I'm not a professional programmer and have limited knowlege on server databases.

If it helps, I'm running on zen-cart 1.5.5f

25 Sep 2018, 4:15 PM
#28
lat9 avatar

lat9

Administrator

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

Post #28 by lat9

Thanks for the report, I'll give that a look a bit later.

Update: It's an issue with an original-install, not an upgrade.

26 Sep 2018, 8:01 AM
#30
honda_crunch avatar

honda_crunch

New Zenner

Join Date:
Jul 2011
Posts:
22
Plugin Contributions:
0

Post #30 by honda_crunch

Thanks for looking into the issue so soon.
I did a bit of tinkering myself. As mine was a first install, I obviously didn't know how you intended to install the extra fields.

According to your supplied instructions, it looks like the user doesn't need to add the metatags especially if you're lazy like me! I found that my first effort crashed if I didn't add them.

After my attemp at fixing the problem, I found that I didn't need the extra 'NOT NULL's in the script. It now looks like this:

DROP TABLE IF EXISTS box_news_content;
CREATE TABLE box_news_content (
box_news_id int(11) NOT NULL DEFAULT '0',
languages_id int(11) NOT NULL DEFAULT '1',
news_title varchar(255) NOT NULL DEFAULT '',
news_content text NOT NULL,
news_metatags_title text,
news_metatags_keywords text,
news_metatags_description text
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

I can now save the news letter with or with out them.

I'm only using it on my test site at the moment so am looking forward to your next fixed release. It's a great app!

26 Sep 2018, 11:42 AM
#31
lat9 avatar

lat9

Administrator

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

Post #31 by lat9

The update (to be released as v2.2.1) is now available on the plugin's GitHub repository: https://github.com/lat9/news_box_manager.

28 Sep 2018, 10:05 AM
#32
honda_crunch avatar

honda_crunch

New Zenner

Join Date:
Jul 2011
Posts:
22
Plugin Contributions:
0

Post #32 by honda_crunch

Hi, I was so impressed with the sql fix I installed it on our live site just in time to advertise a company charity event.... Then i came across a bug. Not a big one! Our site has an issue with the 'more_news' page an wondered if it was a straight forward bug or something that's conflicting with just our site.

It's best explained better with a snipet of the source code provided by W3C as below:

<p>Every penny raised helps us make a difference to people affected by cancer</p><br />↩ <br />↩ <ul><br />↩ <li>When: Friday 28th September</li><br />↩

As you can see, the page automatically provides <br />'s at the end of every line. The resulting large spaces between each paragraph don't help the apparance. It behaves completely normal on the home and news_archive pages.
I have tried adding things like: br { display: none;} to the css, it worked for the page but had effects on some other pages. Alos tried: #moreNewsDefault .newsContent+br { padding: 0.3em 0; display: none;} which had no effect at all.
Many thanks for any assistance

28 Sep 2018, 10:57 AM
#33
lat9 avatar

lat9

Administrator

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

Post #33 by lat9

Since the default template (/includes/templates/template_default/tpl_more_news_default.php) simply echos the 'content' you provide for the article, I'm going to guess that you're using an HTML editor in the admin to produce that content.

You can correct those added <br />'s by turning off the HTML editor (reverting to 'Text') to remove those unwanted HTML additions.

28 Sep 2018, 11:27 AM
#34
honda_crunch avatar

honda_crunch

New Zenner

Join Date:
Jul 2011
Posts:
22
Plugin Contributions:
0

Post #34 by honda_crunch

lat9:

Since the default template (/includes/templates/template_default/tpl_more_news_default.php) simply echos the 'content' you provide for the article, I'm going to guess that you're using an HTML editor in the admin to produce that content.

You can correct those added <br />'s by turning off the HTML editor (reverting to 'Text') to remove those unwanted HTML additions.

Thanks for such a speedy response.

You are correct, I'm using ckeditor. However, from the editor, you can see the source code that it creates. There are no <br/>'s there. Thinking that it might be uploading something different to the server, I looked there. Again found no <br/>'s

Below is same example as before copied straight from the server data field:

<p>Every penny raised helps us make a difference to people affected by cancer</p> <ul> <li>When: Friday 28th September</li> <li>Where: Our Machinery Department</li> <li>Time: 10:00am - 2:00pm</li> </ul> <p><strong>If you are in our area, please call in to enjoy a cuppa and a chat!</strong></p>

As I mentioned, it works properly in the other two pages.

It's certainly got me scratching my head!

28 Sep 2018, 3:36 PM
#35
lat9 avatar

lat9

Administrator

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

Post #35 by lat9

Darn it, it's the more_news page's header that's adding those. I'll get that corrected, too.

Open /includes/modules/pages/more_news/header.php.php and find

    $news_title = nl2br($news_box_query->fields['news_title']);
    $news_content = nl2br($news_box_query->fields['news_content']);

Change those lines, removing the call to nl2br (which converts any new-line characters to <br />'s):

    $news_title = $news_box_query->fields['news_title'];
    $news_content = $news_box_query->fields['news_content'];

I'll get that logged and updated on the plugin's GitHub repository.

Update: https://github.com/lat9/news_box_manager/issues/8

28 Sep 2018, 5:42 PM
#36
honda_crunch avatar

honda_crunch

New Zenner

Join Date:
Jul 2011
Posts:
22
Plugin Contributions:
0

Post #36 by honda_crunch

Thanks Lat9, It works like a dream, no more <br />'s anywhere!!

28 Sep 2018, 6:14 PM
#37
lat9 avatar

lat9

Administrator

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

Post #37 by lat9

No problem, @honda-crunch; thanks for letting me know!

21 Dec 2018, 4:17 PM
#38
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Post #38 by keneso

Hi
I have downloaded, but not installed it yet.

Is there a way to have the following accessible to members only
News Archive page
More News page

and have only the following visible to all
Latest News sidebox
Latest News centerbox

I guess there is some coding involved, do you think it might be a good feature in case?

21 Dec 2018, 7:41 PM
#39
lat9 avatar

lat9

Administrator

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

Post #39 by lat9

@keneso, I've created this GitHub issue so I remember your request.