Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • Fred Tep Friend
    #705987

    Hello,

    I’ve installed the amazing JA K2 filter on my website. It’s working but I can’t order the item the way I want (most recent first).
    I’m searching by tag and it’s working fine with the signaletique tag. When I click on the signaletique tag, the order is the same whatever the configuration I use either on the component parameters or the module parameters.
    Can somebody help me with that ?

    Have a fun day

    Mo0nlight Moderator
    #706156

    Hi fredtep.

    You could fix the problem by adding this code to file :

    com_jak2filter/models/itemlist.php

    line 360

    //Set ordering
    if (empty($order_fields)) { // set default ordering if no ordering choosen.
    if ($jaK2FilterParams->get('catOrdering'))
    $order_fields[$jaK2FilterParams->get('catOrdering')] = $jaK2FilterParams->get('catOrdering');
    }

    Regards

    Mo0nlight Moderator
    #752373

    Hi fredtep.

    You could fix the problem by adding this code to file :

    com_jak2filter/models/itemlist.php

    line 360

    //Set ordering
    if (empty($order_fields)) { // set default ordering if no ordering choosen.
    if ($jaK2FilterParams->get('catOrdering'))
    $order_fields[$jaK2FilterParams->get('catOrdering')] = $jaK2FilterParams->get('catOrdering');
    }

    Regards

    Fred Tep Friend
    #706594

    Great, it’s working just fine. I’ll be glad to offer you a beer if you come in Dordogne (France).
    Last question and i’ll stop bothering you this week.
    Is there a way to add a “most recent first by created date” field in the item ordering option. For now only “most recent first by published date” is available. I can modify my published date but this option would be usefull.
    Thanks for you help

    Fred Tep Friend
    #752511

    Great, it’s working just fine. I’ll be glad to offer you a beer if you come in Dordogne (France).
    Last question and i’ll stop bothering you this week.
    Is there a way to add a “most recent first by created date” field in the item ordering option. For now only “most recent first by published date” is available. I can modify my published date but this option would be usefull.
    Thanks for you help

    Mo0nlight Moderator
    #706721

    Hi Fred.

    You can do it by changing the file

    /components/com_jak2filter/models/itemlist.php

    line 370-372
    Change

    case 'date' :
    $orderby['date'] = 'i.created ASC';
    break;

    To

    case 'adate' :
    $orderby['adate'] = 'i.created ASC';
    break;

    case 'zdate' :
    $orderby['zdate'] = 'i.created DESC';
    break

    /modules/mod_jak2filter/helper.php
    line: 1400-1401
    Change

    $options[] = JHtml::_('select.option', 'date', JText::_('JAK2_OLDEST_FIRST'));
    // $options[] = JHtml::_('select.option', 'rdate', JText::_('JAK2_MOST_RECENT_FIRST'));

    To

    $options[] = JHtml::_('select.option', 'adate', JText::_('JAK2_OLDEST_FIRST'));
    $options[] = JHtml::_('select.option', 'zdate', JText::_('JAK2_MOST_RECENT_FIRST'));

    /modules/mod_jak2filter/tmpl/default.php
    line 266-272

    <div class="group-controls">
    <?php if (!in_array($kfs, array('zelevance', 'best', 'modified', 'publishUp'))) : ?>
    <div class="controls"><input type="radio" <?php echo(strpos($fs, 'r') !== 0 ? ' checked="" ' : '') ?> name="orders[<?php echo(ltrim($fs, 'r')); ?>]" value="<?php echo ltrim($fs, 'r'); ?>"/><p class="ascending"><?php echo JText::_("JAK2ASC"); ?></p></div>
    <?php endif; ?>
    <div class="controls"><input type="radio" <?php echo(preg_match('/^r/', $fs) ? ' checked="" ' : '') ?> name="orders[<?php echo(ltrim($fs, 'r')); ?>]" value="<?php echo 'r' . ltrim($fs, 'r'); ?>"/><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p></div>
    <div class="controls"><button class="delete" onclick="jQuery(this).parents('li').remove();<?php if ($auto_filter || $ajax_filter): ?>jQuery('#<?php echo $formid; ?>').submit();<?php endif; ?>"><?php echo JText::_("JAK2DELETE"); ?></button></div>
    </div>

    To

    <div class="group-controls">
    <?php if (!in_array($kfs, array('zelevance', 'best', 'modified', 'publishUp', 'zdate'))) : ?>
    <div class="controls"><input type="radio" <?php echo(strpos($fs, 'r') !== 0 ? ' checked="" ' : '') ?> name="orders[<?php echo(ltrim($fs, 'r')); ?>]" value="<?php echo ltrim($fs, 'r'); ?>"/><p class="ascending"><?php echo JText::_("JAK2ASC"); ?></p></div>
    <?php endif; ?>
    <?php if (!in_array($kfs, array('adate'))) : ?>
    <div class="controls"><input type="radio" <?php echo(preg_match('/^r/', $fs) ? ' checked="" ' : '') ?> name="orders[<?php echo(ltrim($fs, 'r')); ?>]" value="<?php echo 'r' . ltrim($fs, 'r'); ?>"/><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p></div>
    <?php endif; ?>
    <div class="controls"><button class="delete" onclick="jQuery(this).parents('li').remove();<?php if ($auto_filter || $ajax_filter): ?>jQuery('#<?php echo $formid; ?>').submit();<?php endif; ?>"><?php echo JText::_("JAK2DELETE"); ?></button></div>
    </div>

    line 359-381
    Change

    if (!jQuery('#jak2filter<?php echo $module->id;?>').find('li').length) {
    jQuery(this).parent('li').after(
    '
    <li class="fssorts" data-of="' + jQuery(this).val() + '"> ' +
    '<div class="title"><h6>' + jQuery(this).find('option:selected').html() + '</h6></div>' +
    ' '
    + (jQuery.inArray(jQuery(this).val(), ['zelevance', 'best', 'modified', 'publishUp']) === -1 ? '
    <div class="group-controls">
    <div class="controls">
    <input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" checked="" name="orders[' + jQuery(this).val() + ']" value="' + jQuery(this).val() + '" /><p class="ascending"><?php echo JText::_("JAK2ASC"); ?></p>
    </div>
    <div class="controls">
    <input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p>
    </div>
    </div>
    ' : '' +
    '<div class="group-controls"><div class="controls"><input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" checked="checked" name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p></div></div>')
    + '
    <div class="controls"><button class="delete" onclick="jQuery(this).parents('li').remove();<?php if($auto_filter || $ajax_filter): ?>jQuery('#<?php echo $formid; ?>').submit();<?php endif; ?>"><?php echo JText::_("JAK2DELETE"); ?></button></div>
    </li>
    ');
    }

    To

    if (!jQuery('#jak2filter<?php echo $module->id;?>').find('li').length) {
    strout = '';
    if (jQuery.inArray(jQuery(this).val(), ['zelevance', 'best', 'modified', 'publishUp', 'zdate']) === -1) {
    strout = '
    <div class="group-controls">
    <div class="controls">
    <input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" checked="" name="orders[' + jQuery(this).val() + ']" value="' + jQuery(this).val() + '" /><p class="ascending"><?php echo JText::_("JAK2ASC"); ?></p>
    </div>';
    if (jQuery.inArray(jQuery(this).val(), ['adate']) === -1)
    strout += '<div class="controls">
    <input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p>
    </div>';

    strout += '</div>';
    } else {
    strout = '<div class="group-controls"><div class="controls"><input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" checked="checked" name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p></div></div>';
    }
    jQuery(this).parent('li').after(
    '
    <li class="fssorts" data-of="' + jQuery(this).val() + '"> ' +
    '<div class="title"><h6>' + jQuery(this).find('option:selected').html() + '</h6></div>' +
    ' '
    + strout
    + '
    <div class="controls"><button class="delete" onclick="jQuery(this).parents('li').remove();<?php if($auto_filter || $ajax_filter): ?>jQuery('#<?php echo $formid; ?>').submit();<?php endif; ?>"><?php echo JText::_("JAK2DELETE"); ?></button></div>
    </li>
    ');
    }

    If you find it difficult. You can pm me ftp account, I will do it for you.

    Regards.

    Mo0nlight Moderator
    #752617

    Hi Fred.

    You can do it by changing the file

    /components/com_jak2filter/models/itemlist.php

    line 370-372
    Change

    case 'date' :
    $orderby['date'] = 'i.created ASC';
    break;

    To

    case 'adate' :
    $orderby['adate'] = 'i.created ASC';
    break;

    case 'zdate' :
    $orderby['zdate'] = 'i.created DESC';
    break

    /modules/mod_jak2filter/helper.php
    line: 1400-1401
    Change

    $options[] = JHtml::_('select.option', 'date', JText::_('JAK2_OLDEST_FIRST'));
    // $options[] = JHtml::_('select.option', 'rdate', JText::_('JAK2_MOST_RECENT_FIRST'));

    To

    $options[] = JHtml::_('select.option', 'adate', JText::_('JAK2_OLDEST_FIRST'));
    $options[] = JHtml::_('select.option', 'zdate', JText::_('JAK2_MOST_RECENT_FIRST'));

    /modules/mod_jak2filter/tmpl/default.php
    line 266-272

    <div class="group-controls">
    <?php if (!in_array($kfs, array('zelevance', 'best', 'modified', 'publishUp'))) : ?>
    <div class="controls"><input type="radio" <?php echo(strpos($fs, 'r') !== 0 ? ' checked="" ' : '') ?> name="orders[<?php echo(ltrim($fs, 'r')); ?>]" value="<?php echo ltrim($fs, 'r'); ?>"/><p class="ascending"><?php echo JText::_("JAK2ASC"); ?></p></div>
    <?php endif; ?>
    <div class="controls"><input type="radio" <?php echo(preg_match('/^r/', $fs) ? ' checked="" ' : '') ?> name="orders[<?php echo(ltrim($fs, 'r')); ?>]" value="<?php echo 'r' . ltrim($fs, 'r'); ?>"/><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p></div>
    <div class="controls"><button class="delete" onclick="jQuery(this).parents('li').remove();<?php if ($auto_filter || $ajax_filter): ?>jQuery('#<?php echo $formid; ?>').submit();<?php endif; ?>"><?php echo JText::_("JAK2DELETE"); ?></button></div>
    </div>

    To

    <div class="group-controls">
    <?php if (!in_array($kfs, array('zelevance', 'best', 'modified', 'publishUp', 'zdate'))) : ?>
    <div class="controls"><input type="radio" <?php echo(strpos($fs, 'r') !== 0 ? ' checked="" ' : '') ?> name="orders[<?php echo(ltrim($fs, 'r')); ?>]" value="<?php echo ltrim($fs, 'r'); ?>"/><p class="ascending"><?php echo JText::_("JAK2ASC"); ?></p></div>
    <?php endif; ?>
    <?php if (!in_array($kfs, array('adate'))) : ?>
    <div class="controls"><input type="radio" <?php echo(preg_match('/^r/', $fs) ? ' checked="" ' : '') ?> name="orders[<?php echo(ltrim($fs, 'r')); ?>]" value="<?php echo 'r' . ltrim($fs, 'r'); ?>"/><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p></div>
    <?php endif; ?>
    <div class="controls"><button class="delete" onclick="jQuery(this).parents('li').remove();<?php if ($auto_filter || $ajax_filter): ?>jQuery('#<?php echo $formid; ?>').submit();<?php endif; ?>"><?php echo JText::_("JAK2DELETE"); ?></button></div>
    </div>

    line 359-381
    Change

    if (!jQuery('#jak2filter<?php echo $module->id;?>').find('li').length) {
    jQuery(this).parent('li').after(
    '
    <li class="fssorts" data-of="' + jQuery(this).val() + '"> ' +
    '<div class="title"><h6>' + jQuery(this).find('option:selected').html() + '</h6></div>' +
    ' '
    + (jQuery.inArray(jQuery(this).val(), ['zelevance', 'best', 'modified', 'publishUp']) === -1 ? '
    <div class="group-controls">
    <div class="controls">
    <input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" checked="" name="orders[' + jQuery(this).val() + ']" value="' + jQuery(this).val() + '" /><p class="ascending"><?php echo JText::_("JAK2ASC"); ?></p>
    </div>
    <div class="controls">
    <input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p>
    </div>
    </div>
    ' : '' +
    '<div class="group-controls"><div class="controls"><input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" checked="checked" name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p></div></div>')
    + '
    <div class="controls"><button class="delete" onclick="jQuery(this).parents('li').remove();<?php if($auto_filter || $ajax_filter): ?>jQuery('#<?php echo $formid; ?>').submit();<?php endif; ?>"><?php echo JText::_("JAK2DELETE"); ?></button></div>
    </li>
    ');
    }

    To

    if (!jQuery('#jak2filter<?php echo $module->id;?>').find('li').length) {
    strout = '';
    if (jQuery.inArray(jQuery(this).val(), ['zelevance', 'best', 'modified', 'publishUp', 'zdate']) === -1) {
    strout = '
    <div class="group-controls">
    <div class="controls">
    <input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" checked="" name="orders[' + jQuery(this).val() + ']" value="' + jQuery(this).val() + '" /><p class="ascending"><?php echo JText::_("JAK2ASC"); ?></p>
    </div>';
    if (jQuery.inArray(jQuery(this).val(), ['adate']) === -1)
    strout += '<div class="controls">
    <input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p>
    </div>';

    strout += '</div>';
    } else {
    strout = '<div class="group-controls"><div class="controls"><input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" checked="checked" name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p></div></div>';
    }
    jQuery(this).parent('li').after(
    '
    <li class="fssorts" data-of="' + jQuery(this).val() + '"> ' +
    '<div class="title"><h6>' + jQuery(this).find('option:selected').html() + '</h6></div>' +
    ' '
    + strout
    + '
    <div class="controls"><button class="delete" onclick="jQuery(this).parents('li').remove();<?php if($auto_filter || $ajax_filter): ?>jQuery('#<?php echo $formid; ?>').submit();<?php endif; ?>"><?php echo JText::_("JAK2DELETE"); ?></button></div>
    </li>
    ');
    }

    If you find it difficult. You can pm me ftp account, I will do it for you.

    Regards.

    Fred Tep Friend
    #721112

    hello,

    I did all you suggested. it’s working (which is good) but all the way around (which is not good enough for me) 😉
    My articles are filtered from the oldest to the most recent.
    Any idea ?

    Fred Tep Friend
    #753514

    hello,

    I did all you suggested. it’s working (which is good) but all the way around (which is not good enough for me) 😉
    My articles are filtered from the oldest to the most recent.
    Any idea ?

    Mo0nlight Moderator
    #721216

    Hi Fred,

    It should work fine.

    Could you update the admin account info or PM me the correct account? as I can’t login with the provided info, I need to take a closer look at configuration in back-end.

    BigHug Friend
    #753598

    Hi Fred,

    It should work fine.

    Could you update the admin account info or PM me the correct account? as I can’t login with the provided info, I need to take a closer look at configuration in back-end.

    Fred Tep Friend
    #721493

    I’ve just updated the account. Thanks for having a look

    Fred Tep Friend
    #753744

    I’ve just updated the account. Thanks for having a look

    Luna Garden Moderator
    #721564

    Hi Fred,

    We did take a look at your site, and got the problem. Could you PM your FTP of your site so we can find the way to solve it ?

    Luna Garden Moderator
    #753811

    Hi Fred,

    We did take a look at your site, and got the problem. Could you PM your FTP of your site so we can find the way to solve it ?

Viewing 15 posts - 1 through 15 (of 21 total)

This topic contains 21 replies, has 4 voices, and was last updated by  Luna Garden 9 years ago.

We moved to new unified forum. Please post all new support queries in our New Forum