Individual Channel Articles Sorting?
ReviewStud 135
From: -
From: -
Notice
This topic is archived. New comments cannot be posted and votes cannot be cast.Responses to this topic
1 Re: Individual Channel Articles Sorting?
ReviewStud
OP
135
From: -
From: -
Nice!! Here's two thumbs up for the help and hard work.
http://i25.photobucket.com/albums/c72/chccbs1/Fonzi.jpg
Thank for the help.
http://i25.photobucket.com/albums/c72/chccbs1/Fonzi.jpg
Thank for the help.
1 Re: Individual Channel Articles Sorting?
Philipp Esselbach
From: -
Editor
0From: -
There is a small typo: It is $key == "1a1a1a1a" not $key = "1a1a1a1a"
1 Re: Individual Channel Articles Sorting?
ReviewStud
OP
135
From: -
From: -
It looks like to new code worked. The news articles are being sorted by their posting date, but now every channel/page is displaying the same articles from the "news" channel.
1 Re: Individual Channel Articles Sorting?
Philipp Esselbach
From: -
Editor
0From: -
Open /modules/news/newschannels.php in an editor and replace:
with:
You need to replace the key 1a1a1a1a in the first line with the actual key of your news channel. You find the key in the table esselbach_ct_newschannels
$query = $database -> dbquery( "SELECT newsstory_id, newsstory_author, newsstory_channels, newsstory_title, newsstory_seo, newsstory_story, newsstory_extendedstory, newsstory_link, newsstory_tags, newsstory_teaser, newsstory_comments, newsstory_thread, newsstory_date, newsstory_fields, newsstory_views, newsstory_rating, newsstory_votes, newsstory_source, newsstory_sourceid FROM " . DB_PREFIX . "esselbach_ct_newsstories WHERE newsstory_channels LIKE ('%" . $key . "%') AND " . $newsstory_status . " AND (newsstory_website = '0' OR newsstory_website = '" . $preferences[ 'current_website' ] . "')" . $news_expire_sql . " ORDER BY newsstory_id DESC LIMIT " . intval( $stories ) );
with:
if ( $key = "1a1a1a1a" )
{
$query = $database -> dbquery( "SELECT newsstory_id, newsstory_author, newsstory_channels, newsstory_title, newsstory_seo, newsstory_story, newsstory_extendedstory, newsstory_link, newsstory_tags, newsstory_teaser, newsstory_comments, newsstory_thread, newsstory_date, newsstory_fields, newsstory_views, newsstory_rating, newsstory_votes, newsstory_source, newsstory_sourceid FROM " . DB_PREFIX . "esselbach_ct_newsstories WHERE newsstory_channels LIKE ('%" . $key . "%') AND " . $newsstory_status . " AND (newsstory_website = '0' OR newsstory_website = '" . $preferences[ 'current_website' ] . "')" . $news_expire_sql . " ORDER BY newsstory_date DESC LIMIT " . intval( $stories ) );
}
else
{
$query = $database -> dbquery( "SELECT newsstory_id, newsstory_author, newsstory_channels, newsstory_title, newsstory_seo, newsstory_story, newsstory_extendedstory, newsstory_link, newsstory_tags, newsstory_teaser, newsstory_comments, newsstory_thread, newsstory_date, newsstory_fields, newsstory_views, newsstory_rating, newsstory_votes, newsstory_source, newsstory_sourceid FROM " . DB_PREFIX . "esselbach_ct_newsstories WHERE newsstory_channels LIKE ('%" . $key . "%') AND " . $newsstory_status . " AND (newsstory_website = '0' OR newsstory_website = '" . $preferences[ 'current_website' ] . "')" . $news_expire_sql . " ORDER BY newsstory_title LIMIT " . intval( $stories ) );
}
You need to replace the key 1a1a1a1a in the first line with the actual key of your news channel. You find the key in the table esselbach_ct_newschannels
How can I sort only the articles in my "news" channel by the date they were posted? Newest articles on top then older articles below.
The rest of my channels are already sorted alphabetically.