A Garage Sale Plugin for Wordpress
Um diese Seite in Deutsch anzuzeigen, klicken Sie bitte hier.
This plugin is a lightweight solution to put a kind of yard sale on your wordpress blog.
Users can put their stuff with a picture, description, price and contact details on a wordpress page.
The users are wordpress users with access right Subscriber (so every registered user can use the garage sale).
The plugin was successfully tested with the current version of 3.8 and 3.8 Multisite Wordpress.
Download the Plugin from download.
Unzip the ZIP file in your wordpress plugin directory (usually WORDPRESS-INSTALLATION-DIR/wp-content/plugins).
Finally activate the plugin as an administrator in the plugin section.
Every User with the role Subscriber can now add items to the online sale using the administration user interface with the menu GarageSale Add Item or directly in the Dashboard Widget.
The user can define a title, the contact details, a description, a price and upload a picture for every item.
The user can set the item to sold (these items will not be displayed in the public area) or fully delete the item in the list of items.
The administrator can access all records of all users using the menu Settings › Garage Sale Admin and can delete or change the records if necessary.
To display the garage sale on a page of your wordpress blog, simply add the text [GarageSaleList] to a static page and the plugin automatically shows the list of all active items on this location.
Now all (not saled) items of all users are displayed on this page.
The name of the user is taken from the profile using the field Display name publicly as.
The layout for the users view starts with the call of the file templates/getList4User.tpl.php from method GarageSalePlugin::theContent, which uses the wordpress hook the_content to check all displayed pages for the text [GarageSaleList].
The table is created by the class GarageSale_List_Table4User from file php/garagesale_list_table4user.php.
This class is inspired by the class WP_List_Table, which is used for all tables in the administration user interface.
These methods are interesting for modifications:
- column_default() - display of the columns
- displayPageNav() - display of the page navigation
- displayTable() - display of the table
In opposition to the class WP_List_Table the method GarageSale_List_Table4User::displayTable() returns the output instead of displaying it directly!
- Number of items per page:
since version 1.2.1: file garagesale.php - search for define GARAGESALE_ITEMS_PER_PAGE
Click the menu delete in the plugin administration user interface and the plugin, all additional tables and all pictures uploades from the users will be removed.
ATTENTION: all data and pictures are irrecoverable lost after deleting the plugin!
- Categories - A field category already exists and can be used as a reference to a category table or as primary key of an associative array.
- WP Media-Uploader - The usage of the Wordpress Media-Uploader was already implemented, but there are some problems, because the users need the capabilities upload-files and edit_posts. With this capabilities, the users are able to change or delete pictures from media gallery or modify posts. So I removed this code and wrote an own upload mechanism.
But if anyone disires this, I can upload the (unfinished and untested) version which uses the Media-Uploader.
- Translations - The necessary language file for german/english is located in the directory languages. A translation in other languages is explicitly desired.
A HowTo about multilinguality of Wordpress Plugins can be found here (in german): http://www.nullpointer.at/2012/04/08/mehrsprachigkeit-wordpress-plugins/
- Change colors und hide author/contact information - see wordpress forum: http://wordpress.org/support/topic/category-colors-to-light?replies=3
Copyright 2012-2014 Leo Eibler (http://www.eibler.at)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.