Hm...o.k. try this
SQL
Code: Alles auswählen
INSERT INTO phpbb_config (config_name, config_value) VALUES ('amount_top_thanked_given', '10');
Code: Alles auswählen
<?php
/**
*
* @package phpBB3
* @functions_topthankedgiven.php
* @copyright (c) 2011 Mahony
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Obtain Top Thanked given information
**/
function get_top_thanked_given()
{
global $cache, $config, $db, $user, $auth;
global $template;
$top_thanked_given = $config['amount_top_thanked_given'];
// count top x posters
$sql = 'SELECT username, user_id, user_type, user_colour, user_thanked_others AS num_thanks_given
FROM ' . USERS_TABLE . '
WHERE user_id <> ' . (int) ANONYMOUS . '
AND user_type <> ' . (int) USER_IGNORE . '
AND user_thanked_others > 0
ORDER BY user_thanked_others DESC';
$result = $db->sql_query_limit($sql, $top_thanked_given, 0, 0);
$top_thanked_given_list = '';
while ($row = $db->sql_fetchrow($result))
{
$top_thanked_given_list .= (($top_thanked_given_list != '') ? ', ' : '') . get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']) . ' ('. $row['num_thanks_given'] .')';
}
$db->sql_freeresult($result);
// Assign index specific vars
$template->assign_vars(array(
'TOP_THANKED_GIVEN_LIST' => $top_thanked_given_list));
//End Thank Post MOD
}
?>
Find
Code: Alles auswählen
?>
Code: Alles auswählen
// Top Thanked settings
$lang = array_merge($lang, array(
'AMOUNT_TOP_THANKED_GIVEN' => 'Number of Top Thanked given to show on Index',
'AMOUNT_TOP_THANKED_GIVEN_EXPLAIN' => 'Shows the Top X Thanked given on the Index. Leave blank or type 0 to disable feature',
));
Find
Code: Alles auswählen
?>
Code: Alles auswählen
// Top Thanked
$lang = array_merge($lang, array(
'TOP_THANKED_GIVEN_LIST' => 'Most Thanked given',
));
Find
Code: Alles auswählen
'legend2' => 'WARNINGS',
'warnings_expire_days' => array('lang' => 'WARNINGS_EXPIRE', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
Code: Alles auswählen
'legend4' => 'TOP_THANKED_GIVEN',
'amount_top_thanked_given' => array('lang' => 'AMOUNT_TOP_THANKED_GIVEN', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => true),
Find
Code: Alles auswählen
// Assign index specific vars
Code: Alles auswählen
//Generate top thanked given list if enabled
if ($config['amount_top_thanked_given'])
{
if (!function_exists('get_top_thanked_given'))
{
include_once($phpbb_root_path . 'includes/functions_topthankedgiven.' . $phpEx);
}
get_top_thanked_given();
}
Find
Code: Alles auswählen
<!-- IF NEWEST_USER -->
<h3>{L_STATISTICS}</h3>
<p>{TOTAL_POSTS} • {TOTAL_TOPICS} • {TOTAL_USERS} • {NEWEST_USER}</p>
<!-- ENDIF -->
Code: Alles auswählen
<!-- IF TOP_THANKED_GIVEN_LIST -->
<h3>{L_TOP_THANKED_GIVEN}</h3>
<p>{TOP_THANKED_GIVEN_LIST}</p>
<!-- ENDIF -->
edit by Mahony (error removed)