vBulletin if koşulları - Havas Okulu
 

Go Back   Havas Okulu > Serbest Bölüm > Web & internet > vBulletin

Acil işlemleriniz için instagram: @HavasOkulu
Cevapla
 
LinkBack Seçenekler Stil
  #1  
Alt 03.04.16, 14:49
HeartLess - ait Kullanıcı Resmi (Avatar)
Administrator
 
Üyelik tarihi: 18.08.14
Bulunduğu yer: Dip..
Mesajlar: 4,881
Etiketlendiği Mesaj: 2230 Mesaj
Etiketlendiği Konu: 0 Konu
Standart vBulletin if koşulları

Alttaki kodun amacı sadece foruma kayıtlı olan görebilir;

Kod:
 
<if condition="$show['member']">
Bu içeriği sadece kayıtlı üyeler görebilir.
</if>
Alttaki ise sadece ziyaretçiler için;

Kod:
 
<if condition="$show['guest']">
Bu içeriği sadeve misafirler görebilir.
</if>
Alttaki ise; üyeye özel;

Kod:
 
<if condition="$bbuserinfo['userID'] == 2">
Bu içeriği sadece ID'si 2 olan üye görebilir.
</if>
Alttaki kod ise sadece bu üye göremeze ;

Kod:
 
<if condition="$bbuserinfo['userID'] != 2">
Bu içeriği ID'si 2 olan üye göremez.
</if>
alttaki kod ise mesela ingilizce dilini kullanan görebilir ama türkçe kullanan göremez;

Kod:
 
<if condition="$bbuserinfo['languageID'] == 1">
Bu içeriği sadece ID'si 1 olan forum dilini kullanan görebilir.
</if>
buda tam tersidir;

Kod:
 
<if condition="$bbuserinfo['languageID'] != 1">
Bu içeriği ID'si 1 olan forum dilin kullanmayan görebilir.
</if>
Bu içeriği sadece grup ID'si 2 olan görebilir.

Kod:
 
<if condition="$bbuserinfo[usergroupID] == 2">
Bu içeriği sadece grup ID'si 2 olan görebilir.
</if>
Bu içeriği sadece grup ID'si 2 olmayanlar görebilir.;

Kod:
 
<if condition="$bbuserinfo[usergroupID] != 2">
Bu içeriği sadece grup ID'si 2 olmayanlar görebilir.
</if>
Bu içeriği grup ID'si 2,6 ve 7 olan görebilir

Kod:
 
<if condition="in_array($bbuserinfo['usergroupID'], array(2, 6, 7))">
Bu içeriği grup ID'si 2,6 ve 7 olan görebilir.
</if>
Bu içeriği grup ID'si 2,6 ve 7 olmayan görebilir

Kod:
 
<if condition="!in_array($bbuserinfo['usergroupID'], array(2, 6, 7))">
Bu içeriği grup ID'si 2,6 ve 7 olmayan görebilir.
</if>

Kod:
 
<if condition="$bbuserinfo[posts] > 100">
Bu içeriği 100'den fazla mesajı olanlar görebilir.
</if>
Kod:
 
<if condition="$bbuserinfo[posts] < 100">
Bu içeriği 100'den az mesajı olanlar görebilir.
</if>
Kod:
 
<if condition="$bbuserinfo[posts] == 100">
Bu içeriği mesaj sayısı tam 100 olanlar görebilir.
</if>
Kod:
 
<if condition="$bbuserinfo[posts] != 100">
Bu içeriği mesaj sayısı tam 100 olmayanlar görebilir.
</if>
Kod:
 
<if condition="$show['searchbuttons'] AND $bbuserinfo[posts] >100">
Bu içeriği sadece aramayı kullanan ve 100'den fazla mesajı olan görebilir.
</if
>

Veya bu şekilde de olur:

Kod:
 
<if condition="$show['searchbuttons'] && $bbuserinfo[posts] >100">
Bu içeriği sadece aramayı kullanan ve 100'den fazla mesajı olan görebilir.
</if>
Kod:
 
