Welcome, Guest. Please Login or Register.
June 26, 2024, 10:16:33 AM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Completed mods  |  [Beta 1.5.3]Alternative MessageIndex sort « previous next »
Pages: 1 [2] 3 Reply Ignore Print
Author Topic: [Beta 1.5.3]Alternative MessageIndex sort  (Read 12864 times)
Daniel D.
Mod Team
YaBB God
*****
Posts: 2935


Re:[Beta 1.5.3]Alternative MessageIndex sort
« Reply #15 on: June 17, 2003, 10:26:20 PM »
Reply with quote

Doesn't work. Installed it (altMI_MOD01.zip) on unmodded 1.5.3 & localhost with pics. First page is sorted, if I click on [2], the remain in the standard order. ???
Logged

A.M.A.
YaBB God
*****
Posts: 685


.:: :-) ::.

evolve_xp@hotmail.com WWW
Re:[Beta 1.5.3]Alternative MessageIndex sort
« Reply #16 on: June 18, 2003, 08:55:59 AM »
Reply with quote

Quote from: Daniel D. on June 17, 2003, 10:26:20 PM
Doesn't work. Installed it (altMI_MOD01.zip) on unmodded 1.5.3 & localhost with pics. First page is sorted, if I click on [2], the remain in the standard order. ???
Fixed: Sorry for that .. I do not know how I missed a whole step! Please try loading it again.
Logged

Anguz
YaBB God
*****
Posts: 641


llama me?!

WWW
Re:[Beta 1.5.3]Alternative MessageIndex sort
« Reply #17 on: June 18, 2003, 10:32:15 AM »
Reply with quote

THANK YOU!!! this is a mod a need a lot!  :D

a couple of questions:

when you're viewing a topic that's in a forum sorted with your mod, if you hit the NEXT button, will it take you to the next one in the new order?

is it possible to sort a certain forum by subject as default? so that will be the first order it'll be displayed in when opening it
Logged

My Mods: Avatar & Sig Size Control, No Show Msg Subject, Msg URL Composer, Built-in Avatar Rand, Built-in Sig Rand, Remove New-lines Excess, Show All Stars, Search Bar, Smart URLs
Daniel D.
Mod Team
YaBB God
*****
Posts: 2935


Re:[Beta 1.5.3]Alternative MessageIndex sort
« Reply #18 on: June 18, 2003, 05:32:44 PM »
Reply with quote

Quote from: A.M.A. on June 18, 2003, 08:55:59 AMFixed: Sorry for that .. I do not know how I missed a whole step! Please try loading it again.
Thx ! :)
Logged

A.M.A.
YaBB God
*****
Posts: 685


.:: :-) ::.

evolve_xp@hotmail.com WWW
Re:[Beta 1.5.3]Alternative MessageIndex sort
« Reply #19 on: June 18, 2003, 07:12:48 PM »
Reply with quote

Quote from: Anguz on June 18, 2003, 10:32:15 AM
when you're viewing a topic that's in a forum sorted with your mod, if you hit the NEXT button, will it take you to the next one in the new order?
Yes, if you choose the second ZIPFILE in the first post.

Quoteis it possible to sort a certain forum by subject as default? so that will be the first order it'll be displayed in when opening it
I guess it can be done 'hard-coded'.
Logged

David
Destroyer Dave
Global Moderator
YaBB God
*****
Posts: 5761


I'm not a llama!

WWW
Re:[Beta 1.5.3]Alternative MessageIndex sort
« Reply #20 on: June 26, 2003, 05:04:44 AM »
Reply with quote

Having problems with it sorting by thread starter.  It is instead sorting by the last poster.  The issue is the query is:
$result = mysql_query("
               SELECT t.ID_TOPIC
               FROM {$db_prefix}topics AS t, {$db_prefix}messages AS m
               WHERE m.ID_MSG=t.ID_LAST_MSG
                       AND t.ID_BOARD=$currentboard
               ORDER BY $stickyOrder $ordrsql
               LIMIT $start,$maxindex") or database_error(__FILE__, __LINE__);

So the ordersql of 'm.posterName ASC' is doing that on the last message instead of the first.  I can't come up with a good solution to fix this without a subselect for the order by to get the thread starters membername instead of the id number. :-\
Logged

A.M.A.
YaBB God
*****
Posts: 685


.:: :-) ::.

evolve_xp@hotmail.com WWW
Fix:Sorting by thread starter
« Reply #21 on: June 26, 2003, 03:00:03 PM »
Reply with quote

Change this

 else if ($ordrmindex == 3)
      $ordrsql = 'm.posterName ASC' ;
 else if ($ordrmindex == 4)
      $ordrsql = 'm.posterName DESC' ;
With

 else if ($ordrmindex == 3)
    $ordrsql = 't.ID_MEMBER_STARTED ASC' ;
 else if ($ordrmindex == 4)
    $ordrsql = 't.ID_MEMBER_STARTED DESC' ;

