View Full Version : STS4 Power Pack

10-28-2008, 09:50 AM
STS Articles


STS Articles is a simple contribution for OSCommerce and the Simple-Template-System that allows you to add, edit and delete articles that are viewed via an info box. Although this is made for STS it is a standalone contribution that should work (with a little tweaking) without STS. It is also Standalone in the sense that very few if any OSC functions are used. All the [functions/object classes/database access] I needed to make this work have been reworked into this contribution.

Articles by File Name

The explanation for 'by file name' is that an article can be directly related to a given file name such as 'About_Us.php' and when visitors navigate to this file only those articles can be viewed. File name articles are accessed in admin exactly the same way as category articles because the file name is stored as a category heading.

Because only the file name (including the .php extension) is recognised using the basename() function, no query strings will alter the resulting output. However using the query string will extend the usability of this contribution to providing articles related to say individual products but this feature will only be available in a later update.

Public/Private Categories/Articles

There is a distinction made between public and admin article categories. In the database table `article_categories` each category has a `status`. If `status` is '1' the category and articles contained within may be viewed by the public. If `status` is '0' the category and articles can only be viewed via admin. This feature can be extended upon to provide greater flexibility. At present the `status` can not be changed via admin/articles.php but can be easily done in PHPMYADMIN.

Admin - articles.php

The 'admin/articles.php' file is where the articles may be listed by category or are all listed by date of creation. It is a single file that will do all the article admin such as:

Creating, Editing and Deleting Article Categories.
Inserting New Articles.
Editing Existing Articles.
Deleting Articles.

Number of Articles per Page (in info box).
Number of Page navigation Links.

If there are more than four articles associated with a category or file name you will see a page navigation appear at the top of the Articles info box. This is the same page navigation system used by OSC to page through a large list of products as used in 'products_new.php'.

The number of articles shown per page can be changed in the file catalog/includes/boxes/articles.php where $max_rows = 4;. This is also where you can edit $max_page_links, i.e. the number of pages available as links in the page navigation.

Matthew John Ritchie

More... (http://addons.oscommerce.com/info/4456)