Not Solved [How To?] Make conditional codes?
#1
Not Solved
please check this code

<if $mybb->user['usergroup'] == 1 then>
					    <h1 class="welcomeBlockHeader">Welcome to Our Community</h1>
						<p class="welcomeBlockMessage">Wanting to join the rest of our members? Feel free to sign up today.</p>
					    <p><a href="{$mybb->settings['bburl']}/member.php?action=register" class="sign_up_header">Sign up</a></p>
						<else>
						<img src="{$mybb->user['avatar']}" class="avatar-defaut hidden-xs" alt="#" style="float: left; width: 40px; height: 40px; margin-right: 10px; background: transparent;" /><h1 class="welcomeBlockHeader">Welcome back, {$mybb->user['username']}</h1>
							<p class="welcomeBlockMessage"><span class="label label_red">{$mybb->user['postnum']}</span> Posts - <span class="label label_red">{$mybb->user['threadnum']}</span> Threads - <span class="label label_red">{$mybb->user['totalpms']}</span> Messages - <span class="label label_red">{$mybb->user['reputation']}</span> Reputation</p>
					    <p><a href="{$mybb->settings['bburl']}/member.php?action=logout&amp;logoutkey={$mybb->user['logoutkey']}" class="sign_up_header">{$lang->welcome_logout}</a></p>
						</if>
Reply
#2
Not Solved
where you want to use such conditions ? you can use template conditionals plugin for such requirements.

however, similar information is already available in default MyBB system. no need of conditional codes.

header_welcomeblock_member template is used for guests group specific information
and header_welcomeblock_member template is used for members group specific information.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)