Extension:Favorites

What can this extension do?
This extension is designed to create a list of Favorites for each user, similar to the Watchlist. It also allows for the list of favorites to be embedded on a page using a tag.

Usage
Users add items to the Favorite list by either selecting Favorite from the navigation menu, or by clicking the Star icon (if implemented - see Configuration parameters). Conversely, removing a Favorite from the list is a matter of clicking Unfavorite or clicking the Star a second time. Users can also edit their list through the Special:Favoritelist page using the same features included with the Watchlist.

Special Page
This extension creates a new Special page called Favoritelist. A link to this page can be added to the MediaWiki:Sidebar as such:

**Special:Favoritelist|Favorites

Alternatively, you may want to display the "My Favorites" link at the top of the page next to the "My Watchlist" link. To do this, see Configuration parameters.

Parser Tag
You can embed favorites on any page using the following tag:

This tag takes the following arguments:

editlink=true userpage=true


 * The "editlink" argument will add a link at the bottom of the list that will allow the user to edit their list of favorites.
 * The "userpage" argument will allow you to display your favorites on your user page. This argument will only work on a user page.  Of course, leaving this argument off will display the logged-in user's own list, even while viewing someone else's user page.
 * If both arguments are combined, the edit link will display, but it will take the user back to their list of favorites, not those of the user they are viewing. Of course, this could get confusing, so it's not recommended.

Examples:

Installation
To install this extension, use the Download snapshot link, above. Place Favorites in your MediaWiki's extensions directory. Finally, add the following to LocalSettings.php:

Database Update
This extension also requires a new table in your database.

The easiest way to do this is to run MediaWiki's standard updater (your designated database user needs to have CREATE rights on your MediaWiki database):

php maintenance/update.php

If you do not have command-line access to your server, you can manually apply the favorites.sql file's commands to your database. Remember to use the proper table prefix, if applicable.

Installation can be verified through Special:Version

Uninstalling
Most extensions can be removed by deleting them and editing LocalSettings.php to remove references to it. Since this extension makes changes to your database, removing it additionally requires undoing database changes. It's as simple as removing the favoritelist table from the database.

If you have access to your database using a tool like PHPMyAdmin, you can just delete the table. For commandline access or to use a script, you would use this command:

Configuration parameters
The below configuration parameters add further functionality to the Favorites extension. Simply add the parameters to your LocalSettings.php file before the "require_once" line.

If using both parameters, your LocalSettings.php file should look like this:

Star Icon
This extension utilizes the same "Star" icon that is included with the Vector Watchlist portion of the Usability Initiative extension. If you wish to use the Star for your favorites, add the following parameter to LocalSettings.php:

If you are already using the Star icon for your watched items, you may want to set $wgVectorUseIconWatch to false in LocalSettings.php.

Personal URL
In order to add a link to "My Favorites" to the Personal Urls section of MediaWiki right next to "My Watchlist", add the following parameter to LocalSettings.php: