http://www.icyphoenix.com/viewtopic.php?f=35&t=5444&p=36726#p36726
-----------------------------------
DWho
Mon 16 Feb, 2009 19:25

Re: User Block Mod
-----------------------------------
Ok I got this to work for you 

here is the code let me know... replace all the code in blocks/blocks_imp_user_block.php with 

[spoiler][code linenumbers=false]<?php
/***************************************************************************
 *			 blocks_imp_user_block.php
 *			    -------------------
 *   begin		: Saturday, March 20, 2004
 *   copyright	    : (C) 2004 masterdavid - Ronald John David
 *   website	      : http://www.integramod.com
 *   email		: webmaster@integramod.com
 *
 *   note: removing the original copyright is illegal even you have modified
 *	 the code.  Just append yours if you have modified it.
 ***************************************************************************/

/***************************************************************************
 *
 *   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');
}

if(!function_exists(imp_user_block_block_func))
{
	function imp_user_block_block_func()
	{
		global $userdata, $template, $board_config, $name, $lang, $db, $phpEx;
		include_once($phpbb_root_path . 'includes/functions_groups.' . $phpEx);

		/*if( $userdata['session_logged_in'] )
		{
				$sql = "SELECT COUNT(post_id) as total
					FROM " . POSTS_TABLE . "
					WHERE post_time >= " . $userdata['user_lastvisit'] . " AND poster_id <> " . $userdata['user_id'] . " AND post_time < " . time();
					$result = $db->sql_query($sql);
			if( $result )
			{
				$row = $db->sql_fetchrow($result);
				$lang['Search_new'] = $lang['Search_new'] . "&nbsp;(" . $row['total'] . ")";
			}
		}*/

		$avatar_img = user_get_avatar($userdata['user_id'], $userdata['user_avatar'], $userdata['user_avatar_type'], $userdata['user_allowavatar']);

		// Check For Anonymous User
		if ($userdata['user_id'] != ANONYMOUS)
		{
				$username = colorize_username($userdata['user_id']);
		}
		else
		{
			$username = $lang['Guest'];
			$avatar_img = '<img src="' . $board_config['default_avatar_guests_url'] . '" alt="" />';
		}
		if ($userdata['user_id'] != '-1')
		{
			$userdata['username'] = colorize_username($userdata['user_id']);
			$name_link =  $userdata['username'];
		}
		else
		{
			$name_link = $lang['Guest'];
		}

// Custom Profile Fields - BEGIN
// Include Language
$language = $board_config['default_lang'];
if ( !file_exists($phpbb_root_path . 'language/lang_' . $language . '/lang_profile_fields.' . $phpEx) )
{
	$language = 'english';
}
include($phpbb_root_path . 'language/lang_' . $language . '/lang_profile_fields.' . $phpEx);

