Old 06-13-2005   #1 (permalink)
Registered User
 
Space Cowboy's Avatar
 
Join Date: May 2005
Location: England (South)
Posts: 40

Personal Message System

Does anyone know of a tutorial to code ur own PM system for ur website in php?
__________________
Space Cowboy

Thanks for all the help here guys!
Space Cowboy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 06-13-2005   #2 (permalink)
Sheep Worrier
 
Man1c M0g's Avatar
 
Join Date: Sep 2003
Location: Portsmouth, UK.
Posts: 4,061
Blog Entries: 14

Send a message via ICQ to Man1c M0g Send a message via MSN to Man1c M0g Send a message via Skype™ to Man1c M0g
Errrr. It shouldn't be too difficult surely? If you have a membership system with IDs, all you need to do is have four fields in your MySQL table - the sender ID, the recipient ID, the message, and the date it was sent. You can get PHP to do the rest, including BBcode handling, length limiting, and all that...
__________________
Man1c M0g is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 06-13-2005   #3 (permalink)
Registered User
 
Space Cowboy's Avatar
 
Join Date: May 2005
Location: England (South)
Posts: 40

Ah sounds easy enough! I was thinking about it only problem i though about was multiple messages, how do u stop one writting over the other! So if you get one message but dont look at it then you get anouther message how would u stop the second message over writting the first!
__________________
Space Cowboy

Thanks for all the help here guys!
Space Cowboy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 06-13-2005   #4 (permalink)
Sheep Worrier
 
Man1c M0g's Avatar
 
Join Date: Sep 2003
Location: Portsmouth, UK.
Posts: 4,061
Blog Entries: 14

Send a message via ICQ to Man1c M0g Send a message via MSN to Man1c M0g Send a message via Skype™ to Man1c M0g
Well, add a primary index field with AUTO_INCREMENT enabled and call it something like 'messageid' - then you can have multiple messages from the same people and each message will be saved as a seperate entry - and because each message will have its own unique ID, deleting your messages and/or otherwise managing them will be easy.
__________________
Man1c M0g is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 06-14-2005   #5 (permalink)
Invicible Snake
 
ParaSnake's Avatar
 
Join Date: Sep 2004
Location: Ho Chi Minh City,Vietnam
Posts: 668

