Welcome, Guest. Please Login or Register.
April 27, 2025, 10:38:16 PM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  General Category  |  Feedback  |  Come on BOFFINS this should be easy « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Come on BOFFINS this should be easy  (Read 543 times)
Bossy Boots
Noobie
*
Posts: 24


WWW
Come on BOFFINS this should be easy
« on: September 13, 2002, 01:07:59 PM »
Reply with quote

I beleive the below is the code that will adjust the sort order for me but I can't read it properly. (cut from "messageindex.php" file).

CAN SOME ONE TELL ME WHICH TO CHANGE AROUND.
I desperatly need the "messageindex.php" list to sort by "Subject Name" the program is usless to me without it.
CAN SOMEONE HELP PLEASE ?


Quote// Grab the appropriate topic information
   if ($modSettings['enableStickyTopics'] == '1')
      $result = mysql_query("SELECT t.ID_LAST_MSG,t.ID_TOPIC,t.numReplies,t.locked,m.posterName,m.ID_MEMBER,t.numViews,m.posterTime,m.modifiedTime,t.ID_FIRST_MSG,t.isSticky,t.ID_POLL,mes.posterName as mname,mes.ID_MEMBER as mid,mes.subject as msub,mes.icon as micon FROM {$db_prefix}topics as t, {$db_prefix}messages as m, {$db_prefix}messages as mes WHERE (t.ID_BOARD=$currentboard AND m.ID_MSG=t.ID_LAST_MSG AND mes.ID_MSG=t.ID_FIRST_MSG) ORDER BY t.isSticky DESC, m.posterTime DESC LIMIT $start,$maxindex");
   else
      $result = mysql_query("SELECT t.ID_LAST_MSG,t.ID_TOPIC,t.numReplies,t.locked,m.posterName,m.ID_MEMBER,t.numViews,m.posterTime,m.modifiedTime,t.ID_FIRST_MSG,t.isSticky,t.ID_POLL,mes.posterName as mname,mes.ID_MEMBER as mid,mes.subject as msub,mes.icon as micon FROM {$db_prefix}topics as t, {$db_prefix}messages as m,{$db_prefix}messages as mes WHERE (t.ID_BOARD=$currentboard AND m.ID_MSG=t.ID_LAST_MSG AND mes.ID_MSG=t.ID_FIRST_MSG) ORDER BY m.posterTime DESC LIMIT $start,$maxindex");

P.S. I was going to put a "CODE" around the above but it comes out so small you can't read it.
Logged
TheJkWhoSaysNi
YaBB God
*****
Posts: 1025


I dont know what to put here, i'll leave it blank.

ICQ - 122821095TheJkWhoSaysNi@evilemail.com WWW
Re:Come on BOFFINS this should be easy
« Reply #1 on: September 13, 2002, 06:52:40 PM »
Reply with quote

you know: Shouting, calling people boffins and posting in the wrong forum wont make people help you...  ::)

but because i'm such a nice guy i will anyway.  ::)  Just change that code there to:

  // Grab the appropriate topic information
   if ($modSettings['enableStickyTopics'] == '1')
      $result = mysql_query("SELECT t.ID_LAST_MSG,t.ID_TOPIC,t.numReplies,t.locked,m.posterName,m.ID_MEMBER,t.numViews,m.posterTime,m.modifiedTime,t.ID_FIRST_MSG,t.isSticky,t.ID_POLL,mes.posterName as mname,mes.ID_MEMBER as mid,mes.subject as msub,mes.icon as micon FROM {$db_prefix}topics as t, {$db_prefix}messages as m, {$db_prefix}messages as mes WHERE (t.ID_BOARD=$currentboard AND m.ID_MSG=t.ID_LAST_MSG AND mes.ID_MSG=t.ID_FIRST_MSG) ORDER BY t.isSticky DESC, m.subject DESC LIMIT $start,$maxindex");
   else
      $result = mysql_query("SELECT t.ID_LAST_MSG,t.ID_TOPIC,t.numReplies,t.locked,m.posterName,m.ID_MEMBER,t.numViews,m.posterTime,m.modifiedTime,t.ID_FIRST_MSG,t.isSticky,t.ID_POLL,mes.posterName as mname,mes.ID_MEMBER as mid,mes.subject as msub,mes.icon as micon FROM {$db_prefix}topics as t, {$db_prefix}messages as m,{$db_prefix}messages as mes WHERE (t.ID_BOARD=$currentboard AND m.ID_MSG=t.ID_LAST_MSG AND mes.ID_MSG=t.ID_FIRST_MSG) ORDER BY m.subject DESC LIMIT $start,$maxindex");

I believe that will work.
« Last Edit: September 13, 2002, 06:53:45 PM by Tom B » Logged

WARNING: THIS POST MAY CONTAIN TRACES OF PEANUT!!!
I'm listening to....
Bossy Boots
Noobie
*
Posts: 24


WWW
Re:Come on BOFFINS this should be easy
« Reply #2 on: September 13, 2002, 11:28:31 PM »
Reply with quote

Tom

This term Boffin only applies to the smart ones you know.  ;D
Boffin is a compliment!  ;D

