Difference between revisions of "How to change ordering after featured listings"

From JReviews Documentation
Jump to: navigation, search
Line 23: Line 23:
 
<source lang="php">
 
<source lang="php">
 
case 'featured':
 
case 'featured':
     $order = '`Listing.featured` DESC, Listing.title ASC';
+
     $order = 'Field.featured DESC, Listing.title ASC';
 
</source>
 
</source>
  
Line 30: Line 30:
 
<source lang="php">
 
<source lang="php">
 
case 'featured':
 
case 'featured':
     $order = '`Listing.featured` DESC, Listing.hits DESC';
+
     $order = 'Field.featured DESC, Listing.hits DESC';
 
</source>
 
</source>
  
Line 38: Line 38:
 
<source lang="php">
 
<source lang="php">
 
case 'featured':
 
case 'featured':
     $order = '`Listing.featured` DESC, Totals.user_rating DESC, Totals.user_rating_count DESC';
+
     $order = 'Field.featured DESC, Totals.user_rating DESC, Totals.user_rating_count DESC';
 
</source>
 
</source>
  
Line 47: Line 47:
 
<source lang="php">
 
<source lang="php">
 
case 'featured':
 
case 'featured':
     $order = '`Listing.featured` DESC, Totals.editor_rating DESC, Totals.editor_rating_count DESC';
+
     $order = 'Field.featured DESC, Totals.editor_rating DESC, Totals.editor_rating_count DESC';
 
</source>
 
</source>
  
Line 55: Line 55:
 
<source lang="php">
 
<source lang="php">
 
case 'featured':
 
case 'featured':
     $order = '`Listing.featured` DESC, Totals.user_comment_count DESC';
+
     $order = 'Field.featured DESC, Totals.user_comment_count DESC';
 
</source>
 
</source>
  

Revision as of 22:52, 1 April 2014

When you set the default ordering for list pages to Featured in global configuration, the rest of the listings below featured will be ordered by submission date.

If you want to change that, edit this file:

  • /com_jreviews/jreviews/models/everywhere/everywhere_com_content.php


Find the code for featured ordering:

case 'featured':
 
   // ... some other lines in between ...
 
   $order = 'Field.featured DESC, Field.contentid DESC';


And change it to one of the below, depending which ordering after featured listings you want:


Ordering by title

case 'featured':
    $order = 'Field.featured DESC, Listing.title ASC';


Ordering by most viewed listings

case 'featured':
    $order = 'Field.featured DESC, Listing.hits DESC';


Ordering by highest user rating

case 'featured':
    $order = 'Field.featured DESC, Totals.user_rating DESC, Totals.user_rating_count DESC';


Ordering by highest editor rating

case 'featured':
    $order = 'Field.featured DESC, Totals.editor_rating DESC, Totals.editor_rating_count DESC';


Ordering by number of reviews

case 'featured':
    $order = 'Field.featured DESC, Totals.user_comment_count DESC';