<if condition="$show['searchbuttons'] OR $bbuserinfo[posts] >100">
Bu içeriği sadece aramayı kullanan ya da 100'den fazla mesajı olan görebilir.
</if>
Veya bu şekilde de olur:

Kod:
 
<if condition="$show['searchbuttons'] || $bbuserinfo[posts] >100">
Bu içeriği sadece aramayı kullanan ya da 100'den fazla mesajı olan görebilir.
</if>
Kod:
 
<if condition="in_array($forum['forumID'], array(1,2,3,4,5))">
Bu içerik sadece forum ID si 2.3 ve 4 olan bölümde gösterilir.
</if>
Kod:
 
<if condition="!in_array($foruminfo[forumid], array(1,2,3,4,5))">
Bu içerik forum ID si 2,3 ve 4 olmayan bölümlerde gösterilir.
</if>
Kod:
 
<if condition="$forumID == 5">
Bu içerik sadece forum ID si 5 olan bölümde gösterilir.
</if>
Kod:
 
<if condition="$forumID != 5">
Bu içerik sadece forum ID si 5 olmayan bölümlerde gösterilir.
</if>

Sorgulamalarda <else /> (yoksa) 'da kullanabilirsiniz.

__________________
öLürüm yoLuna öLürümde yine boyun eğmem, yakarım dünyayı uğruna ama sana eğiLmem.. öyLe sInIrsIz öyLe Derin öyLe Çok Severim ki KORKARSIN!! Kuruyup çöLe dönsemde Pare Pare oLsamda YENiLMEM!!..
Alıntı ile Cevapla
  #2  
Alt 10.05.16, 17:06
HeartLess - ait Kullanıcı Resmi (Avatar)
Administrator
 
Üyelik tarihi: 18.08.14
Bulunduğu yer: Dip..
Mesajlar: 4,881
Etiketlendiği Mesaj: 2230 Mesaj
Etiketlendiği Konu: 0 Konu
Standart

<if condition="$show['member']">You're a member! A guest won't see this</if>
<if condition="$show['guest']">You're not yet registered/logged in</if>


Note, you can use ! for (isnot) to; Is the user browser the page not a member? Then the guest will only see the text.
<if condition="!$show['member']">You're not a member, but a guest</if>


You can use in_array for example to match against available usergroups a member is member off:
<if condition="is_member_of($bbuserinfo, 5, 7, 19, 16)">You're seeing this because you're a member of a particular usergroup</if>


Or multiple forums in array to check against:
<if condition="in_array($forumid, array(X,Y,Z))">this only shows for forums x y and z</if>


A common conditional is for banners or ads in a template. This is the
most used one I've run into. Each .php file from vB has a defined value
for THIS_SCRIPT, 99% of the time it is the filename minus the .php
part. So showthread.php is: THIS_SCRIPT == 'showthread'. So you can use
<if condition="THIS_SCRIPT == 'page'">This only appears on PAGE</if>

__________________
öLürüm yoLuna öLürümde yine boyun eğmem, yakarım dünyayı uğruna ama sana eğiLmem.. öyLe sInIrsIz öyLe Derin öyLe Çok Severim ki KORKARSIN!! Kuruyup çöLe dönsemde Pare Pare oLsamda YENiLMEM!!..
Alıntı ile Cevapla
  #3  
Alt 10.05.16, 17:42
HeartLess - ait Kullanıcı Resmi (Avatar)
Administrator
 
Üyelik tarihi: 18.08.14
Bulunduğu yer: Dip..
Mesajlar: 4,881
Etiketlendiği Mesaj: 2230 Mesaj
Etiketlendiği Konu: 0 Konu
Standart

A list of useful conditionals for Vbulletin, this list will be upgraded with more useful information:

1. How to setup a conditional to show some information only to 1 usergroup.
2. How to setup a conditional to show some information to multiple usergroups.

Code:
<if condition="is_member_of($bbuserinfo, X, Y, Z)">
3. How to setup a conditional to show some information only to 1 user id.

