Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • mobinet88 Friend
    #150903

    Right now JA Bulletin most read fuction is showing most read articles from the begining of the webpage. Can we set it up to show most read from only last 30 days?

    Saguaros Moderator
    #342997

    Dear mobinet88!

    Can you pls use the ja slider news, it works same as this module but it has many features 🙂
    and try to check again

    Good luck

    mobinet88 Friend
    #343033

    i cant find ja slider news module.

    Is it part of any template?

    If you mean JA Side News module it doesnt have time limit in most read option.

    Saguaros Moderator
    #343096

    You can get this module from the kyanite ii, ja halite package
    Good luck

    mobinet88 Friend
    #343133

    In this packages i can find JA Side News module, but like i said there is no time limit for most read articles.

    Can you please focus and reply if this is posiible or not?

    Saguaros Moderator
    #343401

    Dear mobinet88!

    Here is the solution to resolve your issue!

    Please open the file: /modules/mod_jasidenews/helper.php and find the following codes:
    [PHP]$query .= $this->getCondition( $params );[/PHP]
    and replace:
    [PHP]
    $query .= ‘ AND datediff( now() , a.created) <= 30 ‘;

    $query .= $this->getCondition( $params );
    [/PHP]

    Good luck

    eturko Friend
    #426747

    <em>@tienhc 178342 wrote:</em><blockquote>Dear mobinet88!

    Here is the solution to resolve your issue!

    Please open the file: /modules/mod_jasidenews/helper.php and find the following codes:
    [PHP]$query .= $this->getCondition( $params );[/PHP]
    and replace:
    [PHP]
    $query .= ‘ AND datediff( now() , a.created) <= 30 ‘;

    $query .= $this->getCondition( $params );
    [/PHP]

    Good luck</blockquote>

    Hi tienhc.. can u please tell me how this solution works in mod_jabulletin.v1.0.1? cos and dont want the total historic news show up in the module… thx!

    obliat Friend
    #430688

    I just created another thread with the same question as I didn’t find this one by searching the forum. I’d really like to get this selectable time feature as well, but for the JA Bulletin, not JA Slide. Hope you guys help with some code. Thanks

    chloregy Friend
    #438623

    <em>@obliat 290490 wrote:</em><blockquote>I just created another thread with the same question as I didn’t find this one by searching the forum. I’d really like to get this selectable time feature as well, but for the JA Bulletin, not JA Slide. Hope you guys help with some code. Thanks</blockquote>

    i would also like this…

    obliat Friend
    #438624

    Well with all the J2.5 work (and I had a ticket for the same thing and was told team has no time for customizations) looks like no go for now. And this is so important, because we all have these great JA based websites that show articles from years behind :((

    chloregy Friend
    #438625

    <em>@tienhc 178342 wrote:</em><blockquote>Dear mobinet88!

    Here is the solution to resolve your issue!

    Please open the file: /modules/mod_jasidenews/helper.php and find the following codes:
    [PHP]$query .= $this->getCondition( $params );[/PHP]
    and replace:
    [PHP]
    $query .= ‘ AND datediff( now() , a.created) <= 30 ‘;

    $query .= $this->getCondition( $params );
    [/PHP]

    Good luck</blockquote>

    the code you refer to doesn’t even exist in the file /modules/mod_jasidenews/helper.php

    c’mon people…

    chloregy Friend
    #438626

    <em>@obliat 300986 wrote:</em><blockquote>Well with all the J2.5 work (and I had a ticket for the same thing and was told team has no time for customizations) looks like no go for now. And this is so important, because we all have these great JA based websites that show articles from years behind :((</blockquote>

    i think this might work in hte ja bulletin helper.php file (see last line)

    if($ordering==’latest’){
    // Set ordering
    $order_map = array(
    ‘m_dsc’ => ‘a.modified DESC, a.created’,
    ‘mc_dsc’ => ‘CASE WHEN (a.modified = ‘.$db->quote($db->getNullDate()).’) THEN a.created ELSE a.modified END’,
    ‘c_dsc’ => ‘a.created’,
    ‘p_dsc’ => ‘a.publish_up’,
    );
    $ordering = JArrayHelper::getValue($order_map, $params->get(‘ordering’, ‘m_dsc’), ‘a.publish_up’);
    }
    else{
    $ordering = ‘a.hits AND datediff( now() , a.created) <= 30′;
    }

    obliat Friend
    #438647

    Did you mean the above code to be added to the helper.php ?

    In my case I’m using K2 and I tried to add the code in blue to the K2MostRead part in helper.php

    }
    function getK2MostRead( $params )
    {
    $rows = $this->getK2List( $params , "a.hits DESC;
    return $rows;

    changed to

    }
    function getK2MostRead( $params )
    {
    $rows = $this->getK2List( $params , "a.hits AND datediff( now() , a.created) <= 30';
    return $rows;

    which results in bringing up news from April 2011 and they were not sorted by hits.

    Please let me know if K2 solution can be provided. Thanks

    korben Friend
    #446724

    Here’s the fix:
    In JA Bulletin’s helper file find this line:

    $query = 'SELECT a.*,' . ' 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' . ' FROM #__content AS a' . ' LEFT JOIN #__content_frontpage AS f ON f.content_id = a.id' . ' INNER JOIN #__categories AS cc ON cc.id = a.catid' . ' INNER JOIN #__sections AS s ON s.id = a.sectionid' . ' WHERE ( a.state = 1 AND s.id > 0 )' . ' AND ( a.publish_up = ' . $db->Quote ( $nullDate ) . ' OR a.publish_up <= ' . $db->Quote ( $now ) . ' )' . ' AND ( a.publish_down = ' . $db->Quote ( $nullDate ) . ' OR a.publish_down >= ' . $db->Quote ( $now ) . ' )' . ($access ? ' AND a.access <= ' . ( int ) $aid . ' AND cc.access <= ' . ( int ) $aid . ' AND s.access <= ' . ( int ) $aid : '') . ($catid ? $catCondition : '') . ($secid ? $secCondition : '') . ($show_front == '0' ? ' AND f.content_id IS NULL' : '') . ' AND s.published = 1' . ' AND cc.published = 1 ' . ' ORDER BY a.hits DESC';

    And add this before ORDER BY …
    . ' AND datediff( now() , a.created) <= 30 '
    30 being the days here of course.
    It must look like this:

    $query = 'SELECT a.*,' . ' 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' . ' FROM #__content AS a' . ' LEFT JOIN #__content_frontpage AS f ON f.content_id = a.id' . ' INNER JOIN #__categories AS cc ON cc.id = a.catid' . ' INNER JOIN #__sections AS s ON s.id = a.sectionid' . ' WHERE ( a.state = 1 AND s.id > 0 )' . ' AND ( a.publish_up = ' . $db->Quote ( $nullDate ) . ' OR a.publish_up <= ' . $db->Quote ( $now ) . ' )' . ' AND ( a.publish_down = ' . $db->Quote ( $nullDate ) . ' OR a.publish_down >= ' . $db->Quote ( $now ) . ' )' . ($access ? ' AND a.access <= ' . ( int ) $aid . ' AND cc.access <= ' . ( int ) $aid . ' AND s.access <= ' . ( int ) $aid : '') . ($catid ? $catCondition : '') . ($secid ? $secCondition : '') . ($show_front == '0' ? ' AND f.content_id IS NULL' : '') . ' AND s.published = 1' . ' AND cc.published = 1 '. ' AND datediff( now() , a.created) <= 14 ' . ' ORDER BY a.hits DESC';

    obliat Friend
    #446732

    Hi, thanks a lot – the code is slightly different in my JA Bulletin helper.php – there’s two instances of this code, I tried your suggestion in both, cleared cache, but in my case it didn’t change nothing, I guess because I’m using K2 items. And there’s specific K2 code in the helper.php which I guess needs some fix. So no go for me. Thanks again 🙂

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

This topic contains 22 replies, has 6 voices, and was last updated by  obliat 12 years, 7 months ago.

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