We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19667
    • 26 Posts
    Basically really cool, but...

    The bookmarklet points (in my case ) to the wrong directory.
    http://myurl/modxdir/modxdir/index.php?id=47

    If modx is installed in the rootdir it would work fine. I reckon.

    After I changed it, it worked. But the tags and xfn werenot saved to the database table. Url,Title,Summ worked.
    Same with the form.
    The form action tag read modxdir/index.php?id=47 and would not work without a leading slash.

    Cool idea to use the keywords as tag proposals. wink

    I keep on testing.
      • 1932
      • 137 Posts
      I’ve updated the FavoriteLinksForm code above, it should fix issues when using MODx in a sub-directory.

      I decided to leave out XFN on the main bookmarklet page (didn’t think it would be used all that often) but the snippet should handle the XFN field should you want it. I’ve re-added it to the form template and also fixed issues with the tag field.
        • 19667
        • 26 Posts
        Yep. Now it works. Nice work.
        Will use it and report back.
          • 23491 ☆ A M B ☆
          • 1,056 Posts
          Look at ApoxX tearing up the scene again wink Sweet stuff, Brian. How much do we owe you?
            Mike Reid - www.pixelchutes.com
            MODx Ambassador / Contributor
            [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
            ________________________________
            Where every pixel matters.
            • 27376
            • 576 Posts
            Just got a chance to try this combo out and it works perfectly! I’m using it for a very simple list with two tags, but I might implement it on my personal site in the future!

            Some things I’d like to see:

            • del.icio.us import feature
            • tags in comma delimited list on manager side instead of a combobox
            • AJAX reloading when a tag is selected? (low priority)
            • Change display format from data grid to a list format (or customized by chunk?)

            Overall, great combo, VERY easy to use, I was expecting I’d have to add the db table myself, but it was all automatic smiley

            Great Module / Snippet combo!

            EDIT: Some coding updates:

            • You’re getting the manager theme from the database, instead just use [tt]global $manager_theme;[/tt] in your module code, it will speed things up a little.
            • You should remove coolbuttons.css from your <link>’ing as it is not included in most manager themes.
            • For some reason the font is really big. I couldn’t find the reason for this...
              • 22533
              • 41 Posts
              First things first, thank you for this great plugin / snippet. smiley

              I just wanted to know if there was some new development scheduled?

              I’m thinking about the tag cloud feature... tongue
                • 1932
                • 137 Posts
                Glad you like it. Yes, I’ve been busy with other projects lately but I plan to have a snippet which handles tag cloud/listing and listing by date done by the end of next week.
                  • 867
                  • 241 Posts
                  This great news.
                  A directory snippet is a great thing for Modx I reckon.

                  Thanks for all the great works.
                    • 867
                    • 241 Posts
                    Hi!

                    I just installet favoritelink but i can’t manage to set the output.

                    I create a chunk with just :
                    <div> <a href="[+url+]"> [+title+]<a/> </div>

                    and in my content :
                    [[FavoriteLinks &rowChunk=`links` ]]

                    Am I forgetting something ?

                    Thanks in advance.
                    nb : [[FavoriteLinks]] work and ouput a link with the title but i would like to ad a summary, date etc..
                      • 1932
                      • 137 Posts
                      @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.