- Kod: Tümünü seç
#####################################################################################
## MOD Adı : gelişmiş son x konu
## Yazar : ALEXIS < N/A > (Alexis Canver) www.canver.net
## Sürüm : 1.0.1b (phpBB 2.0.x)
##
## Açıklama : Geliştirilmiş farklı bir "son x konu" uygulamasıdır.
##
## Kurulum zorluğu : kolay
## Kurulum süresi : ~6 dk.
##
## Düzenlenen dosyalar (3) : includes/page_header.php
## languages/lang_turkish/lang_main.php
## templates/subSilver/index_body.tpl
##
#####################################################################################
##
## Destek ve Yardım : http://www.canver.net
## Telif Hakkı : Copyleft © - Canver Software - www.canversoft.net
## Lisans : GNU Public License v2 http://opensource.org/licenses/gpl-license.php
##
#####################################################################################
## Güvenlik Uyarısı:
##
## Modun son sürümü için lütfen http://www.canver.net adresini kontrol ediniz.
## Modu başka siteden indirdiyseniz, içinde art niyetli kod olmadığını garanti edemeyiz.
## Modu eklemeden önce, güvenlik kopyası amacıyla lütfen dosyalarınızın yedeğini alınız.
##
#####################################################################################
## Yazar Notları:
##
## Geliştirilmiş farklı bir "son x konu" uygulamasıdır.
## Konu, Forum, Cevap, Son Yazan, Son Cevap Tarihi bölümlerine sahiptir.
##
##
## Gösterilecek konu sayısını kodları eklemeden önce ayarlayın:
##
## $CFG['number_recent_topics'] = '5';
##
## değişkenindeki 5 sayısı son 5 konuyu gösterir, kodları eklemeden önce bunu keyfinize
## göre değiştirebilirsiniz.
##
##
## Eklenen kodlarda yetki kontrolü olduğu halde, bazı forumları göstermek istemezseniz,
## bunların ID numaralarını virgül ile ayırarak şu kısıma yazabilirsiniz.
##
## $CFG['exceptional_forums'] = '';
##
##
## tpl dosyasına eklenen kodları index_body.tpl ye eklemek zorunda değilsiniz,
## HTML kodları her tpl dosyasında çalışır, mesela son konuları her sayfada göstermek
## istiyorsanız, üst taraf için overall_header.tpl alt taraf için overall_footer.tpl
## dosyasına ekleyebilirsiniz.
##
######################################################################################
## Mod Geçmişi:
##
## 20.09.2006|21.14 // v1.0.0b
## - Hata bildirimi, düzenleme amaçlı ilk sürüm
##
## 20.09.2006|21.14 // v1.0.1b
## - "index sayfasında forumlardaki son gönderen görünmüyor" hatası giderildi
##
######################################################################################
#
#
##-----[ AÇ ]-------------------------------------------------------------------------
#
includes/page_header.php
#
#------[ BUL ]------------------------------------------------------------------------
#
// Format Timezone. We are unable to use array_pop here, because of PHP3 compatibility
$l_timezone = explode('.', $board_config['board_timezone']);
#
#------[ ÖNCESİNE EKLE ]--------------------------------------------------------------
#
//-- [+] MOD: son x duyuru -------------------------------------------------
//-- eklendi
//
// [+] ayarlar -----------------------------
// Number of Recent Topics (not Forum ID)
$CFG['number_recent_topics'] = '5';
// Excluding forums for Recent Topics, eg. '2,4,10' (note: my Recent Topics script has its own permission checking, so you can leave this variable blank)
$CFG['exceptional_forums'] = '';
// [-] ayarlar -----------------------------
$sql = "SELECT * FROM ". FORUMS_TABLE . " ORDER BY forum_id";
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}
$x_forum_data = array();
while( $row = $db->sql_fetchrow($result) )
{
$x_forum_data[] = $row;
}
$is_auth_ary = array();
$is_auth_ary = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata, $x_forum_data);
if( $CFG['exceptional_forums'] == '' )
{
$except_forum_id = '\'start\'';
}
else
{
$except_forum_id = $CFG['exceptional_forums'];
}
for ($i = 0; $i < count($x_forum_data); $i++)
{
if ((!$is_auth_ary[$x_forum_data[$i]['forum_id']]['auth_read']) or (!$is_auth_ary[$x_forum_data[$i]['forum_id']]['auth_view']))
{
if ($except_forum_id == '\'start\'')
{
$except_forum_id = $x_forum_data[$i]['forum_id'];
}
else
{
$except_forum_id .= ',' . $x_forum_data[$i]['forum_id'];
}
}
}
$sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, t.topic_views, t.topic_replies, p.post_id, p.poster_id, p.post_time, u.user_id, u.username, f.forum_id, f.forum_name
FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . USERS_TABLE . " AS u, " . FORUMS_TABLE . " AS f
WHERE t.forum_id NOT IN (" . $except_forum_id . ")
AND t.forum_id = f.forum_id
AND t.topic_status <> 2
AND p.post_id = t.topic_last_post_id
AND p.poster_id = u.user_id
ORDER BY p.post_id DESC
LIMIT " . $CFG['number_recent_topics'];
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not query recent topics information', '', __LINE__, __FILE__, $sql);
}
$number_recent_topics = $db->sql_numrows($result);
$last_x_row = array();
while ($row = $db->sql_fetchrow($result))
{
$last_x_row[] = $row;
}
for ($i = 0; $i < $number_recent_topics; $i++)
{
$template->assign_block_vars('last_x_topic_row', array(
'L_TITLE' => $last_x_row[$i]['topic_title'],
'L_REPLIES' => $last_x_row[$i]['topic_replies'],
'U_TITLE' => append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $last_x_row[$i]['post_id']) . '#' . $last_x_row[$i]['post_id'],
'U_FORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $last_x_row[$i]['forum_id']),
'U_POSTER' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $last_x_row[$i]['user_id']),
'S_FORUM' => $last_x_row[$i]['forum_name'],
'S_POSTER' => $last_x_row[$i]['username'],
'S_POSTTIME' => create_date($board_config['default_dateformat'], $last_x_row[$i]['post_time'], $board_config['board_timezone']),
)
);
}
$template->assign_vars(array(
'L_LAST_X' => sprintf($lang['l_last_x'], $CFG['number_recent_topics']),
'L_LAST_TOPIC' => $lang['l_last_topic'],
'L_LAST_FORUM' => $lang['l_last_forum'],
'L_LAST_REPLY' => $lang['l_last_reply'],
'L_LAST_WR' => $lang['l_last_wr'],
'L_LAST_DATE' => $lang['l_last_date'],
)
);
//
//-- [-] MOD: son x duyuru -------------------------------------------------
#
##-----[ AÇ ]-------------------------------------------------------------------------
#
languages/lang_turkish/lang_main.php
#
#------[ BUL ]------------------------------------------------------------------------
#
//
// That's all Folks!
// -------------------------------------------------
#
#------[ SONRASINA EKLE ]-------------------------------------------------------------
#
//
// last x topic
//
$lang['l_last_x'] = 'Son %s konu';
$lang['l_last_topic'] = 'Konu';
$lang['l_last_forum'] = 'Forum';
$lang['l_last_reply'] = 'Cevap';
$lang['l_last_wr'] = 'Son Yazan';
$lang['l_last_date'] = 'Son Cevap Tarihi';
#
##-----[ AÇ ]-------------------------------------------------------------------------
#
templates/subSilver/index_body.tpl
#
#------[ BUL ]------------------------------------------------------------------------
#
<table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">
<tr>
<td align="left" valign="bottom"><span class="gensmall">
#
#------[ ÖNCESİNE EKLE ]--------------------------------------------------------------
#
<!-- [+] MOD: son x konu -->
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<th nowrap="nowrap" colspan="5">{L_LAST_X}</th>
</tr>
<tr>
<td class="cat" align="center" width="100%"><span class="genmed"><b>{L_LAST_TOPIC}</b></span></td>
<td class="cat" align="center"><span class="genmed"> <b>{L_LAST_FORUM}</b> </span></td>
<td class="cat" align="center"><span class="genmed"> <b>{L_LAST_REPLY}</b> </span></td>
<td class="cat" align="center" nowrap="nowrap"><span class="genmed"> <b>{L_LAST_WR}</b> </span></td>
<td class="cat" align="center" nowrap="nowrap"><span class="genmed"> <b>{L_LAST_DATE}</b> </span></td>
</tr>
<!-- BEGIN last_x_topic_row -->
<tr>
<td class="row1 gensmall" align="left" nowrap="nowrap"> <a href="{last_x_topic_row.U_TITLE}">{last_x_topic_row.L_TITLE}</a> </td>
<td class="row1 gensmall" align="right" nowrap="nowrap"> <a href="{last_x_topic_row.U_FORUM}">{last_x_topic_row.S_FORUM}</a> </td>
<td class="row1 gensmall" align="center" nowrap="nowrap"> {last_x_topic_row.L_REPLIES} </td>
<td class="row1 gensmall" align="right" nowrap="nowrap"> <a href="{last_x_topic_row.U_POSTER}">{last_x_topic_row.S_POSTER}</a> </td>
<td class="row1 gensmall" align="right" nowrap="nowrap"> {last_x_topic_row.S_POSTTIME} </td>
</tr>
<!-- END last_x_topic_row -->
</table>
<br />
<!-- [-] MOD: son x konu -->
#
##-----[ TÜM DOSYALARI KAYDET/KAPAT ]-------------------------------------------------
#
# SON