das mijn profiel het werkt niet
Maar misschien kunt u helpen?
Ik maak een stemfunctie op het profiel dus ik plaats wat script uit de cash mod maar dat pakt die niet.
Het is geen probleem om die cash.tpl in het tpl bestand te plaatsen maar in cash.php staat wel wat wat over gezet moet wordne naar de viewprofile. Ik zet hier effuh de tekst neer die naar viewprofile moet:
Code: Selecteer alles
<?php
/***************************************************************************
* cash.php
* -------------------
* begin : Wednesday, Jul 16, 2003
* copyright : (C) 2003 Xore
* email : mods@xore.ca
*
* $Id: cash.php,v 2.0.1.1 2003/09/26 01:20:53 Xore $
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
define('IN_PHPBB', true);
define('IN_CASHMOD', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_PROFILE);
init_userprefs($userdata);
//
// End session management
//
if ( !$userdata['session_logged_in'] )
{
redirect(append_sid("login.$phpEx?redirect=cash.$phpEx", true));
}
//$cash_table = array();
//$indices = array();
//get_cash_table($cash_table,$indices);
$mode = isset($HTTP_POST_VARS['mode'])?$HTTP_POST_VARS['mode']:(isset($HTTP_GET_VARS['mode'])?$HTTP_GET_VARS['mode']:(""));
switch( $mode )
{
//
//========================================[ Donate Code ]===========================
//
case "donate":
$ref = isset($HTTP_GET_VARS['ref'])?$HTTP_GET_VARS['ref']:'index';
$profiledata = get_userdata($HTTP_GET_VARS[POST_USERS_URL]);
if ( (!$profiledata) || ($profiledata['user_id'] == $userdata['user_id']) )
{
if ( ($ref == 'viewtopic') && isset($HTTP_GET_VARS[POST_POST_URL]) )
{
redirect(append_sid('viewtopic.'.$phpEx.'?'.POST_POST_URL.'='.$HTTP_GET_VARS[POST_POST_URL]) . '#' . $HTTP_GET_VARS[POST_POST_URL]);
exit;
}
else
{
redirect(append_sid("index.$phpEx"));
exit;
}
}
$target = $profiledata['user_id'];
//
// Load templates
//
$template->set_filenames(array(
'body' => 'cash_donate.tpl')
);
//
// Output page header
//
$page_title = $lang['Donate'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$hidden = '<input type="hidden" name="ref" value="' . $ref . '" />';
$hidden .= '<input type="hidden" name="' . POST_USERS_URL . '" value="' . $target . '" />';
if ( $ref == 'viewtopic' )
{
$hidden .= '<input type="hidden" name="' . POST_POST_URL . '" value="' . $HTTP_GET_VARS[POST_POST_URL] . '" />';
}
$template->assign_vars(array(
'S_DONATE_ACTION' => append_sid("cash.$phpEx?mode=donated"),
'S_HIDDEN_FIELDS' => $hidden,
'L_DONATE' => $lang['Donate'],
'L_FROM' => $lang['From'],
'L_TO' => $lang['To'],
'L_CONVERT' => $lang['Convert'],
'L_SELECT_ONE' => $lang['Select_one'],
'L_SUBMIT' => $lang['Submit'],
'L_RESET' => $lang['Reset'],
'L_AMOUNT' => $lang['Amount'],
'L_DONATE_TO' => sprintf($lang['Donate_to'],$profiledata['username']),
'L_MESSAGE' => $lang['Message'],
'TARGET' => $profiledata['username'],
'DONATER' => $userdata['username'])
);
while ( $c_cur = &$cash->currency_next($cm_i,CURRENCY_ENABLED | CURRENCY_DONATE) )
{
$template->assign_block_vars('cashrow',array( 'CASH_NAME' => $c_cur->name(),
'RECEIVER_AMOUNT' => $profiledata[$c_cur->db()],
'DONATER_AMOUNT' => $userdata[$c_cur->db()],
'S_DONATE_FIELD' => 'cash[' . $c_cur->id() . ']')
);
}
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
break;
//
//========================================[ Donated Code ]===========================
//
case "donated":
$ref = isset($HTTP_POST_VARS['ref'])?$HTTP_POST_VARS['ref']:'index';
$profiledata = get_userdata($HTTP_POST_VARS[POST_USERS_URL]);
if ( !$profiledata )
{
if ( ($ref == 'viewtopic') && isset($HTTP_POST_VARS[POST_POST_URL]) )
{
redirect(append_sid('viewtopic.'.$phpEx.'?'.POST_POST_URL.'='.$HTTP_POST_VARS[POST_POST_URL]) . '#' . $HTTP_POST_VARS[POST_POST_URL]);
exit;
}
else
{
redirect(append_sid("index.$phpEx"));
exit;
}
}
$target = new cash_user($profiledata['user_id'],$profiledata);
$donater = new cash_user($userdata['user_id'],$userdata);
if ( ($target->id() != $donater->id()) && isset($HTTP_POST_VARS['cash']) && is_array($HTTP_POST_VARS['cash']) )
{
$donate_array = array();
$donate = false;
while ( $c_cur = &$cash->currency_next($cm_i,CURRENCY_ENABLED | CURRENCY_DONATE) )
{
if ( isset($HTTP_POST_VARS['cash'][$c_cur->id()]) &&
is_numeric($HTTP_POST_VARS['cash'][$c_cur->id()]) )
{
$amount = cash_floatval($HTTP_POST_VARS['cash'][$c_cur->id()]);
if ( $amount > 0 )
{
$amount = ( $donater->has($c_cur->id(),$amount) ) ? $amount : $donater->amount($c_cur->id());
$donate_array[$c_cur->id()] = $amount;
$message_clause[] = $c_cur->display($amount,true);
$donate = true;
}
}
}
if ( $donate )
{
$donater->remove_by_id_array($donate_array);
$target->give_by_id_array($donate_array);
$action = array($donater->id(),
$donater->name(),
implode('</b>, <b>',$message_clause),
$target->id(),
$target->name());
cash_create_log(CASH_LOG_DONATE,$action,$HTTP_POST_VARS['message']);
if ( isset($HTTP_POST_VARS['message']) && ($HTTP_POST_VARS['message'] != '') && $userdata['user_allow_pm'] )
{
$privmsg_subject = sprintf($lang['Donation_recieved'],$userdata['username']);
$preamble = sprintf($lang['Has_donated'],$userdata['username'],implode('[/b], [b]',$message_clause),$userdata['username']);
$HTTP_POST_VARS['message'] = $preamble . $HTTP_POST_VARS['message'];
cash_pm($profiledata,$privmsg_subject,$HTTP_POST_VARS['message']);
}
}
if ( $ref == 'viewprofile' )
{
redirect(append_sid('profile.'.$phpEx.'?mode=viewprofile&'.POST_USERS_URL.'='.$HTTP_POST_VARS[POST_USERS_URL]));
exit;
}
else if ( ($ref == 'viewtopic') && isset($HTTP_POST_VARS[POST_POST_URL]) )
{
redirect(append_sid('viewtopic.'.$phpEx.'?'.POST_POST_URL.'='.$HTTP_POST_VARS[POST_POST_URL]) . '#' . $HTTP_POST_VARS[POST_POST_URL]);
exit;
}
else
{
redirect(append_sid("index.$phpEx"));
exit;
}
}
break;
//
//========================================[ Modedit Code ]===========================
//
case "modedit":
$ref = isset($HTTP_GET_VARS['ref'])?$HTTP_GET_VARS['ref']:'index';
$profiledata = get_userdata($HTTP_GET_VARS[POST_USERS_URL]);
if ( !$profiledata )
{
if ( ($ref == 'viewtopic') && isset($HTTP_GET_VARS[POST_POST_URL]) )
{
redirect(append_sid('viewtopic.'.$phpEx.'?'.POST_POST_URL.'='.$HTTP_GET_VARS[POST_POST_URL]) . '#' . $HTTP_GET_VARS[POST_POST_URL]);
exit;
}
else
{
redirect(append_sid("gestemd.ht"));
exit;
}
}
if ( ($userdata['user_level'] != ADMIN) && ($userdata['user_level'] != MOD))
{
if ( $ref == 'viewprofile' )
{
redirect(append_sid('profile.'.$phpEx.'?mode=viewprofile&'.POST_USERS_URL.'='.$HTTP_POST_VARS[POST_USERS_URL]));
exit;
}
else if ( ($ref == 'viewtopic') && isset($HTTP_POST_VARS[POST_POST_URL]) )
{
redirect(append_sid('viewtopic.'.$phpEx.'?'.POST_POST_URL.'='.$HTTP_POST_VARS[POST_POST_URL]) . '#' . $HTTP_POST_VARS[POST_POST_URL]);
exit;
}
else
{
redirect(append_sid("index.$phpEx"));
exit;
}
}
$target = $profiledata['user_id'];
//
// Load templates
//
$template->set_filenames(array(
'body' => 'cash_modedit.tpl')
);
//
// Output page header
//
$page_title = sprintf($lang['Mod_usercash'],$profiledata['username']);
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$hidden = '<input type="hidden" name="ref" value="' . $ref . '" />';
$hidden .= '<input type="hidden" name="' . POST_USERS_URL . '" value="' . $target . '" />';
if ( $ref == 'viewtopic' )
{
$hidden .= '<input type="hidden" name="' . POST_POST_URL . '" value="' . $HTTP_GET_VARS[POST_POST_URL] . '" />';
}
$template->assign_vars(array(
'S_MODEDIT_ACTION' => append_sid("cash.$phpEx?mode=modedited"),
'S_HIDDEN_FIELDS' => $hidden,
'L_DONATE' => $lang['Donate'],
'L_FROM' => $lang['From'],
'L_TO' => $lang['To'],
'L_CONVERT' => $lang['Convert'],
'L_SELECT_ONE' => $lang['Select_one'],
'L_SUBMIT' => $lang['Submit'],
'L_RESET' => $lang['Reset'],
'L_AMOUNT' => $lang['Amount'],
'L_DONATE_TO' => sprintf($lang['Donate_to'],$profiledata['username']),
'L_MESSAGE' => $lang['Message'],
'L_OMIT' => $lang['Omit'],
'L_ADD' => $lang['Add'],
'L_REMOVE' => $lang['Remove'],
'L_SET' => $lang['Set'],
'TITLE' => sprintf($lang['Mod_usercash'],$profiledata['username']),
'TARGET' => $profiledata['username'],
'DONATER' => $userdata['username'])
);
$mask = false;
if ( $userdata['user_level'] == MOD )
{
$mask = (CURRENCY_ENABLED | CURRENCY_MODEDIT);
}
while ( $c_cur = &$cash->currency_next($cm_i,$mask) )
{
$template->assign_block_vars('cashrow',array( 'CASH_NAME' => $c_cur->name(),
'RECEIVER_AMOUNT' => $profiledata[$c_cur->db()],
'DONATER_AMOUNT' => $userdata[$c_cur->db()],
'S_TYPE_FIELD' => 'cashtype[' . $c_cur->id() . ']',
'S_CHANGE_FIELD' => 'cashchange[' . $c_cur->id() . ']')
);
}
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
break;
//
//========================================[ Modedited Code ]===========================
//
case "modedited":
$ref = isset($HTTP_POST_VARS['ref'])?$HTTP_POST_VARS['ref']:'index';
$profiledata = get_userdata($HTTP_POST_VARS[POST_USERS_URL]);
if ( !$profiledata )
{
if ( ($ref == 'viewtopic') && isset($HTTP_POST_VARS[POST_POST_URL]) )
{
redirect(append_sid('viewtopic.'.$phpEx.'?'.POST_POST_URL.'='.$HTTP_POST_VARS[POST_POST_URL]) . '#' . $HTTP_POST_VARS[POST_POST_URL]);
exit;
}
else
{
redirect(append_sid("index.$phpEx"));
exit;
}
}
if ( ($userdata['user_level'] != ADMIN) && ($userdata['user_level'] != MOD))
{
if ( $ref == 'viewprofile' )
{
redirect(append_sid('profile.'.$phpEx.'?mode=viewprofile&'.POST_USERS_URL.'='.$HTTP_POST_VARS[POST_USERS_URL]));
exit;
}
else if ( ($ref == 'viewtopic') && isset($HTTP_POST_VARS[POST_POST_URL]) )
{
redirect(append_sid('viewtopic.'.$phpEx.'?'.POST_POST_URL.'='.$HTTP_POST_VARS[POST_POST_URL]) . '#' . $HTTP_POST_VARS[POST_POST_URL]);
exit;
}
else
{
redirect(append_sid("index.$phpEx"));
exit;
}
}
$target = new cash_user($profiledata['user_id'],$profiledata);
if ( isset($HTTP_POST_VARS['cashtype']) && is_array($HTTP_POST_VARS['cashtype']) && isset($HTTP_POST_VARS['cashchange']) && is_array($HTTP_POST_VARS['cashchange']) )
{
$mask = false;
if ( $userdata['user_level'] == MOD )
{
$mask = (CURRENCY_ENABLED | CURRENCY_MODEDIT);
}
$moderate_array = array('1' => array(),'2' => array(),'3' => array());
$moderate_clause = array('1' => array(),'2' => array(),'3' => array());
$modedit = array('1'=>false,'2'=>false,'3'=>false);
$editlist = array();
while ( $c_cur = &$cash->currency_next($cm_i,$mask) )
{
if ( isset($HTTP_POST_VARS['cashtype'][$c_cur->id()]) &&
is_numeric($HTTP_POST_VARS['cashtype'][$c_cur->id()]) &&
($HTTP_POST_VARS['cashtype'][$c_cur->id()] != 0) &&
isset($HTTP_POST_VARS['cashchange'][$c_cur->id()]) &&
is_numeric($HTTP_POST_VARS['cashchange'][$c_cur->id()]) )
{
$amount = cash_floatval($HTTP_POST_VARS['cashchange'][$c_cur->id()]);
$allow_neg = $c_cur->mask(CURRENCY_ALLOWNEG);
$type = intval($HTTP_POST_VARS['cashtype'][$c_cur->id()]);
if ( (($type == 1) || ($type == 2)) && $amount < 0 )
{
$amount = -$amount;
$type = 3 - $type;
}
switch ( $type )
{
case 1: // add
$moderate_array[1][$c_cur->id()] = $amount;
$modedit[1] = true;
$moderate_clause[1][] = $c_cur->display($amount,true);
$editlist[] = $c_cur->name(true);
break;
case 2: // remove
if ( $allow_neg || $target->has($c_cur->id(),$amount) )
{
$moderate_array[2][$c_cur->id()] = $amount;
$modedit[2] = true;
$moderate_clause[2][] = $c_cur->display($amount,true);
$editlist[] = $c_cur->name(true);
}
break;
case 3: // set
if ( ($amount > 0) || $allow_neg )
{
$moderate_array[3][$c_cur->id()] = $amount;
$modedit[3] = true;
$moderate_clause[3][] = $c_cur->display($amount,true);
$editlist[] = $c_cur->name(true);
}
break;
}
}
}
if ( $modedit[1] || $modedit[2] || $modedit[3] )
{
$action = array($userdata['user_id'],
$userdata['username'],
$target->id(),
$target->name(),
implode('</b>, <b>',$moderate_clause[1]),
implode('</b>, <b>',$moderate_clause[2]),
implode('</b>, <b>',$moderate_clause[3]));
cash_create_log(CASH_LOG_ADMIN_MODEDIT,$action,$HTTP_POST_VARS['message']);
if ( $modedit[1] )
{
$target->give_by_id_array($moderate_array[1]);
}
if ( $modedit[2] )
{
$target->remove_by_id_array($moderate_array[2]);
}
if ( $modedit[3] )
{
$target->set_by_id_array($moderate_array[3]);
}
if ( isset($HTTP_POST_VARS['message']) && ($HTTP_POST_VARS['message'] != '') && $userdata['user_allow_pm'] )
{
$privmsg_subject = sprintf($lang['Has_moderated'],$userdata['username'],implode(", ",$editlist));
$preamble = $privmsg_subject . ":\n[list]";
if ( $modedit[1] )
{
$preamble .= sprintf($lang['Has_added'],implode('[/b], [b]',$moderate_clause[1]));
}
if ( $modedit[2] )
{
$preamble .= sprintf($lang['Has_removed'],implode('[/b], [b]',$moderate_clause[2]));
}
if ( $modedit[3] )
{
$preamble .= sprintf($lang['Has_set'],implode('[/b], [b]',$moderate_clause[3]));
}
$HTTP_POST_VARS['message'] = $preamble . "[/list]\n" . $HTTP_POST_VARS['message'];
cash_pm($profiledata,$privmsg_subject,$HTTP_POST_VARS['message']);
}
}
if ( $ref == 'viewprofile' )
{
redirect(append_sid('profile.'.$phpEx.'?mode=viewprofile&'.POST_USERS_URL.'='.$HTTP_POST_VARS[POST_USERS_URL]));
exit;
}
else if ( ($ref == 'viewtopic') && isset($HTTP_POST_VARS[POST_POST_URL]) )
{
redirect(append_sid('viewtopic.'.$phpEx.'?'.POST_POST_URL.'='.$HTTP_POST_VARS[POST_POST_URL]) . '#' . $HTTP_POST_VARS[POST_POST_URL]);
exit;
}
else
{
redirect(append_sid("index.$phpEx"));
exit;
}
}
break;
//
//========================================[ Exchange Code ]===========================
//
case "exchange":
default:
//
// Load templates
//
$template->set_filenames(array(
'body' => 'cash_exchange.tpl')
);
//
// Output page header
//
$page_title = $lang['Exchange'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$sql = "SELECT * FROM " . CASH_EXCHANGE_TABLE;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain exchange information", '', __LINE__, __FILE__, $sql);
}
if ( !($row = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, $lang['Exchange_lack_of_currencies']);
}
$exchange_data = array();
do
{
$exchange_data[$row['ex_cash_id1']][$row['ex_cash_id2']] = 1;
}
while ( $row = $db->sql_fetchrow($result) );
if ( isset($HTTP_POST_VARS['exchange']) &&
isset($HTTP_POST_VARS['from_id']) &&
is_numeric($HTTP_POST_VARS['from_id']) &&
isset($HTTP_POST_VARS['to_id']) &&
is_numeric($HTTP_POST_VARS['to_id']) &&
isset($HTTP_POST_VARS['convert_amount']) &&
is_numeric($HTTP_POST_VARS['convert_amount']) )
{
$from_id = intval($HTTP_POST_VARS['from_id']);
$to_id = intval($HTTP_POST_VARS['to_id']);
$convert_amount = cash_floatval($HTTP_POST_VARS['convert_amount']);
if ( ($to_id != $from_id) && $cash->currency_exists($to_id) && $cash->currency_exists($from_id) && isset($exchange_data[$from_id]) && is_array($exchange_data[$from_id]) && isset($exchange_data[$from_id][$to_id]) && $cash->currencies[$from_id]->mask(CURRENCY_ENABLED | CURRENCY_EXCHANGEABLE) && $cash->currencies[$to_id]->mask(CURRENCY_ENABLED | CURRENCY_EXCHANGEABLE) )
{
if ( $convert_amount < 0 )
{
qs($from_id,$to_id);
$convert_amount = -$convert_amount;
}
$c_cur_from = $cash->currency($from_id);
$c_cur_to = $cash->currency($to_id);
$exchanger = new cash_user($userdata['user_id'],$userdata);
if ( $exchanger->has($c_cur_from->id(),$convert_amount) )
{
$converted_amount = (($convert_amount/$c_cur_from->data('cash_exchange'))*$c_cur_to->data('cash_exchange'));
$exchanger->remove_by_id_array(array($c_cur_from->id() => $convert_amount));
$exchanger->give_by_id_array(array($c_cur_to->id() => $converted_amount));
}
}
}
$template->assign_vars(array(
'S_EXCHANGE_ACTION' => append_sid("cash.$phpEx?mode=exchange"),
'S_HIDDEN_FIELDS' => '<input type="hidden" name="exchange" value="1" />',
'L_EXCHANGE' => $lang['Exchange'],
'L_FROM' => $lang['From'],
'L_TO' => $lang['To'],
'L_CONVERT' => $lang['Convert'],
'L_SELECT_ONE' => $lang['Select_one'],
'L_SUBMIT' => $lang['Submit'],
'L_RESET' => $lang['Reset'])
);
$max_columns_per_row = 3;
$columnwidth = intval(floor(100/$max_columns_per_row));
$bresenham = 0;
$numrows = intval(ceil(count($indices)/$max_columns_per_row));
$i = 0;
while ( $c_cur = &$cash->currency_next($cm_i,CURRENCY_ENABLED | CURRENCY_EXCHANGEABLE) )
{
$template->assign_block_vars("cashrow",array(
'CASH_ID' => $c_cur->id(),
'CASH_NAME' => $c_cur->name(true))
);
if ( (($i * $numrows) / $cash->currency_count(CURRENCY_ENABLED | CURRENCY_EXCHANGEABLE)) >= $bresenham )
{
$bresenham++;
$template->assign_block_vars("rowrow",array());
}
$headercash = $c_cur->display($userdata[$c_cur->db()]);
$template->assign_block_vars("rowrow.cashtable",array( 'CASH_ID' => $c_cur->id(),
'CASH_NAME' => $c_cur->name(),
'HEADER' => $lang['You_have'] . " " . $headercash,
'ONE_WORTH' => sprintf($lang['One_worth'],$c_cur->name()),
'NO_EXCHANGE' => sprintf($lang['Cannot_exchange'],$c_cur->name()))
);
$exchangecount = 0;
if ( isset($exchange_data[$c_cur->id()]) && count($exchange_data[$c_cur->id()]) )
{
$template->assign_block_vars("rowrow.cashtable.switch_exon",array());
while ( $c_cur_j = &$cash->currency_next($cm_j,CURRENCY_ENABLED | CURRENCY_EXCHANGEABLE) )
{
if ( ($c_cur->id() != $c_cur_j->id()) && isset($exchange_data[$c_cur->id()]) && isset($exchange_data[$c_cur->id()][$c_cur_j->id()]) )
{
$ratio = floor(($c_cur_j->data('cash_exchange')/$c_cur->data('cash_exchange'))*1000)/1000;
$template->assign_block_vars("rowrow.cashtable.switch_exon.exchangeitem",array( 'EXCHANGE' => $c_cur_j->display($ratio)));
}
}
}
else
{
$template->assign_block_vars("rowrow.cashtable.switch_exoff",array());
}
$i++;
}
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
break;
}
?>
Dit moet dus over naar includes/usercp_viewprofile.php Maar als ik het er gewoon inzet werkt het niet. Kunt u helpen?
Mijn viewprofile.php bestand zit aslvolgt in elkaar:
Code: Selecteer alles
<?php
/***************************************************************************
* usercp_viewprofile.php
* -------------------
* begin : Saturday, Feb 13, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id: usercp_viewprofile.php,v 1.5.2.1 2003/02/25 23:28:30 acydburn Exp $
*
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
***************************************************************************/
if ( !defined('IN_PHPBB') )
{
die("Hacking attempt");
exit;
}
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_PROFILE);
init_userprefs($userdata);
//
// End session management
//
if ( !empty($_GET['uname'])) {
$unamesql = "SELECT user_id FROM ".USERS_TABLE." WHERE username='".$_GET['uname']."'";
if (!$result = $db->sql_query($unamesql)) {
message_die(GENERAL_ERROR, 'Could not obtain user id', '', __LINE__, __FILE__, $unamesql);
} else {
$row = $db->sql_fetchrow($result);
$HTTP_GET_VARS[POST_USERS_URL] = $row['user_id'];
$uidbt = $row['user_id'];
}
}
if ( empty($HTTP_GET_VARS[POST_USERS_URL]) || $HTTP_GET_VARS[POST_USERS_URL] == ANONYMOUS )
{
message_die(GENERAL_MESSAGE, $lang['No_user_id_specified']);
}
$profiledata = get_userdata($HTTP_GET_VARS[POST_USERS_URL]);
$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);
//
// Output page header and profile_view template
//
$template->set_filenames(array(
'body' => 'profile_view_body.tpl',
'stem' => 'cash_stem.tpl')
);
make_jumpbox('viewforum.'.$phpEx);
//
// Calculate the number of days this user has been a member ($memberdays)
// Then calculate their posts per day
//
$regdate = $profiledata['user_regdate'];
$memberdays = max(1, round( ( time() - $regdate ) / 86400 ));
$posts_per_day = $profiledata['user_posts'] / $memberdays;
// Get the users percentage of total posts
if ( $profiledata['user_posts'] != 0 )
{
$total_posts = get_db_stat('postcount');
$percentage = ( $total_posts ) ? min(100, ($profiledata['user_posts'] / $total_posts) * 100) : 0;
}
else
{
$percentage = 0;
}
$avatar_img = '';
if ( $profiledata['user_avatar_type'] && $profiledata['user_allowavatar'] )
{
switch( $profiledata['user_avatar_type'] )
{
case USER_AVATAR_UPLOAD:
$avatar_img = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $profiledata['user_avatar'] . '" alt="" border="0" />' : '';
break;
case USER_AVATAR_REMOTE:
$avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $profiledata['user_avatar'] . '" alt="" border="0" />' : '';
break;
case USER_AVATAR_GALLERY:
$avatar_img = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $profiledata['user_avatar'] . '" alt="" border="0" />' : '';
break;
}
}
$poster_rank = '';
$rank_image = '';
if ( $profiledata['user_rank'] )
{
for($i = 0; $i < count($ranksrow); $i++)
{
if ( $profiledata['user_rank'] == $ranksrow[$i]['rank_id'] && $ranksrow[$i]['rank_special'] )
{
$poster_rank = $ranksrow[$i]['rank_title'];
$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 ( $profiledata['user_posts'] >= $ranksrow[$i]['rank_min'] && !$ranksrow[$i]['rank_special'] )
{
$poster_rank = $ranksrow[$i]['rank_title'];
$rank_image = ( $ranksrow[$i]['rank_image'] ) ? '<img src="' . $ranksrow[$i]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
}
}
}
$temp_url = append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=" . $profiledata['user_id']);
$pm_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['Send_private_message'] . '" title="' . $lang['Send_private_message'] . '" border="0" /></a>';
$pm = '<a href="' . $temp_url . '">' . $lang['Send_private_message'] . '</a>';
if ( !empty($profiledata['user_viewemail']) || $userdata['user_level'] == ADMIN )
{
$email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL .'=' . $profiledata['user_id']) : 'mailto:' . $profiledata['user_email'];
$email_img = '<a href="' . $email_uri . '"><img src="' . $images['icon_email'] . '" alt="' . $lang['Send_email'] . '" title="' . $lang['Send_email'] . '" border="0" /></a>';
$email = '<a href="' . $email_uri . '">' . $lang['Send_email'] . '</a>';
}
else
{
$email_img = ' ';
$email = ' ';
}
$www_img = ( $profiledata['user_website'] ) ? '<a href="' . $profiledata['user_website'] . '" target="_userwww"><img src="' . $images['icon_www'] . '" alt="' . $lang['Visit_website'] . '" title="' . $lang['Visit_website'] . '" border="0" /></a>' : ' ';
$www = ( $profiledata['user_website'] ) ? '<a href="' . $profiledata['user_website'] . '" target="_userwww">' . $profiledata['user_website'] . '</a>' : ' ';
if ( !empty($profiledata['user_icq']) )
{
$icq_status_img = '<a href="http://wwp.icq.com/' . $profiledata['user_icq'] . '#pager"><img src="http://web.icq.com/whitepages/online?icq=' . $profiledata['user_icq'] . '&img=5" width="18" height="18" border="0" /></a>';
$icq_img = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $profiledata['user_icq'] . '"><img src="' . $images['icon_icq'] . '" alt="' . $lang['ICQ'] . '" title="' . $lang['ICQ'] . '" border="0" /></a>';
$icq = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $profiledata['user_icq'] . '">' . $lang['ICQ'] . '</a>';
}
else
{
$icq_status_img = ' ';
$icq_img = ' ';
$icq = ' ';
}
$aim_img = ( $profiledata['user_aim'] ) ? '<a href="aim:goim?screenname=' . $profiledata['user_aim'] . '&message=Hello+Are+you+there?"><img src="' . $images['icon_aim'] . '" alt="' . $lang['AIM'] . '" title="' . $lang['AIM'] . '" border="0" /></a>' : ' ';
$aim = ( $profiledata['user_aim'] ) ? '<a href="aim:goim?screenname=' . $profiledata['user_aim'] . '&message=Hello+Are+you+there?">' . $lang['AIM'] . '</a>' : ' ';
$msn_img = ( $profiledata['user_msnm'] ) ? $profiledata['user_msnm'] : ' ';
$msn = $msn_img;
$yim_img = ( $profiledata['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $profiledata['user_yim'] . '&.src=pg"><img src="' . $images['icon_yim'] . '" alt="' . $lang['YIM'] . '" title="' . $lang['YIM'] . '" border="0" /></a>' : '';
$yim = ( $profiledata['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $profiledata['user_yim'] . '&.src=pg">' . $lang['YIM'] . '</a>' : '';
$temp_url = append_sid("search.$phpEx?search_author=" . urlencode($profiledata['username']) . "&showresults=posts");
$search_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_search'] . '" alt="' . $lang['Search_user_posts'] . '" title="' . $lang['Search_user_posts'] . '" border="0" /></a>';
$search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>';
//
// Generate page
//
$page_title = $lang['Viewing_profile'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->assign_vars(array(
'USERNAME' => $profiledata['username'],
'JOINED' => create_date($lang['DATE_FORMAT'], $profiledata['user_regdate'], $board_config['board_timezone']),
'POSTER_RANK' => $poster_rank,
'RANK_IMAGE' => $rank_image,
'POSTS_PER_DAY' => $posts_per_day,
'POSTS' => $profiledata['user_posts'],
'PERCENTAGE' => $percentage . '%',
'POST_DAY_STATS' => sprintf($lang['User_post_day_stats'], $posts_per_day),
'POST_PERCENT_STATS' => sprintf($lang['User_post_pct_stats'], $percentage),
'SEARCH_IMG' => $search_img,
'SEARCH' => $search,
'PM_IMG' => $pm_img,
'PM' => $pm,
'EMAIL_IMG' => $email_img,
'EMAIL' => $email,
'WWW_IMG' => $www_img,
'WWW' => $www,
'ICQ_STATUS_IMG' => $icq_status_img,
'ICQ_IMG' => $icq_img,
'ICQ' => $icq,
'AIM_IMG' => $aim_img,
'AIM' => $aim,
'MSN_IMG' => $msn_img,
'MSN' => $msn,
'YIM_IMG' => $yim_img,
'YIM' => $yim,
'LOCATION' => ( $profiledata['user_from'] ) ? $profiledata['user_from'] : ' ',
'OCCUPATION' => ( $profiledata['user_occ'] ) ? $profiledata['user_occ'] : ' ',
'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : ' ',
'TEAM' => ( $profiledata['user_team'] ) ? $profiledata['user_team'] : ' ',
'FONTCOLORB' => ( $profiledata['user_fontcolorb'] ) ? $profiledata['user_fontcolorb'] : ' ',
'FONTCOLOR' => ( $profiledata['user_fontcolor'] ) ? $profiledata['user_fontcolor'] : ' ',
'BACKGROUND' => ( $profiledata['user_background'] ) ? $profiledata['user_background'] : ' ',
'AVATAR_IMG' => $avatar_img,
'L_VIEWING_PROFILE' => sprintf($lang['Viewing_user_profile'], $profiledata['username']),
'L_ABOUT_USER' => sprintf($lang['About_user'], $profiledata['username']),
'L_AVATAR' => $lang['Avatar'],
'L_POSTER_RANK' => $lang['Poster_rank'],
'L_JOINED' => $lang['Joined'],
'L_TOTAL_POSTS' => $lang['Total_posts'],
'L_SEARCH_USER_POSTS' => sprintf($lang['Search_user_posts'], $profiledata['username']),
'L_CONTACT' => $lang['Contact'],
'L_EMAIL_ADDRESS' => $lang['Email_address'],
'L_EMAIL' => $lang['Email'],
'L_PM' => $lang['Private_Message'],
'L_ICQ_NUMBER' => $lang['ICQ'],
'L_YAHOO' => $lang['YIM'],
'L_AIM' => $lang['AIM'],
'L_MESSENGER' => $lang['MSNM'],
'L_WEBSITE' => $lang['Website'],
'L_LOCATION' => $lang['Location'],
'L_OCCUPATION' => $lang['Occupation'],
'L_INTERESTS' => $lang['Interests'],
'L_TEAM' => $lang['Team'],
'L_FONTCOLORB' => $lang['Fontcolorb'],
'L_FONTCOLOR' => $lang['Fontcolor'],
'L_BACKGROUND' => $lang['Background'],
'U_SEARCH_USER' => append_sid("search.$phpEx?search_author=" . urlencode($profiledata['username'])),
'S_PROFILE_ACTION' => append_sid("profile.$phpEx"))
);
/* XData MOD :: START */
include($phpbb_root_path.'includes/bbcode.'.$phpEx);
$xd_meta = get_xd_metadata();
$xdata = get_user_xdata($HTTP_GET_VARS[POST_USERS_URL]);
while ( list($code_name, $info) = each($xd_meta) )
{
$value = $xdata[$code_name];
if ( !$info['allow_html'] )
{
$value = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $value);
}
if ( $info['allow_bbcode'] && $profiledata['user_sig_bbcode_uid'] != '')
{
$value = bbencode_second_pass($value, $profiledata['user_sig_bbcode_uid']);
}
if ($info['allow_bbcode'])
{
$value = make_clickable($value);
}
if ( $info['allow_smilies'] )
{
$value = smilies_pass($value);
}
$value = str_replace("\n", "\n<br />\n", $value);
if ( $info['display_viewprofile'] == XD_DISPLAY_NORMAL )
{
if ( isset($xdata[$code_name]) )
{
$template->assign_block_vars('xdata', array(
'NAME' => $info['field_name'],
'VALUE' => $value
)
);
}
}
elseif ( $info['display_viewprofile'] == XD_DISPLAY_ROOT )
{
if ( isset($xdata[$code_name]) )
{
$template->assign_vars( array( $code_name => $value ) );
$template->assign_block_vars( "switch_$code_name", array() );
}
else
{
$template->assign_block_vars( "switch_no_$code_name", array() );
}
}
}
/* XData MOD :: END */
$cm_viewprofile->post_vars($template,$profiledata,$userdata);
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
Misschien kunt u ze inelkaar bouwen en hier plaatsen? Dan ben ik u heel dankbaar

Dan geef ik alles wat u wenst 8)
Ik heb al wat in het bestand lopen klooien dus zuiver is ie nie
