Dành cho Newbie như mềnh đây, vừ sưu tầm được, share luôn pro đừng chém nhá XenForo Template Conditionals List Conditionals The following conditional statements will only work in templates which support the arguments and parameters. Statements can be expanded using AND, OR, and <xen:else />. Replacing == with != in the following examples will change the condition from true to false. For example, <xen:if is="{$visitor.user_id} == x"> for true, <xen:if is="{$visitor.user_id} != x"> for false. Where an argument only contains a single parameter, inserting a ! before the parameter has the same effect. For example, <xen:if is="{$visitor.user_id}"> for true, <xen:if is="!{$visitor.user_id}"> for false. When working with arrays, the ! is placed just before the argument. For example, <xen:if is="in_array({$forum.node_id}, array(x, y, z))"> for true, <xen:if is="!in_array({$forum.node_id}, array(x, y, z))"> for false. Depending on the template being worked with, you may need to use $user instead of $visitor; $visitor is always the record for the current logged in user, $user is the record being processed (e.g. message author, member list, list of online users, etc.). When working with the PAGE_CONTAINER template, you can pass variables from the view templates (category_view, forum_view, thread_view, etc.) using xen:container. The same applies to any templates which are included in the PAGE_CONTAINER template; the header or ad_header templates for example. To use the $forum.node_id variable for example, you would add this to the PAGE_CONTAINER template: <xen:container var="$forumId">{$forum.node_id}</xen:container>. Similarly for the $threadId variable, you would add this: <xen:container var="$threadId">{$thread.thread_id}</xen:container>. Where variables such as x, y, or z have been used, these must be replaced with actual values. How can I show content just to logged in members and hide it from guests? <xen:if is="{$visitor.user_id}"> This content will show to logged in members </xen:if> How can I show content just to guests and hide it from logged in members? <xen:if is="!{$visitor.user_id}"> This content will show to guests </xen:if> How can I show different content to guests and logged in members? <xen:if is="{$visitor.user_id}"> This content will show to logged in members <xen:else /> This content will show to guests </xen:if> How can I show content to a specific user group? <xen:if is="{xen:helper ismemberof, $visitor, x}"> This content will show to members of user group x </xen:if> How can I hide content from a specific user group? <xen:if is="!{xen:helper ismemberof, $visitor, x}"> This content will be hidden from members of user group x </xen:if> How can I show content to more than one user group? <xen:if is="{xen:helper ismemberof, $visitor, x, y}"> This content will show to members of user groups x or y </xen:if> How can I hide content from more than one user group? <xen:if is="!{xen:helper ismemberof, $visitor, x, y}"> This content will be hidden from members of user groups x or y </xen:if> How can I show content to Administrators? <xen:if is="{$visitor.is_admin}"> This content will show to Administrators </xen:if> How can I show content to Moderators? <xen:if is="{$visitor.is_moderator}"> This content will show to Moderators </xen:if> How can I show content to Administrators and Moderators? <xen:if is="{$visitor.is_admin} OR {$visitor.is_moderator}"> This content will show to Administrators and Moderators </xen:if> How can I show content to a specific member? <xen:if is="{$visitor.user_id} == x"> This content will show to member x </xen:if> How can I show content to more than one member? <xen:if is="in_array({$visitor.user_id}, array(x, y, z))"> This content will show to members x, y and z </xen:if> How can I show content after the first post in a thread? <xen:if is="{$post.position} == 0 AND !{$message.conversation_id}"> This content will show after the first post in a thread </xen:if> How can I show content after the first post in a thread or conversation? <xen:if is="{$post.position} == 0"> This content will show after the first post </xen:if> How can I show content after post x on every page in a thread? <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == x AND !{$message.conversation_id}"> This content will show after post x on every page in a thread </xen:if> How can I show content after post x on every page in a thread or conversation? <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == x"> This content will show after post x on every page </xen:if> How can I show content after post x on every page, only in forums y and z? <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == x AND in_array({$thread.node_id}, array(y, z))"> This content will show after post x on every page, only in forums y and z </xen:if> How can I show content after post x on every page, except in forums y and z? <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == x AND !in_array({$thread.node_id}, array(y, z))"> This content will show after post x on every page, except in forums y and z </xen:if> How can I show content on a specific page? <xen:if is="{$contentTemplate} == 'xyz'"> This content will show on the xyz template </xen:if> How can I show content in a specific category? <xen:if is="{$category.node_id} == x"> This content will show in category x </xen:if> Note that in order for this to work, you must have categories set as pages in the ACP -> Options -> Node & Forum List: Create Pages for Categories. How can I show content in a specific forum? <xen:if is="{$forum.node_id} == x"> This content will show in forum x </xen:if> How can I show content in more than one forum? <xen:if is="in_array({$forum.node_id}, array(x, y, z))"> This content will show in forums x, y, and z </xen:if> How can I show content in a specific thread? <xen:if is="{$threadId} == x"> This content will show in thread x </xen:if> How can I show content in more than one thread? <xen:if is="in_array({$threadId}, array(x, y, z))"> This content will show in threads x, y, and z </xen:if> How can I show content in a specific post? <xen:if is="{$postId} == x"> This content will show in post x </xen:if> How can I show content in more than one post? <xen:if is="in_array({$postId}, array(x, y, z))"> This content will show in posts x, y, and z </xen:if> How can I show content to the thread author? <xen:if is="{$thread.user_id} == x"> This content will show to thread author x </xen:if> How can I show content if the post author is the thread author? <xen:if is="{$post.user_id} == {$thread.user_id}"> This content will show if the post author is the thread author </xen:if> How can I show content to members with 0 posts? <xen:if is="{$visitor.message_count} == 0"> This content will show to members with 0 posts </xen:if> How can I show content to members with more than x posts? <xen:if is="{$visitor.message_count} > x"> This content will show to members with more than x posts </xen:if> How can I show content to members with less than x posts? <xen:if is="{$visitor.message_count} < x"> This content will show to members with less than x posts </xen:if> How can I show content to members who have not confirmed their email address? <xen:if is="{$isAwaitingEmailConfirmation}"> This content will show to members who have not confirmed their email address </xen:if> How can I show content to visitors arriving from search engines? <xen:if is="{$visitor.from_search}"> This content will show to visitors arriving from search engines </xen:if>
bờm nhất cái thể loại copy + paste + no trans >>>> kg hiểu >>>> quăng gạch Đừng bảo search google thì tội nghiệp mấy bé nhá
trời người ta đã có 1 bài tiếng việt hoàn chỉnh ko đọc.. đi copy cái này về : http://www.vxf.vn/threads/cac-cau-hoi-thuong-gap-khi-su-dung-xenforo.3427/