DNA Tasarim
20 Mayıs 2012, 21:17:12 *
Hoşgeldiniz, Ziyaretçi.Lütfen giriş yapın veya kayıt olun.

Kullanıcı adınızı, parolanızı ve aktif kalma süresini giriniz
 
   Portal   Forum Ara Takvim Tags GoogleTagged Giriş Yap Kayıt  
Sayfa: [1]   Aşağı git
Yazdır
Gönderen Konu: Gelişmiş Popüler konu  (Okunma Sayısı 871 defa)
0 Üye ve 1 Ziyaretçi konuyu incelemekte.
DNA


Üye ID: 1

Cinsiyet: Bay
Yaş: 24
Nerden: Gaziantep

Konu Sayısı: 42
Mesaj Sayısı: 127

Çevrimdışı


WWW
« : 12 Mayıs 2009, 10:27:35 »

Konu Sahibi=d-gan
| Son mesajlar : Forumdan Son Mesajlar  >> Yönetim paneli >> Kullanılan Tema >> Forum anasayfasında gösterilecek yeni mesaj sayısı: "10" olarak ayarlayın
| Popüler Bölümler : En Çok Mesaj Atılan 10 kategori
| En Çok Okunan Konular: En Çok Okunan 10 konu
| Son Cevaplanan Konular Son Cevaplanan 10 konu
| Kullanılan Sistem : Yahoo'nun Ajax Geliştirme Paketi

Eklentide verdiğim tabview klasörünü default tema içine atınız.



index.template.php
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />';

Kod: (SONRASINA EKLE) Hepsini Seç | Panoya Kopyala
// Gelişmiş Popüler Konular Modifikasyonu by d-gan  //
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/tabview/fonts-min.css" />
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/tabview/tabview.css" />
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/tabview/yahoo-dom-event.js"></script>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/tabview/element-beta-min.js"></script>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/tabview/tabview-min.js"></script>';

// Gelişmiş Popüler Konular Modifikasyonu by d-gan  //

<body>
Kod: (DEĞİŞTİR) Hepsini Seç | Panoya Kopyala
<body class=" yui-skin-sam">


BoardIndex.template.php
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/fader.js"></script>
</td>
</tr>
</table>';
}

Kod: (SONRASINA EKLE) Hepsini Seç | Panoya Kopyala
// Gelişmiş Popüler Konular Modifikasyonu by d-gan  //

echo '
<div id="d-gan" class="yui-navset">
    <ul class="yui-nav">
        <li><a href="#tab1"><em>Son Mesajlar</em></a></li>
        <li class="selected"><a href="#tab2"><em>Populer Bölümler</em></a></li>
        <li><a href="#tab3"><em>En Çok Okunan Konular</em></a></li>
<li><a href="#tab3"><em>Son Cevaplanan Konular</em></a></li>
    </ul>           
    <div class="yui-content">';
         echo '<div id="tab1">';
// This is the "Recent Posts"
if (!empty($settings['number_recent_posts']))
{


// Only show one post.
if ($settings['number_recent_posts'] == 1)
{
// latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.)
echo '
<b><a href="', $scripturl, '?action=recent">', $txt[214], '</a></b>
<div class="smalltext">
', $txt[234], ' &quot;', $context['latest_post']['link'], '&quot; ', $txt[235], ' (', $context['latest_post']['time'], ')<br />
</div>';
}
// Show lots of posts.
elseif (!empty($context['latest_posts']))
{
echo '
<table  class="windowbg2" cellspacing="1" width="100%" cellpadding="0"  border="0">
';


/* Each post in latest_posts has:
board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
subject, short_subject (shortened with...), time, link, and href. */
foreach ($context['latest_posts'] as $post)
echo '

<tr>
<td valign="top" width="29%">', $post['board']['link'], '</td>
<td valign="top" width="27%"><a href="', $post['href'],'">', $post['short_subject'], '</td>
<td valign="top" width="15%">', $post['poster']['link'], '</td>
<td aling="right" valign="top" width="29%"><div align="right">', $post['time'], '</div></td>

</tr>';
echo '
</table>';

}

}echo '</div>';
echo ' <div id="tab1"><table border="0" cellpadding="1" cellspacing="0" width="100%">';
foreach ($context['top_boards'] as $board)
echo '
<tr>
<td width="60%" valign="top">', $board['link'], '</td>
<td width="20%" align="left" valign="top">', $board['num_posts'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $board['post_percent'] . '" height="15" alt="" />' : '&nbsp;', '</td>
<td width="20%" align="right" valign="top">', $board['num_posts'], '</td>
</tr>';
echo '
</table></div>';
        echo '<div id="tab2"><table border="0" cellpadding="1" cellspacing="0" width="100%">';
