Author |
Message |
nuken
RavenNuke(tm) Development Team
![](modules/Forums/images/avatars/3234de284ee21bd39eecd.jpg)
Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina
|
Posted:
Wed Mar 12, 2008 6:12 am |
|
How do you change the default ordering of comments on news articles from oldest to newest to newest to oldest???
I saw where users can change their preference, I am looking to have it as default newest comments on top...
I looked in the modules/news and could not find a ASC or DESC call that was related to the comments .... I checked the index.php the comments.php... and several others...
Maybe a point in the right direction....
Thank you... |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Susann
Moderator
![](modules/Forums/images/avatars/4e3210db4efb891870d79.gif)
Joined: Dec 19, 2004
Posts: 3191
Location: Germany:Moderator German NukeSentinel Support
|
Posted:
Wed Mar 12, 2008 5:26 pm |
|
IsnĀ“t there something under edit comments / account-editcomm.html logged in as user ? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nuken
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Mar 12, 2008 6:19 pm |
|
Users can select their preference.... I want it to be by default.... |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
montego
Site Admin
![](modules/Forums/images/avatars/0c0adf824792d6d341ef4.gif)
Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Thu Mar 13, 2008 6:13 am |
|
I have never seen a site-wide default for comment threading. Sorry.
comments.php could probably be modified to do this, but unfortunately I do not have the time ATM to recommend any such changes. |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nuken
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Mar 13, 2008 12:41 pm |
|
Thanks anyway... I'll have another go at it in a few days.... |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nuken
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Mar 14, 2008 11:57 am |
|
I figured it out...
Just in case anyone else needs it, here are the changes needed to have the default news articles comments go from newest to oldest:
In modules/news/comments.php under function DisplayTopic locate
Code:if ($order==0) $q .= ' ORDER BY date ASC'; //RN0000665
if ($order==1) $q .= ' ORDER BY date DESC';
if ($order==2) $q .= ' ORDER BY score DESC';
|
and change to
Code:if ($order==0) $q .= ' ORDER BY date DESC'; //RN0000665
if ($order==1) $q .= ' ORDER BY date ASC';
if ($order==2) $q .= ' ORDER BY score DESC';
|
Than in modules/Your_Account/index.php under function editcomm locate
Code:<option value="0" <?php if (!$userinfo['uorder']) { echo 'selected="selected"'; } ?>><?php echo _OLDEST ?></option>
<option value="1" <?php if ($userinfo['uorder']==1) { echo 'selected="selected"'; } ?>><?php echo _NEWEST ?></option>
<option value="2" <?php if ($userinfo['uorder']==2) { echo 'selected="selected"'; } ?>><?php echo _HIGHEST ?></option>
|
and change it to
Code:<option value="0" <?php if (!$userinfo['uorder']) { echo 'selected="selected"'; } ?>><?php echo _NEWEST ?></option>
<option value="1" <?php if ($userinfo['uorder']==1) { echo 'selected="selected"'; } ?>><?php echo _OLDEST ?></option>
<option value="2" <?php if ($userinfo['uorder']==2) { echo 'selected="selected"'; } ?>><?php echo _HIGHEST ?></option>
|
Everything seems to work correctly.... I will check it out later to make sure nothing else is effected... |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
Site Admin
![](modules/Forums/images/avatars/125904890252d880f79f312.png)
Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Fri Mar 14, 2008 4:34 pm |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
montego
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Mar 15, 2008 11:36 am |
|
nuken, I enhanced your topic title a bit in order to hopefully help others to find this thread. If you do not like how I've changed it, you may change it to whatever you like (of course, we may just change it back on you - lol). |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nuken
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Mar 16, 2008 5:46 pm |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|