Ez portal vraag
Geplaatst: 26 nov 2006, 14:05
Ik heb laatst een mod voor Ezportal geinstaleert dat je wat informatie ziet van de nieuwste gebruiker, alleen het probleem is nu als je inlogt zie je het niet meer 

Code: Selecteer alles
##############################################################
## MOD Title: Welcome New User Block
## MOD Author: cirestodd < cirestodd@toddalbert.com > (Todd Albert) http://forum.toddalbert.com
## MOD Description: Adds a block to your ezPortal page welcoming the newest user.
## MOD Version: 0.1 [BETA]
##
## Installation Level: easy
## Installation Time: 10 Minutes
## Files To Edit: (4)
## language/lang_english/lang_main.php
## includes/functions.php
## portal.php
## templates/subSilver/portal_body.tpl
##############################################################
## 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 requires Smartor's ezPortal (not tested with other portal pages),
## and requires the Online/Offline Indicator mod. Special thanks to Ricky_Racer
## for his help, patience, and testing!
##
###
##############################################################
## MOD History:
##
## 2003-09-03 - version 0.1 BETA
## - First BETA release.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all, Folks!
// -------------------------------------------------
#
#-----[ BEFORE, ADD ]-----------------------------------
#
$lang['our_newest_user'] = 'Nieuwste lid';
#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------
#
case 'newestuser':
$sql = "SELECT user_id, username
FROM " . USERS_TABLE . "
WHERE user_id <> " . ANONYMOUS . "
ORDER BY user_id DESC
LIMIT 1";
#
#-----[ IN-LINE FIND ]------------------------------------------
#
$sql = "SELECT user_id, username
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, user_avatar, user_regdate, user_avatar_type, user_allow_viewonline, user_from, user_rank, user_session_time
#
#-----[ OPEN ]------------------------------------------
#
portal.php
#
#-----[ FIND ]------------------------------------------
#
//
// End session management
//
#
#-----[ AFTER, ADD ]------------------------------------
#
$sql = "SELECT *
FROM " . RANKS_TABLE . "
ORDER BY rank_special, rank_min";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain ranks information', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
$ranksrow[] = $row;
}
$db->sql_freeresult($result);
#
#-----[ FIND ]------------------------------------------
#
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
$newest_uid = $newest_userdata['user_id'];
#
#-----[ AFTER, ADD ]------------------------------------
#
$newest_user_regdate = $newest_userdata['user_regdate'];
$newest_avatar = $newest_userdata['user_avatar'];
$newest_av_type = $newest_userdata['user_avatar_type'];
$newest_joined = $lang['Joined'] . ': ' . create_date($lang['DATE_FORMAT'], $newest_user_regdate, $board_config['board_timezone']);
$newest_from = ( $newest_userdata['user_from'] ) ? $lang['Location'] . ': ' . $newest_userdata['user_from'] : '';
$newest_user_posts = ( $newest_userdata['user_posts'] ) ? $lang['Posts'] . ': ' . $newest_userdata['user_posts'] : $lang['Posts'] . ': 0';
$newest_rank = $newest_userdata['user_rank'];
#
#-----[ FIND ]------------------------------------------
#
//
// END: Avatar On Index MOD
//
#
#-----[ AFTER, ADD ]------------------------------------
#
// ---------------------------------------------------------------------------------------------------------
//
// BEGIN WELCOME NEW USER MOD
//
// ---------------------------------------------------------------------------------------------------------
$navatar_img = '';
if ( $newest_userdata['user_avatar_type'] )
{
switch( $newest_userdata['user_avatar_type'] )
{
case USER_AVATAR_UPLOAD:
$navatar_img = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $newest_userdata['user_avatar'] . '" alt="" border="0" />' : '';
break;
case USER_AVATAR_REMOTE:
$navatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $newest_userdata['user_avatar'] . '" alt="" border="0" />' : '';
break;
case USER_AVATAR_GALLERY:
$navatar_img = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $newest_userdata['user_avatar'] . '" alt="" border="0" />' : '';
break;
}
}
// Generate ranks, set them to empty string initially.
$newest_rank = '';
$newest_rank_image = '';
if ( $newest_userdata['user_rank'] )
{
for($i = 0; $i < count($ranksrow); $i++)
{
if ( $newest_userdata['user_rank'] == $ranksrow[$i]['rank_id'] && $ranksrow[$i]['rank_special'] )
{
$newest_rank = $ranksrow[$i]['rank_title'];
$newest_rank_image = ( $ranksrow[$i]['rank_image'] ) ? '<img src="' . $ranksrow[$i]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
}
}
}
else
{
for($i = 0; $i < count($ranksrow); $i++)
{
if ( $newest_userdata['user_posts'] >= $ranksrow[$i]['rank_min'] && !$ranksrow[$i]['rank_special'] )
{
$newest_rank = $ranksrow[$i]['rank_title'];
$newest_rank_image = ( $ranksrow[$i]['rank_image'] ) ? '<img src="' . $ranksrow[$i]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
}
}
}
//Online/Offline
if (($newest_userdata['user_session_time'] >= ( time() - 300 )) && ($newest_userdata['user_allow_viewonline']))
{
$on_off_hidden = '<img src="' . $images['icon_online'] . '" alt="' . $lang['Online'] . '" title="' . $lang['Online'] . '" border="0" />';
}
else if (($newest_userdata['user_allow_viewonline']) == 0)
{
$on_off_hidden = '<img src="' . $images['icon_hidden'] . '" alt="' . $lang['Hidden'] . '" title="' . $lang['Hidden'] . '" border="0" />';
}
else
{
$on_off_hidden = '<img src="' . $images['icon_offline'] . '" alt="' . $lang['Offline'] . '" title="' . $lang['Offline'] . '" border="0" />';
}
// -------------------------------------------------------------------------------------
//
// END WELCOME NEW USER MOD
//
// -------------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------
#
// Welcome Avatar
'L_NAME_WELCOME' => $lang['Welcome'],
'U_NAME_LINK' => $name_link,
'AVATAR_IMG' => $avatar_img,)
#
#-----[ IN-LINE FIND ]------------------------------------------
#
$avatar_img
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
# (before the parenthesis, be sure to include the comma)
,
// Newest User
'L_OUR_NEWEST_USER' => $lang['our_newest_user'],
'NEWEST_USER' => sprintf('<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$newest_uid") . '">' . $newest_user . '</a>'),
'NEWEST_ONLINE' => $on_off_hidden,
'NEWEST_RANK' => $newest_rank,
'NEWEST_RANK_IMAGE' => $newest_rank_image,
'NEWEST_JOINED' => $newest_joined,
'NEWEST_POSTS' => $newest_user_posts,
'NEWEST_FROM' => $newest_from,
'NAVATAR_IMG' => $navatar_img
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------
#
# EoM