Support Forum
Hi,
I've been reading through the codex and forum but haven't found this solution.
After upgrading to the latest version I cannot figure out how to show how many unread private messages a user has.
In the old version I was able to do this with this code. Is there a way to do it now?
<li>
<?php
$pm = sf_pm_tag(false, true);
if ($pm['count'] > -1) {
if ($pm['count'] > 0) $pmLink = '<b><a href="' . $pm['url'] . '">Inbox (' . $pm['count'] . ')</a></b>';
else $pmLink = '<a href="' . $pm['url'] . '">Inbox (' . $pm['count'] . ')</a>'; }
print $pmLink;
?>
</li>
The template tags for PMs are documented here: https://simple-press.com/docum.....e-plugins/ - it might just be a name change bit am not sure. I literally have to go bit will be back in an hour or so and if you have not found it I will look myself to work out which it is.
YELLOW
SWORDFISH
|
I found the files in the plugin folder that should do this
The page sp-pm-inbox-tag.php seems to have the function but I am not having success calling it as a template tag. Is my syntax off?
Here's what the page says:
* =====================================================================================
sp_pm_do_inbox($display)
template tag to display number of new PMs in the current user inbox. This tag includes
default text that is output with the pm count data and inbox hyperlink. This text can
be supressed by setting $display to false. If supressed, the new PM count and hyperlink
are returned to the call in an array. A -1 count and empty url will be returned for
guests or user that do not have PM permissions. Additionally, if the default text is used,
the no permissions for pm default text can be supressed or those without permissions.
parameters:
$display Determines whether to display pm count plus informational text
$usersonly If $display is true, only display pm text for users with pm permissions
===================================================================================*/
When I drop sp_pm_do_inbox() in it breaks the page. Any suggestions?
Thanks!
Diego
if you dont want the canned display, your option is to pass the argument to it to not display.. instead if will return the data to you and you can do what you want with it... so:
$pm = sp_pm_do_inbox(false);
then you will get an array returned to you where you have $pm['count'] and $pm['url']... the former is the inbox count and the latter is the url to the inbox...
just output whatever you want...
Visit Cruise Talk Central and Mr Papa's World
1 Guest(s)