Anyway thanks for responding.

To the problem at hand, I have tried the adjustment and can see what you did, I thought it would be easy (for the smart ones).
Yes it does sort the messages by name (alphabetically),  :o Unfortunately, starting at the "W's"  o oh.

Any idea how to reverse this ?
Logged
Bossy Boots
Noobie
*
Posts: 24


WWW
Re:Come on BOFFINS this should be easy
« Reply #3 on: September 14, 2002, 02:05:01 AM »
Reply with quote

After some fiddling I found the answers to all my WOES.

Now I am so HAPPY  ;D :D ;) :)
Below is the answer, if anyone else is interested.
It was actually very easy once you study all that code for long enough, I knew that answer had to be in there somewhere

// Grab the appropriate topic information
  if ($modSettings['enableStickyTopics'] == '1')
     $result = mysql_query("SELECT t.ID_LAST_MSG,t.ID_TOPIC,t.numReplies,t.locked,m.posterName,m.ID_MEMBER,t.numViews,m.posterTime,m.modifiedTime,t.ID_FIRST_MSG,t.isSticky,t.ID_POLL,mes.posterName as mname,mes.ID_MEMBER as mid,mes.subject as msub,mes.icon as micon FROM {$db_prefix}topics as t, {$db_prefix}messages as m, {$db_prefix}messages as mes WHERE (t.ID_BOARD=$currentboard AND m.ID_MSG=t.ID_LAST_MSG AND mes.ID_MSG=t.ID_FIRST_MSG) ORDER BY t.isSticky DESC, m.subject, t.ID_FIRST_MSG DESC LIMIT $start,$maxindex");
  else
     $result = mysql_query("SELECT t.ID_LAST_MSG,t.ID_TOPIC,t.numReplies,t.locked,m.posterName,m.ID_MEMBER,t.numViews,m.posterTime,m.modifiedTime,t.ID_FIRST_MSG,t.isSticky,t.ID_POLL,mes.posterName as mname,mes.ID_MEMBER as mid,mes.subject as msub,mes.icon as micon FROM {$db_prefix}topics as t, {$db_prefix}messages as m,{$db_prefix}messages as mes WHERE (t.ID_BOARD=$currentboard AND m.ID_MSG=t.ID_LAST_MSG AND mes.ID_MSG=t.ID_FIRST_MSG) ORDER BY m.subject, t.ID_FIRST_MSG DESC LIMIT $start,$maxindex");
Logged
TheJkWhoSaysNi
YaBB God
*****
Posts: 1025


I dont know what to put here, i'll leave it blank.

ICQ - 122821095TheJkWhoSaysNi@evilemail.com WWW
Re:Come on BOFFINS this should be easy
« Reply #4 on: September 14, 2002, 03:41:45 PM »
Reply with quote

the easy answer hwoever, is to change both "DESC" (Meaning Descending) To "ASC" (Meaning ASCending)
Logged

WARNING: THIS POST MAY CONTAIN TRACES OF PEANUT!!!
I'm listening to....
Bossy Boots
Noobie
*
Posts: 24


WWW
Re:Come on BOFFINS this should be easy
« Reply #5 on: September 14, 2002, 11:35:04 PM »
Reply with quote

Yeh OK I got it, just needed to play with order of ASC and DESC's a bit here is the final full strings

Quote// Grab the appropriate topic information
  if ($modSettings['enableStickyTopics'] == '1')
     $result = mysql_query("SELECT t.ID_LAST_MSG,t.ID_TOPIC,t.numReplies,t.locked,m.posterName,m.ID_MEMBER,t.numViews,m.posterTime,m.modifiedTime,t.ID_FIRST_MSG,t.isSticky,t.ID_POLL,mes.posterName as mname,mes.ID_MEMBER as mid,mes.subject as msub,mes.icon as micon FROM {$db_prefix}topics as t, {$db_prefix}messages as m, {$db_prefix}messages as mes WHERE (t.ID_BOARD=$currentboard AND m.ID_MSG=t.ID_LAST_MSG AND mes.ID_MSG=t.ID_FIRST_MSG) ORDER BY t.isSticky DESC, m.subject ASC LIMIT $start,$maxindex");
  else
     $result = mysql_query("SELECT t.ID_LAST_MSG,t.ID_TOPIC,t.numReplies,t.locked,m.posterName,m.ID_MEMBER,t.numViews,m.posterTime,m.modifiedTime,t.ID_FIRST_MSG,t.isSticky,t.ID_POLL,mes.posterName as mname,mes.ID_MEMBER as mid,mes.subject as msub,mes.icon as micon FROM {$db_prefix}topics as t, {$db_prefix}messages as m,{$db_prefix}messages as mes WHERE (t.ID_BOARD=$currentboard AND m.ID_MSG=t.ID_LAST_MSG AND mes.ID_MSG=t.ID_FIRST_MSG) ORDER BY m.subject ASC LIMIT $start,$maxindex");

Thanks for help
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  General Category  |  Feedback  |  Come on BOFFINS this should be easy « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.030 seconds with 18 queries.