wp–Recent–Links

1.33 (March 2, 2005)

Requirements | Changelog | Installation | Upgrade | Functions | Help | Copying

wp–recent–links is a WordPress plugin (hack!) for adding a links blog to your WordPress–powered site, similar to kottke.org’s remaindered links. A working example can be seen at the author’s weblog. Compared to WordPress’s included links manager, this plugin allows you to have a separate archives page for your links blog, with monthly archives. An RSS2 feed is also included for syndicating your links.

Requirements

The plugin version has been tested on WordPress 1.5 and 1.2 without any known issues.

This document’s formatting and style was inspired (ripped?) from WP’s readme.html, and is provided for users of this hack.

Changelog

1.33 (March 2, 2005)
Cleaned up header() errors.
1.32 (February 22, 2005)
This plugin now works seamlessly with wp-1.5-strayhorn!
Submenu items added under “Write” and “Manage.”
add_magic_quotes() conditionally used for older versions only.
Bookmarklet tweaked.
1.31 (May 25, 2004)
Fixed some small bugs, including the unset $siteurl variable in the bookmarklet. Thanks Georg Bauer!
1.3 (May 19, 2004)
This hack is now a wp-1.2 compatible plugin!
Separate sets of files for wp-1.2 and wp-1.0 are included in the package.
Fixed all functions, especially those containing some copy-and-paste bugs. :) Older rpmod_* functions are now deprecated, in favor of the plugin-flavored rp_* function names. Older functions will still work (and now, correctly) but you are advised to make use of the new ones.
A new template for the recent links archive page has been made based on the wp-1.2 index.php file.
Fixed/added other stuff I couldn’t remember right now. :)
1.21 (May 17, 2004)
Fixed non-display of captions (in title attribute), a result of my mastery of copy-and-paste without looking. :)
1.2 (May 14, 2004)
Added an rss2 feed for links syndication. Link to the feed is given by the rpmod_recentlinks_rss2_url() function, another addition.
Fixed the displayed text for the title attribute produced by the function rpmod_recentlinks(), now more simpler. If you didn’t add a description, you will simply get the date.
1.11 (April 27, 2004)
Removed some unnecessary "breaks", which caused a problem for some users. (As reported by Kate. Thanks Kate!)
1.1 (April 5, 2004)
Added bookmarklet, taken from "Press It" on the WP main post window. (Suggested by Stephen.)
Fixed a bug involving time differences on servers. (Thanks Sushubh!)

Installation

  1. Unzip the package in an empty directory.
  2. Choose the proper directory for the WP version you are using. wp-1.0 uses the my-hacks.php file, while wp-1.2+ uses the newer plugin format.
    Upload/Copy/Edit the following files:
    wp-recent-links-setup.php
    Upload to your wordpress root. Used only once for creating the required table.
    wp-recent-links.php
    Upload to your wordpress root; i.e, the folder where your WordPress-powered page will reside.
    wp-recent-links-rss2.php
    Upload to your wordpress root; i.e, the folder where your WordPress-powered page and syndication pages reside.
    recent-links.php
    Upload inside your wp-admin/ directory.
    menu.php or menu.txt
    (For versions older than 1.5) If you haven’t edited the default menu.php or menu.txt file in your wordpress install, it is safe to copy/upload this to your wp-admin/ directory and overwrite the original file.

    If you have edited it before, just add a new menu item with a user level of 5, pointing to recent-links.php and named “Recent Links.”

    rp-plugin-recent-links.php or my-hacks.php
    For wp-1.2, just drop the rp-plugin-recent-links.php file into your wp-content/plugins/ directory, and activate it in the plugins menu. For wp-1.0, copy the functions inside my-hacks.php to your current my-hacks.php file, and make sure it is enabled in WordPress’s options. if you currently don’t have one, just upload this file and enable it in the options page.
  3. If you are using WordPress’s mod_rewrite rules, add the following rules to your .htaccess file on the server (where you also placed WP’s generated rewrite rules):
    
    RewriteRule    ^recent-links/feed?/?$    wp-recent-links-rss2.php   [QSA]
    RewriteRule    ^recent-links?/?$    wp-recent-links.php   [QSA]
    RewriteRule    ^recent-links/([0-9]{4})?/?([0-9]{1,2})?/?$    wp-recent-links.php?y=$1&m=$2   [QSA]
          
  4. Open wp-recent-links-setup.php in your browser, and follow the one-step instruction! after this, you are good to go! You may now delete wp-recent-links-setup.php.
  5. Login to WordPress and start using your recent-links hack, using the new menu item "Recent Links."
  6. Edit wp-recent-links.php to your site’s style and design.
  7. To display your recent links on your frontpage (index.php), just insert the following block of code after the <div id="menu"> line (or anywhere you want, really!)
    
    <!-- begin recent links block -->
    <h2>Recent Links</h2>
    <ul>
        <?php rp_recentlinks(12, true, false); ?>
         <li><a href="<?php rp_recentlinks_archives_url(); ?>" title="Recent Links Archives" rel="Links Archives">more &#187;</a> | <a href="<?php rp_recentlinks_rss2_url(); ?>" title="RSS2 Feed for recently added links." rel="RSS2 Feed.">feed &#187;</a></li>
    </ul>
    <!-- end recent links block -->
    

Upgrade

If you have earlier versions of wp-recent-links installed, just overwrite recent-links.php, wp-recent-links-rss2.php as well as the wp-recent-links functions inside your my-hacks.php file. For plugin users, just drop the new rp-plugin-recent-links.php into your wp-content/plugins/ directory. That’s all!

Functions

Listed below are the functions made available for use by this plugin.

<?php rp_recentlinks_archives_url(); ?>
Displays the URL of the archives page for the recent links plugin.

<?php rp_recentlinks_rss2_url(); ?>
Displays the URL of the RSS 2 feed for the recent links plugin.

<?php rp_recentlinks_month($limit = '', $show_link_count = false, $use_permalink = false, $permalink_beginning = true, $permalink_icon = '#', $inline_caption = false, $date_append = 'F j', $before = '<li>', $after = '</li>', $between = "\n"); ?>
Displays the links for the given month.

<?php rp_recentlinks_archives($limit = '', $show_link_count = false, $before = '<li>', $after = '</li>', $between = "\n"); ?>
Displays the monthly archives for the recent links plugin.

Help

Questions, reactions and, suggestions regarding this hack may be posted on the author’s site, just as you can email him at markku at rebelpixel dot com.

Copying

Copying, modification and redistribution is allowed under the terms of the GPL, better explained by the CC–GPL (Creative Commons Deed). If you found this hack useful, don’t hesitate to link to my site and the projects’s page.