Ayın En Çok Mesaj Yazan Üyesi : Linux 700 Mesaj
Haftanın En Çok Mesay Yazan Üyesi : BeLgin 250 Mesaj
Günün En Çok Mesaj Yazan Üyesi : Linux 15 Mesaj
## MOD Başlık: Top Poster of the Month
## MOD Yazar: 3Di < 3D@you3d.za.net > (Marco) http://www.phpbb2italia.za.net/phpbb2/index.php
## MOD Yazar: Dicky < rfoote@tellink.net > (Richard Foote) http://dicky.askmaggymae.com
## MOD Açıklama: Have a Top Poster of the Month to show on your phpBB. Admin not included.
## MOD Sürüm: 0.3.0
##
## Kurulum zorluğu: (Easy)
## Kurulum süresi: 5 minutes
## Düzenlenecek dosyalar:
##
## index.php
## language/lang_english/lang_main.php
## templates/subSilver/index_body.tpl
##
## Yüklenecek dosyalar:
## N/A
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/
##############################################################
## Yazar notları:
##
## tested on a fresh phpBB 2.0.18 (localhost)
##
##############################################################
## MOD Geçmişi:
##
## 2005-11-02 - Sürüm 0.3.0 beta
## - core code partially re written, elapsed time updated in real time (after refresh).
## - added NoBody fake user in case of no top poster (abandoned board? )
## - added post/posts language bit
##
## 2005-10-28 - Sürüm 0.1.0 beta
## - first public release
##
## 2005-10-27 - Sürüm 0.0.1 alpha
## - first version in localhost
##############################################################
#
#-----[ AÇ ]------------------------------------------------
#
index.php
#
#-----[ BUL ]------------------------------------------------
#
//
// Start page proper
#
#-----[ ÖNCESİNE EKLE ]-----------------------------------------
#
// -- Top Poster of the Month add --------------
$today = time();
$date_today = gmdate("Y-m-d", $today);
list($year_cur, $month_cur, $day1) = split('-', $date_today);
$month_start_cur = gmmktime (0,0,0, $month_cur, 1, $year_cur); // Start time for current month
$month_end_cur = $today;
$month_start = $month_start_cur;
$month_end = $month_end_cur;
$sql = 'SELECT u.username, u.user_regdate, u.user_id, u.user_posts, p.poster_id, p.post_time, COUNT(p.post_id) AS total_posts
FROM ' . USERS_TABLE . ' u, ' . POSTS_TABLE . ' p
WHERE (u.user_id <> ' . ANONYMOUS . ')
AND (u.user_id = p.poster_id)
AND (u.user_level <> ' . ADMIN . ')
AND p.post_time BETWEEN ' . $month_start . ' AND ' . $month_end . '
GROUP BY u.user_id
ORDER BY total_posts DESC';
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Couldn't retrieve Top Poster of the Month's data', ', __LINE__, __FILE__, $sql);
}
// let's go with the loop
$posts_data = $db->sql_fetchrowset($result);
$num_items = count($posts_data);
$top_posts = $posts_data[0][total_posts]; // The first row will have the most posts since we ordered by total_posts
for ( $row = 0; $row < $num_items; $row++ )
{
while ( list( $key, $value ) = each( $posts_data ) )
{
if ( $value[total_posts] == $top_posts ) // We have a poster with a match of the top_posts
{
$topm_un = $posts_data[0]['username'];
$topm_rd = $posts_data[0]['user_regdate'];
$topm_id = $posts_data[0]['user_id'];
$topm_up = $posts_data[0]['user_posts'];
$topm_tp = $posts_data[0]['total_posts']; // posts made into the selected elapsed time
}
}
}
if ($topm_tp <1)
{
$topm_un = $lang['Top_Username_None'];
}
if ($topm_tp ==1)
{
$lang['Top_Posts'] = $lang['Top_Post'];
}
// -- Top Poster of the Month end --------------
#
#-----[ BUL ]------------------------------------------------
#
'FORUM_LOCKED_IMG' => $images['forum_locked'],
#
#-----[ SONRASINA EKLE ]-----------------------------------------
#
// --- Top Poster of the Month add -------------
'TOPM_UN' =>sprintf($lang['Top_Username'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$topm_id") . ">', $topm_un, '</a>'),
'TOPM_RD' => $topm_rd,
'TOPM_ID' => $topm_id,
'TOPM_UP' => $topm_up,
// --- Top Poster of the Month end -------------
#
#-----[ BUL ]------------------------------------------------
#
'L_ONLINE_EXPLAIN' => $lang['Online_explain'],
#
#-----[ SONRASINA EKLE ]------------------------------------------
#
// --- Top Poster of the Month add -------------
'L_TOPM_UNA_L' => $lang['Top_Username'],
'L_TOPM_UID_L' => $lang['Top_User_ID'],
'L_TOPM_UTP_L' => $lang['Top_User_Posts'],
'L_TOPM_URD_L' => $lang['Top_User_Registration_date'],
'L_TOPM_UPO_L' => sprintf($lang['Top_User_Month_Posts'], $topm_tp),
'L_TOPM_UNN_L' => $lang['Top_Username_None'],
'L_TOPM_POSTS_L' => $lang['Top_Posts'],
// --- Top Poster of the Month end -------------
#
#-----[ AÇ ]------------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ BUL ]------------------------------------------------
#
?>
#
#-----[ ÖNCESİNE EKLE ]------------------------------------------
#
// -- Top Poster of the Month add --------------
$lang['Top_Username'] = 'The Top Poster of the Month till this moment is <b>%s%s%s</b>';
$lang['Top_User_Month_Posts'] = ' with a total of <b>%d</b>';
$lang['Top_Posts'] = ' posts';
$lang['Top_Post'] = ' post';
$lang['Top_Username_None'] = '<b>NoBody</b>';
// --- Top Poster of the Month end -------------
#
#-----[ AÇ ]------------------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ BUL ]----------------------------------------
# the line is longer..
<td class="row1" align="center" valign="middle" rowspan="2">
#
#-----[ SATIR İÇİNDE BUL ]----------------------------------------
#
rowspan="2"
#
#-----[ SATIR İÇİNDE, ile DEĞİŞTİR ]--------------------------------
#
rowspan="3"
#
#-----[ BUL ]----------------------------------------
# the line is longer...
<td class="row1" align="left" width="100%"><span class="gensmall">{TOTAL_POSTS}
#
#-----[ BUL ]----------------------------------------
#
</tr>
#
#-----[ SONRASINA EKLE ]----------------------------------
#
<tr>
<td class="row1" align="left"><span class="gensmall">{TOPM_UN}{L_TOPM_UPO_L}{L_TOPM_POSTS_L}</span>
</td>
</tr>
#
#-----[ TÜM DOSYALARI KAYDET/KAPAT ]--------------------------------
#
# Eklentinin Sonu
Bu forumu görüntüleyenler: Kayıtlı kullanıcı yok ve 0 misafir