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.

Edited by Mahngiel
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.