TheBigK
Well-known member
I want to display advertisement in the first post. I've edited the "message" template to display the advertisement and extra.css to style it.
"message" template code:-
...and extra.css has -
Now the problem:
I plan to use: <xen:if is="{$visitor.user_id}"> conditional to show the advertisement only to guests. However, when a user is logged in, it shows an empty space created by the code in extra.css.
My question is: How can I hide the styling code I've used from logged in users? I've tried using the above 'guests' conditional; but it doesn't seem to work. Or am I doing something wrong?
"message" template code:-
Code:
<xen:require css="message.css" />
<xen:require css="bb_code.css" />
<li id="{$messageId}" class="message {xen:if $message.isDeleted, 'deleted'} {xen:if '{$message.is_admin} OR {$message.is_moderator}', 'staff'} {xen:if $message.isIgnored, ignored}" data-author="{$message.username}">
<xen:if is="{$visitor.user_id}">
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0">
<div class="right_block">
<ADVRTISEMENT CODE GOES HERE>
</div>
</xen:if>
</xen:if>
<xen:include template="message_user_info">
<xen:map from="$message" to="$user" />
.
.
...code continues below...
...and extra.css has -
Code:
.messageList .message:first-child .messageInfo.primaryContent { margin-right: 325px; }
.messageList .message:first-child .right_block
{
display:block;
float:right;
height:265px !important;
width:310px !important;
border: 1px solid @primaryLighter;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-khtml-border-radius: 5px;
border-radius: 20px;
text-align: center;
}
Now the problem:
I plan to use: <xen:if is="{$visitor.user_id}"> conditional to show the advertisement only to guests. However, when a user is logged in, it shows an empty space created by the code in extra.css.
My question is: How can I hide the styling code I've used from logged in users? I've tried using the above 'guests' conditional; but it doesn't seem to work. Or am I doing something wrong?