• منتديات شباب الرافدين .. تجمع عراقي يقدم محتوى مميز لجميع طلبة وشباب العراق .. لذا ندعوكم للانضمام الى اسرتنا والمشاركة والدعم وتبادل الافكار والرؤى والمعلومات. فأهلاَ وسهلاَ بكم.

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

الإهداءات
  • سليم البصري سليم البصري:
    جناب المديرة صبحكم الله بالخير شلون اتواصل وياكم

Ibn AliraQ

ヅ واحد من الناس ヅ
المدير العام للمنتديات
2018-08-28
17,303
العراق
جوهرة
დ13,258
الجنس
ذكر
maxresdefault.jpg
السلام عليكم ورحمة الله وبركاته

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

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

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

مودتي
 
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>
 
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>
 
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>
 
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>
 
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>
 
PHP:
<xf:if is="$template == 'thread_view'">
   Show content..
</xf:if>

<xf:if is="$template =='forum_view'">
   Show content..
</xf:if>
 
القائمة الجانبية للموقع
خرّيج وتبحث عن عمل؟
تعيينات العراق
هل أنت من عشاق السفر حول العالم؟
إكتشف أجمل الأماكن
هل أنت من عشاق التكنولوجيا؟
جديد التكنولوجيا
عودة
أعلى أسفل