Jump to content

Private Message System


kdigital

Recommended Posts

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.

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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.