SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
July 29, 2010, 04:14:22 pm

Login with username, password and session length
Members
Total Members: 8182
Latest: Laser077
Stats
Total Posts: 21474
Total Topics: 4005
Online Today: 43
Online Ever: 399
(March 21, 2008, 10:16:14 pm)
Users Online
Users: 0
Guests: 29
Total: 29
Sponsored Links
+  SMFHacks.com
|-+  Forum
| |-+  SMFHacks.com
| | |-+  Site Discussion
| | | |-+  List Private Messages From The Database With PHP
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 5168 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 05:27:30 am]

[July 28, 2010, 04:25:31 pm]

[July 28, 2010, 03:26:44 pm]

[July 28, 2010, 12:31:49 am]

[July 27, 2010, 01:13:37 pm]

[July 27, 2010, 11:53:36 am]

[July 27, 2010, 07:22:28 am]

[July 25, 2010, 12:18:25 am]

[July 24, 2010, 10:36:53 pm]

[July 24, 2010, 02:14:46 pm]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
TinyPortal v0.9.7 © Bloc
Page created in 0.194 seconds with 19 queries.