Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Topic list order
Avatar
Simon Trice
Wales
Member
Free Members
sp_UserOfflineSmall Offline
Feb 15, 2016 - 7:43 am

I am in the middle of a tedious process of migrating 12 years worth of posts from a Bravenet forum.  Because there is no access to the database I have to add all posts and replies by hand and set the post date and author.

I started doing this with no problems, the topics would appear in the correct forum group, in the correct order based on the amended topic date.

Since the last update ( the one prior to yesterdays) when I add a new topic it now appears at the top of the list instead of in it's correct postion as if it is now being sorted by the real date posted instead of the amended date..

 

Any ideas on how to fix this so that the forum is listed by the published date instead.

 

Simon

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Feb 15, 2016 - 9:23 am

Hey Simon,

Sounds like a big job.. What update are you referring to - 5.6.3? I don't think there was anything in there to do with ordering topics / posts.

How exactly are you adding topics and posts? Are you doing this within the forum itself and then changing the post timestamp? Or are you doing it in the database?

Off the top of my head I'm pretty sure the only way things are organised is by post / topic date not ID although I could be wrong. I think I will probably need Andy or Steve to put some input in to this one..

Avatar
Simon Trice
Wales
Member
Free Members
sp_UserOfflineSmall Offline
Feb 15, 2016 - 9:56 am

Hi Ike

 Yes, I am adding topics via the forum and changing the post date and author before posting.  Then adding the replies using the same method.

One at a time...........monotonous or what!

Not sure what the revision number was, I updated to the latest today so it would have happened when I applied the previous update.  It does seem that they are currently being ordered by topic ID at the moment rather than topic date though.

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Feb 15, 2016 - 10:12 am

Yes sounds very tedious. Just out of interest why can't you access the original database? I know people have had success with gConverter (gconverters.com) but I can't find any reference to Bravenet.

I apologise, after some digging posts are actually ordered by ID which makes sense generally speaking - The ID is created as the post is created so ID / date go hand in hand.

You can change the post ID's in the database but you would have to be very careful as you'd have to make sure all references to the ID's match up. Again will have to wait for Andy or Steve to offer any further advice.

Avatar
Simon Trice
Wales
Member
Free Members
sp_UserOfflineSmall Offline
Feb 15, 2016 - 10:18 am

Hi Ike

Bravenet is a hosted solution my customer was using, along with half a dozen other services just to build a single site.  I am merging everything into a single platform.  The issue is that there is absolutely no way to export anything from Bravenet (they do not like you to leave).

Is there any way I can use sph_forumview_query in a theme filter to change the sort order.  Have been reading through the forums for clues but there is nothing in the codex about what arguments should be used for sorting by post date.

Simon

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 15, 2016 - 11:52 am

Ike is correct that topics are - by default - sorted by the post ID. This is the same as sorting by the post date of course.

But he is also correct that there were no changes made to anything that could effect sort ordering of posts or topics - actually for many, many releases. I really do not see what the update could have done to upset anything like that.

So... if you are adding posts as they should be entered - or as they would naturally be entered - i.e., letting the post ID increment by one for each new post then things should be fine.

If what you are saying is that you want to sort your forums with the oldest topics first - which is an unusual way to do it but I know some users do - then you just need to change the sort settings in the forum admin > options > general display settings.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Simon Trice
Wales
Member
Free Members
sp_UserOfflineSmall Offline
Feb 15, 2016 - 12:14 pm

I'd just figured that, The earlier ones were in the correct order because I had started from the earliest posts.  The problem now is that some people have added new posts which are appearing below the posts I have since been entering.

Is there any way I can force the forum to display based on the post date shown on the topic rather than by ID.

I have seen in the forum that I may be able to use sph_forumview_query as a filter in my theme functions but as the codex is incomplete I am at a loss for what variable to sort by.

https://simple-press.com/suppo.....e/#p135303

 

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 15, 2016 - 12:45 pm

The post you linked to is a perfect example actually. Leave out the 'if' conditional of course. And change the 'orderby' property to 'post_date'- use ASC or DESC as preferred.

For the record we use post_id for the sort - which in the normal run of things equates to post_date - simply because being an integer and the primary key column it is going to be faster. No other reason.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Simon Trice
Wales
Member
Free Members
sp_UserOfflineSmall Offline
Feb 15, 2016 - 1:11 pm

Tried that and get an invalid database query error at the top of the screen.  Inspected the database table and found that the correct header was 'topic_date DESC'.

Thanks for all the help. smile

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 15, 2016 - 4:15 pm

Well it depends what you want to achieve. Under normal circumstances when a topic receives a new post it will shuffle that topic to the top of the list. Using topic_date wont do that.

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