• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

How to show notification to newly registered users?

#1
Hey folks!
I want to show notifications to those users who have ZERO posts in the forum. Any idea how to do that?

For example, if a user have post count ZERO then a simple notification box will appear below the header saying -
You have ZERO posts, why don't you start posting at... blah! blah! blah!
 

Jake Bunce

XenForo moderator
Staff member
#2
In 1.1 you can use a notice:

http://xenforo.com/community/threads/notices.18390/

In the meantime you can edit the templates:

Admin CP -> Appearance -> Templates -> PAGE_CONTAINER

Add this code:

Code:
						<xen:if is="{$visitor.user_id} AND {$visitor.message_count} == 0">
							<p class="importantMessage">
								You have ZERO posts, why don't you start posting at... blah! blah! blah!
							</p>
						</xen:if>
Like so:

Code:
<div id="content" class="{$contentTemplate}">
	<div class="pageWidth">
		<div class="pageContent">
			<!-- main content area -->
			
			<xen:hook name="page_container_content_top" />
			
			<xen:if is="{$sidebar}">
				<div class="mainContainer">
					<div class="mainContent"></xen:if>

						<xen:if is="{$visitor.user_id} AND {$visitor.message_count} == 0">
							<p class="importantMessage">
								You have ZERO posts, why don't you start posting at... blah! blah! blah!
							</p>
						</xen:if>

						<xen:hook name="page_container_notices">
						<xen:if is="{$showUpgradePendingNotice}">
							<p class="importantMessage">
								{xen:phrase upgrade_is_pending_forum_only_accessible_in_debug} <br />
								<a href="install/">{xen:phrase complete_upgrade}</a>
							</p>
						</xen:if>
						
						<xen:if is="{$showBoardClosedNotice}">
							<p class="importantMessage">
								{xen:phrase forum_is_currently_closed_only_admins_may_access}<br />
								<a href="admin.php">{xen:phrase reopen_via_admin_control_panel}</a>
							</p>
						</xen:if>
The result:

Screen shot 2011-08-05 at 8.37.16 PM.png