Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
requests-topic
Create Post Sort Order by Forum
Avatar
FidoSysop
Clearwater Florida
Member

VIP
sp_UserOfflineSmall Offline
Mar 25, 2012 - 9:24 am

G'mornin..

It would be useful to be able to define post sorting by forum, or if that is not possible sort by group.

I sort my posts by oldest first, but have another forum for my blog posts that would be best sorted by newest first.

I looked before posting this message, please excuse me if i am incorrect and there is a way to sort by forum.

Thanks.. wink

  • Doc ~ An old Fidonet SysOp. Just hanging out in cyberspace keeping up with tech.
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 25, 2012 - 9:49 am

Can you explain just where you mean you would like this sorting behaviour? You seem to be talking about 'posts' but in what context? If you mean the standard Topic View - i.e, all the posts in a specific topic - then sorting by 'forum' or 'group' is meaningless. So I am a little confused...

andy-signature.png
YELLOW
SWORDFISH
Avatar
FidoSysop
Clearwater Florida
Member

VIP
sp_UserOfflineSmall Offline
Mar 25, 2012 - 10:02 am

I sometimes confuse myself not knowing how to say what i am thinking.

I have one Group, with 4 Forums installed so far.

All my SP forum posts are sorted by the oldest message first.

Of these 4 Forums, one is for Blog posts that are auto created when i publish a blog post. That one forum is getting fairly long. In just that one Forum would be better to sort the Posts by newest published.

 

I considered creating another Group for those blog posts copied to SP, but didn't see a sort order there either. 

  • Doc ~ An old Fidonet SysOp. Just hanging out in cyberspace keeping up with tech.
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 25, 2012 - 10:21 am

No worries but still a little confused!

But that s probably academic. Currently SP supports options for the sorting of topic lists (Forum View) and post lists (Topic View) but - they are globally applied to all forums and topics. So the answer sounds like it is - not at the moment.

But I will open a ticekt so we can discuss whether this is something we should consider adding.

andy-signature.png
YELLOW
SWORDFISH
Avatar
FidoSysop
Clearwater Florida
Member

VIP
sp_UserOfflineSmall Offline
Mar 25, 2012 - 10:22 am

Thanks.. I think that would a useful addition.

  • Doc ~ An old Fidonet SysOp. Just hanging out in cyberspace keeping up with tech.
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Mar 25, 2012 - 11:01 am

we might try to get it in next release since its straight forward, but no guarantees.

Avatar
Dosenben
Member
Free Members
sp_UserOfflineSmall Offline
Jun 19, 2012 - 10:42 am

Dear Simple:press team,

i'll just necromance this thread - i changed the topic order to alphabetical by inserting 

add_filter('sph_forumview_query', 'my_sort_function');
function my_sort_function($sqlObj) {
$sqlObj->orderby = SFTOPICS . '.topic_name ASC';
return $sqlObj;

 

into the spfunctions.php of the template. Of course, now my beloved customer has noticed (after i told him about 15 times rolleys) that this is great for the "collector" part of the forum (german stamps; they seem to have an extremely strict numbering system...), but quite disturbing for the off-topic part (people don't seem to number their threads there :D).

At this, i'm at my wits end. Can you think of any way to implement this; short of setting up a second forum?

 

best regards and thanks for your time!

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jun 19, 2012 - 11:12 am

What are you asking for here? Is it just to add the alphabetical sort to a single forum and its topics?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Dosenben
Member
Free Members
sp_UserOfflineSmall Offline
Jun 20, 2012 - 3:41 am

Hey Andy,

 

yeah; sorry for my confusing post - that's pretty much it. Is that possible?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jun 20, 2012 - 4:30 am

The quickest and easiest way to confine your sort change to a single forum would be:

add_filter('sph_forumview_query', 'my_sort_function');
function my_sort_function($sqlObj) {
    global $sfvars;
    if($sfvars['forumid'] == XX) {
        $sqlObj->orderby = SFTOPICS . '.topic_name ASC';
    }
    return $sqlObj;
}

Where XX is the forum ID you want to effect.

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 643
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 616
Members: 17343
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10117
Posts: 79590