Viewing 7 posts - 16 through 22 (of 22 total)
  • Author
    Posts
  • korben Friend
    #446744

    Hey, sorry it didn’t help :((
    I was having the same problem few hours ago when I bumped into this unresolved thread.
    I thought you needed it for the standard content (as did I) and honestly I didn’t notice you were talking about K2. I’m not a php a guy and I’m not using K2, so I can’t really help you much :((
    If I come across something I’ll let you know. Good luck finding quick solution for your problem!

    obliat Friend
    #446762

    No worries thanks for willing to help. I’m not a php guy as well, but I think this is very important and it’s so weird it was not configured by devs to show specific time range. People laugh at me having Most Read articles on my website that I created year ago…

    obliat Friend
    #446766

    In mod_k2content K2 guys set time range with following code

    case 'hits':
    if ($params->get('popularityRange')){
    $datenow = &JFactory::getDate();
    $date = $datenow->toMySQL();
    $query.=" AND i.created > DATE_SUB('{$date}',INTERVAL ".$params->get('popularityRange')." DAY) ";
    }
    $orderby = 'i.hits DESC';
    break;

    but I don’t know how to use it in JA-bulleting helper.php K2 section :((

    korben Friend
    #446767

    I think I might have an idea. Can you show me your helper file, mine is different version, doesn’t support K2.

    obliat Friend
    #446802

    Yup, here you go 🙂


    1. helper.rar
    korben Friend
    #446829

    Find and replace these lines

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

    function getK2List( $params , $ordering = "a.hits DESC . ' AND datediff( now() , a.created) <= 30 '" )

    Hope it works!

    obliat Friend
    #447039

    Hm, this seems logical, but it prevents tab from showing K2 items (it’s like collapses). I think K2 uses different code to set date interval, like the one in post #18, but I don’t know how to use it here. So the above code does not work unfortunately.

    Thanks a lot for you efforts dude 😉

Viewing 7 posts - 16 through 22 (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