TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 195,994
  • Total Topics: 21,325
  • Online today: 369
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 295
  • Total: 295

forum kategori başlıkları ana sayfada bir blokta toplanabilirmi

Started by artmen, February 09, 2008, 11:14:28 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

artmen

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

alp

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 />';
}
         
}
}

artmen

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....

alp

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 />';

}
         
}
}

artmen

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

alp

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>

artmen


Turk Navy

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.

}

artmen

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.

}


bbTURK

bunlar php kodları php blokda çalışır. ancak kodlara bakmadım zaten baksamda fazla anlamam bu kodların düzenlenmesi gerekebilir.

This website is proudly hosted on Crocweb Cloud Website Hosting.