Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RN v2.20.00 - All Issues
Author Message
nuken
RavenNuke(tm) Development Team



Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Wed Mar 12, 2008 6:12 am Reply with quote

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...
 
View user's profile Send private message Send e-mail Visit poster's website
Susann
Moderator



Joined: Dec 19, 2004
Posts: 3191
Location: Germany:Moderator German NukeSentinel Support

PostPosted: Wed Mar 12, 2008 5:26 pm Reply with quote

IsnĀ“t there something under edit comments / account-editcomm.html logged in as user ?
 
View user's profile Send private message
nuken







PostPosted: Wed Mar 12, 2008 6:19 pm Reply with quote

Users can select their preference.... I want it to be by default....
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Thu Mar 13, 2008 6:13 am Reply with quote

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.

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
nuken







PostPosted: Thu Mar 13, 2008 12:41 pm Reply with quote

Thanks anyway... I'll have another go at it in a few days....
 
nuken







PostPosted: Fri Mar 14, 2008 11:57 am Reply with quote

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...
 
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Fri Mar 14, 2008 4:34 pm Reply with quote

Nice - thanks!
 
View user's profile Send private message Send e-mail
montego







PostPosted: Sat Mar 15, 2008 11:36 am Reply with quote

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).
 
nuken







PostPosted: Sun Mar 16, 2008 5:46 pm Reply with quote

No problem... Thank you
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RN v2.20.00 - All Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©