-
AuthorPosts
-
mobinet88 Friend
mobinet88
- Join date:
- December 2008
- Posts:
- 19
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 2
- Thanked:
- 1 times in 1 posts
May 6, 2010 at 12:07 pm #150903Right 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 ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
May 8, 2010 at 4:48 am #342997Dear mobinet88!
Can you pls use the ja slider news, it works same as this module but it has many features 🙂
and try to check againGood luck
mobinet88 Friendmobinet88
- Join date:
- December 2008
- Posts:
- 19
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 2
- Thanked:
- 1 times in 1 posts
May 8, 2010 at 2:16 pm #343033i 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 ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
May 10, 2010 at 4:18 am #343096You can get this module from the kyanite ii, ja halite package
Good luckmobinet88 Friendmobinet88
- Join date:
- December 2008
- Posts:
- 19
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 2
- Thanked:
- 1 times in 1 posts
May 10, 2010 at 11:44 am #343133In 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 ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
May 13, 2010 at 2:05 am #343401Dear 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
November 27, 2011 at 7:00 pm #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 Friendobliat
- Join date:
- December 2010
- Posts:
- 416
- Downloads:
- 12
- Uploads:
- 64
- Thanks:
- 108
- Thanked:
- 31 times in 1 posts
December 21, 2011 at 1:57 pm #430688I 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
February 16, 2012 at 9:45 pm #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 Friendobliat
- Join date:
- December 2010
- Posts:
- 416
- Downloads:
- 12
- Uploads:
- 64
- Thanks:
- 108
- Thanked:
- 31 times in 1 posts
February 16, 2012 at 9:58 pm #438624Well 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 :((
February 16, 2012 at 10:05 pm #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…
February 16, 2012 at 10:15 pm #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 Friendobliat
- Join date:
- December 2010
- Posts:
- 416
- Downloads:
- 12
- Uploads:
- 64
- Thanks:
- 108
- Thanked:
- 31 times in 1 posts
February 17, 2012 at 6:47 am #438647Did 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
April 1, 2012 at 5:20 pm #446724Here’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 Friendobliat
- Join date:
- December 2010
- Posts:
- 416
- Downloads:
- 12
- Uploads:
- 64
- Thanks:
- 108
- Thanked:
- 31 times in 1 posts
April 1, 2012 at 7:03 pm #446732Hi, 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 🙂
-
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