Bilgisayar donanımları, kullanım kolaylıkları, yardım konuları ve teknolojik haberler.
gönderen Mitnick Condor » Pzr Ağu 26, 2007 12:25
Bu mod sayesinde profilde kullanıcının en aktif olduğu yeri görebilirsiniz.Kesinlikle tavsiyemdir.Kendi siteme kurdum onaylıyorum.- İm (Kod): Tümünü seç
##############################################################
## MOD İSMİ : Most active in forum - in Profile
## MOD YAPIMCISI: Kleopatra < admin@kleo.org > (Kathleen) http://www.kleo.org
## MOD TANIMI: This hack displays a new field in profiles that displays
## which forum the user has been the most active in and how
## many posts he or she has in that forum.
## MOD Version: 1.1
##
## KURULUM SEVİYESİ : BASİT
## KURULUM SÜRESİ 10 DK
## EDİTLENECEK DOSYALAR: includes/functions.php, includes/usercp_viewprofile.php,
## templates/subSilver/profile_view_body.tpl,
## language/lang_english/lang_main.php
##
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## This MOD is EasyMOD Friendly!
##
## Works with phpBB2.0.0 - 2.0.10
##
## For lang_german replace in language/lang_german/lang_main.php
## $lang['Most_active'] = 'Most Active in: ';
## $lang['Most_active_posts'] = 'with %s posts';
## with
## $lang['Most_active'] = 'Am meisten aktiv in: ';
## $lang['Most_active_posts'] = 'mit %s Beiträgen';
##
##############################################################
## MOD History:
##
## 2004-11-18 - Version 1.1
## - add - users with no access for hidden forums, don't see it listed
## - fix - displays wrong forum name on particular forums and members
## 2004-11-16 - Version 1.0
## - first release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ AÇ]------------------------------------------------
#
includes/functions.php
#
#-----[ BUL ]------------------------------------------------
#
?>
#
#-----[ ÖNCESİNE EKLE]------------------------------------------
#
function get_forummostactive($user)
{
global $db, $userdata;
if (intval($user) == 0)
{
$user = trim(htmlspecialchars($user));
$user = substr(str_replace("\'", "'", $user), 0, 25);
$user = str_replace("'", "\'", $user);
}
else
{
$user = intval($user);
}
$sql_forum = "SELECT forum_id, forum_name
FROM " . FORUMS_TABLE . "
ORDER BY forum_id";
if ( !($result = $db->sql_query($sql_forum)) )
{
message_die(GENERAL_ERROR, 'Could not obtain forums list', '', __LINE__, __FILE__, $sql_forum);
}
while ($line = mysql_fetch_array($result, MYSQL_ASSOC))
{
$mostactive_id[] = $line['forum_id'];
$mostactive_name[$line['forum_id']] = $line['forum_name'];
}
$count_mostactive_id = count($mostactive_id);
$mostactive_posts = 0;
$num_result = 0;
foreach($mostactive_id as $i)
{
$is_auth = auth(AUTH_VIEW, $i, $userdata);
if ( $is_auth['auth_view'] == 1 )
{
$sql_most = "SELECT *
FROM " . POSTS_TABLE . "
WHERE forum_id = $i AND poster_id = $user";
if ( !($result = $db->sql_query($sql_most)) )
{
message_die(GENERAL_ERROR, 'Tried obtaining data for a non-existent user', '', __LINE__, __FILE__, $sql_most);
}
$num_result = mysql_num_rows($result);
if ($num_result > $mostactive_posts)
{
$mostactive_posts = $num_result;
$mostactive_foren_id = $i;
$mostactive_forum_name = $mostactive_name[$i];
}
}
}
return array($mostactive_foren_id, $mostactive_posts, $mostactive_forum_name);
}
#
#-----[ AÇ ]------------------------------------------------
#
includes/usercp_viewprofile.php
#
#-----[ BUL ]------------------------------------------------
#
//
// Generate page
//
#
#-----[ ÖNCESİNE EKLE ]------------------------------------------
#
$user_mostactive = get_forummostactive($HTTP_GET_VARS[POST_USERS_URL]);
$user_mostactive_forum = '<a href="' . append_sid("viewforum.$phpEx?f=" . urlencode($user_mostactive['0'])) . '" class="genmed">' . $user_mostactive['2'] . '</a>';
$user_mostactive_posts = $user_mostactive['1'];
#
#-----[ BUL ]------------------------------------------------
#
'POST_PERCENT_STATS' => sprintf($lang['User_post_pct_stats'], $percentage),
#
#-----[ ARDINA EKLE ]------------------------------------------
#
'MOSTACTIVE_FORUM' => $user_mostactive_forum,
#
#-----[ BUL ]------------------------------------------------
#
'L_SEARCH_USER_POSTS' => sprintf($lang['Search_user_posts'], $profiledata['username']),
#
#-----[ ARDINA EKLE ]------------------------------------------
#
'L_MOST_ACTIVE' => $lang['Most_active'],
'L_MOST_ACTIVE_POSTS' => sprintf($lang['Most_active_posts'], $user_mostactive_posts),
#
#-----[ AÇ ]------------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ BUL ]------------------------------------------------
#
?>
#
#-----[ ÖNCESİNE EKLE ]------------------------------------------
#
$lang['Most_active'] = 'Most Active in: ';
$lang['Most_active_posts'] = 'with %s posts';
#
#-----[ AÇ ]------------------------------------------------
#
templates/subSilver/profile_view_body.tpl
#
#-----[ BUL ]------------------------------------------------
#
<td valign="top"><b><span class="gen">{POSTS}</span></b><br /><span class="genmed">[{POST_PERCENT_STATS} / {POST_DAY_STATS}]</span> <br /><span class="genmed"><a href="{U_SEARCH_USER}" class="genmed">{L_SEARCH_USER_POSTS}</a></span></td>
</tr>
#
#-----[ ARDINA EKLE ]------------------------------------------
#
<tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_MOST_ACTIVE}</span></td>
<td valign="top"><b><span class="gen">{MOSTACTIVE_FORUM}</span></b><br /><span class="genmed">{L_MOST_ACTIVE_POSTS}</span></td>
</tr>
#
#-----[ KAYDET VE KAPAT ]--------------------------------
#
# EoM
-
Mitnick Condor
- Üye
-
- İletiler: 26
- Kayıt: Pzr Mar 11, 2007 13:15
Şu dizine dön: Bilgisayar
Kİmler çevrİmİçİ
Bu dizini gezen kullanıcılar: Hiç kayıtlı kullanıcı yok ve 0 konuk