-
AuthorPosts
-
April 1, 2012 at 8:27 pm #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 Friendobliat
- Join date:
- December 2010
- Posts:
- 416
- Downloads:
- 12
- Uploads:
- 64
- Thanks:
- 108
- Thanked:
- 31 times in 1 posts
April 1, 2012 at 9:41 pm #446762No 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 Friendobliat
- Join date:
- December 2010
- Posts:
- 416
- Downloads:
- 12
- Uploads:
- 64
- Thanks:
- 108
- Thanked:
- 31 times in 1 posts
April 1, 2012 at 10:11 pm #446766In 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 :((April 1, 2012 at 10:19 pm #446767I think I might have an idea. Can you show me your helper file, mine is different version, doesn’t support K2.
obliat Friendobliat
- Join date:
- December 2010
- Posts:
- 416
- Downloads:
- 12
- Uploads:
- 64
- Thanks:
- 108
- Thanked:
- 31 times in 1 posts
April 2, 2012 at 5:05 am #446802April 2, 2012 at 8:21 am #446829Find 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 Friendobliat
- Join date:
- December 2010
- Posts:
- 416
- Downloads:
- 12
- Uploads:
- 64
- Thanks:
- 108
- Thanked:
- 31 times in 1 posts
April 3, 2012 at 5:21 am #447039Hm, 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 😉
-
AuthorPosts
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