TRForumcu.NeTWebmaster / Web Dizayn Scriptler / Programlama DilleriPHP / ASP WeB SiSTeMLeRi SMF (Moderatör: Gondolin)Bölümleri İki Sütun Halinde Listelemek
Konu Bilgileri
Konu Başlığı Bölümleri İki Sütun Halinde Listelemek
Cevaplar 0
Sonraki Sonraki Konu
Görüntüleyenler0 Üye ve 1 Ziyaretçi konuyu incelemekte.
Görüntülenme 663
Önceki Önceki Konu
Sayfa: [1]   Aşağı git
Yazdır
Konu Derecelendirme: 0 Bookmark and Share
Konu: Bölümleri İki Sütun Halinde Listelemek  (Okunma Sayısı 663 defa) EkleBunu Sosyal Paylaşım Butonu
Gondolin
Bölüm Sorumlusu
*


Mesaj : 1.169
Forum Para : 7896.00 YTL
« : 03 Temmuz 2008, 14:35:03 »


Bu ipucu sayesinde, forum ana sayfasındaki kategoriler, bölümler iki sütun halinde listeleniyor. Belki tema yapımcıları için güzel bir fikir olabilir.

BoardIndex.template.php

Bul:

/* Each category in categories is made up of:

Değiştir:

// How many categories do we have?
$category_count = count($context['categories']);

// Mod it and see if it is an odd number or not.
$category_left_count = $category_count % 2;

// Lucky, its even.
if($category_left_count == 0)
// Just divide it and calculate cat per column.
$category_per_column = $category_count / 2;
else
// Opps, odd number. We just need integer, so add the left part after you divide.
$category_per_column = (($category_count - $category_left_count) / 2) + $category_left_count;

// Keep track of the categories you echoed.
$counter = 0;

// Here comes the table.
echo '
<table>
<tr>';

/* Each category in categories is made up of:

Bul:

echo '
<div class="tborder" style="margin-top: ' , $first ? '0;' : '1ex;' , '' , $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'width: 100%;' : '', '">

Değiştir:

// Pass to a new column if reset.
if($counter == 0)
echo '
<td width="50%" style="vertical-align: top;">';

echo '
<div class="tborder" style="margin-top: 1ex;' , '' , $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'width: 100%;' : '', '">

Bul:

}
echo '
</div>';
}

Değiştir:

}
echo '
</div>';

// Increase the number cats echoed.
$counter = $counter + 1;

// If we displayed enough cats, pass to new column
if($counter == $category_per_column) {
echo '
</td>';

// Reset the tracker.
$counter = 0;
}
}

// We need to close the column if it was an odd number.
if($category_left_count != 0)
echo '
</td>';

// Close the table.
echo '
</tr>
</table>';

Kodlardaki 2 rakamlarını 3 olarak değiştirirek 3 sütun haline de getirebilirsiniz.

Bir süre burada durduktan sonra İpuçları ve Hileler bölümüne taşınacak.

Tamamiyle [SiNaN] yapımıdır.

Örnek Görüntü.

Logged
 
Sayfa: [1]   Yukarı git
Yazdır