• Resolved jrsjohn

    (@jrsjohn)


    I need to alphabetize the posts within a Simple Press forum, instead of showing in chronological order.

Viewing 11 replies - 1 through 11 (of 11 total)
  • This tells us nothing… which prevents us from helping you.

    What have you tried?
    Do you have any code snippets?
    Have you tried contacting the plugin/theme author?
    What is the link the “Simple Press Forum” you are currently using?

    Thread Starter jrsjohn

    (@jrsjohn)

    I apologize but I’m not understanding why this tells you nothing.

    We are using a forum designed in Simple Press to post files or documents that would be beneficial to a large number of users. Currently the files are being shown in chronological order as they are posted. To make them easier to find, we need to show them in alphabetical order by the name of the file or document.

    Is there a way to do this?

    Any help will be appreciated.

    Thread Starter jrsjohn

    (@jrsjohn)

    I have looked for code but have not gotten anything to work as of yet.

    I’ve also changed the code but to no avail.

    Thread Starter jrsjohn

    (@jrsjohn)

    Can someone please help with alphabetizing posts in a forum.

    What is the link to the “Simple Press Forum” you are using?
    I don’t use this… so I have no idea what it is.

    Before I download it, install it, and test it… I’d like to make sure I am using the exact same plugin/addon you are using.

    I will need to look at the code.. and see how they are showing the files in chronological order. Then, I’ll need to see if making it display in alphabetical order has to be hard-coded, or if there is a way to make an option.

    Before I do all this.. I want to ensure we are both looking at the same plugin/addon.

    Thread Starter jrsjohn

    (@jrsjohn)

    Josh,

    The link to Simple Press is https://www.simple-press.com.
    This is a plugin for WordPress.

    The actual link to the site we are working from is
    108.175.205.89/dp20g/
    This is where our demo site is located.
    We created a login for you which will be removed in a few days.
    Username: josh
    Password: josh12345

    To download the Simple Press plugin:
    108.175.205.89/dp20g/wp-content/uploads/simple-press.zip

    After you download the zip file above, the files I’ve been working on are located at:
    wp-content\plugins\simple-press\forum\content\classes

    The specific files in this location that I’ve worked on are:
    sp-lst-topic-class.php
    sp-lst-post-class.php

    I’m not even sure these are the correct files to work on, however, the changes I made did not work. The files are still in chronological order.

    Please note the files you will see have had no changes made. This is the original zip file.

    Your help will be appreciated.

    Great. Thank you.
    Go ahead and remove the details above (WP mods might remove it anyways).

    You may use my contact form here:
    https://ultimatetinymcepro.com/contact/
    … to contact me directly.

    Please add a link to this thread in your message; so I know what we are talking about.

    Okay… the first thing I noticed were the amount of errors that were thrown when I installed the plugin.

    What version of WP is it rated to support? What version of WP do you currently have installed?

    In order to show forum topics alphabetically, we need to adjust the simple-press/forum/content/classes/sp-forum-view-class.php file.

    In that file, around line #297… you will see this snippet:

    if ($setSort XOR $reverse) {
        $ORDER = 'topic_pinned DESC, '.$COLUMN.' DESC';
    } else {
        $ORDER = 'topic_pinned DESC, '.$COLUMN.' ASC';
    }

    Immediately, after that… on a new line… let’s add the following:

    // OVER-RIDE ORDER TO ALLOW ALPHABETICAL
    $ORDER = 'topic_name ASC';

    Final code should look like so:

    if ($setSort XOR $reverse) {
        $ORDER = 'topic_pinned DESC, '.$COLUMN.' DESC';
    } else {
        $ORDER = 'topic_pinned DESC, '.$COLUMN.' ASC';
    }
    
    // OVER-RIDE ORDER TO ALLOW ALPHABETICAL
    $ORDER = 'topic_name ASC';

    Basically, what we have done, is over-ridden the variable used to store the sort order… depending on the admin option.

    Unfortunately, it only looks like the two options they provided for sorting are ascending and descending ONLY by forum topic date.

    I don’t really have the time to dig through the code to find out about storing an option… so I just hard-coded it.

    This means that no matter what the admin option setting for sorting… it will always display alphabetically (unless you remove the hard-coded snippet).

    Save the file.. and re-upload to your server.

    Voila… alphabetical sorting!!

    Thread Starter jrsjohn

    (@jrsjohn)

    Voila… alphabetical sorting!!

    Thanks!!!

    I was going about it in the wrong way…

    You’re welcome.

    Please mark your topic as ‘resolved’ to help others who may ask the same question in the future.

    Thread Starter jrsjohn

    (@jrsjohn)

    Thank again!!

    Great job!!!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Alphabetize Posts within Simple Press Forum Topic’ is closed to new replies.