Plugin: Ordered

Lets you determine the order blog items are displayed on index pages, or categories are listed

General plugin info
Author:Frank Truscott, Leo
Current version:1.36-lm1
Download:np_ordered-1.36-lm1.zip
Support: Plugin comments or forum thread
Compability:Nucleus CMS 3.2

Plugin overview

This plugin allows a blog administrator to set the order in which each item appears. Each item can be assigned an order number. When the blog form of the skinvar is used, the posts will be displayed in the order designated. Posts that are not given an order, are not shown when using the default form of the skinvar. An alternate form of the skinvar will display just the unordered posts ordered by post time. The skinvar also accepts an optional blogname parameter to display ordered posts from a different blog.

Additionally, a blog administator can set orders to categories in a blog for use with the categorylist form of this skinvar. A template can be designated, as well, to be used when displaying items in a given category when using the blog form of this skinvar. A category's items can also be excluded from the main page when using the form of this skinvar.

Also, can show individual items anywhere, show random items, show custom list of blogs, list items under each category in a category list, and some other cool things.

Installing

  1. Download and extract the zip file. Copy the NP_Ordered.php file and the ordered directory to the nucleus/plugins directory.
  2. Use the Nucleus Admin GUI to register the NP_Ordered plugin into Nucleus. Be sure to click the Update Subscription List button.

Upgrading

  • v1.0 to v1.1 - Just replace the 1.0 files with the 1.1 files.
  • v1.0 or 1.1 to v1.2+ - Uninstall the old version. Then install the new version. Required.
  • v1.2 to v1.2x - Just replace the old files with the new.
  • v1.0x, 1.1x, or 1.2x to v1.3+ - Uninstall the old version. Then install the new version. Required for database changes. Your data should be safe if the Delete tables on uninstall plugin option is set to No.
  • v1.31 or lower to v1.32 or higher - Just replace the old files with the new.

Plugin Options

There are two options that control the operation of the Ordered plugin. These options are set from the edit options link in the Plugin Admin area.

  1. Show Admin Area in quick menu : Whether the Ordered admin area should be shown in the Quick Menu area. yes or no. (yes)
  2. Delete NP_Ordered data tables on uninstall? : Whether the database table should be deleted on an uninstall. This should be set to yes only when permanently removing NP_Ordered. yes or no. (no)

SkinVars

See the help file included in the plugin distribution.

How to use the plugin

See the help file included in the plugin distribution.

What it does

This plugin is a bit of a swiss-army knife. It's general function is to allow custom ordering of item lists, category lists, and blog lists. Its skinvars have a complex syntax that is described in the help file, here will be listed some of the things you can do with this plugin, organized by skinvar form. It should be noted that all its functions are tied to a single blog and it will not list items, categories, or blogs over multiple blogs.

An additional feature is that each category can be assigned a special template for display in indexes (blog) or item pages (item), so that on the main page, some items may be displayed with the normal template, while a special category, e.g. photos, can be displayed using a different template.

blog This is a replacement for the <%blog%> and <%otherblog%> skinvars and is mostly used on Main Index skin parts, but can also be used in sidebars and other places where items need to be listed. It can list items in the following orders:

  • Custom, i.e. manually determined by assigning an order to items. In each case, you can choose to list only the items that have been assigned orders, only the ones that haven't, or both (ordered ones first). Also, you can choose to display only the ordered ones with order numbers between two limits.
  • time
  • title
  • author
  • category
  • authorname
  • views (requires NP_Views)

Each sorting, except custom, can be done ascending, descending, or random.

categorylist This is a replacement of the <%categorylist%> and <%othercategorylist%> skinvars and is most often used in a sidebar to list the categories in a given blog. Besides allowing special ordering of the categories, you can also choose to list items from the categories inside the category list, e.g. the titles of the latest three items from each category.

It can list categories in the following orders:

  • Custom, i.e. manually determined by assigning an order to categories. In each case, you can choose to list only the categories that have been assigned orders, only the ones that haven't, or both (ordered ones first). Also, you can choose to display only the ordered ones with order numbers between two limits.
  • name
  • description

Each sorting, except custom, can be done ascending, descending, or random.

bloglist This is a replacement for the <%bloglist%> skinvar and can be used anywhere in your skin. For a site with multiple blogs, it can list the blogs in various orders and even list the most recent items from those blogs.

It can list blogs in the following orders:

  • Custom, i.e. manually determined by assigning an order to blogs. In each case, you can choose to list only the blogs that have been assigned orders, only the ones that haven't, or both (ordered ones first). Also, you can choose to display only the ordered ones with order numbers between two limits.
  • newestblog
  • oldestblog
  • lastentry
  • itemcount
  • reverse by name
  • shortname
  • reverse by shortname
  • random

