Jump to content


[Hack] Sort MKPortal Gallery Images by Title


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

#1 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 26 July 2006 - 10:13 AM

It is simple to change default sorting in the modules. Here are instructions for the gallery section_view

FIND in /modules/gallery/index.php (function section_view):
		switch($mkportals->input['order']) {
		case '1':
			$order = "ORDER BY `titolo`";
		break;
		default:
			$order = "ORDER BY `id` DESC";
		break;
		}
REPLACE WITH:
		//ORDER BY title
		switch($mkportals->input['order']) {
		case '1':
			//$order = "ORDER BY `titolo`";
			$order = "ORDER BY `id` DESC";
		break;
		default:
			//$order = "ORDER BY `id` DESC";
			$order = "ORDER BY `titolo`";
		break;
		}
FIND:
	 	$sort = "
		<select name="order" size="1" onchange="selChoe(this, '$idev')"  class="bgselect">
		 <option value="0">{$mklib->lang['ga_orderby']}</option>n
		 <option value="1">{$mklib->lang['ga_nameimg']}</option>n
		 <option value="2">{$mklib->lang['ga_dateins']}</option>n
		  </select>
		 ";
REPLACE WITH:
	 	$sort = "
		<select name="order" size="1" onchange="selChoe(this, '$idev')"  class="bgselect">
		 <option value="0">{$mklib->lang['ga_orderby']}</option>n
		 <option value="2">{$mklib->lang['ga_nameimg']}</option>n
		 <option value="1">{$mklib->lang['ga_dateins']}</option>n
		</select>
		 ";



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