NP_LatestDisc.php

This plugin displays the n latest commented posts. The plugin shows the titles of the items and not an excerpt of the comments. The name stands for 'Latest discussion'.

General Plugin info
Current Version: v0.2
Download: np_latestdisc_v0.2.zip
Code: download here
Demo: n/a
Forum Thread: http://forum.nucleuscms.org/viewtopic.php?t=3046&highlight=

Installing

  1. copy the code above and put it in NP_LatestDisc.php
  2. upload to the plugin directory
  3. install the plugin from plugin admin menu

How to use the plugin

  1. add <%LatestDisc%> to your skin to show the default amount (10) of links to recently commented on items.

Parameters

Parameters are used to determine how many links are displayed, for which blog, how they are displayed (in ul, ol, or seperated by <br />), whether the number of comments per item are displayed and whether the date and time of the last comment per item is displayed.

  • if no parameter is defined, the default amount of 10 item links will be displayed for all blogs:
    • <%LatestDisc%>;
  • the first parameter defines how many item links will be displayed:
    • <%LatestDisc(7)%>: show 7 item links, taken from all blogs;
  • the second parameter defines for which blog item links will be displayed:
    • if no 2nd parameter is defined, the plugin will display the item links for all blogs. (see example above);
    • <%LatestDisc(7,actual)%>: show 7 latest item links from the actual blog;
    • <%LatestDisc(7,3)%>: show 7 latest item links from blog number 3;
    • <%LatestDisc(7,default)%>: show 7 latest item links from the default blog;
  • the third parameter defines the display of the item links:
    • if no 3rd parameter is defined, the plugin will display the item links separated by <br />;
    • <%LatestDisc(7,actual,ul)%>: displays 7 latest item links in an unordered list (<ul>);
    • <%LatestDisc(7,actual,ol)%>: displays 7 latest item links in an ordered list (<ol>);
  • the fourth parameter defines whether the number of comments for each item link will be displayed:
    • if no 4th parameter is defined, no number of comments will be added (see examples above);
    • <%LatestDisc(7,actual,ul,num)%>: displays 7 item links for current blog in unordered list, with number of comments;
  • the fifth parameter defines whether the date and time will be displayed. For each item this will be the date and time at which the last comment was added to that item:
    • if no 5th parameter is defined, no date and time will be added (see examples above);
    • <%LatestDisc(7,actual,ul,num,date)%>: displays 7 item links for current blog in unordered list, with number of comments and trailing time and date;

Note! It is possible to apply the default parameters for one or more options, by leaving the space for the parameter empty:

  • <%LatestDisc(,,,,date)%>: displays the default of 10 item links for all blogs, separated by <br />, whithout number of comments, but with time and date;

Styling options

  • If display of the number of comments is selected, the number will be surrounded by brackets and a span with the class 'discussionnumber', enabling the possibility to control the display by css.
  • If display of date and time is selected, date and time will be inserted in a span with the class 'discussiondate', enabling the possibility to control the display by css.

Wishlist

  • support for fancier urls

Bugs

  • no known bugs in version 0.2 (yet).
  • for some strange reason the default value of 5 posts is not working in php 4.3.10…. so once can't use <%LatestDisc%>
    • Marza: fixed in version 0.2

History

  • [Version 0.1, released 30-12-2003 ]
    • initial release by Radek HULAN
  • [Version 0.2, released 30-03-2005 ]
    • release by Marza

Plugin review

NP_LatestDisc version 0.2 works with Nucleus CMS version 3.31 - 2007-11-13 kg

latestdisc.txt · Last modified: 2007/11/13 22:38 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki