-
AuthorPosts
-
nowwecanmakewar Friend
nowwecanmakewar
- Join date:
- January 2007
- Posts:
- 17
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 3
July 29, 2009 at 11:54 pm #143104Ive 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 ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
July 30, 2009 at 9:36 am #312670Hi
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.
2 users say Thank You to JA Developer for this useful post
nowwecanmakewar Friendnowwecanmakewar
- Join date:
- January 2007
- Posts:
- 17
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 3
July 31, 2009 at 8:55 pm #312815You are the ****ing man!
TomC ModeratorTomC
- Join date:
- October 2014
- Posts:
- 14077
- Downloads:
- 58
- Uploads:
- 137
- Thanks:
- 948
- Thanked:
- 3155 times in 2495 posts
October 3, 2009 at 12:53 pm #319451Thank 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 ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
hengstler Friendhengstler
- Join date:
- August 2006
- Posts:
- 123
- Downloads:
- 7
- Uploads:
- 23
- Thanks:
- 106
- Thanked:
- 4 times in 1 posts
March 30, 2011 at 8:16 am #383969Sorry folks
I’m not very familiar to PHP. I’d like to extend Ja content slider to sort also by random.
Thanks for help
January 2, 2012 at 6:24 am #432118I 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.
-
AuthorPosts
This topic contains 8 replies, has 6 voices, and was last updated by vreelandwood 12 years, 12 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum