bam2550 Posted May 4, 2008 Share Posted May 4, 2008 You may remember me from a while back when i asked help about my Private Messaging System. Well its all good now, and i can effectively put in and take out the private message. My question is now, how can i make it like Invisionfrees/any forum private messaging? So far my inbox is like this: [From] admin [subject] Test [Message] Hey.... Test. And i would like it like [subject] Test [From] Admin And the word Test be incoded in a link to lead to a nice little page stating the From, Subject and Message. (Like a forum PM) I have no clue how to do this... Thanks Quote Link to comment https://forums.phpfreaks.com/topic/104112-private-messaging-system/ Share on other sites More sharing options...
MattDunbar Posted May 4, 2008 Share Posted May 4, 2008 Make sure your PMs are linked to an ID, then use the ID as a GET Parameter and do 2 pages listing different info sets. I need too see more of the code you're using to give a more detailed description of how this would be done. Quote Link to comment https://forums.phpfreaks.com/topic/104112-private-messaging-system/#findComment-533020 Share on other sites More sharing options...
bam2550 Posted May 4, 2008 Author Share Posted May 4, 2008 uhhmm here ill pastebin all the import things for you. This is basically what it is (minus the control panel, minus the login screen (which i doubt is important)) PS... The includes are to help identify the $username sending and receiving... PPS... It actually works http://pastebin.com/m1b803a4 Quote Link to comment https://forums.phpfreaks.com/topic/104112-private-messaging-system/#findComment-533029 Share on other sites More sharing options...
MattDunbar Posted May 4, 2008 Share Posted May 4, 2008 You're going to need to add a unique ID for each message in the database. Quote Link to comment https://forums.phpfreaks.com/topic/104112-private-messaging-system/#findComment-533035 Share on other sites More sharing options...
bam2550 Posted May 4, 2008 Author Share Posted May 4, 2008 Yes, i was thinking about doing that. But how? and where? Quote Link to comment https://forums.phpfreaks.com/topic/104112-private-messaging-system/#findComment-533036 Share on other sites More sharing options...
bam2550 Posted May 4, 2008 Author Share Posted May 4, 2008 Hmm, im still having much trouble with this. I can figure out how to apply a set number to it (0 for each one, 1 for each one, 2 for each one, ect ect) but not a unique one. Quote Link to comment https://forums.phpfreaks.com/topic/104112-private-messaging-system/#findComment-533074 Share on other sites More sharing options...
MattDunbar Posted May 4, 2008 Share Posted May 4, 2008 Hmm, perhaps you should look into following a tutorial to make this PM system. A rewrite will likely be needed. Quote Link to comment https://forums.phpfreaks.com/topic/104112-private-messaging-system/#findComment-533075 Share on other sites More sharing options...
BlueSkyIS Posted May 4, 2008 Share Posted May 4, 2008 there should be an id field on your message table that auto-increments when a record is added. after you insert a message, you can get the id of that new record using mysql_insert_id() (assuming you're using MySQL): $sql = "INSERT INTO messages VALUES (NULL,'$message_text'); mysql_query($sql) or die(mysql_error()); $new_message_id = mysql_insert_id(); Quote Link to comment https://forums.phpfreaks.com/topic/104112-private-messaging-system/#findComment-533076 Share on other sites More sharing options...
bam2550 Posted May 4, 2008 Author Share Posted May 4, 2008 1.) I have never seen a PMing system tutorial... 2.) I really do not want to redo this PM system... Through all this debugging and building from scratch (which took me a while, and i learned a lot) I dont want to stop now. 3.) Thanks BlueSky Quote Link to comment https://forums.phpfreaks.com/topic/104112-private-messaging-system/#findComment-533078 Share on other sites More sharing options...
DeanWhitehouse Posted May 4, 2008 Share Posted May 4, 2008 here is a PM tutorial http://www.egmods.com/Main/Tutorials/php/intermediate/pms/index.php Quote Link to comment https://forums.phpfreaks.com/topic/104112-private-messaging-system/#findComment-533081 Share on other sites More sharing options...
MattDunbar Posted May 4, 2008 Share Posted May 4, 2008 1.) I have never seen a PMing system tutorial... 2.) I really do not want to redo this PM system... Through all this debugging and building from scratch (which took me a while, and i learned a lot) I dont want to stop now. 1. http://www.pixel2life.com/search/php_coding/Private%20Message/1/ That page lists 2 tutorials. 2. Thats fine, but maybe reading through a tutorial will help explain how the ID system would work. Quote Link to comment https://forums.phpfreaks.com/topic/104112-private-messaging-system/#findComment-533082 Share on other sites More sharing options...
bam2550 Posted May 4, 2008 Author Share Posted May 4, 2008 Hmm okay thanks a lot. Nice tutorials Quote Link to comment https://forums.phpfreaks.com/topic/104112-private-messaging-system/#findComment-533085 Share on other sites More sharing options...
bam2550 Posted May 5, 2008 Author Share Posted May 5, 2008 mysql_select_db("messaging", $con); $result = mysql_query("SELECT * FROM private_messages WHERE sendto='$username'", $con);; Is there anyway to sort it by the id? from highest number to lowest? Quote Link to comment https://forums.phpfreaks.com/topic/104112-private-messaging-system/#findComment-533124 Share on other sites More sharing options...
gdfhghjdfghgfhf Posted May 5, 2008 Share Posted May 5, 2008 add ORDER BY id ASC (or DESC) to the end of the query. Quote Link to comment https://forums.phpfreaks.com/topic/104112-private-messaging-system/#findComment-533127 Share on other sites More sharing options...
Trium918 Posted May 5, 2008 Share Posted May 5, 2008 bump Quote Link to comment https://forums.phpfreaks.com/topic/104112-private-messaging-system/#findComment-533163 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.