Send a message via MSN to ParaSnake Send a message via Yahoo to ParaSnake
Lets me give u a good advice:When u think about making something,take a paper,a pencil,a chair and a table,then think about ur script,even if its a simple guestbook,u have to concerntrate on it,and write(or draw0 down everything u can imagine,and finally,draw down the databse that u have to make,draw all it down.
And after doing all of that,u are standing on a strong platform to complete your script
__________________
ParaSnake is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 06-14-2005   #6 (permalink)
Registered User
 
Space Cowboy's Avatar
 
Join Date: May 2005
Location: England (South)
Posts: 40

Thanks for the advise, for the auto increment do i put all these feilds in the user table i use for my site? I understand the code for the system its the Table Layouts im unshure of!
__________________
Space Cowboy

Thanks for all the help here guys!
Space Cowboy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 06-14-2005   #7 (permalink)
Sheep Worrier
 
Man1c M0g's Avatar
 
Join Date: Sep 2003
Location: Portsmouth, UK.
Posts: 4,061
Blog Entries: 14

Send a message via ICQ to Man1c M0g Send a message via MSN to Man1c M0g Send a message via Skype™ to Man1c M0g
Yeah - autoincrement is a feature of the column that you can set (very easily if you use the phpMyAdmin applet). When its all set up correctly you never need to actually set a value for the auto-incrementing field - it will automatically fill itself in when you add a new row.
__________________
Man1c M0g is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 06-14-2005   #8 (permalink)
Registered User
 
Space Cowboy's Avatar
 
Join Date: May 2005
Location: England (South)
Posts: 40

This is getting confusing i tried to add a primary index field with auto increment and got the following error "#1075 - Incorrect table definition; There can only be one auto column and it must be defined as a key" am i ment to be adding this into my main table?
__________________
Space Cowboy

Thanks for all the help here guys!
Space Cowboy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 06-14-2005   #9 (permalink)
Sheep Worrier
 
Man1c M0g's Avatar
 
Join Date: Sep 2003
Location: Portsmouth, UK.
Posts: 4,061
Blog Entries: 14

Send a message via ICQ to Man1c M0g Send a message via MSN to Man1c M0g Send a message via Skype™ to Man1c M0g
Yeah. Add it and define it as the primary key with auto_increment. I won't describe WHY - that goes into database construction in some depth... and i'm too lazy...
__________________
Man1c M0g is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 06-15-2005   #10 (permalink)
Registered User
 
Space Cowboy's Avatar
 
Join Date: May 2005
Location: England (South)
Posts: 40

um im getting confused in my users table i have id which is primary and auto increment and i can't have two. Should i create a new table called messages then, and add username, messageid and everything?
__________________
Space Cowboy

Thanks for all the help here guys!
Space Cowboy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 06-15-2005   #11 (permalink)
Invicible Snake
 
ParaSnake's Avatar
 
Join Date: Sep 2004
Location: Ho Chi Minh City,Vietnam
Posts: 668

Send a message via MSN to ParaSnake Send a message via Yahoo to ParaSnake
This is what i can imagine about the PM system:
table name : message
col 1 : username - store the username who will receive the mesage on col "message"
col 2 : message - Store the message
col 3 : read - default value is 0,if the user click on the message ,turn this value to 1,means that it isn`t a unread message anymore.
col 4 : time - store the date and time of the message
col 5 : sender - store the sender`s name
col 6 : subject - store the subject of the message.

See? you dont need any ID in this script,all u need is make a simple query like ("SELECT * From message WHERE username="'.$name_of_the_receiver."' ")
You can also sort those messages by date,sender,ect...

P.S:If the username haev an ID,i suggest you use ID instead of uing username
__________________
ParaSnake is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 06-15-2005   #12 (permalink)
Sheep Worrier
 
Man1c M0g's Avatar
 
Join Date: Sep 2003
Location: Portsmouth, UK.
Posts: 4,061
Blog Entries: 14

Send a message via ICQ to Man1c M0g Send a message via MSN to Man1c M0g Send a message via Skype™ to Man1c M0g
Quote:
Originally Posted by Space Cowboy
um im getting confused in my users table i have id which is primary and auto increment and i can't have two. Should i create a new table called messages then, and add username, messageid and everything?
Oh HELL yes! You should create seperate tables for each major new feature that requires lots of new data fields - it keeps your tables much simpler that way. You can always pass variables between the tables using PHP - its dead easy really! Just think of it this way - your MessageID field will be the unique auto-incrementing one unique to this table, your sendingusername/receivingusername will relate to the member ID on the Users table.

Its all very logical - you just have to get your head around thinking in this way.
__________________
Man1c M0g is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 06-15-2005   #13 (permalink)
Registered User
 
Space Cowboy's Avatar
 
Join Date: May 2005
Location: England (South)
Posts: 40

Ahh thanks guys makes more sense now! Now i just have to set out a structure and work out how its going to work! Thanks again guys very help full!
__________________
Space Cowboy

Thanks for all the help here guys!
Space Cowboy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 06-16-2005   #14 (permalink)
Local Biorust Beast
 
Order's Avatar
 
Join Date: Oct 2003
Location: San Diego, CA, USA
Posts: 2,253

Send a message via AIM to Order Send a message via MSN to Order Send a message via Yahoo to Order
When developing, paper and a pencil, as archiac as it seems is the most useful tool a programmer can have.. I have literally notebooks full of programming notes on things I code or plan to code on.
__________________
Order is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 06-17-2005   #15 (permalink)
Registered User
 
ViciOuS's Avatar
 
Join Date: Apr 2005
Posts: 82

Quote:
Originally Posted by Order
When developing, paper and a pencil, as archiac as it seems is the most useful tool a programmer can have.. I have literally notebooks full of programming notes on things I code or plan to code on.
This is very true, for beginners and advanced coders alike. Another thing that seems to help me out a lot, is make the interface first (after you have drawn everything out on paper first) with html/css or even a grahpical user interface (gui) made from photoshop or paint shop pro. This way, all you have left to do is slap in your code. I personally think it's better to make it in html/css before you move on to a gui, that way it's easier to change things and make arrangements.

I hope this helps!
ViciOuS is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Content Mangament System Question LimitLess HTML / PHP / ASP / JS 3 06-01-2006 12:32 AM
Help needed with PHP: Pagination in a tut system nitr0x HTML / PHP / ASP / JS 3 05-24-2005 05:30 PM
A Complete Membership System tutorial stingerblue HTML / PHP / ASP / JS 2 05-18-2005 05:19 AM


All times are GMT +1. The time now is 08:52 PM.
Content Relevant URLs by vBSEO 3.2.0 RC7

Design & Content © BioRUST 2007 :: PRIVACY STATEMENT :: LEGAL INFORMATION :: ADVERTISING MEDIA KIT