درس XF-2.x مجموعة اوامر بإستخدام دالة IF

الإهداءات
  • غزل من من قلب الغزل ..:
    ضياءٌ شعَّ من أرض المدينة و زُفَّت البشرى لرسول الله (ص) بولادة سبطه الأول الإمام المجتبى (ع).✨💚
  • غزل من قلب الغزل:
    "يارب دائمًا اعطنّي على قد نيتي وسخر لي الأشخاص اللي يشبهون قلبي🌿✨. .
  • غزل من قلب الغزل:
    مارس الرحمة قدر المُستطاع فكلما تلطفت مع خلق الله زاد الله لطفهُ حولك.💐
  • غزل من قلب الغزل:
    اللهم إنك عفوٌ كريمٌ تحب العفو فاعفو عنا ♥️😌
maxresdefault.jpg
السلام عليكم ورحمة الله وبركاته

الاخوة والاخوات اعضاء وزوار منتديات شباب الرافدين الكرام
تحية طيبة للجميع

هذا الموضوع عبارة عن مكتبة بسيطة لمجموعة من الاوامر والشروط باستخدام دالة الشرط IF [متوافقة فقط مع الجيل الثاني من XenForo]

اتمنى منها ان تكون مفيدة لم يبحث عن هذه الاوامر

مودتي
 
  • بادئ الموضوع
  • #2
PHP:
<xf:if is="{{ $xf.visitor.isMemberOf(x) }}">This content will show to members of user group x</xf:if>

PHP:
<xf:css src="xfv_marker_test.less" />
<xf:if is="{{ $xf.visitor.isMemberOf(3) }}">
<span class="message-avatar-online" data-xf-init="tooltip" title="{{ phrase('online_now') }}"></span>
</f:if>

PHP:
<xf:if is="$xf.visitor.is_admin">
Show content...
</xf:if>

PHP:
<xf:if is="{$xf.visitor.Option.is_discouraged}">
     Show content...
</xf:if>

PHP:
<xf:if is="{$xf.visitor.Option.is_discouraged}">
     Show content...
</xf:if>
 
  • بادئ الموضوع
  • #3
PHP:
<xf:if is="{$xf.visitor.gravatar}">
Show content...
</xf:if>

PHP:
<xf:if is="{$xf.visitor.is_staff}">
Show content...
</xf:if>

PHP:
<xf:if is="{$xf.visitor.isAwaitingEmailConfirmation()}">
Show content...
</xf:if>

PHP:
<xf:if is="{$forum.node_id} != x">
Hide content. . .
</xf:if>

PHP:
<xf:if is="in_array(!{$forum.node_id}, [x,y,z])">
Hide content...
</xf:if>
 
  • بادئ الموضوع
  • #4
PHP:
<xf:if is="{$post.position} % {$xf.options.messagesPerPage} == 1">
        Show content..
    </xf:if>

PHP:
<xf:if is="{$post.position} % {$xf.options.messagesPerPage} == 0">
               Show content..
      </xf:if>

PHP:
<xf:if is="$xf.post.user_id == $xf.thread.user_id">
This content will show if the post author is the thread author
</xf:if>

PHP:
<xf:if is="$post.user_id == $xf.thread.user_id"> This content will show if the post author is the thread author </xf:if>

PHP:
<xf:if is="$post.user_id == $thread.user_id"> This content will show if the post author is the thread author </xf:if>
 
  • بادئ الموضوع
  • #5
PHP:
<xf:if is="{$xf.visitor.location}">
    Show content...
</xf:if>

PHP:
<xf:if is="{$xf.visitor.website}">
    Show content...
</xf:if>

PHP:
<xf:if is="{$xf.visitor.signature}">
    Show content...
</xf:if>

PHP:
<xf:if is="{$xf.visitor.user_state} == 'valid'">
    Show content...
</xf:if>

PHP:
<xf:if is="{$xf.visitor.user_state} == 'email_confirm_edit'">
    Show content...
</xf:if>

PHP:
<xf:if is="{$xf.visitor.user_state} == 'email_bounce'">
    Show content...
</xf:if>
 
  • بادئ الموضوع
  • #6
PHP:
<xf:if is="$post.position % $xf.options.messagesPerPage == $xf.options.messagesPerPage - 1 OR $post.position == $thread.reply_count AND $thread.reply_count % $xf.options.messagesPerPage > 1">
    Ad code here <xf:ad position="post_above_content" arg-post="{$post}" />
</xf:if>

PHP:
<xf:if is="$template != 'forum_list'">
Show content...
</xf:if>

PHP:
<xf:if is="$template == 'forum_list'">
Show content...
</xf:if>

PHP:
<xf:if is="{{ $xf.visitor.hasPermission('Dadparvar_PricingTables', 'Can_See_PricingTable_One') }}">
    User will see this text if s/he has "Can_See_PricingTable_One" permission of "Dadparvar_PricingTables" group.
</xf:if>

PHP:
<xf:if is="$post.position % $xf.options.messagesPerPage == $xf.options.messagesPerPage - 1 OR $post.position == $thread.reply_count AND $thread.reply_count % $xf.options.messagesPerPage > 1">
    Ad code here <xf:ad position="post_above_content" arg-post="{$post}" />
</xf:if>

PHP:
<xf:if is="!in_array({$forum.node_id}, [1,2,3])">
                  Hide content..
</xf:if>

PHP:
<xf:if is="$post.position % $xf.options.messagesPerPage == $xf.options.messagesPerPage - 1 OR $post.position == $thread.reply_count AND $thread.reply_count % $xf.options.messagesPerPage > 1">
    Ad code here <xf:ad position="post_above_content" arg-post="{$post}" />
</xf:if>
 
  • بادئ الموضوع
  • #7
PHP:
<xf:if is="$template == 'thread_view'">
   Show content..
</xf:if>

<xf:if is="$template =='forum_view'">
   Show content..
</xf:if>
 

أقسام الرافدين

عودة
أعلى أسفل