Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Article Manager v1.0


RobAnderson

Recommended Posts

A new version has been uploaded with these changes:

  • Compatible with php 7.2.
  • Compatible with BS4. (see note below)
  • Header Tags SEO no longer required. (see note below)
  • Added code to automatically add the title and tags for an article to Page Control in Header Tags SEO (if HTS is installed).
  • Added the date posted on the blog comments page.
  • Added a link to the customers account on the blog comments page, if it exists.
  • Added multi-select option to the Cross Sell page in admin.
  • Added a module to display articles on the home page.
  • Added a module to display articles on the product page.
  • Added the article ID to the article listing page in admin.
  • Added reply to blog in admin.
  • Added IP tracking for blog articles.
  • Added option to require approval for blog posts.
  • Changed the articles infobox to use ssl, if set, to fix a non-secure warning.
  • Changed the articles infobox to only display the articles section if articles exist for those sections.
  • Changed the format of the article listing pages on the shop side.
  • Changed the default setting for an article to non-blog.
  • Changed all of the article listing to use the sort order setting.
  • Fixed code to handle the filter database definition correctly. Reported by member @vmn.
  • Fixed code for the listing description text to prevent problems when html is used. Reported by member @vmn.
  • Fixed Cross Sell code to the blog page.
  • Fixed Cross Sell code to display the images.
  • Fixed article listing page to only show blog or non-blog articles.
  • Fixed code in the articles box to correctly show upcoming articles.
  • Fixed the layout problem in authors section of admin.
  • Fixed coding mistakes on the topics page that caused incorrect links.
  • Fixed coding mistakes on the articles page that caused incorrect links.
  • Fixed coding mistakes in the articles infobox for upcoming article that caused incorrect links.
  • Made many changes on the blog comment page in admin fixes and improvements.
  • Replaced date code with jquery's datepicker. Reported by member @vmn.
  • Replaced all uses of NONSSL with $request_type.
  • Replaced the topics code in the articles infobox with standard oscommerce code.
  • Removed preview from articles creation page.
  • Removed preview code in admin blog comments.
  • Removed unnecessary database code from the articles box.
  • Removed extra files in the new directory for the CE version.
  • Removed redundant functions used by the articles infobox.
  • Removed all filename and table definitions so it now works in CE shops.
  • Rewrote the new articles page to remove html codes.
  • Rewrote the upcoming module to remove html codes.

Notes:

1 - The changes in this update are only for the CE versions. The code for the CE version will probably work in 2.3.4 shops, though I haven't tested it, but not any version before that. There were far too many changes in this version to get them to work with the older versions. It can be done but will take a bit of time.

2 - I included the code for BS4 versions. This was not thoroughly tested but I don't think there are any problems in that version.

3 - The requirement to have Header Tags SEO installed has been removed. This was not thoroughly tested but I don't think there are any problems caused by it. You have to turn the option for Header Tags SEO off in the settings. Please note that if you don't have Header Tags SEO installed, you will not be able to set the title and meta tags from admin. You will need to figure out how to do that manually. Also, the Ultimate SEO url rewriter won't change the url's as expected.

My sincere thanks to @FrediHis help in troubleshooting this saved weeks on the release date. It was invaluable since he pointed out things I probably would not have seen.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

One of the things left out of the last version was the article reviews code. Mainly because I ran out of time but also because I question if it is ever used. I would be interested to hear what others think of that option. Should there be a way for customers to post reviews for articles?

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hello Jack,

After installing this new version on a FROZEN website I get the following errors :

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; cm_footer_articles_manager has a deprecated constructor in /includes/modules/content/footer/cm_footer_articles_manager.php on line 13

Articles


  • Warning: Use of undefined constant ARTICLE_MANAGER_XREF_ARTICLES - assumed 'ARTICLE_MANAGER_XREF_ARTICLES' (this will throw an Error in a future version of PHP) in /includes/modules/content/footer/templates/articles_manager.php on line 11
    1054 - Unknown column 'a.box_id' in 'where clause'

    SELECT a.articles_id, ad.articles_name, a.articles_is_blog from articles a left join articles_description ad on a.articles_id = ad.articles_id where a.articles_status = '1' and a.box_id = '0' and ad.language_id = '1'