Code:
<if condition="$bbuserinfo[userid] == X">
4. How to setup a conditional to show some information to multiple user Ids.

Code:
<if condition="in_array($bbuserinfo[userid], array(X,Y,Z))">
5. How to setup a conditional to hide information only from 1 usergroup.

Code:
<if condition="!is_member_of($bbuserinfo, X)">
6. How to setup a conditional to hide information from multiple usergroups.

Code:
<if condition="!is_member_of($bbuserinfo, X, Y, Z)">
7.How to setup a conditional to show hide information only from 1 user id.

Code:
<if condition="$bbuserinfo[userid] == X">
8. How to setup a conditional to hide information from multiple user Ids.

Code:
<if condition="!in_array($bbuserinfo[userid], array(X,Y,Z))">
9. How to show information only in forum

Code:
<if condition="$forumid == X">
10. How to show information in few forums

Code:
<if condition="in_array($forumid, array(X,Y,Z))">
11. How to hide information in 1 forum

Code:
<if condition="$forumid != X">
12. How to hide information in multiple forums.

Code:
<if condition="!in_array($forumid, array(X,Y,Z))">

__________________
öLürüm yoLuna öLürümde yine boyun eğmem, yakarım dünyayı uğruna ama sana eğiLmem.. öyLe sInIrsIz öyLe Derin öyLe Çok Severim ki KORKARSIN!! Kuruyup çöLe dönsemde Pare Pare oLsamda YENiLMEM!!..
Alıntı ile Cevapla
  #4  
Alt 10.05.16, 17:42
HeartLess - ait Kullanıcı Resmi (Avatar)
Administrator
 
Üyelik tarihi: 18.08.14
Bulunduğu yer: Dip..
Mesajlar: 4,881
Etiketlendiği Mesaj: 2230 Mesaj
Etiketlendiği Konu: 0 Konu
Standart

To show info for a particular style only:

< if condition="$bbuserinfo[styleid]==x">
Stuff for styleid 'x' here
< /if>


...with 'x' being the styleid of course.

__________________
öLürüm yoLuna öLürümde yine boyun eğmem, yakarım dünyayı uğruna ama sana eğiLmem.. öyLe sInIrsIz öyLe Derin öyLe Çok Severim ki KORKARSIN!! Kuruyup çöLe dönsemde Pare Pare oLsamda YENiLMEM!!..
Alıntı ile Cevapla
  #5  
Alt 24.05.16, 13:45
HeartLess - ait Kullanıcı Resmi (Avatar)
Administrator
 
Üyelik tarihi: 18.08.14
Bulunduğu yer: Dip..
Mesajlar: 4,881
Etiketlendiği Mesaj: 2230 Mesaj
Etiketlendiği Konu: 0 Konu
Standart

Display Information To Members Only
--------------------------
If you want to show a link only to registered members you would use this conditional.

HTML Code:
<if condition="$show['member']"></if>
Display Information To Guests Only
--------------------------
The following conditional will display information only to guests and no one else. This is helpful in displaying a welcome message that you only wish for guests to see.

HTML Code:
<if condition="$show['guest']"></if>
If Viewer is in the Following Usergroups Array. Enter the Usergroup Number(s) Seperated by a Comma
--------------------------
If you want to show an advertisement to viewers that are unregistered, registered members and awaiting email confirmation you would use the usergroup ids 1,2,3 within the array.

HTML Code:
<if condition="is_member_of($vbulletin->userinfo, 1, 2, 3)"></if>
If This Script Is or Is Not XXX
--------------------------
If this script is index (as used in the example below) then it will show the code within the conditional. You can use it to show a piece of code only on Forumhome if you have to put it in a template that is global such as the header. To find out what the script is per page open up the php file that loads the page like for instance showthread.php and look for.

HTML Code:
define('THIS_SCRIPT', 'showthread');
And the showthread part is what you would use.

HTML Code:
<if condition="THIS_SCRIPT == 'index'"></if>
And here you can show information on every page but the index page by using this conditional.

