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.