I have two tips for anyone using this system.
First, it's to change the wording of the private messages phrase to anything you want. I have it set to say "Private messages, "1 new message", and "2 new messages". Here's the code for that (it goes in the include):
Code:
// Display PM Details and generate link to PM box
$pmremove = array("Unread ", "<strong>", "</strong>");
$unreadPM = str_replace($pmremove,"",$vbphrase[unread_x_nav_compiled]);
if ($unreadPM==1) {
echo "<a id=\"unreadpm\" href=\"".$forumpath."private.php?$session[sessionurl] \">1 new message</a>";
} else {
if ($unreadPM>1) {
echo "<a id=\"unreadpm\" href=\"".$forumpath."private.php?$session[sessionurl] \">" . $unreadPM . " new messages";
} else {
echo "<a href=\"".$forumpath."private.php?$session[sessionurl] \">Private Messages</a>";
}
}
Similarly, it's easy to show new posts with the proper grammatical syntax. In other words, have it say 'No new posts' '1 new post' or '2 new posts'.
Code:
// finds number of new posts
$newposts = $db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "post AS post " . iif($vbulletin->options['threadmarking'], 'LEFT JOIN ' . TABLE_PREFIX . 'threadread AS threadread ON (threadread.threadid = post.threadid AND threadread.userid = ' . $vbulletin->userinfo['userid'] . ')') . " WHERE dateline >= " . $vbulletin->userinfo['lastvisit'] . iif($vbulletin->options['threadmarking'], ' AND dateline > IF(threadread.readtime IS NULL, ' . (TIMENOW - ($vbulletin->options['markinglimit'] * 86400)) . ', threadread.readtime)'));
$newposts = vb_number_format($newposts['count']);
if ($newposts < 1) {
echo "<a href=\"".$forumpath."search.php?$session[sessionurl]do=getnew\">No new posts</a><br />";}
if ($newposts == 1) {
echo "<a href=\"".$forumpath."search.php?$session[sessionurl]do=getnew\">$newposts new post</a><br />";}
if ($newposts > 1) {
echo "<a href=\"".$forumpath."search.php?$session[sessionurl]do=getnew\">$newposts new posts</a><br />";}
Hope this helps someone. It took me a little bit of tinkering to get it just right.