#####################################################################
##
## Only do this if you prevously installed this MOD without function to list top donors in index page.
##
#####################################################################
#
#-----[ SQL ]-------------------------------------------------
#
INSERT INTO phpbb_config(config_name, config_value) VALUES('list_top_donors', '0');
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]------------------------------------------------
#
{L_LW_DISPLAY_X_DONORS}
{L_LW_DISPLAY_X_DONORS_EXPL
#
#-----[ AFTER, ADD ]------------------------------------------
#
{L_LW_TOP_DONORS}
{L_LW_TOP_DONORS_EXPLAIN}
#
#-----[ OPEN ]------------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]------------------------------------------------
#
"L_LW_DONATION_POINTS_EXPLAIN" => $lang['L_LW_DONATION_POINTS_EXPLAIN'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
"LW_TOP_DONORS" => $new['list_top_donors'],
"L_LW_TOP_DONORS" => $lang['L_LW_TOP_DONORS'],
"L_LW_TOP_DONORS_EXPLAIN" => $lang['L_LW_TOP_DONORS_EXPLAIN'],
#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------------
#
//-- fin mod : Loewen Enterprise - Donation MOD v1.0.0.1 ----------------------------------------------------
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$lang['L_LW_TOP_DONORS'] = 'Display top donors: ';
$lang['L_LW_TOP_DONORS_EXPLAIN'] = 'If you want to display top donors, enter 1; If you want to display last donors, enter 0.';
#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------------
#
//-- fin mod : Loewen Enterprise - Donation MOD v1.0.0.1 ----------------------------------------------------
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$lang['L_LW_TOP_DONORS_TITLE'] = 'Top %s Donors';
#
#-----[ OPEN ]------------------------------------------------
#
index.php
#
#-----[ FIND ]------------------------------------------------
#
if( strlen($donordesc) > 0)
{
$donordesc .= '' . $lang['LW_CURRENT_DONORS'] . '';
$donordesc .= ']';
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
$donationtitle = "";
if(intval($board_config['list_top_donors']) == 1)
{
$donationtitle = sprintf($lang['L_LW_TOP_DONORS_TITLE'], $board_config['dislay_x_donors']) . ' ' . $donordesc;
}
else
{
$donationtitle = sprintf($lang['L_LW_LAST_DONORS'], $board_config['dislay_x_donors']) . ' ' . $donordesc;
}
#
#-----[ FIND ]------------------------------------------------
#
# This is a partial search, then whole line maybe longer
#
'L_LW_LAST_DONORS' =>
#
#-----[ REPLACE WITH ]------------------------------------------------
#
# Replace the whole line with following setence
#
'L_LW_LAST_DONORS' => $donationtitle,
#
#-----[ OPEN ]------------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------------
#
# Replace the whole function definition with following replacement.
#
function last_donors()
{
global $db, $phpEx, $theme, $lang, $board_config;
// Show All
$count = 0;
$sql = "SELECT COUNT(*) FROM " . ACCT_HIST_TABLE . " a, " . USERS_TABLE . " u" . " WHERE a.comment LIKE 'donate from%' AND u.user_id = a.user_id";
//in between content are omitted.
$last_donors .= '' . $lang['LW_MORE_DONORS'] . '';
}
if($count == 0)
{
$last_donors = $lang['LW_NO_DONORS_YET'];
}
return $last_donors;
}
#
#-----[ REPLACE WITH ]------------------------------------------------
#
function last_donors()
{
global $db, $phpEx, $theme, $lang, $board_config;
// Show All
$count = 0;
$sql = "SELECT COUNT(*) FROM " . ACCT_HIST_TABLE . " a, " . USERS_TABLE . " u" . " WHERE a.comment LIKE 'donate from%' AND u.user_id = a.user_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query forum donors information', '', __LINE__, __FILE__, $sql);
}
if($row = $db->sql_fetchrow($result))
{
$count = $row['COUNT(*)'];
}
$orderby = "ORDER BY lw_date DESC";
if(intval($board_config['list_top_donors']) == 1)
{
$orderby = "ORDER BY lw_money DESC";
}
$str_input = intval($board_config['dislay_x_donors']);
$sql = "SELECT a.*, u.* FROM " . ACCT_HIST_TABLE . " a, " . USERS_TABLE . " u" . " WHERE a.comment LIKE 'donate from%' AND u.user_id = a.user_id" .
" $orderby LIMIT $str_input";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query forum donors information', '', __LINE__, __FILE__, $sql);
}
$last_donors = '';
while( $row = $db->sql_fetchrow($result) )
{
$style_color = '';
if ( $row['user_level'] == ADMIN )
{
$row['username'] = '' . $row['username'] . '';
$style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
}
else if ( $row['user_level'] == MOD )
{
$row['username'] = '' . $row['username'] . '';
$style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
}
if($row['user_id'] == ANONYMOUS)
{
$last_donors .= $lang['LW_ANONYMOUS_DONOR'] . '(' . $row['MNY_CURRENCY'] . sprintf("%.2f", $row['lw_money']) . '), ';
}
else
{
$last_donors .= '' . $row['username'] . '(' . $row['MNY_CURRENCY'] . sprintf("%.2f", $row['lw_money']) . '), ';
}
}
if($count > $str_input)
{
$last_donors .= '' . $lang['LW_MORE_DONORS'] . '';
}
if($count == 0)
{
$last_donors = $lang['LW_NO_DONORS_YET'];
}
return $last_donors;
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
No hay comentarios:
Publicar un comentario