kdigital Posted September 25, 2012 Share Posted September 25, 2012 Does anyone know a good inbox style private message tutorial with pagination? Book suggestions? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/268794-private-message-system/ Share on other sites More sharing options...
Mahngiel Posted September 25, 2012 Share Posted September 25, 2012 (edited) what does an inbox/messaging system have to do with pagination? Just create simple table with row id, from_user_id, to_user_id, and message. Based on a user's ID, you query the table for messages to them. if there are more than the desired amount of returned messages, you'll need to set a query string which manages the limits in your query. you can read a tutorial on pagination here by PHPF's own .josh Not sure what you're really going for here. Edited September 25, 2012 by Mahngiel Quote Link to comment https://forums.phpfreaks.com/topic/268794-private-message-system/#findComment-1380929 Share on other sites More sharing options...
kdigital Posted September 26, 2012 Author Share Posted September 26, 2012 what does an inbox/messaging system have to do with pagination? Just create simple table with row id, from_user_id, to_user_id, and message. Based on a user's ID, you query the table for messages to them. if there are more than the desired amount of returned messages, you'll need to set a query string which manages the limits in your query. you can read a tutorial on pagination here by PHPF's own .josh Not sure what you're really going for here. I need read and sent options also. You've never seen an inbox with pagination? Thanks for the link on pagination by the way. I'm going to try this myself today since finding a tutorial that teaches you to build one like the ones on popular social media sites is like finding the Philosophers Stone. Quote Link to comment https://forums.phpfreaks.com/topic/268794-private-message-system/#findComment-1380983 Share on other sites More sharing options...
Mahngiel Posted September 26, 2012 Share Posted September 26, 2012 You've never seen an inbox with pagination? I skimmed your post and misread it initially and neglected to edit that out. Adding sent and read status options is just a matter of extending the database or modifying the query. In regards to `read status`, I generally like to use a boolean value (1=read, 0=unread) that the application will update. On that same note, you could apply the same concept to `visibility` if you want to keep all messages regardless if they've been marked 'deleted'. You have to approaches when it comes to grabbing the messages sent to and by a user. You could separate the queries depending on if the user is on his 'inbox' or 'sent box', which just applies the user's `user_id` to the different column. Or, you could grab both columns and sort them depending on where their id falls. Give it a try, and post any code you have problems with. Quote Link to comment https://forums.phpfreaks.com/topic/268794-private-message-system/#findComment-1381114 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.