include_once($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
$profile_data = get_fields('WHERE view_in_profile = ' . VIEW_IN_PROFILE . ' AND users_can_view = ' . ALLOW_VIEW);
$profile_names = array();

$abouts = array();
$contacts = array();
foreach($profile_data as $field)
{
	$name = $field['field_name'];
	$col_name = text_to_column($field['field_name']);
	$id = $userdata['user_id'];
	$type = $field['field_type'];
	$location = $field['profile_location'];

	$field_id = $field['field_id'];
	$field_name = $field['field_name'];
	if (isset($lang[$field_id . '_' . $field_name]))
	{
		$field_name = $lang[$field_id . '_' . $field_name];
	}

	$sql = "SELECT $col_name FROM " . USERS_TABLE . "
		WHERE user_id = $id";
	if(!($result = $db->sql_query($sql)))
	{
		message_die(GENERAL_ERROR,'Could not obtain field value','',__LINE__,__FILE__,$sql);
	}

	$temp = $db->sql_fetchrow($result);
	$profile_names[$name] = displayable_field_data($temp[$col_name],$field['field_type']);
	$tmp_field = $profile_names[$name];
	if (isset($lang[$field_id . '_' . $tmp_field]))
	{
		$profile_names[$name] = $lang[$field_id . '_' . $tmp_field];
	}

	if($location == 1)
	{
		$contacts[] = '<td valign="middle" align="left" nowrap="nowrap"  width="38%"><span class="gen">' . $field_name . '</span></td><td class="row2" valign="middle" width="100%"  align="right"><span class="gen">' . $profile_names[$name] . '&nbsp;</span></td>';
	}
	else
	{
		$abouts[] = '<td class="row2" valign="middle" width="100%"  align="center"><span class="gen"><img src="http://avatar.xboxlive.com/avatar/' . $profile_names[$name] . '/avatar-body.png" /></span></td>';
	}
}

foreach($abouts as $about_field)
{
	$template->assign_block_vars('custom_about',array('ABOUT' => $about_field));
}

foreach($contacts as $contact_field)
{
	$template->assign_block_vars('custom_contact',array('CONTACT' => $contact_field));
}
// Custom Profile Fields - END
		$template->assign_vars(array(
			'AVATAR_IMG' => $avatar_img,
			'U_NAME_LINK' => $name_link,
			'L_REMEMBER_ME' => $lang['Remember_me'],
			'L_SEND_PASSWORD' => $lang['Forgotten_password'],
			'U_SEND_PASSWORD' => append_sid(PROFILE_MG . '?mode=sendpassword'),
			'L_REGISTER_NEW_ACCOUNT' => sprintf($lang['Register_new_account'], '<a href="' . append_sid(PROFILE_MG . '?mode=register') . '">', '</a>'),
			'L_NEW_SEARCH' => $lang['Search_new']
			)
		);
	}
}

imp_user_block_block_func();
?>[/code][/spoiler]

open templates/YOUR TEMPLATE/blocks/user_block_block.tpl

and replace all the code with

[spoiler][code linenumbers=false]
<table class="empty-table" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
	<td align="center">
	

		<span class="name">{U_NAME_LINK}</span>

									<!-- BEGIN custom_about -->
						<tr>{custom_about.ABOUT}</tr>
						<!-- END custom_about -->
						
</td>
</tr>
</table>

<!-- BEGIN switch_user_logged_out -->
<form method="post" action="{S_LOGIN_ACTION}">
<table class="empty-table" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
	<td align="center">
	<table><tr><td>
		<br /><div class="picshadow"><div class="picframe2">{AVATAR_IMG}</div></div></td></tr></table>
<input type="hidden" name="redirect" value="index.php" />
	{L_USERNAME}:<br />
	<input class="post" type="text" name="username" size="15" />
	<br />
	{L_PASSWORD}:<br />
	<input class="post" type="password" name="password" size="15" />
	<br />

	<!-- BEGIN switch_allow_autologin -->
	<br />
	<input class="text" type="checkbox" name="autologin" /><span class="gensmall">&nbsp;{L_REMEMBER_ME}</span><br />
	<!-- END switch_allow_autologin -->
	<br/>
	<input type="submit" class="mainoption" name="login" value="{L_LOGIN}" /><br /><br />
	<a href="{U_SEND_PASSWORD}" class="gensmall">{L_SEND_PASSWORD}</a>

	</td>
</tr>
</table>
</form>
<!-- END switch_user_logged_out -->[/code][/spoiler]

Goto admin and set the field to whatever you are calling it...

[b]Field Type[/b]  text
[b]Viewable in User Profile[/b] yes
[b]These options are for if this field is to be viewed in the user's profile.[/b] about column

and save

you just have to add your name to the text box you have created so for you it would be [b]n1cks21[/b]

but I am not sure if you can create any more custom fields now though

[b]logged out[/b]

 [img]http://www.icyphoenix.com/files/images/166/logged_out.png[/img] 

[b]logged in[/b]

 [img]http://www.icyphoenix.com/files/images/166/logged_in.png[/img]


Let me know

 :mrgreen:  :mrgreen:  :mrgreen:


