Page 1 of 1
[SOLVED][OWN SOLUTION]Ordering of Category File View?
Posted: 01 Mar 2011, 10:30
by bruzzler
Hi Jan,
do I miss something? Isn't it actually possible to display an order-field in the categories, as it is in the backend under "options"? So the user can sort the files i.e. "most downloaded" etc.
Thanks for feedback
André
Re: Ordering of Category File View?
Posted: 05 Mar 2011, 20:44
by Jan
Hi, for now this feature was not implemented yet.
Jan
Re: Ordering of Category File View?
Posted: 20 Jun 2012, 09:59
by bruzzler
Any update on this? Is it planned?
Is it possible to extract the Code for ordering in the Admin-section to the frontend?
Thanks
Re: Ordering of Category File View?
Posted: 26 Jun 2012, 23:04
by Jan
Still not implemented

but I hope this will be done soon.
Jan
Re: Ordering of Category File View?
Posted: 23 Jul 2012, 11:16
by bruzzler
I did this on my own and want to share this with you. Hope this helps.
components/com_phocadownload/models/category.php
changed function _getFileOrdering:
function _getFileOrdering() {
global $mainframe;
if (empty($this->_file_ordering)) {
$params = &$mainframe->getParams();
$ordering = $params->get(
'file_ordering', 1 );
$this->_file_ordering =
PhocaDownloadHelperFront::getOrderingText($ordering);
}
$filter_order =
$mainframe->getUserStateFromRequest('file_ordering', 'file_ordering', '', 'cmd');
if($filter_order){
$this->_file_ordering = $filter_order;
$this->_file_ordering= str_replace('DESC','
DESC',$this->_file_ordering);
$this->_file_ordering= str_replace('ASC','
ASC',$this->_file_ordering);
return $this->_file_ordering;
}else{
return $this->_file_ordering;
}
}
components/com_phocadownload/views/category/tmpl/default.php
Row 62 added:
$filter_order = $mainframe->getUserStateFromRequest('file_ordering',
'file_ordering', '', 'cmd');
?>
<div style="text-align:right;margin:10px 0;"> <script type="text/javascript">
function sendordering(){
document.getElementById('sfordering').submit();
}
</script>
<form action="" method="post" id="sfordering"> <select name="file_ordering" onchange="sendordering();"> <option value="title" <?php if($filter_order=='title'){echo 'selected="selected"';}?>>Name</option>
<option value="publish_up DESC" <?php
if($filter_order=='publish_upDESC'){echo
'selected="selected"';}?>>Neueste</option>
<option value="hits DESC" <?php if($filter_order=='hitsDESC'){echo
'selected="selected"';}?>>Am meisten aufgerufen</option> </select> </form> </div>
Row 81 added
if($filter_order){
echo '<input type="hidden" name="file_ordering"
value="'.$filter_order.'" />';
}
Re: [SOLVED][OWN SOLUTION]Ordering of Category File View?
Posted: 09 Aug 2012, 08:07
by Jan
Hi, thank you very much for this info, this will help me to implement it, thank you, Jan