Code: |
#################################################################
## MOD Title: Categories Collapse to Top
## MOD Version: .99
## MOD Author: Murmur (Mike McKeown)
## MOD Description:
## When in the collapsed categories view, this mod
## moves the open category to the top of the list
## of categories.
##
## Installation Level: Easy
## Installation Time: 1-2 Minutes
## Files To Edit (1): index.php
## Added queries: 0
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]---------------------------------------------
#
index.php
#
#-----[ FIND ]---------------------------------------------
# around line 130
if( ( $total_categories = count($category_rows) ) )
{
#
#-----[ AFTER, ADD ]---------------------------------------
#
if($viewcat != -1) {
for ($i = 0; $i < $total_categories; $i++ ) {
if($viewcat == $category_rows[$i]['cat_id']) {
$category_rows[$i]['cat_order'] = -999;
break;
}
}
usort($category_rows,'cat_sort');
}
#
#-----[ FIND ]---------------------------------------------
# at End of File
?>
#
#-----[ BEFORE, ADD ]---------------------------------------
#
function cat_sort($x, $y) {
if ( $x['cat_order'] == $y['cat_order'] )
return 0;
else if ( $x['cat_order'] < $y['cat_order'] )
return -1;
else
return 1;
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
|