SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
February 11, 2012, 10:35:08 am

Login with username, password and session length
Members
Total Members: 9906
Latest: mdebruijne
Stats
Total Posts: 27815
Total Topics: 4860
Online Today: 86
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 2
Guests: 77
Total: 79
+ 
|-+ 
| |-+ 
| | |-+ 
| | | |-+ 
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: List Private Messages From The Database With PHP  (Read 6403 times)
origin
Newbie
*
Offline Offline

Posts: 1


View Profile
« on: March 08, 2007, 09:17:12 am »

Hello, I am currently working on a website that will be integrating with a Simple Machines Forum. I want to make a messaging system, but why not just use the smf pm system? It will be easier and it will be better so users don't get confused with forums pms and site pms. Here is what I would like to do:

Message Title:
Message Content
From: Username, Date & Time
[Delete] [Reply]

Can this be done in a way like this? I have looked in my database and see that there are two tables for private messages:

smf_personal_messages:
 ID_PM        ID_MEMBER        labels        bcc        is_read        deleted

And smf_pm_recipients:
 ID_PM        ID_MEMBER_FROM        deletedBySender        fromName        msgtime        subject        body

The first one contains who wrote it, the time, and the message, the second one contains who the message was sent to.

I would need to get the users id that is logged in, which would be simple enough with SSI. But I would also need to then check if that member id has any messages from the recipients table. If there is a message with their id then go into the first table and gather the info from the message with that id.

I could do something like this for when I list them...

Code:
echo('<table width="241" height="80" border="0" cellpadding="0" cellspacing="0">');
echo('<tr><td><p><b>Title:<br></b>$message<br><b>From: </b><i>'.$userfrom.',</i><b> On:</b><i> '.$time.'</i></p></td></tr>');
echo('</table>');

It is kind of confusing and if anyone would be willing to help it would be great.

Thanks
« Last Edit: March 08, 2007, 09:49:31 am by origin » Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Recent
[Today at 10:07:55 am]

[Today at 09:32:34 am]

[Today at 08:49:33 am]

[Today at 08:36:58 am]

[February 10, 2012, 02:42:09 pm]

[February 10, 2012, 02:23:51 pm]

[February 10, 2012, 10:26:45 am]

by exit
[February 09, 2012, 04:47:13 pm]

[February 08, 2012, 09:09:16 pm]

[February 08, 2012, 09:11:02 am]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Powered by SMF 1.1.16 | SMF © 2006-2011, Simple Machines LLC
TinyPortal v0.9.7 © Bloc
SMF and SimpleMachines are registered trademarks of Simple Machines. SMFHacks.com is not affiliated with nor endorsed by Simple Machines.
Page created in 0.196 seconds with 20 queries.