@alchime, please try the release below and let me know if it fixes your problems. Also, check your </a>, it was not closed properly.
Below is the latest version which supports tag list, tag cloud, and archive display.
Some of the parameter names have changed so please review them as they are documented within the snippet code.
@SNIPPET
Required files: FavoriteLinks-0.0.7.zip
Extract directory from zip file above and place in assets/snippets/.
The "supported parameters" section in the snippet code below contains a list and description of available parameters and their meanings. Chunks support PHx processing (if available), the default chunk is:
<li class="favLinks"><a href="[+url+]" title="[+summ+]">[+title+]</a></li>
The snippet/module also supports XFN (
http://gmpg.org/xfn/) which can be added to a chunk’s link by inserting something like rel="[+xfn+]".
Snippet Name: FavoriteLinks
Description: <strong>0.0.7</strong> Favorite Links Snippet
<?php
/*---------------------------------------------------------------------------
* Favorite Links Snippet - Displays customized listing for "favorite" links
* - Used in conjunction w/ the Favorite Links module
*----------------------------------------------------------------------------
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* @author Brian Stanback (www.stanback.net)
* @copyright Brian Stanback 2007
* @created: 2007/02/27
* @updated: 2007/04/18
* @version 0.0.7
*
$params = array();
/**
* General parameters
*--------------------------------------------------------------------------*/
$params['basePath'] = isset($basePath) ? $basePath : $modx->config['base_path'] . 'assets/snippets/FavoriteLinks/';
// Path to Favorite Links snippet directory (default: modx_base/assets/snippets/FavoriteLinks/)
$params['id'] = isset($id) ? $id : '';
// Unique identifier
// FavoriteLinks will set any global placeholders like this: [+id_PhName+]
// (Required if using pagination with several instances of FavoriteLinks on a single page)
$params['dispType'] = isset($dispType) ? $dispType : 'list';
// Type of results to display
// Possible types: list, tags, dates, results
$params['landing'] = isset($landing) ? intval($landing) : $modx->documentIdentifier;
// Page ID containing the [!FavoriteLinks? &results=`1`!] snippet call
$params['results'] = isset($results) ? intval($results) : 0;
// Set to 1 to allow the snippet call to be used for displaying
// results by specific tag/date
$params['startId'] = isset($startId) ? intval($startId) : 0;
// Start displaying data after the specified link ID
$params['tagSeparator'] = isset($tagSeparator) ? $tagSeparator : ', ';
// Separate tag display using the specified string
// Default: comma and a space
$params['tags'] = isset($tags) ? $tags : '';
// Display results matching the specified tag(s)
// Multiple tags are separated by a comma and a space
$params['excludeTags'] = isset($excludeTags) ? $excludeTags : '';
// Display results which do not match the specified tag(s)
// Multiple tags are separated by a comma and a space
$params['boolean'] = isset($boolean) ? $boolean : 'OR';
// Boolean operator to use when filtering by multiple &tags (default: OR)
// Options:
// OR - display records matching any defined tag
// AND - only display records matching all defined tags
$params['filter'] = isset($filter) ? $filter : '';
// Display only the links/dates/tags with a title or summary matching the filter text
$params['startDate'] = isset($startDate) ? $startDate : null;
// Return links added on or after the specified date
// Example: 2007-01-03
// Example: -1 Month
$params['endDate'] = isset($endDate) ? $endDate : null;
// Return results added on or before the specified date
$params['tplOuter'] = isset($tplOuter) ? $tplOuter : '@FILE:tpl/outer.tpl';
// Outer container template for links display/archive
// Default: @FILE:tpl/outer.tpl
// Possible placeholders:
// [+favlinks_items+]
//
// Templates can be:
// Any valid chunk name
// Code via @CODE:
// File via @FILE:
$params['tplNoResults'] = isset($tplNoResults) ? $tplNoResults : '@CODE:<p>No links found.</p>';
// Text or chunk to display when there are no results
// Default: @CODE:<p>No links found.</p>
/**
* Link display parameters
*--------------------------------------------------------------------------*/
$params['paginate'] = isset($paginate) ? intval($paginate) : 0;
// Split up the display into pages after reaching the specified number of links
// When paginate is enabled, &maxLinks becomes the number of links per page
// If set to 0, pagination is disabled
// Default: 0 (disabled)
$params['paginateAlwaysShowLinks'] = isset($paginateAlwaysShowLinks) ? intval($paginateAlwaysShowLinks) : 1;
// Whether or not to always show previous/next links
// Set to 1 to show or 0 to hide when there are 1 page or fewer links
// Default: 1 (enabled)
$params['paginateSplitter'] = isset($paginateSplitter) ? $paginateSplitter : ' ';
// Splitter character/text to include between page numbers
$params['showLinks'] = isset($showLinks) ? intval($showLinks) : 1;
// To show individual links, set to 1
// For only showing the tags/dates, set to 0
// Default: 1
// Only applicable to taglist and datelist display types
$params['sortLinks'] = isset($sortLinks) ? $sortLinks : 'title ASC';
// Sort link items
// Possible fields: id, url, title, summ, tags, xfn, rating, added, RAND()
// Add ASC or DESC to change the sort order, example: &sortLinks=`added DESC`
// Default: title ASC
$params['maxLinks'] = isset($maxLinks) ? intval($maxLinks) : 100000;
// Maximum number of links to display in the result
$params['offsetLinks'] = isset($offsetLinks) ? intval($offsetLinks) : 0;
// Offset for the links result
$params['tplLink'] = isset($tplLink) ? $tplLink : '@FILE:tpl/link.tpl';
// Template for each individual link in the listing
// Default: @FILE:tpl/link.tpl
// Possible placeholders:
// [+id+], [+url+], [+title+], [+summ+], [+tags+], [+xfn+], [+rating+], [+added+]
$params['tplAltLink'] = isset($tplAltLink) ? $tplAltLink : '';
// Template for alternating links
/**
* Tag-specific parameters
*--------------------------------------------------------------------------*/
$params['sortTags'] = isset($sortTags) ? $sortTags : 'count DESC';
// Sort tag items
// Possible fields: tag, count
// Add ASC or DESC to change the sort order, example: &sortTags=`tag ASC`
// Default: count DESC
$params['maxTags'] = isset($maxTags) ? intval($maxTags) : 100000;
// Maximum number of tags to display in the result
$params['offsetTags'] = isset($offsetTags) ? intval($offsetTags) : 0;
// Offset for the tags result
$params['tplTag'] = isset($tplTag) ? $tplTag : '@FILE:tpl/tag.tpl';
// Template for each individual tag
// Default: @FILE:tpl/tag.tpl
// Possible placeholders:
// [+url+], [+class+], [+tag+], [+count+], [+favlinks_links+]
/**
* Date-specific parameters
*--------------------------------------------------------------------------*/
$params['groupByYears'] = isset($groupByYears) ? intval($groupByYears) : 1;
// To show dates grouped by years, set to 1
// To show dates grouped by combined month and year, set to 0
// Default: 1
// Note: If this is set to 0, only &tplMonth will be used
$params['sortYears'] = isset($sortYears) ? $sortYears : 'ASC';
// Direction to sort the years
// Can be: ASC (for ascending order) or DESC (for descending)
// Default: ASC
$params['sortMonths'] = isset($sortMonths) ? $sortMonths : 'ASC';
// Direction to sort the months
// Can be: ASC (for ascending order) or DESC (for descending)
// Default: ASC
$params['tplYear'] = isset($tplYear) ? $tplYear : '@FILE:tpl/year.tpl';
// Template for each year
// Default: @FILE:tpl/year.tpl
// Possible placeholders:
// [+url+], [+year+], [+count+], [+favlinks_months+]
$params['tplMonth'] = isset($tplMonth) ? $tplMonth : '@FILE:tpl/month.tpl';
// Template for each month
// Default: @FILE:tpl/month.tpl
// Possible placeholders:
// [+url+], [+month+], [+month_name+], [+year+], [+count+], [+favlinks_links+]
/*--------------------------------------------------------------------------*/
include_once($params['basePath'] . 'classes/favoritelinks.class.inc.php');
if ($params['paginate']) // Set offset according to requested value
{
$params['offsetPage'] = isset($_REQUEST['offset']) ? intval($_REQUEST['offset']) : 0;
$params['offsetLinks'] += ($params['offsetPage'] * $params['maxLinks']);
}
if (class_exists('FavoriteLinks'))
$favlinks = new FavoriteLinks($params);
else
{
$modx->logEvent(1, 3, 'FavoriteLinks: Error loading main class:' . $params['basePath'] . 'classes/favoritelinks.class.inc.php');
return 'FavoriteLinks: Error loading main class';
}
return $favlinks->execute();
?>
Please post any comments, feature requests, bug reports below.