webtuto Posted January 11, 2008 Share Posted January 11, 2008 hi im trying to do a personal messages system in my script and i had few problems is there someone than can help a little bit with some tips thanks already Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted January 11, 2008 Share Posted January 11, 2008 Here's a rhetorical question that is stated oh so often around here: How do you figure that we, out of thin air, know your script, the errors you are having if you don't tell us; and thus, can provide tips for you? Quote Link to comment Share on other sites More sharing options...
webtuto Posted January 11, 2008 Author Share Posted January 11, 2008 tips about how to do a pm system here is ascript didnt work if (isset($_COOKIE[user])) { $member = $_COOKIE[user_z]; echo "By : <a href='msgs.php?member=$member'>".$_COOKIE[user_z]."</a><br>"; echo"Comment : ".$oop[com]."<br><br>"; } Quote Link to comment Share on other sites More sharing options...
adam291086 Posted January 11, 2008 Share Posted January 11, 2008 It all depends how big the system is going to be. If the system is small you can store PM message in a database. Then have a auto run script to check for new messages every minute. If you have a lot of users this is a bad design idea. You should google php chat tutorials. There are a few good ones out there. Maybe from that you'll come up with a solution. Quote Link to comment Share on other sites More sharing options...
twostars Posted January 11, 2008 Share Posted January 11, 2008 echo "By : <a href='msgs.php?member=$member'>".$_COOKIE[user_z]."[/url] Okay, you're trying to use bbCode to end a HTML tag? Quote Link to comment Share on other sites More sharing options...
revraz Posted January 11, 2008 Share Posted January 11, 2008 Probably disaplayed like that because he didn't use CODE tags. Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted January 11, 2008 Share Posted January 11, 2008 If you have a lot of users this is a bad design idea. How else would your propose that you design a personal message system? As far as i can see, the only possible change is to have the messages checked for when the page loads, rather than at a fixed interval. Quote Link to comment Share on other sites More sharing options...
twostars Posted January 11, 2008 Share Posted January 11, 2008 Table: private_messages Columns: - id - author - receiver - time - title - message - status Something like that.. Then use the query: SELECT * FROM private_messages WHERE receiver='{$myself}' Display them all (basic data) in a while loop (don't forget a count!) for a PM list, and (in the while loop) determine if the PM has been viewed or not. For a "You have x PMs" you can basically just use a similar while loop & counter, leaving out the output, but keeping the counter and status check. If its viewed, don't add it to the count, otherwise do add it to the count. Then on the PM VIEW page, output all the details of that PM and change the status (if its not already) to viewed. Simple, no? Quote Link to comment 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.