للمطورين : استعمال الشرط في قوالب vb للجيل الرابع

The DoN

:: عضو بارز ::
أحباب اللمة
إنضم
1 أوت 2008
المشاركات
2,980
نقاط التفاعل
702
النقاط
171
العمر
31

«®°·.¸.•°°·.¸.•°®»[ السلام عليكم ورحمة الله وبركاته ]«®°·.¸.•°°·.¸.•°®»

image003v.png



قبل كل شيء، تذكر انه لا يمكن استعمال {vb:raw var} في الشروط


-- اعرض عبارة للاعضاء
فقط :

PHP:
<vb:if condition="$show['member']">Show this to members only</vb:if>



-- اعرض عبارة للزوار فقط :

PHP:
<vb:if condition="$show['guest']">Show this to guest only</vb:if>



-- اعرض عبارة لمجموعة معينة :

PHP:
<vb:if condition="is_member_of($bbuserinfo, 1,2,3)">Show this to user group 1, 2, and 3</vb:if>


-- اعرض عبارة لعضو معين :

PHP:
<vb:if condition="$bbuserinfo['userid'] == 73418">Show this only to the member with the user id of 73418</vb:if>



-- اعرض عبارة للجميع ماعدا عضو معين:

PHP:
<vb:if condition="$bbuserinfo['userid'] != 73418">Show this to every one but the member with the user id of 73418</vb:if>


-- اعرض عبارة للمشرفين على المنتدى:

PHP:
<vb:if condition="can_moderate()">Show this to all moderators</vb:if>


-- اعرض عبارة للمشرفين على القسم X:
PHP:
<vb:if condition="can_moderate($forum['x])">Show this if moderator is moderator of the forum with the id of x</vb:if>


-- اعرض عبارة للمشرفين على القسم الحالي:

PHP:
<vb:if condition="can_moderate($forum['forumid'])">Show this to the moderator of the current forum</vb:if>


-- اعرض عبارة في القسم X فقط :

PHP:
<vb:if condition="$forum[forumid] == x">Show this if forum id is x</vb:if>

-- اعرض عبارة في كل الاقسام ماعدا القسم X :

PHP:
<vb:if condition="$forum[forumid] != x">Show this if forum id is not x</vb:if>


-- اعرض عبارة في الاقسام Y Z X :

PHP:
<vb:if condition="in_array($forum['forumid'], array(x,y,z))">Show this to forum x, y and z</vb:if>

-- اعرض عبارة في الملف التالي فقط : نستعمل المعرف THIS_SCRIPT

مثل : ('THIS_SCRIPT', 'register') ، ('THIS_SCRIPT', 'calendar')


PHP:
<vb:if condition="THIS_SCRIPT == 'calendar'">Show this only on calendar.php</vb:if>


-- اعرض عبارة في كل الملفات ماعدا الملف التالي :

PHP:
<vb:if condition="THIS_SCRIPT != 'calendar'">Show this only on calendar.php</vb:if>


-- استعمــال else :
PHP:
<vb:if condition="$show['guest']">
Show this to only guest.
<vb:else />
Show this to all registered users
</vb:if>


-- استعمال elseif :
PHP:
<vb:if condition="$show['guest']">
Show this to only guest.

<vb:elseif condition="is_member_of($bbuserinfo, 5,6)" />
Show this to user group 5 and 6 which is  mods and admins

<vb:else />
Show this to all registered users

</vb:if>




image003v.png



الحقوق محفوظـة لمنتديات اللمة الجزائرية

وشكرا [ لكم ]

و... [ لكم ] تحياتــي

أخوكـم في الله

The DoN

«®°·.¸.•°°·.¸.•°®»[ في حفظ الرحمن ]«®°·.¸.•°°·.¸.•°®»



 
بارك الله فيك اخي الكريم

لم تختلف دالة الشرط كثيرا في الجيل الرابع عن سابقتها في الجيل الثالث سوى بإضافة vb: قبل جملة الشرط.

شكراً
 
لإعلاناتكم وإشهاراتكم عبر صفحات منتدى اللمة الجزائرية، ولمزيد من التفاصيل ... تواصلوا معنا
العودة
Top