Where can I find a PM Block?
Thanks and God bless. :)
Hi shengton, welcome to TinyPortal.
If you give a more detailed description of what you need then maybe one of our coders will be able to assist you.
Thanks for the quick reply sir.
I have a forum site and if someone will PM me I can't immediately notice it. I want a phpscript that I can immediately notice when someone will PM or Private Message.
You should be able to set your forum to "Show a popup when you receive new messages?"
Profile>Personal Message Options>Show a popup when you receive new messages?
Thanks for that sir but I want all my members automatically applied using a phpscript. Here's a code but it nothings happen.
if($context['user']['is_logged'] && $context['user']['unread_messages']>0)
echo '<a href="',$scripturl,'?action=pm"><img src="',$settings['images_url'],'/menu/newpm.gif"/></a>';
PM's are actually a function of SMF, not TinyPortal.
Someone here may be able to give you an answer, but chances are you'll get help lots faster on the SMF forum.
Ahh ok thanks for your help sir.. :)
Found it for you...
http://www.simplemachines.org/community/index.php?topic=185521.msg1180646#msg1180646
Search is your friend. ;)
Create a php block and use the global to set the scope for the $context and $settings variables; the rest is your code:
global $context, $settings;
if($context['user']['is_logged'] && $context['user']['unread_messages']>0)
echo '<a href="',$scripturl,'?action=pm"><img src="',$settings['images_url'],'/menu/newpm.gif"/>[/url]';
Once you enable the block to display, it will notify the member on new messages...
Thanks lanedres....Greate :)
Glad to help... will mark as solved.
I will move this to block code and snippets from the request board
This is untested, but you can try this to show just how many messages a member has in the mouseover tip over the image...
global $context, $settings, $scripturl;
$msgcount = $context['user']['unread_messages'];
if($context['user']['is_logged'] && $msgcount > 0)
{
echo '<a href="',$scripturl,'?action=pm">';
echo '<img src="',$settings['images_url'],'/menu/newpm.gif" title="You have '.$msgcount.' message' . ($message = $msgcount > 1 ? 's' : ''). ' awaiting." /></a>';
}
Basically, assigns the variable $msgcount (just to use a short name) and in the echo line where the title tag is, it should output an 's' if more than one message awaits. Broke it up into two lines just to make it read better...