Link to comment
Share on other sites

Sorry Jack,

I had not fully deleted the tables before running the installer so redoing it made the second errors go away.

As for the first with the deprecated constructor I replaced line 13 in includes/modules/content/footer/cm_footer_articles_manager.php with

    function __construct() {

and it is good to go.

Thanks for your work to get this updated!

Link to comment
Share on other sites

2 hours ago, artfulweb said:

I had not fully deleted the tables before running the installer so redoing it made the second errors go away.

As for the first with the deprecated constructor I replaced line 13 in includes/modules/content/footer/cm_footer_articles_manager.php with

    function __construct() {

You shouldn't have had to delete the tables. Just selecting the reset option would have brought the database up to this version. It's too late now but others may need to know this.

Also, the line to change is 21. Line 13 is the class name and needs to stay as it is. Thanks for reporting this mistake.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 3 weeks later...

I have an issue with the new version

Enable Header Tags SEO is set to false and the db was restored and all previous AM & HTS tables and configuration entries were removed.

Installed the db entries via article_manager_db_handler.php

configuration_group = Article Manager

Have been installed and re-installed five times with no luck.

Same error repeatedly.

 

 

1146 - Table 'bowwowwow.headertags' doesn't exist

select page_title from headertags where page_name like '%articles_id=%' and language_id = '1'

[TEP STOP]

 

Link to comment
Share on other sites

@Dnj1964You don't mention the version of your shop (please always do that) but I will assume Frozen since that is the only version that setting will work with. I just tried it here and it works as expected so I don't have an answer as to why it would fail. But here's a quick fix. Find this line in admin/articles.php

          $hts_status = (ENABLE_HEADER_TAGS_SEO != 'true' ? 'disabled="disabled" ' : '');
           

and add this below it

          if (false)

.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

 

Edge BS4 - Current commits to 05-28

Adding the above to admin/articles.php creates a syntax error on the line below.

          <td valign="top" width="50%"><table border="0" cellspacing="0" cellpadding="2" class="BorderedBox">
          <?php
		  $hts_status = (ENABLE_HEADER_TAGS_SEO != 'true' ? 'disabled="disabled" ' : '');
		  	for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
          ?>
            <tr>
              <td class="smallText row-left-seo"><?php echo TEXT_ARTICLES_HTS_TITLE; ?></td>
              <td class="smallText"><?php echo tep_draw_input_field('articles_hts_title[' . $languages[$i]['id'] . ']', GetHeaderTagsTitle($aInfo->articles_id, $languages[$i]['id']), $hts_status . ' size="35"'); ?></td>
            </tr>
            <tr>
              <td class="smallText row-left-seo"><?php echo TEXT_ARTICLES_HTS_DESC; ?></td>
              <td class="smallText"><?php echo tep_draw_input_field('articles_hts_desc[' . $languages[$i]['id'] . ']', GetHeaderTagsDescription($aInfo->articles_id, $languages[$i]['id']), $hts_status . ' size="35"'); ?></td>
            </tr>
            <tr>
              <td class="smallText row-left-seo"><?php echo TEXT_ARTICLES_HTS_KWORDS; ?></td>
              <td class="smallText"><?php echo tep_draw_input_field('articles_hts_kwords[' . $languages[$i]['id'] . ']', GetHeaderTagsKeywords($aInfo->articles_id, $languages[$i]['id']), $hts_status . ' size="35"'); ?></td>
            </tr>          
         <?php
             }
         ?>
          </table>

 

3 hours ago, Jack_mcs said:

@Dnj1964You don't mention the version of your shop (please always do that) but I will assume Frozen since that is the only version that setting will work with. I just tried it here and it works as expected so I don't have an answer as to why it would fail. But here's a quick fix. Find this line in admin/articles.php


          $hts_status = (ENABLE_HEADER_TAGS_SEO != 'true' ? 'disabled="disabled" ' : '');
           

and add this below it


          if (false)

.

 

Edited by Dnj1964
Link to comment
Share on other sites

5 hours ago, Dnj1964 said:

Adding the above to admin/articles.php creates a syntax error on the line below.

Which line would that be? The code you posted doesn't have the change I mentioned so it is unclear where you added it.

Also, the code for BS4 is an afterthought since that is not a finished package. Article Manager should work in it but I don't have a BS4 shop setup that doesn't have Header Tags SEO installed so I can't say for sure. I do have a BS4 shop with Header Tags SEO installed and this addon works correctly in it but that doesn't help in your case.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

17 minutes ago, Jack_mcs said:

Which line would that be? The code you posted doesn't have the change I mentioned so it is unclear where you added it.

Also, the code for BS4 is an afterthought since that is not a finished package. Article Manager should work in it but I don't have a BS4 shop setup that doesn't have Header Tags SEO installed so I can't say for sure. I do have a BS4 shop with Header Tags SEO installed and this addon works correctly in it but that doesn't help in your case

<td valign="top" width="50%"><table border="0" cellspacing="0" cellpadding="2" class="BorderedBox">
          <?php
		  $hts_status = (ENABLE_HEADER_TAGS_SEO != 'true' ? 'disabled="disabled" ' : '');
		  if (false)
		  	for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
          ?>
            <tr>
              <td class="smallText row-left-seo"><?php echo TEXT_ARTICLES_HTS_TITLE; ?></td>
              <td class="smallText"><?php echo tep_draw_input_field('articles_hts_title[' . $languages[$i]['id'] . ']', GetHeaderTagsTitle($aInfo->articles_id, $languages[$i]['id']), $hts_status . ' size="35"'); ?></td>
            </tr>
            <tr>
              <td class="smallText row-left-seo"><?php echo TEXT_ARTICLES_HTS_DESC; ?></td>
              <td class="smallText"><?php echo tep_draw_input_field('articles_hts_desc[' . $languages[$i]['id'] . ']', GetHeaderTagsDescription($aInfo->articles_id, $languages[$i]['id']), $hts_status . ' size="35"'); ?></td>
            </tr>
            <tr>
              <td class="smallText row-left-seo"><?php echo TEXT_ARTICLES_HTS_KWORDS; ?></td>
              <td class="smallText"><?php echo tep_draw_input_field('articles_hts_kwords[' . $languages[$i]['id'] . ']', GetHeaderTagsKeywords($aInfo->articles_id, $languages[$i]['id']), $hts_status . ' size="35"'); ?></td>
            </tr>          
         <?php
             }
         ?>
          </table>

 

