TinyPortal

Development => International => Turkish => Topic started by: artmen on February 09, 2008, 11:14:28 AM

Title: forum kategori başlıkları ana sayfada bir blokta toplanabilirmi
Post by: artmen on February 09, 2008, 11:14:28 AM
alp bey selam

forum kategori başlıkları bloklardan birinde otomatik olarak toplanabilirmi. tek tek eklemeye çalıştım zaman alıyor. eğer yoksa tek tek ekleyeceğim. bir kaçını ekledim araları çok açık durdu. bakmak istersen. araları daraltmak mümkünmü...

http://www.okulplatformu.com da forum başlıkları bloku
Title: Re: forum kategori başlıkları ana sayfada bir blokta toplanabilirmi
Post by: alp on February 09, 2008, 11:19:26 AM
Bu blok işinizi görür sanırım
-----------
Board Index Menu (bölümlerin indexi)
bu blok ile portalda site de bulunan tüm bölümlerin alt bölümleri indexini gösterebilirsiniz
ekran görüntüsü

http://img207.imageshack.us/img207/5760/asasrt5.jpg
***************
php blok oluşturun kodu kopyalayın
global $db_prefix, $context, $user_info;


// Find the boards/cateogories they can see.
$request = db_query("
SELECT c.name AS catName, c.ID_CAT, b.ID_BOARD, b.name AS boardName, b.numTopics, b.childLevel
FROM {$db_prefix}boards AS b
LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
WHERE $user_info[query_see_board]", __FILE__, __LINE__);
$context['jump_to'] = array();
$this_cat = array('id' => -1);
while ($row = mysql_fetch_assoc($request))
{
if ($this_cat['id'] != $row['ID_CAT'])
{
$this_cat = &$context['jump_to'][];
$this_cat['id'] = $row['ID_CAT'];
$this_cat['name'] = $row['catName'];
$this_cat['boards'] = array();
}

$this_cat['boards'][] = array(
'id' => $row['ID_BOARD'],
'name' => $row['boardName'],
'child_level' => $row['childLevel'],
'is_current' => isset($context['current_board']) && $row['ID_BOARD'] == $context['current_board'],
'topics' => $row['numTopics']
);
}
mysql_free_result($request);

foreach ($context['jump_to'] as $category){
// edit the following line if you want to change the style of the category text.
echo '<span style="line-height: 10px; font-weight: bold;" class="normaltext" ><b>', strtoupper($category['name']), '</b></span><br />';

foreach ($category['boards'] as $board){
            if (!$board['child_level']){
//edit the following line for the regular board text
echo '<a href="',$scripturl,'?board=', $board['id'], '">', $board['name'], '</a><br />';
//this line you can edit for the topics count text
echo '<span class="smalltext" style="margin-left: 10px;">', $board['topics'],' ', $txt[330], '</span><br />';
}
else{
//this line you can edit to change the child board text
echo '<a class="normaltext" style="margin-left: 20px;" href="',$scripturl,'?board=', $board['id'], '">', $board['name'],'</a><br />';
}
         
}
}
Title: Re: forum kategori başlıkları ana sayfada bir blokta toplanabilirmi
Post by: artmen on February 09, 2008, 11:34:15 AM
alp bey
tüm forum başlıkları olunca benim forum uzun olduğundan tabiki orasıda çok uzun oldu. eğer sadece üst başlıklar (alt bölüm başlıkları olmadan) gösterebilirse yada kategori başlıkları olursa daha iyi olacak....
Title: Re: forum kategori başlıkları ana sayfada bir blokta toplanabilirmi
Post by: alp on February 09, 2008, 03:28:37 PM
ilk verdiğimi editleyerek sadece kategori adı bölüm adlarını yaptım denedim sorunsuz çalışıyor

global $db_prefix, $context, $user_info;


// Find the boards/cateogories they can see.
$request = db_query("
SELECT c.name AS catName, c.ID_CAT, b.ID_BOARD, b.name AS boardName, b.numTopics, b.childLevel
FROM {$db_prefix}boards AS b
LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
WHERE $user_info[query_see_board]", __FILE__, __LINE__);
$context['jump_to'] = array();
$this_cat = array('id' => -1);
while ($row = mysql_fetch_assoc($request))
{
if ($this_cat['id'] != $row['ID_CAT'])
{
$this_cat = &$context['jump_to'][];
$this_cat['id'] = $row['ID_CAT'];
$this_cat['name'] = $row['catName'];
$this_cat['boards'] = array();
}

$this_cat['boards'][] = array(
'id' => $row['ID_BOARD'],
'name' => $row['boardName'],
'child_level' => $row['childLevel'],
'is_current' => isset($context['current_board']) && $row['ID_BOARD'] == $context['current_board'],
'topics' => $row['numTopics']
);
}
mysql_free_result($request);

foreach ($context['jump_to'] as $category){
// edit the following line if you want to change the style of the category text.
echo '<span style="line-height: 10px; font-weight: bold;" class="normaltext" ><b>', strtoupper($category['name']), '</b></span><br />';

foreach ($category['boards'] as $board){
            if (!$board['child_level']){
//edit the following line for the regular board text
echo '<a href="',$scripturl,'?board=', $board['id'], '">', $board['name'], '</a><br />';

}
         
}
}
Title: Re: forum kategori başlıkları ana sayfada bir blokta toplanabilirmi
Post by: artmen on February 09, 2008, 08:51:07 PM
Alp beyciÄŸim
ellerine ve emeğine sağlık. ancak bunu biraz daha kısaltabilirsik. kategori isimleri yanında alt ana başlıklarda çıkıyor. malum okul sitesi olunca o kadar sınıf, ders forumu uzattık iyice. olabilirse ne iyi. olmazsa da canın sağolsun.
selamlar ve teşekkürler
ismet demir
öğretmen
Title: Re: forum kategori başlıkları ana sayfada bir blokta toplanabilirmi
Post by: alp on February 09, 2008, 11:02:36 PM
uğraştım ama bir türlü kategorinin yolunu veremedim, ama bir html/bbc box oluşturun kaynağa tıklayın
yapıştırın kategori adları tıklanınca kategoriye gidiyor umarım işinizi görür

<font style="font-size: 8pt;"><strong><a class="nav" href="http://www.okulplatformu.com/index.php?action=forum#2">ATAT&Uuml;RK PLATFORMU</a></strong> <br />
</font><font style="font-size: 8pt;"><strong><a class="nav" href="http://www.okulplatformu.com/index.php?action=forum#20">BİZİMKİLER PLATFORMU</a></strong> <br />
</font><font style="font-size: 8pt;"><strong><a class="nav" href="http://www.okulplatformu.com/index.php?action=forum#24">K&Uuml;T&Uuml;PHANE PLATFORMU</a><br />
</strong></font><font style="font-size: 8pt;"><strong><a class="nav" href="http://www.okulplatformu.com/index.php?action=forum#32">HERKESE LAZIM</a></strong> <br />
</font><font style="font-size: 8pt;"><strong><a class="nav" href="http://www.okulplatformu.com/index.php?action=forum#27">KURULLAR</a><br />
</strong></font><font style="font-size: 8pt;"><strong><a class="nav" href="http://www.okulplatformu.com/index.php?action=forum#28">TOPLANTI SALONU</a></strong> <br />
</font><font style="font-size: 8pt;"><strong><a class="nav" href="http://www.okulplatformu.com/index.php?action=forum#30">&Ouml;ĞRETİM PROGRAMLARI</a></strong> <br />
</font><font style="font-size: 8pt;"><strong><a class="nav" href="http://www.okulplatformu.com/index.php?action=forum#26">BİREYSELLEŞTİRİLMİŞ EĞİTİM PROGRAMLARI</a></strong> </font><br />
<font style="font-size: 8pt;"><strong><a class="nav" href="http://www.okulplatformu.com/index.php?action=forum#23">ANA SINIFI PLATFORMU</a></strong> <br />
</font><font style="font-size: 8pt;"><strong><a class="nav" href="http://www.okulplatformu.com/index.php?action=forum#4"><strong>1. SINIF PLATFORMU</strong></a><br />
</strong></font><font style="font-size: 8pt;"><strong><a class="nav" href="http://www.okulplatformu.com/index.php?action=forum#11">2. SINIF PLATFORMU</a></strong> <br />
</font><font style="font-size: 8pt;"><strong><a class="nav" href="http://www.okulplatformu.com/index.php?action=forum#12">3. SINIF PLATFORMU</a><br />
</strong></font><font style="font-size: 8pt;"><strong><a class="nav" href="http://www.okulplatformu.com/index.php?action=forum#13">4. SINIF PLATFORMU</a><br />
</strong></font><font style="font-size: 8pt;"><strong><a class="nav" href="http://www.okulplatformu.com/index.php?action=forum#14">5. SINIF PLATFORMU</a><br />
</strong></font><font style="font-size: 8pt;"><strong><a class="nav" href="http://www.okulplatformu.com/index.php?action=forum#15">6. SINIF PLATFORMU</a><br />
</strong></font><font style="font-size: 8pt;"><strong><a class="nav" href="http://www.okulplatformu.com/index.php?action=forum#16">7. SINIF PLATFORMU</a><br />
</strong></font><font style="font-size: 8pt;"><strong><a class="nav" href="http://www.okulplatformu.com/index.php?action=forum#17">8. SINIF PLATFORMU</a><br />
</strong></font><a class="nav" href="http://www.okulplatformu.com/index.php?action=forum#12"><font style="font-size: 8pt;"><strong><a class="nav" href="http://www.okulplatformu.com/index.php?action=forum#6">BELİRLİ G&Uuml;N VE HAFTALAR</a><br />
</strong></font><font style="font-size: 8pt;"><strong><a class="nav" href="http://www.okulplatformu.com/index.php?action=forum#7">SOSYAL  ETKİNLİKLER ve &Ouml;ÄžRENCİ KUL&Uuml;P &Ccedil;ALIÅžMALARI</a></strong> </font></a><br />
<font style="font-size: 8pt;"><strong><a class="nav" href="http://www.okulplatformu.com/index.php?action=forum#22">ANKETLER</a><br />
</strong></font><font style="font-size: 8pt;"><strong><a class="nav" href="http://www.okulplatformu.com/index.php?action=forum#31">YAZ TATİLİ</a></strong></font>
Title: Re: forum kategori başlıkları ana sayfada bir blokta toplanabilirmi
Post by: artmen on February 09, 2008, 11:50:49 PM
bundan iyisi şamda kayısı. eline sağlık.
Title: Re: forum kategori başlıkları ana sayfada bir blokta toplanabilirmi
Post by: Turk Navy on February 13, 2008, 02:36:23 PM
alp'ın verdiği kodu istediğiniz gibi düzenledim. Bilgileri veritabanından çekmek isterseniz bunu kullanabilirsiniz.

global $db_prefix, $context, $user_info;


// Find the boards/cateogories they can see.
$request = db_query("
SELECT c.name AS catName, c.ID_CAT, b.ID_BOARD, b.name AS boardName, b.numTopics, b.childLevel
FROM {$db_prefix}boards AS b
LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
WHERE $user_info[query_see_board]", __FILE__, __LINE__);
$context['jump_to'] = array();
$this_cat = array('id' => -1);
while ($row = mysql_fetch_assoc($request))
{
if ($this_cat['id'] != $row['ID_CAT'])
{
$this_cat = &$context['jump_to'][];
$this_cat['id'] = $row['ID_CAT'];
$this_cat['name'] = $row['catName'];
$this_cat['boards'] = array();
}

$this_cat['boards'][] = array(
'id' => $row['ID_BOARD'],
'name' => $row['boardName'],
'child_level' => $row['childLevel'],
'is_current' => isset($context['current_board']) && $row['ID_BOARD'] == $context['current_board'],
'topics' => $row['numTopics']
);
}
mysql_free_result($request);

foreach ($context['jump_to'] as $category){
echo '<span style="line-height: 10px; font-weight: bold;" class="normaltext" >
<a href="',$scripturl,'?action=forum#', $category['id'], '">', strtoupper($category['name']), '</a>
</span><br />';
// edit the following line if you want to change the style of the category text.

}
Title: Re: forum kategori başlıkları ana sayfada bir blokta toplanabilirmi
Post by: artmen on February 14, 2008, 09:04:21 PM
bunu siz denedinizmi. belki 10 defa denedim olmadı. html blok yapıp kaynağa tıkladım ve ekledi. gönder dedim. hep kodlar çıktı.
Quote from: Turk Navy on February 13, 2008, 02:36:23 PM
alp'ın verdiği kodu istediğiniz gibi düzenledim. Bilgileri veritabanından çekmek isterseniz bunu kullanabilirsiniz.

global $db_prefix, $context, $user_info;


// Find the boards/cateogories they can see.
$request = db_query("
SELECT c.name AS catName, c.ID_CAT, b.ID_BOARD, b.name AS boardName, b.numTopics, b.childLevel
FROM {$db_prefix}boards AS b
LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
WHERE $user_info[query_see_board]", __FILE__, __LINE__);
$context['jump_to'] = array();
$this_cat = array('id' => -1);
while ($row = mysql_fetch_assoc($request))
{
if ($this_cat['id'] != $row['ID_CAT'])
{
$this_cat = &$context['jump_to'][];
$this_cat['id'] = $row['ID_CAT'];
$this_cat['name'] = $row['catName'];
$this_cat['boards'] = array();
}

$this_cat['boards'][] = array(
'id' => $row['ID_BOARD'],
'name' => $row['boardName'],
'child_level' => $row['childLevel'],
'is_current' => isset($context['current_board']) && $row['ID_BOARD'] == $context['current_board'],
'topics' => $row['numTopics']
);
}
mysql_free_result($request);

foreach ($context['jump_to'] as $category){
echo '<span style="line-height: 10px; font-weight: bold;" class="normaltext" >
<a href="',$scripturl,'?action=forum#', $category['id'], '">', strtoupper($category['name']), '</a>
</span><br />';
// edit the following line if you want to change the style of the category text.

}

Title: Re: forum kategori başlıkları ana sayfada bir blokta toplanabilirmi
Post by: bbTURK on February 14, 2008, 09:43:05 PM
bunlar php kodları php blokda çalışır. ancak kodlara bakmadım zaten baksamda fazla anlamam bu kodların düzenlenmesi gerekebilir.
Title: Re: forum kategori başlıkları ana sayfada bir blokta toplanabilirmi
Post by: alp on February 14, 2008, 10:32:31 PM
Quotebunu siz denedinizmi. belki 10 defa denedim olmadı. html blok yapıp kaynağa tıkladım ve ekledi. gönder dedim. hep kodlar çıktı.
Turk Navy verdiği kodları php blok a kopyalayın orada çalışıyor
Title: Re: forum kategori başlıkları ana sayfada bir blokta toplanabilirmi
Post by: Turk Navy on February 15, 2008, 08:01:21 PM
Quote from: artmen on February 14, 2008, 09:04:21 PM
bunu siz denedinizmi. belki 10 defa denedim olmadı. html blok yapıp kaynağa tıkladım ve ekledi. gönder dedim. hep kodlar çıktı.

Evet, kendi sunucumda denedim. PHP blok olarak eklediğinizde sorunsuz olarak çalışması lazım.

Düzenleme: alp te denemiş sanırım, onaylıyor.
Title: Re: forum kategori başlıkları ana sayfada bir blokta toplanabilirmi
Post by: artmen on February 15, 2008, 09:39:55 PM
canlarım sağolun varolun...