blogroll

Blogroll

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.

The latest version add tag cloud and del.ico.us support.

General Plugin info
Current Version: 0.40 (Beta)
Download: Download the latest version here
:np_blogroll_v30.zip (Old Version)
Forum Thread: v0.4x Old Thread
Author: Joel Pan (ketsugi)
Modified by Edmond Hui (admun)

Installing

  • Download the zip file
  • Unzip and upload all files to the plugin directory
  • Install it from the plugin admin menu
  • Edit the blogroll template from the plugin option

Upgrading from v0.30

Note: Version 0.36 onwards added new plugin and member options, so user need to uninstall/re-install to upgrade.

  • Download the zip file
  • unzip the files and upload it to plugin directory
  • Set the plugin option to _not_ delete database table when uninstall if wish to keep existing blogroll.
  • Uninstall and reinstall the plugin
  • run upgrade_2_v0_35.php in the plugins/blogroll directory. You can deleted it once it’s done

How to use the plugin

  • Go to the plugin quick menu and add new blogroll group, if needed
  • Bookmark the blogroll “bookmarklet” link from top of the quick menu (add favorite or drop it to the menu)
  • Add the skinvar in where you’d like to show the blogroll, usually the left/right column (see the skinvar section for syntax)
  • The Quick menu also provide function to manage link in the group and such

SkinVars

Parameters: Type, ID, Sort field, Sort order, GroupDesc, NumOfLinks, tagcloud, tagclousresult

Type (optional)

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 (only optional if also no type is set)

If Type is ‘group’, this should be the name of the group 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’ 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’, this field is ignored.

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.

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 deprecated in version 0.36
  • <%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.

How to use this Plugin

Basic Display

  • <%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 all 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”.
  • <%Blogroll(tagcloud,[group]%> (New in Ver 0.36): display a tagcloud for a particular group
  • <%Blogroll(tagcloudresult)%> (New in Ver 0.36): display all links for a tag (select from the tagcloud)

Activate the del.icio.us function

  • enable the del.icio.us support from plugin option
  • set user & password from memeber setting

p.s. The del.icio.us used the same phpDelicious code as NP_TechnoratiTags. So, if you have this plugin installed, just overwrite it.

Tagcloud Decoration

Add the follow CSS to your skin CSS file:

.BRtinyT { font-size:14px;} 
.BRsmallT { font-size:20px;} 
.BRmediumT { font-size:24px;} 
.BRlargeT { font-size:26px; font-weight: bold;} 

To setup the blogroll page

  1. Clone the skin you use on the blog
  2. Rename it to ‘blogroll’
  3. Edit the main index, replace the <%blog(...)%> to <%Blogroll(tagcloudresult%>, and replace the sidebar line (i.e. <%parsedinclude(sidebar.inc)%>) to <%Blogroll(tagcloud,group)%> (replace group with your blogroll group name)
  4. Create a blogroll.php and place it in your blog’s root directory (same as where index.php is) with the content below:
  5. link to the blogroll page from your blog’s sidebar
<?php 
$CONF = array(); 
$CONF['Self'] = 'index.php'; 

include('./config.php'); 

selectSkin('blogroll'); 
selector(); 

?> 

If FancyURL/FancierURL2 is setup, the following code is need to add to .htaccess

<FilesMatch "^tags$">
    ForceType application/x-httpd-php
</FilesMatch>

Then, rename tags.php to tags

Code: http://edmondhui.homeip.net/nudn/item/1029
Example: http://edmondhui.homeip.net/blog/blogroll.php

Keyword search in blogroll page

By adding <%Blogroll(searchbox, [group])%> in the blogroll page, a search box will be inserted to allow user to search for links with a keyword.

Keyword search in blogroll page

A new <%Blogroll(relatedtags)%> skinvar is added to allow showing of related tags in blogroll page.

Changelog

  • 0.40 (27 Jun 2007)
    • htmlspecialchars_decode PHP4 support
    • add search function
    • add related tag function in tagcloud
  • 0.39 (9 May 2007)
    • Fixed PluginAdmin inclusion in bookmarklet and links.php
    • Fixed " in query Mysql update error
    • Seperate CSS decoration with NP_TechnoratiTags
    • Add redirection after edit link from blogroll page
  • 0.38 (12 April 2007)
    • Bug fix version
  • 0.37 (21 March 2007)
    • Added tagcloud decoration
    • Fixed admin tag menu functions
    • Fixed utf-8 support
    • Added rename/delete tag, (currently not fully working, as delete tag rename the tag to “deleted”.... still finding a way to do that)
    • Added replace “+” with " " plugin option
    • Added show #links without tag at the end of managelinks
    • Fixed no delete/rename tag after edit in managetag
    • Fixed missing tag/comment when error in bookmarklet
  • 0.36 (9 March 2007)
    • Option for tagcloudresult header
    • Fixed tagcloud result list only to group specified
    • Fixed getTableList() bug
    • Added template options for tagcloud link display
    • Added tagcloud link click count
    • del.icio.us support
  • 0.35 (7 March 2007)
    • add tagging function
  • 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. If neither title nor text is specified, no title attribute will be generated.
  • 0.11 (1 April 2005)
    • Fixed a minor bug.
  • 0.10 (1 April 2005)
    • Initial release.

ToDo

  • Modify htmlentities call to not break non-English text
  • Implement XFN support

Feature Request (to be acknowledged for future release)

  • tagging support: Instead of having a URL belongs to only one group, maybe we can re-write to support tag. This allow a URL to belongs to more than one tag, effectively having multi-group support. A tag cloud to show all blogrol tags might be a cool idea, as well as a search function. Implementation can be an issue, as it’s not really align with the current design. maybe talk to admun to brainstorm? Implemented in version 0.35
  • a function similar to blogmarks.net’s blog sync function, which automatically create post daily in the blog for a summary of recently added blogroll (ie ).

Plugin Review

NP_Blogroll version 0.40 works with Nucleus CMS version 3.31 - 2007-10-31 kg

 
blogroll.txt · Last modified: 2007/10/31 00:05 by kg