Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • nowwecanmakewar Friend
    #143104

    Ive tried everything from switching the article order, changing the publish/create dates and the orders will not change. Basically I want it to show the most recent article first (on the left side) but cant seem to figure out how to sort it period.

    Anybody know?

    Anonymous Moderator
    #312670

    Hi

    Open modulesmod_ja_contentslidehelper.php, at about line 77, find following code:

    <blockquote>
    $query = ‘SELECT a.*,cc.description as catdesc, cc.title as cattitle,s.description as secdesc, s.title as sectitle,’ .
    ‘ CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(“:”, a.id, a.alias) ELSE a.id END as slug,’.
    ‘ CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(“:”,cc.id,cc.alias) ELSE cc.id END as catslug,’.
    ‘ CASE WHEN CHAR_LENGTH(s.alias) THEN CONCAT_WS(“:”, s.id, s.alias) ELSE s.id END as secslug’
    . “n FROM #__content AS a”.
    ‘ INNER JOIN #__categories AS cc ON cc.id = a.catid’ .
    ‘ INNER JOIN #__sections AS s ON s.id = a.sectionid’
    . “n WHERE a.state = 1”
    . “n AND ( a.publish_up = ” . $db->Quote( $db->getNullDate() ) . ” OR a.publish_up <= ” . $db->Quote( date(‘Y-m-d H:i’) ) . ” )”
    . “n AND ( a.publish_down = ” . $db->Quote( $db->getNullDate() ) . ” OR a.publish_down >= ” . $db->Quote( date(‘Y-m-d H:i’) ) . ” )”
    . ( ( !$mainframe->getCfg( ‘shownoauth’ ) ) ? “n AND a.access <= ” . (int) $aid : ” )
    ;
    if( $catid ) {
    $query .= ‘ AND a.catid IN (‘.$catid.’) ‘;
    }
    </blockquote>

    and change to:


    $query = 'SELECT a.*,cc.description as catdesc, cc.title as cattitle,s.description as secdesc, s.title as sectitle,' .
    ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,'.
    ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":",cc.id,cc.alias) ELSE cc.id END as catslug,'.
    ' CASE WHEN CHAR_LENGTH(s.alias) THEN CONCAT_WS(":", s.id, s.alias) ELSE s.id END as secslug'
    . "n FROM #__content AS a".
    ' INNER JOIN #__categories AS cc ON cc.id = a.catid' .
    ' INNER JOIN #__sections AS s ON s.id = a.sectionid'
    . "n WHERE a.state = 1"
    . "n AND ( a.publish_up = " . $db->Quote( $db->getNullDate() ) . " OR a.publish_up <= " . $db->Quote( date('Y-m-d H:i') ) . " )"
    . "n AND ( a.publish_down = " . $db->Quote( $db->getNullDate() ) . " OR a.publish_down >= " . $db->Quote( date('Y-m-d H:i') ) . " )"
    . ( ( !$mainframe->getCfg( 'shownoauth' ) ) ? "n AND a.access <= " . (int) $aid : '' )
    ;
    if( $catid ) {
    $query .= ' AND a.catid IN ('.$catid.') ';
    }

    $query .= ' order by a.id desc';

    Hope it helps.

    nowwecanmakewar Friend
    #312815

    You are the ****ing man!

    TomC Moderator
    #312818

    nowwecanmakewar;138907You are the ****ing man!

    He’s the CAKEing man ??

    He’s the BAKEing man ??

    He’s the PEEPing man ??

    He’s the BARKing man ??

    He’s the PARKing man ??

    :p

    (yah, I’m bored . . . so what)

    jojoradio Friend
    #319451

    Thank you for this and I’ve made my change. However, I really want to force the order in the slider to whatever order I deem in the article category, or make them random. This code only forces the ordering by ID number in the category.

    Any help is appreciated.

    Anonymous Moderator
    #319718

    Hi jojoradio

    To displays according to your order, please change:

    $query .= ‘ order by a.id desc’;

    to

    $query .= ‘ order by a.ordering’;

    + for random:

    $query .= ‘ order by rand()’;

    hengstler Friend
    #383969

    Sorry folks

    I’m not very familiar to PHP. I’d like to extend Ja content slider to sort also by random.

    Thanks for help

    vreelandwood Friend
    #432118

    I have JA Contentslider 1.1.9 installed on JA Methys template and the module will not properly sort my articles by Date, Descending. No matter how I change the sort parameters, the articles continue to display in the “wrong” order. Can you point me toward the correct php fix for this, or an updated version? I could not locate the above code in my version.

Viewing 8 posts - 1 through 8 (of 8 total)

This topic contains 8 replies, has 6 voices, and was last updated by  vreelandwood 12 years, 4 months ago.

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