In the previous post we dealt with how to send messages from one user to the other, which in a small text we assume is unnecessary information.
In this we will deal with the codes for viewing messages, those sent, received and new.
Let's create 4 pages, one for incoming messages, one for outgoing messages, for new messages and another for opening the message.
The message code is divided into 2 parts, the first deals with parameter information, information that will not be displayed in the browser and another part of the contents, this part will be shown in the browser and contains message tags and html tags.
[*msg]parameters||contents[/msg]
1. Inbox.
Create a page and paste this code below:
[*msg]m=in, o=u, l=12, s=:to-page:, n=no message||
<li>
<a href="/page-open-msg/%id%.html"> %name% (%status%)<br>
%*date% </a>
</li>
[/msg]
Where:
m= carries the value the message is in, the values are:
> in= message received, including unopened and opened messages.
> new = only unopened incoming messages, new messages.
> out = sent messages
To show all messages just remove the "m" attribute.
l= defines the amount of the message that will be shown on the page.
s = is the page number
n = the text that will be shown if there are no messages.
In the contents section:
%name% = the name of the user who sends or was sent the message.
%status% = the status of the message, whether it has been read or not.
%*date% = the date and time of the message, you can configure the date display.
In the link, we have the page where' the message will be opened "/page-open-msg/" and then we have the message id "%id%".
2. Sent Messages.
On another page, paste the same code and just change the value of "m=in" to "m=out".
[*msg]m=out, o=u, l=12, s=:to-page:, n=no message||
<li>
<a href="/page-open-msg/%id%.html"> %name% (%status%)<br>
%*date% </a>
</li>
[/msg]
3. New Messages
Another page, paste the same code below, let's just change the value of "m=in" to "m=new".
[*msg]m=new, o=u, l=12, s=:to-page:, n=no message||
<li>
<a href="/page-open-msg/%id%.html"> %name% (%status%)<br>
%*date% </a>
</li>
[/msg]
4. Message preview page.
Let's create a new page with the name "open-msg". After creating the page, paste the code below.
[*msg]to=:url-1:||
<b>%name%</b> - <span>%*date%</span>
<p>%text%</p>
<a href="/site_message.html?user=%name%">Reply</a>
[/msg]
Where:
to = is the message id value.
The link "/site_message.html?user=%name%" opens the page to reply to the message, learn more on how to send a message to a user.
Remove all asterisk on code
3 Comments
I hav done every thimg as listed but why is it that if i want to reply a new msg from someone it wil show message not found pls help
Hello Salam, The code has been tested several times and there is no problem, check the send message link well if everything is okay, remove the spaces if possible.
Pls, admin can you teach me how to create pages.
Leave a Reply