lol I did it
But this is not professional work and I think shouldnt use in official ver.
This is only for who wants to have all sorting option like me.
language/english/modinfo.phpadd bellow: define("_MI_PUBLISHER_ORDERBY_RATING","Rating DESC");
define("_MI_PUBLISHER_ORDERBY_VOTES","Votes DESC");
define("_MI_PUBLISHER_ORDERBY_COMMENTS","COMMENTS DESC");
xoops_version.phpreplace: $modversion['config'][$i]['options'] = array(_MI_PUBLISHER_PUBLISHED => _PUBLISHER_STATUS_PUBLISHED,
_MI_PUBLISHER_OFFLINE => _PUBLISHER_STATUS_OFFLINE,
_MI_PUBLISHER_SUBMITTED => _PUBLISHER_STATUS_SUBMITTED,
_MI_PUBLISHER_REJECTED => _PUBLISHER_STATUS_REJECTED);
with: $modversion['config'][] = array(
'name' => 'format_order_by',
'title' => '_MI_PUBLISHER_ORDERBY',
'description' => '_MI_PUBLISHER_ORDERBYDSC',
'formtype' => 'select',
'valuetype' => 'text',
'options' => array(
_MI_PUBLISHER_ORDERBY_TITLE => 'title',
_MI_PUBLISHER_ORDERBY_DATE => 'date',
_MI_PUBLISHER_ORDERBY_RATING => 'rating',
_MI_PUBLISHER_ORDERBY_VOTES => 'votes',
_MI_PUBLISHER_ORDERBY_COMMENTS => 'comments',
_MI_PUBLISHER_ORDERBY_WEIGHT => 'weight'),
'default' => 'date',
'category' => 'format'
);
item.phpreplace: switch ($publisher->getConfig('format_order_by')) {
case 'title' :
$sort = 'title';
$order = 'ASC';
break;
case 'date' :
$sort = 'datesub';
$order = 'DESC';
break;
default :
$sort = 'weight';
$order = 'ASC';
break;
}
with: switch ($publisher->getConfig('format_order_by')) {
case 'title':
$sort = 'title';
$order = 'ASC';
break;
case 'date':
$sort = 'datesub';
$order = 'DESC';
break;
case 'rating' :
$sort = 'rating';
$order = 'DESC';
break;
case 'votes' :
$sort = 'votes';
$order = 'DESC';
break;
case 'comments' :
$sort = 'comments';
$order = 'DESC';
break;
default :
$sort = 'weight';
$order = 'ASC';
break;
}
index.phpreplace: switch ($publisher->getConfig('format_order_by')) {
case 'title' :
$sort = 'title';
$order = 'ASC';
break;
case 'date' :
$sort = 'datesub';
$order = 'DESC';
break;
default :
$sort = 'weight';
$order = 'ASC';
break;
}
with: switch ($publisher->getConfig('format_order_by')) {
case 'title':
$sort = 'title';
$order = 'ASC';
break;
case 'date':
$sort = 'datesub';
$order = 'DESC';
break;
case 'rating' :
$sort = 'rating';
$order = 'DESC';
break;
case 'votes' :
$sort = 'votes';
$order = 'DESC';
break;
case 'comments' :
$sort = 'comments';
$order = 'DESC';
break;
default:
$sort = 'weight';
$order = 'ASC';
break;
}
category.phpreplace: switch ($publisher->getConfig('format_order_by')) {
case 'title' :
$sort = 'title';
$order = 'ASC';
break;
case 'date' :
$sort = 'datesub';
$order = 'DESC';
break;
default :
$sort = 'weight';
$order = 'ASC';
break;
}
with: switch ($publisher->getConfig('format_order_by')) {
case 'title' :
$sort = 'title';
$order = 'ASC';
break;
case 'date' :
$sort = 'datesub';
$order = 'DESC';
break;
case 'rating' :
$sort = 'rating';
$order = 'DESC';
break;
case 'votes' :
$sort = 'votes';
$order = 'DESC';
break;
case 'comments' :
$sort = 'comments';
$order = 'DESC';
break;
default:
$sort = 'weight';
$order = 'ASC';
break;
}
BLOCKS
blocks/item_new.phpreplace: $item['title'] = $itemsObj[$i]->title();
if ($sort == "datesub") {
$item['new'] = $itemsObj[$i]->datesub();
} elseif ($sort == "counter") {
$item['new'] = $itemsObj[$i]->counter();
} elseif ($sort == "weight") {
$item['new'] = $itemsObj[$i]->weight();
}
$block['newitems'][] = $item;
with: $item['title'] = $itemsObj[$i]->title();
if ($sort == "datesub") {
$item['new'] = $itemsObj[$i]->datesub();
} elseif ($sort == "counter") {
$item['new'] = $itemsObj[$i]->counter();
} elseif ($sort == "weight") {
$item['new'] = $itemsObj[$i]->weight();
} elseif ($sort == "rating") {
$item['new'] = $itemsObj[$i]->rating();
} elseif ($sort == "votes") {
$item['new'] = $itemsObj[$i]->votes();
}
elseif ($sort == "comments") {
$item['new'] = $itemsObj[$i]->comments();
}
$block['newitems'][] = $item;
replace: $orderEle->addOptionArray(array(
'datesub' => _MB_PUBLISHER_DATE,
'counter' => _MB_PUBLISHER_HITS,
'weight' => _MB_PUBLISHER_WEIGHT,
));
with: $orderEle->addOptionArray(array(
'datesub' => _MB_PUBLISHER_DATE,
'counter' => _MB_PUBLISHER_HITS,
'weight' => _MB_PUBLISHER_WEIGHT,
'rating' => _MI_PUBLISHER_ORDERBY_RATING,
'votes' => _MI_PUBLISHER_ORDERBY_VOTES,
'comments' => _MI_PUBLISHER_ORDERBY_COMMENTS,
));
include/functions.phpreplace: function publisherGetOrderBy($sort)
{
if ($sort == "datesub") {
return "DESC";
} elseif ($sort == "counter") {
return "DESC";
} elseif ($sort == "weight") {
return "ASC";
}
return null;
}
with: function publisherGetOrderBy($sort)
{
if ($sort == "datesub") {
return "DESC";
} elseif ($sort == "counter") {
return "DESC";
} elseif ($sort == "weight") {
return "ASC";
}
elseif ($sort == "votes") {
return "DESC";
}
elseif ($sort == "rating") {
return "DESC";
}
elseif ($sort == "comments") {
return "DESC";
}
return null;
}
Thas all!
Working well for both: starting page and block "recent items list"
If you want to have more than one option in this block, just clone it
If you want to have these sortings on whole or many pages, just use cloned block in dummy module
10x Mamba, It would not happen without you