I just tried putting the private message box code on the index and it didn’t work, so I’m not sure how, or if you can (without sql queries) do this right now.
It points and laughs at me :( oh and shows nothing whatsoever… lol I should have posted when I was more awake and coherant instead of “IT DOESN’T WORK FIX IT” without the actual error lol
Add it to the wiki, categorize it, and I can always move it if I know of somewhere better. I just host the thing, I’m not the end-all be-all of wiki knoweldge, even of this one.
Hmm.. This code doesn’t seem to work for me. I get nothing returned and I have 1 msg in my Inbox as a test.
Now this is not for the “forums” only is it as I dont have that module. I am just using the built in 1.3 PM code.
{exp:since_last_visit:stats}
<a href="{path=member/profile}">Profile</a> | <a href="{path=LOGOUT}">Logout</a><br /> <span style="font-weight:bold;"> Welcome {screen_name}! </span><br /> Last visited on {last_visit_date format="%m/%d/%y"} at {last_visit_date format="%H:%i"}<br /> You are visiting from {ip_hostname}.<br /> New Posts: <strong>{new_entry_total}</strong> New Comments: <strong>{new_comment_total}</strong><br /> <a href="{path=member/memberlist}" target="_blank">Member List</a>
{/exp:since_last_visit:stats}
<?php global $SESS; $pmcount = $SESS->userdata['private_messages'];
if ($pmcount == 1) { echo 'You have a new private message!'; } elseif ($pmcount > 1) { echo 'You have '.$pmcount.' new private messages!'; }
Also, it’s not just for the forums, I’m using it without the forum module.
I reckon StarryMom’s got the right idea—- that your test PM has been read, and you’re not expecting EE to be as cool as it’s being. XD
Also make sure that PHP is turned on, and that your initial {if logged_in} statement actually exists—- in your pasted code the {/if} is just hangin’ out by itself. ;P
This is nice, thanks for the code guys (and for wiki’ing it) :thumbsup:
One question though - what’s the appropriate path to link to a private message inbox? I’m using http://www.mysite.com/forums/member/messages/view_folder/1/
..which seems to work whether you’re user 1 or 81 - is that correct? Should the trailing number be ‘1’ for any logged in user?
That URL you have there will work. The PM system will only ever show the messages for the currently logged in user so that URL works for everyone. If the person is not a logged in user, then it will not work, in case you are wondering.