It can be used on a multi-user open blog community to list the blogs on the front page so that the most active bloggers get their blogs listed first (itemcount) or so that the most recently active blogs get listed first (lastentry).

item: This is a replacement for the <%item%> skinvar and is used mostly on the Item Pages skin part, but it can be used anywhere in the skin where you want a specific item (or randomly chosen item) to be displayed.

In the form where no item is specified, it must be used on the Item Pages skin part and its main purpose is to display the selected item using any custom template chosen for that category in the Ordered admin pages.

In the form where an item number is specified, it will display that item anywhere in the skin using the specified template. Will act like a sticky, or can be used to display an “about me” item in a sidebar, footer, etc…

In its final form, it can be used to display a random item anywhere in your skin. You can also set hints to the plugin to draw that random item from specific blogs, categories, and times.

Compability

This version of the NP_Ordered is tested against version 3.66 of LMNucleus CMS. The minimum version of Nucleus CMS needed for using this plugin is 3.2.

The NP_Ordered plugin is not compatible with plugins that require NP_LMReplacementVars.

History

  • 1.36-lm1 - 2014-04-19 by Leo (http://nucleus.slightlysome.net/leo)
    • Tested and updated to run on PHP 5.4 and MySQL 5.5.
  • 1.36 - 26 Oct 2010
    • allow a show parameter of 'none' to permit use of some of the features like sorting by author, and category-specific templates for items without overhead of ordered query.
  • 1.35 - 14 Oct 2009
    • allow items to be shown within categorylist
  • 1.34.01 - 05 Oct2009 -
    • fix obscure bug in some PHP4 configurations
  • 1.34 - 06/11/2009 -
    • fix bug where call to member function on non-object error appears on error or member pages
  • 1.33 - 02/28/2009 -
    • fix bug where blogs created after installation of NP_Ordered do not get inserted into plug_ordered_bloglist
    • add reversename, short, reverseshort to special sort orders for bloglist type.
    • add parameter format to allow min and max order values to be specified for blog, categorylist, and bloglist
  • 1.32 - 02/19/2009 - bug fix for situation where items are being created by blog team members, then not being displayed properly.
    • enhance bloglist skinvar to allow better control over how items are listed under each blog.
  • 1.31 - 01/12/2009 -
    • enhance bloglist skinvar to allow better control over how items are listed under each blog.
  • 1.30 - 12/30/2008 -
    • add bloglist ordering
    • add special views ordering for blog variable to order by number of views in NP_Views
    • add PreBlogListItem event (coming in new release of Nucleus)
  • 1.29.02 - 09/15/2008 -
    • add PreCategoryListItem event to showCategoryList() method. This is a new event coming in a future release of Nucleus
  • Version 1.29.01, released 05 September 2008
    • fix item form where specified item displays only if on its own blog or category. Should really display everywhere now.
  • Version 1.28, released 03 September 2008
    • fix so doesn't use sscanf() function. Some PHP installs block it for security reason. Only somewhat useful since the Nucleus CMS core files use sscanf() in a number of places.
  • Version 1.27, released 29 August 2008
    • fix bug where blog admins could not set order of item during createitem
  • Version 1.26, released 08 August 2008
    • add special value for category parameter of blog-type skinvar. Use %ALL% to show items from all blogs, regardless of the category being set by URL
  • Version 1.25, released 21 Novemeber 2007
    • Add random sort capabilities to all skinvar types (blog,categorylist,item,setnavigation)
  • Version 1.24, released 20 September 2007
    • XHTML compliance fix, add itemid parameter to item type
    • Can now use NP_Ordered to display any specific item in your skin.</li>
  • Version 1.23, released 22 May 2007
    • Can now use NP_Ordered to sort your items in reverse time order or alphabetically by name. And categories by name and description.
  • Version 1.22, released 10 May 2007
    • added tickets to actions on admin page.
  • Version 1.21, released 21 February 2007
    • fix bug in admin page where form action not set correctly. Problem only on certain php environments.
  • Version 1.2, released 1 December 2006
    • added item form of Ordered skinvar. Also ability to set an item template for each category (in addition to an index template).
  • Version 1.1, released 21 November 2006
    • added <%catiscurrent%> as template var in Category List fields when using the categorylist form of this skinvar. (Useful for putting a class parameter in the links for categories that can be different if listing the current category).
    • Added templatemode to override special category template if wanted. 'strict' is only current option.
    • Added setnavigation form of skinvar to set nextitem and previtem for item pages. Put in head section, above any call to nextlink or prevlink.
    • Fixed how handle offset in blog form of skinvar.
    • Add API function getQueryResult().
  • Version 1.0, released 10 November 2006

Add Comment

Spam and off topic comments will be deleted.

Allowed BBCode:[b] [i] [u] [s] [color=] [size=] [quote] [code] [email] [url]