- - phpBB2


##############################################################
## : -
## MOD :
## -
## .
##
## :
## : 5-10
## : 4
## includes/functions.php
## includes/usercp_viewprofile.php
## language/lang_bulgarian/lang_main.php
## templates/subSilver/profile_view_body.tpl
##
## :
##
##############################################################
## , Back Up
##############################################################
#
#-----[ ]------------------------------------------------
#
includes/functions.php
#
#-----[ ]------------------------------------------------
#
?>
#
#-----[ ]------------------------------------------
#
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);
}
#
#-----[ ]------------------------------------------------
#
includes/usercp_viewprofile.php
#
#-----[ ]------------------------------------------------
#
//
// Generate page
//
#
#-----[ ]------------------------------------------
#
$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'];
#
#-----[ ]------------------------------------------------
#
'POST_PERCENT_STATS' => sprintf($lang['User_post_pct_stats'], $percentage),
#
#-----[ ]------------------------------------------
#
'MOSTACTIVE_FORUM' => $user_mostactive_forum,
#
#-----[ ]------------------------------------------------
#
'L_SEARCH_USER_POSTS' => sprintf($lang['Search_user_posts'], $profiledata['username']),
#
#-----[ ]------------------------------------------
#
'L_MOST_ACTIVE' => $lang['Most_active'],
'L_MOST_ACTIVE_POSTS' => sprintf($lang['Most_active_posts'], $user_mostactive_posts),
#
#-----[ ]------------------------------------------------
#
language/lang_bulgarian/lang_main.php
#
#-----[ ]------------------------------------------------
#
?>
#
#-----[ ]------------------------------------------
#
$lang['Most_active'] = '- : ';
$lang['Most_active_posts'] = ' %s ';
#
#-----[ ]------------------------------------------------
#
templates/subSilver/profile_view_body.tpl
#
#-----[ ]------------------------------------------------
#
<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>
#
#-----[ ]------------------------------------------
#
<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>
#
#-----[ ]--------------------------------
#
#

- .
!


/ /
: Genius_m
0:12 23-09-2010
, ...
: Botzo
3:42 29-09-2010
.
1