bir sıra halinde çıkma ihtimnali varmı ben çok uraştım yapamadım yardımlarınızı bekliyorum.
## easymod compliant
########################################################################################################
## MOD Title: Top X Posters
## MOD Author: AbelaJohnB < abela@johnabela.com > (John B. Abela) http://www.johnabela.com/mods/
## MOD Description: Allows you to post the "Top 'x'" members of your forum on your forum.
## MOD Version: 1.0.2
##
## Installation Level: Easy
## Installation Time: ~5 Minutes
## Files To Edit:
## index.php
## includes/functions.php
## templates/subSilver/index_body.tpl
## Included Files:
## templates/subSilver/images/top_posters.gif
########################################################################################################
## Author Notes:
## Copyright © John B. Abela, < abela@johnabela.com >
##
## I do not support my MOD's anywhere except at http://www.johnabela.com/mods/ so please
## visit there for support. If you intend to take my work and modify it, you must retain my above
## Copyright within any install file. This does not mean you have to ask me to -use- this MOD,
## but that does mean you cannot -distribute- this MOD, in modified or non-modified format,
## without my copyright left intact. Contact me at: abela@johnabela.com - www.JohnAbela.Com
##
## This MOD, like all phpBB MOD's, is released under the GNU/GPL License. A copy of this license
## should have been included with the distribution package that included this install.txt file.
## If it was not, chances are you are using a version of this MOD that very likely has been edited
## by someone other than myself, and thus, perhaps, a greater security risk to you.
##
## Possible Future Plans:
## I have been told my SQL statements do not work for PostGreSQL.
## It has been a long time since I worked with that SQL db. If someone knows the fix I
## will correct my MOD and release a new version with credit given where credit is due.
##
##
## ~ John B. Abela - (aka: AbelaJohnB) http://www.johnabela.com/mods/ - abela@johnabela.com
##
## Stop By And Say Hello If You Feel Like It :)
##
## I maintain a "Mailing Group" for email notification of any new/updated MOD's. Just stop by my
## forum, register, than join the Group within the Usersgroup section of my MOD Forums!
########################################################################################################
## Usage Notes:
##
## You can specific the amount of members it returns by chaning the function input string.
##
## Example:
## top_posters('10', x, x) will return Top Ten Members
## top_posters('5', x, x) will return Top Five Members
##
## If you want to limit ADMIN and/or MOD from showing, use the following methods:
##
## Example:
## top_posters('10', 1, 1) Top Ten Members, Show both ADMIN & MOD
## top_posters('10', 1, 0) Top Ten Members, Show both ADMIN, but not MOD
## top_posters('10', 0, 1) Top Ten Members, Show both MOD, but not ADMIN
## top_posters('10', 0, 0) Top Ten Members, Show neither ADMIN nor MOD
##
########################################################################################################
## Issues Beyond My Control:
##
## Now, a note about "post counts not matching" that everybody complains to me about....
##
## This is NOT a bug in MY CODE. Rather it is a situation caused by normal forum usage.
## What you need to do to keep the post-counts syncronized is install and regularly run a
## MOD by R45 called: Resync User Post Count
## You can download this MOD at:
## http://prdownloads.sourceforge.net/r45phpbbmods/resync_user_pcounts-1.2.1.zip?download
## I have no idea if it is updated for the latest version of phpBB. I do not maintain this
## MOD and have no intention of doing so. Hound on R45 about any outdatedness, not me!
##
########################################################################################################
## MOD History:
##
## 2005-01-13 - Version 1.0.2
## - Updated For phpBB 2.0.11
##
## 2003-07-16 - Version 1.0.1
## - Added Style Features and Limiting ADMIN/MOD AUTH
##
## 2003-07-14 - Version 1.0.0
## - Initial Release
##
########################################################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
########################################################################################################
#
#-----[ COPY ]------------------------------------------
#
copy top_users.gif to templates/subSilver/images/top_users.gif
#
#-----[ OPEN ]------------------------------------------
#
index.php
#
#-----[ FIND ]------------------------------------------
#
'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//
// START MOD: TOP 'X' USERS (AbelaJohnB)
//
// PLEASE SEE THE INSTALL FILE FOR FURTHER INFORMATION ON WHAT TO DISPLAY AND HOW MANY TO DISPLAY.
//
'TOP_POSTERS' => top_posters('10', 1, 1), // Replace This Line If You Want Alternative Settings Displayed
'L_TOP_POSTERS' => $lang['Top_Posters'],
//
// END MOD: TOP 'X' USERS (AbelaJohnB)
//
#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//
//////////////////////////////////////////////////////////////////////////////////////////////////
// START MOD: TOP 'X' USERS (AbelaJohnB)
//
// This function will be used to acquire the "Top 'x'" members of your forum.
// It can be called on any page that this file is included on.
// You can specific the amount of members it returns by chaning the function input string.
// Example:
// top_posters('10', x, x) will return Top Ten Members
// top_posters('5', x, x) will return Top Five Members
//
// If you want to limit ADMIN and/or MOD from showing, use the following methods:
//
// top_posters('10', 1, 1) Top Ten Members, Show both ADMIN & MOD
// top_posters('10', 1, 0) Top Ten Members, Show both ADMIN, but not MOD
// top_posters('10', 0, 1) Top Ten Members, Show both MOD, but not ADMIN
// top_posters('10', 0, 0) Top Ten Members, Show neither ADMIN nor MOD
//
//////////////////////////////////////////////////////////////////////////////////////////////////
function top_posters($str_input, $show_admin, $show_mod)
{
global $db, $phpEx, $theme;
// Show All
if ( ( $show_admin == '1' ) && ( $show_mod == '1' ) )
{
$sql = "SELECT u.user_id, u.username, u.user_posts, u.user_level, count(u.user_id) as user_posts
FROM " . USERS_TABLE . " u, " . POSTS_TABLE . " p
WHERE (u.user_id <> " . ANONYMOUS . ") AND (u.user_id = p.poster_id)
GROUP BY user_id, username
ORDER BY user_posts DESC
LIMIT $str_input";
}
// Show Admin But Not Moderators
elseif ( ( $show_admin == '1' ) && ( $show_mod == '0' ) )
{
$sql = "SELECT u.user_id, u.username, u.user_posts, u.user_level, count(u.user_id) as user_posts
FROM " . USERS_TABLE . " u, " . POSTS_TABLE . " p
WHERE (u.user_id <> " . ANONYMOUS . ") AND (u.user_id = p.poster_id) AND (u.user_level != " . MOD . ")
GROUP BY user_id, username
ORDER BY user_posts DESC
LIMIT $str_input";
}
// Show Moderators But Not Admins
elseif ( ( $show_admin == '0' ) && ( $show_mod == '1' ) )
{
$sql = "SELECT u.user_id, u.username, u.user_posts, u.user_level, count(u.user_id) as user_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 . ")
GROUP BY user_id, username
ORDER BY user_posts DESC
LIMIT $str_input";
}
// Show Neither Admins Nor Moderators
else/// ( ( $show_admin == '0' ) && ( $show_mod == '0' ) )
{
$sql = "SELECT u.user_id, u.username, u.user_posts, u.user_level, count(u.user_id) as user_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 (u.user_level != " . MOD . ")
GROUP BY user_id, username
ORDER BY user_posts DESC
LIMIT $str_input";
}
//
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query forum top poster information', '', __LINE__, __FILE__, $sql);
}
// $top_posters = array();
while( $row = $db->sql_fetchrow($result) )
{
$style_color = '';
if ( $row['user_level'] == ADMIN )
{
$row['username'] = '<b>' . $row['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
}
else if ( $row['user_level'] == MOD )
{
$row['username'] = '<b>' . $row['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
}
$top_posters .= '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a> (' . $row['user_posts'] . '), ';
}
// return $top_posters;
return substr($top_posters,0,strlen($top_posters)-2); // strip last comma and space
}
//
// END MOD: TOP 'X' USERS (AbelaJohnB)
//
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ FIND ]------------------------------------------
#
</table>
<table width="100%" cellpadding="1" cellspacing="1" border="0">
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<tr>
<td class="catHead" colspan="2" height="28"><span class="cattitle">{L_TOP_POSTERS}</span></span></td>
</tr>
<tr>
<td class="row1" align="center" valign="middle" rowspan="2"><img src="templates/subSilver/images/top_users.gif" alt="{L_TOP_POSTERS}" /></td>
<td class="row1" align="left" width="100%"><span class="gensmall">{TOP_POSTERS}</span></td>
</tr>
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//
// START MOD: TOP 'X' USERS (AbelaJohnB)
//
$lang['Top_Posters'] = 'Top Posting Members';
//
// END MOD: TOP 'X' USERS (AbelaJohnB)
//
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Bu forumu görüntüleyenler: Kayıtlı kullanıcı yok ve 0 misafir