Plugin overview
This plugin lets you manage a database of links from your admin area and maintains a count of how many times each link has been clicked on by reader. When used as a skin variable, it displays a redirector URL in the form of /nucleus/plugins/blogroll/?n=id, or a group of such URLs.
SkinVars
Parameters: Type, ID, Sort field, Sort order, GroupDesc, NumOfLinks, Redirect
- Type - 'group' | 'link' | 'user'
- Tells plugin whether to display an individual link or a group of links as defined in the admin area, or a single user's links.
- ID
- If Type is 'group', this should be the name of the group(s) to display. Use the pipe character ('|') to separate multiple group names. If Type is 'link', this should be the numeric ID of the link to display. If Type is 'user', this should be the short name (login name) of the user whose blogroll should be displayed. If the user specified is not a member of the team for the blog being displayed, the blogroll will not be shown.
- Sort field (optional) - 'order' | 'url' | 'text' | 'desc' | 'created' | 'clicked' | 'counter' | 'random'
- If Type is 'group', tells plugin in what order to display links. Defaults to 'order', which displays links according to the order defined in admin area. If Type is 'link', place the Redirect value here.
- Sort order (optional) - 'asc' | 'desc'
- If Type is group, tells plugin whether to display links in ascending or descending order according to the field defined in Sort field. Defaults to 'asc'.
- GroupDesc (optional)
- If ID defines multiple groups to display links from, the GroupDesc value will determine what will replace the
<%groupdesc%>
variable in the blogroll template. If no GroupDesc is specified, the description of the first group will be used.
- NumOfLinks (optional)
- If Type is group, tells plugin to display only a specified number of links. Must be a positive integer value; if not, plugin will display all links.
- Redirect (optional)
- Set to "yes" or "no" to override the default as set in Blogroll's plugin options to determine whether to show the redirector URL or the regular URL.
Example Usage
<%Blogroll(group,blogs)%>
: displays the group of links named 'blogs'
<%Blogroll(group,mac,clicked,desc)%>
: display the group of links named 'mac', from the most recently clicked to the least recently clicked
<%Blogroll(group,blogs|news|mac,text,desc,Blogroll)%>
: displays links from 'blogs', 'news' and 'mac, sorted by text in descending order, and using 'Blogroll' as a collective group description
<%Blogroll(group,news|mac,random,,News,10)%>
: displays 10 random links from 'news' and 'mac'.
<%Blogroll(link,5,yes)%>
: displays the link for link #5, displaying the redirector URL even if the plugin option is set to "no".
<%Blogroll(user,johndoe)%>
: displays all groups and links for the member with short name "johndoe".
Template Options
In the plugin options page, you can specify how links will appear on your page. The variables available for use in all fields except 'Item' are:
<%groupid%>
: the group's internal id number
<%groupname%>
: the group name
<%groupdesc%>
: the group's description
Variables available for use in the item template are:
<%linkid%>
: the link's id number
<%linkurl%>
: the link's redirector URL as generated by the plugin
<%linktext%>
: the link text
<%linktitle%>
: the link's description
<%linkcounter%>
: number of times the link has been clicked (not available if redirection is off)
<%linkclicked%>
: date and time the link was last clicked (not available if redirection is off)
<%linkcreated%>
: when the link was created
If the <%Blogroll%>
skinvar is used to call a single link, the item template will be used to display the link.
Support and Bug reports
For additional support and/or bug reports please use this forum thread:
http://forum.nucleuscms.org/viewtopic.php?t=6781
Version History
- 0.30 (4 March 2006)
- Added option to display a single user's blogroll.
- Admin area for managing links now shows current group.
- 0.27 (27 October 2005)
- Added redirector option for skin variable.
- Fixed bug in groups.php that led to potential HTTP 405 error.
- Fixed bug in bookmarklet URL that screwed up non-English document titles.
- 0.25 (30 April 2005)
- Changed output of skinvar to encode HTML entities for standards compliance.
- Changed skinvar behaviour to let groupdesc parameter override
db-set groupdesc for single-group skinvar calls.
- Fixed an issue where text/titles in edit forms (index.php) and add
forms (bookmarklet.php) were showing backslash-escaped text.
- Fixed an issue where sorting by counter was not working.
- 0.23 (27 April 2005)
- Added a bookmarklet for adding links.
- Fixed an issue where after deleting a link, the group link list is displayed twice.
- Added option for 'sortfield' parameter to sort links randomly.
- Added parameter to display only a specified number of links.
- Corrected some references to Redirect.
- Fixed an issue where deleting a group did not also delete the links in that group.
- Fixed an issue where plugin was making too many SQL queries to display a group of links.
- Added <%groupid%>, <%linkcreated%> and <%linkclicked%> to templates.
- 0.20 (22 April 2005)
- Changed plugin name to NP_Blogroll since redirection is now merely an option.
- Fixed a bug that caused template for list footer and footer to not be parsed properly.
- Added option to turn off redirection feature.
- Added option to call multiple groups of links with a single skinvar call.
- Removed <%groupid%> from templates.
- 0.18 (20 April 2005)
- Added sorting options (sort by order, name, url and asc/desc).
- Fixed a minor bug that was causing the plugin to not update the counter.
- Removed skinvar parameter to display only counter (use template to display counter).
- 0.17 (14 April 2005)
- Added ability to move a link from one group to another
- Fixed bugs preventing changing group order from functioning as intended
- 0.16 (14 April 2005)
- Added ability for grouping links together and to call a group of links from a skinvar
- Plugin now uses a template to display a link or group of links
- Plugin now keeps separate links for each user.
- 0.15 (5 April 2005)
- Plugin will now check client's user agent against a list of known bots and will not increment the counter if client is a bot.
- 0.14 (1 April 2005)
- Added a second parameter for the skinvar to display link counter instead.
- 0.13 (1 April 2005)
- Fixed a minor bug in redirect/index.php that was causing the plugin to not update the counter.
- 0.12 (1 April 2005)
- Admin page now truncates long URLs for display purposes
- Generated link will now use the link text as title attribute if title is not specified
- 0.11 (1 April 2005)
- 0.10 (1 April 2005)
License Information
Copyright © 2005 Joel Pan