HTML Code:
<if condition="THIS_SCRIPT != 'index'"></if>
If this user equals or does not equal XXX
--------------------------
What this conditional will do is only show certain information if the person viewing the page has the same userid as defined within the conditional. So if you put userid 667 inside the conditional below and put a link inside the conditional tags only the user that has the userid 667 will see that link.

HTML Code:
<if condition="$bbuserinfo['userid'] == 667"></if>
And it works the opposite way as well if you do not want information to show for 667 but you want it to show for everyone else you would use.

HTML Code:
<if condition="$bbuserinfo['userid'] != 667"></if>
Display Information On a Per Forum Basis
--------------------------
This conditional allows you to display information on a per forum basis. This can be helpful if you wish to display different advertisements depending on what forum that the user is in. You would simply replace X with the forum id that you wish the information to appear in.

HTML Code:
<if condition="$forum[forumid] == X"></if>
And on the other hand you can use the ! to do the opposite and display the information in every forum but the id you list.

HTML Code:
<if condition="$forum[forumid] != X"></if>
Or if you have multiple forums you wish to include something with you can use an array such as this.

HTML Code:
<if condition="in_array($forum['forumid'], array(1,2,3,6))"></if>
If Usergroup Is or Is Not X
--------------------------
If the user is a member of the x usergroup then show the code.

HTML Code:
<if condition="$post['usergroupid'] == 6"></if>
And then you can use the ! to tell it to not show it to the x usergroup but show it to everyone else.

HTML Code:
<if condition="$post['usergroupid'] != 6"></if>
If Users Birthday is Less Than or Greater Than XXXX-XX-XX Do Something
--------------------------
Just to show the power of vBulletin here is a cool conditional that will show information based on the birthday of the user. The one below will show "Too Young" if they were born after 01-01-1980.

HTML Code:
<if condition="$bbuserinfo['birthday_search'] > '1980-01-01'">Too Young</if>
And this one will show you "Too Young" if the user was born before 01-01-1980.

HTML Code:
<if condition="$bbuserinfo['birthday_search'] < '1980-01-01'">Too Young</if>
If Thread is or is not in X Forum Execute Code
--------------------------
For instance if you want a piece of code to appear within thread in a particular forum you can do so with this conditional.

HTML Code:
<if condition="$thread['forumid'] == X"></if>
If you want to show the piece of code on every new reply on every thread but 1 forum you can use this which says if thread is in forum x do not show the code but show it for all the other threads out side of forum x.

HTML Code:
<if condition="$thread['forumid'] != X"></if>
And of course you can define multiple forum ids with the array.

HTML Code:
<if condition="in_array($thread['forumid'], array(1,2,3,6))"></if>
Is user moderator of any forum?
--------------------------
If the user is a moderator execute code.

HTML Code:
<if condition="can_moderate()"></if>
Is user moderator of current forum?
--------------------------
If the user is a moderator of the current forum execute code.

HTML Code:
<if condition="can_moderate($forum['forumid'])"></if>
Is user moderator of X Forum?
--------------------------
If the user is a moderator of x forum execute code.

HTML Code:
<if condition="can_moderate($forum['x'])"></if>
Is user the thread starter?
--------------------------
Is the user the thread creator? If so execute code.

HTML Code:
<if condition="$threadinfo['postuserid'] == $bbuserinfo['userid']"></if>
Thread is closed?
--------------------------
If the thread is closed execute code.

HTML Code:
<if condition="!$show['closethread']"></if>
Place Information After First Post
--------------------------
Useful for adding a advertisement or other information after the first post on every page.

HTML Code:
<if condition="!$GLOBALS['FIRSTPOSTID']"></if>
Place Information After x Post On Every Page
--------------------------
This will add your code directly after the post number you define on each page. If you put 2 in place of x the code will appear on every page after the second post.

HTML Code:
<if condition="$post['postcount'] % $vboptions['maxposts'] == x"></if>
Using If Else in Templates
--------------------------
You can also use If Else conditionals within your templates. The below shows you how to correctly do this.

