What's the query for setting "Default Sort Field"?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MrApples
    Senior Member
    • Sep 2007
    • 108
    • 3.6.x

    What's the query for setting "Default Sort Field"?

    to Last Post and Descending. I've searched for this and cannot find it.
  • Floris
    Senior Member
    • Dec 2001
    • 37767

    #2
    Post Order
    Newest first: UPDATE user SET options=options + 32768 WHERE NOT(options & 32768)
    Oldest first: UPDATE user SET options=options - 32768 WHERE options & 32768


    Comment

    • MrApples
      Senior Member
      • Sep 2007
      • 108
      • 3.6.x

      #3
      It's not that. I would have found it then.

      That controls the post order within a topic, I am looking for the topic order within a forum. "Default Sort Field"

      Comment

      • Floris
        Senior Member
        • Dec 2001
        • 37767

        #4
        That is a per forum setting, admincp> forums > forum manager > modify the forum where you want to set this for. I am not aware of a query to set this for all the forums in one go.

        Comment

        • MrApples
          Senior Member
          • Sep 2007
          • 108
          • 3.6.x

          #5
          Looked in the code to get this.
          Code:
          UPDATE vforum SET defaultsortfield = 'lastpost'
          UPDATE vforum SET defaultsortorder = 'desc'
          Not sure if that worked(i have a sort preference, dunno how to get rid of it), although it did set the columns correctly.

          Comment

          • Baitona
            New Member
            • Jul 2005
            • 21
            • 3.0.7

            #6
            Hi There are two methods:

            1.
            Originally posted by Floris
            That is a per forum setting, admincp> forums > forum manager > modify the forum where you want to set this for. I am not aware of a query to set this for all the forums in one go.
            2.
            UPDATE `NAME_OF_UR_DATABASE`.`forum` SET `defaultsortfield` = 'lastpost',
            `defaultsortorder` = 'desc';

            and it is will work

            Comment

            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
            Working...