Jump to content


[Hack] Sort Reviews alphabetically by default


  • You cannot reply to this topic
No replies to this topic

#1 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 04 May 2006 - 10:05 AM

To sort the list of reviews alphabetically by title in the MKPReviews module...

FIND in mkportal/modules/reviews/index.php (function reviews_show):
	switch($mkportals->input['order']) {
		case '2':
			$order = "ORDER BY `title`";
		break;
		case '3':
			$order = "ORDER BY `id` DESC";
		break;
		default:
			$order = "ORDER BY `position`";
		break;
	}
REPLACE WITH:
	switch($mkportals->input['order']) {
		case '2':
			//$order = "ORDER BY `title`";
		$order = "ORDER BY `position`";
		break;
		case '3':
			$order = "ORDER BY `id` DESC";
		break;
		default:
			//$order = "ORDER BY `position`";
		$order = "ORDER BY `title`";
		break;
	}
FIND:
	 $sort = "
	<select name="order" size="1" onchange="selChoc(this)" class="bgselect">
	  <option value="0">{$mklib->lang['re_order']}</option>n
	  <option value="1">{$mklib->lang['re_ordpos']}</option>n
	  <option value="2">{$mklib->lang['re_ordnamec']}</option>n
	  <option value="3">{$mklib->lang['re_ordcrea']}</option>n
		  </select>
	 ";
REPLACE WITH:
	 $sort = "
	<select name="order" size="1" onchange="selChoc(this)" class="bgselect">
	  <option value="0">{$mklib->lang['re_order']}</option>n
	  <option value="2">{$mklib->lang['re_ordpos']}</option>n
	  <option value="1">{$mklib->lang['re_ordnamec']}</option>n
	  <option value="3">{$mklib->lang['re_ordcrea']}</option>n
		  </select>
	 ";
FIND in (function section_view):
		switch($mkportals->input['order']) {
		case '1':
			$order = "ORDER BY `title`";
		break;
		default:
			$order = "ORDER BY `id` DESC";
		break;
		}
REPLACE WITH:
		switch($mkportals->input['order']) {
		case '1':
	  $order = "ORDER BY `id` DESC";
			//$order = "ORDER BY `title`";
		break;
		default:
		//$order = "ORDER BY `id` DESC";
			$order = "ORDER BY `title`";	 
		break;
FIND:
	 	$sort = "
		<select name="order" size="1" onchange="selChoe(this, '$idev')"  class="bgselect">
		  <option value="0">{$mklib->lang['re_order']}</option>n
		  <option value="1">{$mklib->lang['re_ordnamef']}</option>n
		  <option value="2">{$mklib->lang['re_ordinsert']}</option>n
		</select>
		 ";
REPLACE WITH:
	 	$sort = "
		<select name="order" size="1" onchange="selChoe(this, '$idev')"  class="bgselect">
		  <option value="0">{$mklib->lang['re_order']}</option>n
		  <option value="2">{$mklib->lang['re_ordnamef']}</option>n
		  <option value="1">{$mklib->lang['re_ordinsert']}</option>n
		</select>
		 ";
I think that should do it. Sorry the formatting of the code in this post is a little screwy.


Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users