HTML Code:
<if condition="$show['guest']"> Show Guest This Message <else /> Show Everyone but guests this message </if>

__________________
öLürüm yoLuna öLürümde yine boyun eğmem, yakarım dünyayı uğruna ama sana eğiLmem.. öyLe sInIrsIz öyLe Derin öyLe Çok Severim ki KORKARSIN!! Kuruyup çöLe dönsemde Pare Pare oLsamda YENiLMEM!!..
Alıntı ile Cevapla
  #6  
Alt 24.06.16, 18:14
 
Üyelik tarihi: 15.04.16
Mesajlar: 1,116
Etiketlendiği Mesaj: 279 Mesaj
Etiketlendiği Konu: 0 Konu
Standart

heartless kardeşim ben bunlardan hiç bir şey anlamıyorum nedir ne içindir

Alıntı ile Cevapla
  #7  
Alt 25.06.16, 00:35
HeartLess - ait Kullanıcı Resmi (Avatar)
Administrator
 
Üyelik tarihi: 18.08.14
Bulunduğu yer: Dip..
Mesajlar: 4,881
Etiketlendiği Mesaj: 2230 Mesaj
Etiketlendiği Konu: 0 Konu
Standart

Bunlar site kodları @[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...] abla, sizinle bir ilgisi yok umursamayın

__________________
öLürüm yoLuna öLürümde yine boyun eğmem, yakarım dünyayı uğruna ama sana eğiLmem.. öyLe sInIrsIz öyLe Derin öyLe Çok Severim ki KORKARSIN!! Kuruyup çöLe dönsemde Pare Pare oLsamda YENiLMEM!!..
Alıntı ile Cevapla
  #8  
Alt 05.05.17, 22:51
Manevi
 
Üyelik tarihi: 31.05.15
Mesajlar: 2,190
Etiketlendiği Mesaj: 84 Mesaj
Etiketlendiği Konu: 0 Konu
Standart

Allah razı olsun bu güzel paylaşım için.

Alıntı ile Cevapla
  #9  
Alt 01.05.18, 09:25
Daimi Üye
 
Üyelik tarihi: 28.04.15
Bulunduğu yer: Nefes Aldığım Yerde
Mesajlar: 14,974
Etiketlendiği Mesaj: 891 Mesaj
Etiketlendiği Konu: 0 Konu
Standart

Sayın HeartLess, konu paylaşımınız için teşekkür ederiz.

__________________
Sözün kıymetini '' Lal'' olandan,
Ekmeğini kıymetini ''Aç '' olandan,
Aşkın kıymetini ''Hiç'' olandan öğren..

Alıntı ile Cevapla
Cevapla

Etiketler
kosullari, vbulletin


Yetkileriniz
Konu Acma Yetkiniz Yok
Cevap Yazma Yetkiniz Yok
Eklenti Yükleme Yetkiniz Yok
Mesajınızı Değiştirme Yetkiniz Yok

BB code is Açık
Smileler Açık
[IMG] Kodları Açık
HTML-Kodu Kapalı
Trackbacks are Açık
Pingbacks are Açık
Refbacks are Açık


Benzer Konular
Konu Konuyu Başlatan Forum Cevap Son Mesaj
vBulletin rss ile konunun tamamını çekmek HeartLess vBulletin 3 09.07.21 15:50
vbulletin Powered by vbulletin yazısını kaldırmak selamidemir vBulletin 0 26.02.19 08:20
vBulletin optimizasyon HeartLess vBulletin 2 07.05.18 09:17
vBulletin 5.3.0 artık Erişilebilir SiLence vBulletin 3 05.06.17 10:46
vBulletin Forumlarda Toplu Temizlik işlemleri HeartLess vBulletin 0 13.05.16 17:43


Tüm Zamanlar GMT +3 Olarak Ayarlanmış. Şuanki Zaman: 05:09.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
HavasOkulu.Com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147