1.32 (February 22, 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
- PHP4 (version 4.0.6 or higher)
- MySQL (version 3.23.23 or higher)
- WordPress 1.5 or 1.2 (Users of earlier
versions should upgrade their WP, or stick with 1.31.
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.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
- Unzip the package in an empty directory.
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.
- 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]
- 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.
- Login to WordPress and start using your recent-links hack,
using the new menu item "Recent Links."
- Edit wp-recent-links.php to your site’s style and design.
- 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 »</a> | <a href="<?php rp_recentlinks_rss2_url(); ?>" title="RSS2 Feed for recently added links." rel="RSS2 Feed.">feed »</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($limit = 12,
$use_permalink = false,
$permalink_beginning = true,
$permalink_icon = '#',
$inline_caption = false,
$date_append = 'F j',
$before = '<li>',
$after = '</li>',
$between = "\n"); ?>
Displays the most recent links added to your linklog.
- $limit - The number of links to display.
Defaults to 12.
- $use_permalink - Use permalinks for your links? True or False.
Defaults to false.
- $permalink_beginning - Permalink at the beginning of the link? True or False.
Defaults to True.
- $permalink_icon - Permalink icon used.
Defaults to the commonly-used '#' character.
- $inline_caption - Use inline captions, in addition to the title attribute.
Defaults to false.
- $date_append - Date format of the date string added for a link's title attribute.
This is based on PHP's date() function.
Defaults to 'F j', which displays March 22.
Other suggested formats:
jS M Y @ g A ==> 22nd Mar 2004 @ 5 PM
M j ==> Mar 22
- $before - String to add before the link-formatted text.
Defaults to "<li>"
- $after - String to add after the link-formatted text.
Defaults to "</li>"
- $between - String to add after a link. This is added after the $after string.
Defaults to "\n" (newline)
<?php rp_recentlinks_archives_url(); ?>
Displays the URL of the archives page 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.
- $limit - The number of links to display.
Defaults to 12.
- $show_link_count - Show link count for given month? True or False.
Defaults to false.
- $use_permalink - Use permalinks for your links? True or False.
Defaults to false.
- $permalink_beginning - Permalink at the beginning of the link? True or False.
Defaults to True.
- $permalink_icon - Permalink icon used.
Defaults to the commonly-used '#' character.
- $inline_caption - Use inline captions, in addition to the title attribute.
Defaults to false.
- $date_append - Date format of the date string added for a link's title attribute.
This is based on PHP's date() function.
Defaults to 'F j', which displays March 22.
Other suggested formats:
jS M Y @ g A ==> 22nd Mar 2004 @ 5 PM
M j ==> Mar 22
- $before - String to add before the link-formatted text.
Defaults to "<li>"
- $after - String to add after the link-formatted text.
Defaults to "</li>"
- $between - String to add after a link. This is added after the $after string.
Defaults to "\n" (newline)
<?php rp_recentlinks_archives($limit = '',
$show_link_count = false,
$before = '<li>',
$after = '</li>',
$between = "\n"); ?>
Displays the monthly archives for the recent links plugin.
- $limit - The number of links to display.
Defaults to '', which shows all.
- $show_link_count - Show link count for given month? True or False.
Defaults to false.
- $before - String to add before the link-formatted text.
Defaults to "<li>"
- $after - String to add after the link-formatted text.
Defaults to "</li>"
- $between - String to add after a link. This is added after the $after string.
Defaults to "\n" (newline)
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.