Nick
03-24-2010, 05:14 AM
Order By Votes
Version: 0.2
Author: Nick Ramsay
Created on: 2010/03/24
Last Updated: 2010/06/04
Tested on: 1.3.0 ~ 1.4.1
Plugins Required: Bookmarking
Plug & Play: Yes
Supported: Yes
Description
A simple plugin to change the default sorting order of the index page to "most votes" instead of "date".
Instructions
1. Upload the "order_by_votes" folder to your plugins folder.
2. Install it from Plugin Management in Admin.
Note
This plugin sorts by "post_votes_up" only, so it's suitable for sites using the Vote (http://hotarucms.org/showthread.php?78-Vote-1.4) plugin, but not the Up Down Voting (http://hotarucms.org/showthread.php?485-Up-Down-Voting-0.2) plugin.
The Code
This plugin is so basic, I thought I'd share the code with you! :cool:
class OrderByVotes
{
/**
* Override the default sort filters for the front page
*/
public function bookmarking_functions_preparelist($h)
{
if ($h->pageName != 'popular') { return false; }
$h->vars['orderby'] = 'post_votes_up DESC, post_date DESC';
}
}Revision History
v.0.2 2010/05/28 - Nick - Updated for compatibility with the Bookmarking plugin
v.0.1 2010/03/24 - Nick - Released first version
Please click "Rate Thread" and give this plugin a rating. Thank you.
Version: 0.2
Author: Nick Ramsay
Created on: 2010/03/24
Last Updated: 2010/06/04
Tested on: 1.3.0 ~ 1.4.1
Plugins Required: Bookmarking
Plug & Play: Yes
Supported: Yes
Description
A simple plugin to change the default sorting order of the index page to "most votes" instead of "date".
Instructions
1. Upload the "order_by_votes" folder to your plugins folder.
2. Install it from Plugin Management in Admin.
Note
This plugin sorts by "post_votes_up" only, so it's suitable for sites using the Vote (http://hotarucms.org/showthread.php?78-Vote-1.4) plugin, but not the Up Down Voting (http://hotarucms.org/showthread.php?485-Up-Down-Voting-0.2) plugin.
The Code
This plugin is so basic, I thought I'd share the code with you! :cool:
class OrderByVotes
{
/**
* Override the default sort filters for the front page
*/
public function bookmarking_functions_preparelist($h)
{
if ($h->pageName != 'popular') { return false; }
$h->vars['orderby'] = 'post_votes_up DESC, post_date DESC';
}
}Revision History
v.0.2 2010/05/28 - Nick - Updated for compatibility with the Bookmarking plugin
v.0.1 2010/03/24 - Nick - Released first version
Please click "Rate Thread" and give this plugin a rating. Thank you.