View Full Version : Desc mode in 'More News'
themx
01-13-2007, 07:39 AM
Hi to everyone!
Does anyone knows how to sort the More News option in Desc mode? this to show the lastest news intead of the first one. Thanks in advanced.
shketuljko
01-15-2007, 02:31 PM
If you want to set latest news according to latest created news you need to
find function HTML_latest_news($featured=0) in HTML_function.
In HTML_latest_news function you need to find 1st query variable
and this code
$query="SELECT id FROM tblArticles
WHERE status=1
AND featured_news=$featured
AND created<='$cur_date'
ORDER BY order_num DESC LIMIT {$news_number}";
replace with this code
$query="SELECT id FROM tblArticles
WHERE status=1
AND featured_news=$featured
AND created<='$cur_date'
ORDER BY created DESC LIMIT {$news_number}";
GusLinares
01-15-2007, 07:08 PM
Is this for V3.4 for the More News Link? index.php?view_all
Have tried this but does not work. Still displays oldest articles first. Any other ideas please? :cool:
shketuljko
01-16-2007, 09:20 AM
For more news click here »
in index.php try to find this line
elseif (isset($_GET['view_all']))
after that, in 1st variable $query it's seems to be:
$query="Select a.*, c.id as cid, c.parent_cat from tblArticles a
inner join tblCategories c on a.category_id=c.id
$status_filter ORDER BY created DESC";
GusLinares
01-16-2007, 11:03 PM
The above works fine.
Where can I change the sort order when you click on one of the catergories in the section menu?
Thanks
Gus
themx
01-17-2007, 02:36 PM
Thanks a lot shketuljko the above code works fine! =)...
Also what GusLinares said could be good, do you know how to do that?
shketuljko
01-17-2007, 02:43 PM
Try to find line:
if (isset($_GET['category'])){
in index.php.
After few lines try to find this line:
$sort_order = " ORDER BY order_num desc";
Field from database: example:order_num
(You can use another fields from database)
Descending or Ascending: example:desc
OK?
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.