I hope this will fix it.
Logged

David
Destroyer Dave
Global Moderator
YaBB God
*****
Posts: 5761


I'm not a llama!

WWW
Re:[Beta 1.5.3]Alternative MessageIndex sort
« Reply #22 on: June 26, 2003, 11:28:33 PM »
Reply with quote

That would sort it by date the thread starter registered their account. :-\
Logged

A.M.A.
YaBB God
*****
Posts: 685


.:: :-) ::.

evolve_xp@hotmail.com WWW
Re:[Beta 1.5.3]Alternative MessageIndex sort
« Reply #23 on: June 27, 2003, 03:46:32 PM »
Reply with quote

Here is another try.. this may be a fix tho I am not sure of the effect that it may cause!
Look for:
   // Grab the appropriate topic information
 if ($ordrmindex == 1)
    $ordrsql = 'm.subject ASC' ;
 else if ($ordrmindex == 2)
    $ordrsql = 'm.subject DESC' ;
 else if ($ordrmindex == 3)
    $ordrsql = 'm.posterName ASC' ;
 else if ($ordrmindex == 4)
    $ordrsql = 'm.posterName DESC' ;
 else if ($ordrmindex == 5)
    $ordrsql = 't.numReplies ASC' ;
 else if ($ordrmindex == 6)
    $ordrsql = 't.numReplies DESC' ;
 else if ($ordrmindex == 7)
    $ordrsql = 't.numViews ASC' ;
 else if ($ordrmindex == 8)
    $ordrsql = 't.numViews DESC' ;
 else if ($ordrmindex == 9)
    $ordrsql = 'm.posterTime ASC' ;
 else if ($ordrmindex == 10)
    $ordrsql = 'm.posterTime DESC' ;
 else
    $ordrsql = 'm.posterTime DESC' ;
   
   $stickyOrder = ($modSettings['enableStickyTopics'] == 1 ? 't.isSticky DESC,' : '');
   $result = mysql_query("
      SELECT t.ID_TOPIC
      FROM {$db_prefix}topics AS t, {$db_prefix}messages AS m
      WHERE m.ID_MSG=t.ID_LAST_MSG
         AND t.ID_BOARD=$currentboard
      ORDER BY $stickyOrder $ordrsql
      LIMIT $start,$maxindex") or database_error(__FILE__, __LINE__);
   $topics = array();

and replace it with
   // Grab the appropriate topic information
 $PostrOnly='t.ID_LAST_MSG';
 if ($ordrmindex == 1)
    $ordrsql = 'm.subject ASC' ;
 else if ($ordrmindex == 2)
    $ordrsql = 'm.subject DESC' ;
 else if ($ordrmindex == 3)
    {
    $ordrsql = 'm.posterName ASC' ;
    $PostrOnly='t.ID_FIRST_MSG';
    }
 else if ($ordrmindex == 4)
    {
    $ordrsql = 'm.posterName DESC' ;
    $PostrOnly='t.ID_FIRST_MSG';
    }
 else if ($ordrmindex == 5)
    $ordrsql = 't.numReplies ASC' ;
 else if ($ordrmindex == 6)
    $ordrsql = 't.numReplies DESC' ;
 else if ($ordrmindex == 7)
    $ordrsql = 't.numViews ASC' ;
 else if ($ordrmindex == 8)
    $ordrsql = 't.numViews DESC' ;
 else if ($ordrmindex == 9)
    $ordrsql = 'm.posterTime ASC' ;
 else if ($ordrmindex == 10)
    $ordrsql = 'm.posterTime DESC' ;
 else
    $ordrsql = 'm.posterTime DESC' ;
   
   $stickyOrder = ($modSettings['enableStickyTopics'] == 1 ? 't.isSticky DESC,' : '');
   $result = mysql_query("
      SELECT t.ID_TOPIC
      FROM {$db_prefix}topics AS t, {$db_prefix}messages AS m
      WHERE m.ID_MSG=$PostrOnly
         AND t.ID_BOARD=$currentboard
      ORDER BY $stickyOrder $ordrsql
      LIMIT $start,$maxindex") or database_error(__FILE__, __LINE__);
   $topics = array();

if ($ordrmindex == 3)
    $ordrsql = 'mname ASC';
else if ($ordrmindex == 4)
    $ordrsql = 'mname DESC';
Logged

David
Destroyer Dave
Global Moderator
YaBB God
*****
Posts: 5761


I'm not a llama!

WWW
Re:[Beta 1.5.3]Alternative MessageIndex sort
« Reply #24 on: June 29, 2003, 12:40:20 AM »
Reply with quote

Real question is why is the messages table in that query at all, we are only selecting from the topics table.
Logged

A.M.A.
YaBB God
*****
Posts: 685


.:: :-) ::.

evolve_xp@hotmail.com WWW
Re:[Beta 1.5.3]Alternative MessageIndex sort
« Reply #25 on: July 01, 2003, 10:20:57 AM »
Reply with quote

so.. did it work!

Quote from: David on June 29, 2003, 12:40:20 AM
Real question is why is the messages table in that query at all, we are only selecting from the topics table.
:-\ I did not create any query. It is already in there.
Logged

dthomas
Noobie
*
Posts: 26


I'm a llama!

Re:[Beta 1.5.3]Alternative MessageIndex sort
« Reply #26 on: July 11, 2003, 06:27:26 PM »
Reply with quote

First let me say it is a great mod and thanks for the work you put into it. Now to my question I was wanting the ability to sort by original date posted.  I had this on another board I was using and everyone seemed to like that. I run a photo board and many peoples post gets burried because it sorts by replies and not the start date. Can this be done?
Logged
Keng
Noobie
*
Posts: 19


Web Thai

ICQ - 11470350kengracing@msn.com WWW
Re:[Beta 1.5.3]Alternative MessageIndex sort
« Reply #27 on: July 13, 2003, 04:21:41 PM »
Reply with quote

english.lng$txt['sort'] = 'Sort';
$txt['sort1'] = ' -> ASC';
$txt['sort2'] = ' <- DESC';


all_altMI.mod
Look for:        <form name="AscdesDD"><font size="1">Sort:</font>
         <select name="DDAD">
           <option value="' . $cgi . '&ordrmindex=1">Subject -> ASC</option>
           <option value="' . $cgi . '&ordrmindex=2">Subject <- DESC</option>
           <option value="">---------------------</option>
           <option value="' . $cgi . '&ordrmindex=3">Started by -> ASC</option>
           <option value="' . $cgi . '&ordrmindex=4">Started by <- DESC</option>
           <option value="">---------------------</option>
           <option value="' . $cgi . '&ordrmindex=5">Replies -> ASC</option>
           <option value="' . $cgi . '&ordrmindex=6">Replies <- DESC</option>
           <option value="">---------------------</option>
           <option value="' . $cgi . '&ordrmindex=7">Views -> ASC</option>
           <option value="' . $cgi . '&ordrmindex=8">Views <- DESC</option>
           <option value="">---------------------</option>
           <option value="' . $cgi . '&ordrmindex=9">Last post -> ASC</option>
           <option value="' . $cgi . '&ordrmindex=10">Last post <- DESC</option>


replace it with:        <form name="AscdesDD"><font size="1">' . $txt[sort] . ':</font>
         <select name="DDAD">
           <option value="' . $cgi . '&ordrmindex=1">' . $txt[70] . '' . $txt[sort1] . '</option>
           <option value="' . $cgi . '&ordrmindex=2">' . $txt[70] . '' . $txt[sort2] . '</option>
           <option value="">---------------------</option>
           <option value="' . $cgi . '&ordrmindex=3">' . $txt[109] . '' . $txt[sort1] . '</option>
           <option value="' . $cgi . '&ordrmindex=4">' . $txt[109] . '' . $txt[sort2] . '</option>
           <option value="">---------------------</option>
           <option value="' . $cgi . '&ordrmindex=5">' . $txt[110] . '' . $txt[sort1] . '</option>
           <option value="' . $cgi . '&ordrmindex=6">' . $txt[110] . '' . $txt[sort2] . '</option>
           <option value="">---------------------</option>
           <option value="' . $cgi . '&ordrmindex=7">' . $txt[301] . '' . $txt[sort1] . '</option>
           <option value="' . $cgi . '&ordrmindex=8">' . $txt[301] . '' . $txt[sort2] . '</option>
           <option value="">---------------------</option>
           <option value="' . $cgi . '&ordrmindex=9">' . $txt[111] . '' . $txt[sort1] . '</option>
           <option value="' . $cgi . '&ordrmindex=10">' . $txt[111] . '' . $txt[sort2] . '</option>
« Last Edit: July 15, 2003, 11:57:17 AM by Keng » Logged

visit our website at: RacingWeb.NET, Thai YaBB SE Thai Language, Forums test Mods
A.M.A.
YaBB God
*****
Posts: 685


.:: :-) ::.

evolve_xp@hotmail.com WWW
Re:[Beta 1.5.3]Alternative MessageIndex sort
« Reply #28 on: July 14, 2003, 11:58:06 PM »
Reply with quote

dthomas: I guess It can be done .. it may be something similar to what I did for David .. tho am not sure!

Keng: Thanks for adding the text strings, this way it will work with other translations.
Logged

sensovision
Full Member
***
Posts: 100


WWW
Re:[Beta 1.5.3]Alternative MessageIndex sort
« Reply #29 on: July 15, 2003, 10:16:01 PM »
Reply with quote

thank you for the great mod!
Logged

Denis

Are you good with the graphic? check out our design logo contest!
Pages: 1 [2] 3 Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  [Beta 1.5.3]Alternative MessageIndex sort « 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.082 seconds with 20 queries.