Link to comment
Share on other sites

Thanks, the code fixes the admin side and can now add an article. 👍

Catalog side clicking article link error: 👎

1146 - Table 'bowwowwow.headertags' doesn't exist

select page_name, page_title from headertags where page_name like 'article_info.php?articles_id=1' and language_id = '1' LIMIT 1

[TEP STOP]

 

 

 

 

 

 

Link to comment
Share on other sites

PHP 7.1.30
MySQL 5.5.5-10.2.19-MariaDB-log

 

Maybe this an issue that is causing all the problems.

As I said I restored the db which removed all the HTS and AM from the db

All files were deleted from the server.

Yet when adding an article after installing the new version of AM without HTS

When clicking on article Name it drops down and shows a list of article names previously used.

Cleared the browser cache but the names are still showing.

 

Link to comment
Share on other sites

5 hours ago, Dnj1964 said:

Catalog side clicking article link error:

To fix this, find this line in includes/modules/article_manager.php

  if (isset($_GET['articles_id'])) {

and replace it with

  if (isset($_GET['articles_id']) && ENABLE_HEADER_TAGS_SEO == 'true') {

Just so you know, or anyone else reading this, there's no reason to uninstall existing installations of this addon to install the latest one. There is an update file in the Docs directory that explains what is needed to upgrade.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Tried that fix and all I got was a blank page on refresh

1 hour ago, Jack_mcs said:

To fix this, find this line in includes/modules/article_manager.php


  if (isset($_GET['articles_id'])) {

and replace it with


  if (isset($_GET['articles_id']) && ENABLE_HEADER_TAGS_SEO == 'true') {

Just so you know, or anyone else reading this, there's no reason to uninstall existing installations of this addon to install the latest one. There is an update file in the Docs directory that explains what is needed to upgrade.

 

Link to comment
Share on other sites

A blank page, after a change like this one, is usually due to a mistake in the code being added. Bu I have tried it here and it is working fine. If you can't see a problem with the change, please paste the contents of that file here so I can copy and test it.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Jack,

Checked it again, still blank page. Dreaweaver says there is an issue with the replacement code, doesn't say what other than syntax error on that line of code

include('includes/languages/' . $language . '/article_manager.php');
  require('includes/functions/articles.php');

// calculate topic path
  $tPath = '';
  if (isset($_GET['tPath'])) {
      $tPath = $_GET['tPath'];
  } elseif (isset($_GET['articles_id']) && !isset($_GET['authors_id'])) {
      $tPath = tep_get_article_path($_GET['articles_id']);
  }

  $current_topic_id = 0;
  if (tep_not_null($tPath)) {
      $tPath_array = tep_parse_topic_path($tPath);
      $tPath = implode('_', $tPath_array);
      $current_topic_id = $tPath_array[(sizeof($tPath_array)-1)];
  }

//if (isset($_GET['articles_id'])) {
  if (isset($_GET['articles_id']) && ENABLE_HEADER_TAGS_SEO == 'true') {
$articlesPage = 'article_info.php?articles_id=' . $_GET['articles_id'];
      $pageTags_query = tep_db_query("select page_name, page_title from headertags where page_name like '" . tep_db_input($articlesPage) . "' and language_id = '" . (int)$languages_id . "' LIMIT 1");
      if (tep_db_num_rows($pageTags_query) == 1) {
          $pageTags = tep_db_fetch_array($pageTags_query);
          $breadcrumb->add('Articles', tep_href_link('articles.php'));
          $breadcrumb->add($pageTags['page_title'], tep_href_link($articlesPage));
      }
  }

Doug

Link to comment
Share on other sites

check your code in a clean code editor like notepad++ , If you  are cutting and pasting code from the forum then you can have probems as the code from the form can copy badly.

This is what I see from your pasted code in php sand box. As you can see extra bits have been added. These will give syntex error. With these removes no syntex error given.

http://sandbox.onlinephpfunctions.com/

image.png.6fa5811618f8dcbc591202d701afa4eb.png

Edited by JcMagpie

 

Link to comment
Share on other sites

Unreal....

Copy and paste doesn't even work simply anymore...

Thanks

5 minutes ago, JcMagpie said:

check your code in a clean code editor like notepad++ , If you  are cutting and pasting code from the forum then you can have probems as the code from the form can copy badly.

This is what I see from your pasted code in php sand box. As you can see extra bits have been added. These will give syntex error. With these removes no syntex error given.

http://sandbox.onlinephpfunctions.com/

image.png.6fa5811618f8dcbc591202d701afa4eb.png

 

Link to comment
Share on other sites

Thanks,

Just went and got Notepad++

1 minute ago, ArtcoInc said:

@Dnj1964

Dreamweaver has been known to create problems with PHP bases, data-drive websites. As I mentioned to you in another thread, try using a different code editor, such as Notepad++.

M

 

Link to comment
Share on other sites

6 minutes ago, Dnj1964 said:

Goes to articles.php but doesn't show a list of articles but shows

It looks as if the install is bad, I can only guess from the code I see but it looks to be missing the links in the db to the articles. I'm assuming when you add articles it saves in to db the actual artical and a id to find them all. It looks as if you have added articles by copying them over and not copied the links? Not sure just a guess.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...