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é
[SOLVED][OWN SOLUTION]Ordering of Category File View?
-
- Phoca Member
- Posts: 11
- Joined: 13 Jan 2011, 09:36
[SOLVED][OWN SOLUTION]Ordering of Category File View?
Last edited by bruzzler on 23 Jul 2012, 11:24, edited 1 time in total.
- Jan
- Phoca Hero
- Posts: 48595
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Ordering of Category File View?
Hi, for now this feature was not implemented yet. 
Jan

Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 11
- Joined: 13 Jan 2011, 09:36
Re: Ordering of Category File View?
Any update on this? Is it planned?
Is it possible to extract the Code for ordering in the Admin-section to the frontend?
Thanks
Is it possible to extract the Code for ordering in the Admin-section to the frontend?
Thanks
- Jan
- Phoca Hero
- Posts: 48595
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Ordering of Category File View?
Still not implemented
but I hope this will be done soon.
Jan


Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 11
- Joined: 13 Jan 2011, 09:36
Re: Ordering of Category File View?
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.'" />';
}
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.'" />';
}
- Jan
- Phoca Hero
- Posts: 48595
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: [SOLVED][OWN SOLUTION]Ordering of Category File View?
Hi, thank you very much for this info, this will help me to implement it, thank you, Jan
If you find Phoca extensions useful, please support the project