MyBB Community Forums

Full Version: Show draft on top menu
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I usually write a new thread and then save it as draft, but some time I forget it from a draft folder.
So, I think it will better if I can show number of draft message on top of menu such as same line with 'View New Posts' menu. (Shown after login)

Thank you.
chaime Wrote:I usually write a new thread and then save it as draft, but some time I forget it from a draft folder.
So, I think it will better if I can show number of draft message on top of menu such as same line with 'View New Posts' menu. (Shown after login)

Thank you.

I have it in my test forum as a popup link which displays my saved drafts, not just the number. Here is how I did it:

In the header template, find:
<div class="menu">
				<ul>

After it add:
	<li><a <strong><a href="#" onclick="MyBB.popupWindow('usercp.php?action=drafts', 100, 800);">{$lang->ucp_nav_drafts}View Drafts</a> </li>

Of course you can always add an icon to that if you like.

Regards
Thank you very much, maatty.
It's good idea and new knowledge for me, but I want to show the number of draft message same as private message.
Because I like to click it when it have a draft message only and don't need to click it when it show 0 or empty.
You would need to make a code modification to do that. In global.php, find:
unset($admincplink);
After it, add:
// Get number of drafts
$query = $db->simple_select(TABLE_PREFIX."privatemessages", "COUNT(pmid) as count", "uid='{$mybb->user['uid']}' AND folder=3");
$row = $db->fetch_array($query);
$num_draft_pms = $row['count'];

Then in the template above, use {$num_draft_pms} where you want the number to appear.