foreach ($context['top_topics_views'] as $topic)
echo '
<tr>
<td width="60%" valign="top">', $topic['link'], '</td>
<td width="20%" align="left" valign="top">', $topic['num_views'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $topic['post_percent'] . '" height="15" alt="" />' : '&nbsp;', '</td>
<td width="20%" align="right" valign="top">', $topic['num_views'], '</td>
</tr>';
echo '
</table></div>';
        echo '<div id="tab3"><table border="0" cellpadding="1" cellspacing="0" width="100%">';
foreach ($context['top_topics_replies'] as $topic)
echo '
<tr>
<td width="60%" valign="top">', $topic['link'], '</td>
<td width="20%" align="left" valign="top">', $topic['num_replies'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $topic['post_percent'] . '" height="15" alt="" />' : '&nbsp;', '</td>
<td width="20%" align="right" valign="top">', $topic['num_replies'], '</td>
</tr>';
echo '
</table></div>
    </div>
</div>
<script>
(function() {
    var tabView = new YAHOO.widget.TabView(\'d-gan\');

    YAHOO.log("The example has finished loading; as you interact with it, you\'ll see log messages appearing here.", "info", "example");
})();
</script>

<br /> ';
// Gelişmiş Popüler Konular Modifikasyonu by d-gan  //


Boardindex.php
// Remember the most recent topic for optimizing the recent posts feature.
$most_recent_topic = array(
'timestamp' => 0,
'ref' => null
);


Kod: (SONRASINA EKLE) Hepsini Seç | Panoya Kopyala
// Gelişmiş Popüler Konular Modifikasyonu by d-gan  //

// Son cevaplanan konular //
$topic_reply_result = db_query("
SELECT m.subject, t.numReplies, t.ID_BOARD, t.ID_TOPIC, b.name
FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS m, {$db_prefix}boards AS b)
WHERE m.ID_MSG = t.ID_FIRST_MSG
AND $user_info[query_see_board]" . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? "
AND b.ID_BOARD != $modSettings[recycle_board]" : '') . "
AND t.ID_BOARD = b.ID_BOARD" . (!empty($topic_ids) ? "
AND t.ID_TOPIC IN (" . implode(', ', $topic_ids) . ")" : '') . "
ORDER BY t.numReplies DESC
LIMIT 10", __FILE__, __LINE__);
$context['top_topics_replies'] = array();
$max_num_replies = 1;
while ($row_topic_reply = mysql_fetch_assoc($topic_reply_result))
{
censorText($row_topic_reply['subject']);

$context['top_topics_replies'][] = array(
'id' => $row_topic_reply['ID_TOPIC'],
'board' => array(
'id' => $row_topic_reply['ID_BOARD'],
'name' => $row_topic_reply['name'],
'href' => $scripturl . '?board=' . $row_topic_reply['ID_BOARD'] . '.0',
'link' => '<a href="' . $scripturl . '?board=' . $row_topic_reply['ID_BOARD'] . '.0">' . $row_topic_reply['name'] . '</a>'
),
'subject' => $row_topic_reply['subject'],
'num_replies' => $row_topic_reply['numReplies'],
'href' => $scripturl . '?topic=' . $row_topic_reply['ID_TOPIC'] . '.0',
'link' => '<a href="' . $scripturl . '?topic=' . $row_topic_reply['ID_TOPIC'] . '.0">' . $row_topic_reply['subject'] . '</a>'
);

if ($max_num_replies < $row_topic_reply['numReplies'])
$max_num_replies = $row_topic_reply['numReplies'];
}
mysql_free_result($topic_reply_result);

foreach ($context['top_topics_replies'] as $i => $topic)
$context['top_topics_replies'][$i]['post_percent'] = round(($topic['num_replies'] * 100) / $max_num_replies);

// Son cevaplanan konular //


// En Çok Okunan Konular //
$topic_view_result = db_query("
SELECT m.subject, t.numViews, t.ID_BOARD, t.ID_TOPIC, b.name
FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS m, {$db_prefix}boards AS b)
WHERE m.ID_MSG = t.ID_FIRST_MSG
AND $user_info[query_see_board]" . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? "
AND b.ID_BOARD != $modSettings[recycle_board]" : '') . "
AND t.ID_BOARD = b.ID_BOARD" . (!empty($topic_ids) ? "
AND t.ID_TOPIC IN (" . implode(', ', $topic_ids) . ")" : '') . "
ORDER BY t.numViews DESC
LIMIT 10", __FILE__, __LINE__);
$context['top_topics_views'] = array();
$max_num_views = 1;
while ($row_topic_views = mysql_fetch_assoc($topic_view_result))
{
censorText($row_topic_views['subject']);

$context['top_topics_views'][] = array(
'id' => $row_topic_views['ID_TOPIC'],
'board' => array(
'id' => $row_topic_views['ID_BOARD'],
'name' => $row_topic_views['name'],
'href' => $scripturl . '?board=' . $row_topic_views['ID_BOARD'] . '.0',
'link' => '<a href="' . $scripturl . '?board=' . $row_topic_views['ID_BOARD'] . '.0">' . $row_topic_views['name'] . '</a>'
),
'subject' => $row_topic_views['subject'],
'num_views' => $row_topic_views['numViews'],
'href' => $scripturl . '?topic=' . $row_topic_views['ID_TOPIC'] . '.0',
'link' => '<a href="' . $scripturl . '?topic=' . $row_topic_views['ID_TOPIC'] . '.0">' . $row_topic_views['subject'] . '</a>'
);

if ($max_num_views < $row_topic_views['numViews'])
$max_num_views = $row_topic_views['numViews'];
}
mysql_free_result($topic_view_result);

foreach ($context['top_topics_views'] as $i => $topic)
$context['top_topics_views'][$i]['post_percent'] = round(($topic['num_views'] * 100) / $max_num_views);

// En Çok Okunan Konular //


// Populer Bölümler //
$boards_result = db_query("
SELECT ID_BOARD, name, numPosts
FROM {$db_prefix}boards AS b
WHERE $user_info[query_see_board]" . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? "
AND b.ID_BOARD != $modSettings[recycle_board]" : '') . "
ORDER BY numPosts DESC
LIMIT 10", __FILE__, __LINE__);
$context['top_boards'] = array();
$max_num_posts = 1;
while ($row_board = mysql_fetch_assoc($boards_result))
{
$context['top_boards'][] = array(
'id' => $row_board['ID_BOARD'],
'name' => $row_board['name'],
'num_posts' => $row_board['numPosts'],
'href' => $scripturl . '?board=' . $row_board['ID_BOARD'] . '.0',
'link' => '<a href="' . $scripturl . '?board=' . $row_board['ID_BOARD'] . '.0">' . $row_board['name'] . '</a>'
);

if ($max_num_posts < $row_board['numPosts'])
$max_num_posts = $row_board['numPosts'];
}
mysql_free_result($boards_result);

foreach ($context['top_boards'] as $i => $board)
$context['top_boards'][$i]['post_percent'] = round(($board['num_posts'] * 100) / $max_num_posts);

// Populer Bölümler //

// Gelişmiş Popüler Konular Modifikasyonu by d-gan  //
« Son Düzenleme: 12 Mayıs 2009, 10:31:44 Gönderen: DNA » Logged

Tags:
Sayfa: [1]   Yukarı git
Yazdır
GoogleTagged: bot kopyala

Gitmek istediğiniz yer:  

Powered by SMF 1.1.16 | SMF © 2006-2008, Simple Machines

Sitemap