EchoFool Posted February 21, 2008 Share Posted February 21, 2008 I need some input on how you would approach this idea logically using tables too.. I have a forum... where by users can edit their posts. But i want to store the original version.. then the new version as a separate row. But obviously then i would have post ID clashes as i sort the post's output by ID order. So i need to some how store the edits with the original so staff can see what they are trying to hide if anything, whilst the post remaining in its exact same position as it did originally in terms of the order of the posts in a thread... How would you go about this.. (i don't need code help here) just logic, is the problem. Once i know the logic i will be able to do it. Quote Link to comment https://forums.phpfreaks.com/topic/92357-help-with-logic-of-my-idea/ Share on other sites More sharing options...
Lashiec Posted February 21, 2008 Share Posted February 21, 2008 Off the top of my head maybe a separate database table that when a post is edited it kicks the original message into that database with the ID. Quote Link to comment https://forums.phpfreaks.com/topic/92357-help-with-logic-of-my-idea/#findComment-473213 Share on other sites More sharing options...
EchoFool Posted February 21, 2008 Author Share Posted February 21, 2008 Thats what i was planning to do... but then how would i with that table and the other table list all posts in logical order if a staff wanted to see the user's posts for any illegal activity .. thats the problem Quote Link to comment https://forums.phpfreaks.com/topic/92357-help-with-logic-of-my-idea/#findComment-473217 Share on other sites More sharing options...
Lashiec Posted February 21, 2008 Share Posted February 21, 2008 Maybe have a field with a time stamp in it so you can sort it by time edited and view them in order. Or, some unique ID in the new table that you can sort the table by and pull out all the specific posts you want to and they should be in order then. Quote Link to comment https://forums.phpfreaks.com/topic/92357-help-with-logic-of-my-idea/#findComment-473223 Share on other sites More sharing options...
EchoFool Posted February 21, 2008 Author Share Posted February 21, 2008 Can't use time cos if you edit a post "after" some one replies.. then the new edited version time stampe will be newer than the other guy's post. I use a ID but how would you pull out the specific .. thats the tough part. Quote Link to comment https://forums.phpfreaks.com/topic/92357-help-with-logic-of-my-idea/#findComment-473226 Share on other sites More sharing options...
Lashiec Posted February 21, 2008 Share Posted February 21, 2008 Well, from what I understand maybe this would work. In the new table you have a column for unique ID to the table, another column for the ID of the forum post, and then whatever else for the message and other info. Then when you go to look for the edited messages in this new table you can sort them by the unique ID, that way you will know which post was first and second and so on. You can also look for the ID of the original message on the forum and get the specific edits for that one, sorted by their unique ID. So, a user posts, lets say it's post # 50. They go ahead and edit it, what would happen is in your new database it gets this info: Unique ID = 1, Forum ID = 50, Message = original message. When they go ahead and edit their post again it gets another entry. Unique ID = 2, Forum ID = 50, Message = ... and so on. That would be one way to keep the posts in order. Quote Link to comment https://forums.phpfreaks.com/topic/92357-help-with-logic-of-my-idea/#findComment-473231 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.