[SOLVED][OWN SOLUTION]Ordering of Category File View?

Phoca Download - download manager
bruzzler
Phoca Member
Phoca Member
Posts: 11
Joined: 13 Jan 2011, 09:36

[SOLVED][OWN SOLUTION]Ordering of Category File View?

Post 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é
Last edited by bruzzler on 23 Jul 2012, 11:24, edited 1 time in total.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48595
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Ordering of Category File View?

Post by Jan »

Hi, for now this feature was not implemented yet. :-(

Jan
If you find Phoca extensions useful, please support the project
bruzzler
Phoca Member
Phoca Member
Posts: 11
Joined: 13 Jan 2011, 09:36

Re: Ordering of Category File View?

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48595
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Ordering of Category File View?

Post by Jan »

Still not implemented :-( :-( but I hope this will be done soon.

Jan
If you find Phoca extensions useful, please support the project
bruzzler
Phoca Member
Phoca Member
Posts: 11
Joined: 13 Jan 2011, 09:36

Re: Ordering of Category File View?

Post 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.'" />';
}
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48595
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: [SOLVED][OWN SOLUTION]Ordering of Category File View?

Post by Jan »

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
Post Reply