############################################################## 
## MOD Title: Viewtopic User Info Panel 
## MOD Author: Nightrider < phpbb@4fxearth.net > (Blake) http://4fxearth.net/phpBB2 
## MOD Description: This adds a User information panel to the right of the username, rank, and avatar.
## MOD Version: 1.0.0
## 
## Installation Level: Moderate due to massive FIND and REPLACE WITH command for viewtopic_body.tpl file
## Installation Time: ~10 Minutes 
##
## Files To Edit: (4)
##			viewtopic.php
##			includes/functions.php
##			language/lang_english/lang_main.php
##			templates/subSilver/viewtopic_body.tpl
##
## Included Files: (0)
##
############################################################## 
## Author Notes: 
##
##  The Birtday, Word Count, Zodiac, and Gender MODs MUST BE
##	installed before attempting to install this MOD...
##
##	Due to the massive FIND statement for the viewtop_body.tpl file,
##	it is impossible to make this completely EM Friendly since so 
##	much of original code is being totally overwritten.  You 
##	may have to adjust both the FIND and REPLACE WITH commands
##	if you have added other MODs that have altered the replaced
##	anything in that section of code...
## 
############################################################## 
## MOD History: 
##	
##	2007-08-01 	- Version 1.0.0
##				- Initial Release
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
#
#-----[ OPEN ]------------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------------
#
$zodiac_img = '<img src="
#
#-----[ REPLACE WITH ]------------------------------------------------
#
				//$zodiac_img = '<img src="' . $u_zodiac . '" alt="' . $zodiac . '" title="' . $zodiac . '" align="top" border="0" />' . $zodiac;
				$zodiac_img = $zodiac;
#
#-----[ FIND ]------------------------------------------------
#
$poster_joined =
#
#-----[ AFTER, ADD ]------------------------------------------------
#
	$poster_joined2 = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? create_date($lang['DATE_FORMAT'], $postrow[$i]['user_regdate'], $board_config['board_timezone']) : '';
#
#-----[ FIND ]------------------------------------------------
#
$gender_image = ''; 
#
#-----[ AFTER, ADD ]------------------------------------------------
#
	$gender_image2 = ''; 
	$gender_text = '';
#
#-----[ FIND ]------------------------------------------------
#
$poster_rank = $lang['Guest'];
#
#-----[ AFTER, ADD ]------------------------------------------------
#
		$poster_age = '';
		$poster_age2 = '';
		$poster_text = '';
#
#-----[ FIND ]------------------------------------------------
#
$gender_image = $lang['Gender']
#
#-----[ IN-LINE FIND ]------------------------------------------------
#
; break;
#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------------
#
;
#
#-----[ AFTER, ADD ]------------------------------------------------
#

		 $gender_image2 = "<img src=\"" . $images['icon_minigender_male'] . "\" alt=\"" . $lang['Gender'].  ":".$lang['Male']."\" title=\"" . $lang['Gender'] . ":".$lang['Male']. "\" border=\"0\" />";
		 $gender_text = $lang['Gender']; break; 
#
#-----[ FIND ]------------------------------------------------
#
$gender_image = $lang['Gender']
#
#-----[ IN-LINE FIND ]------------------------------------------------
#
; break;
#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------------
#
;
#
#-----[ AFTER, ADD ]------------------------------------------------
#
		 $gender_image2 = "<img src=\"" . $images['icon_minigender_female'] . "\" alt=\"" . $lang['Gender']. ":".$lang['Female']. "\" title=\"" . $lang['Gender'] . ":".$lang['Female']. "\" border=\"0\" />";
		 $gender_text = $lang['Gender'];  break;
#
#-----[ FIND ]------------------------------------------------
#
default : $gender_image="";		 
#
#-----[ AFTER, ADD ]------------------------------------------------
#
	 	$gender_image2="";
		$gender_text=""; 
#
#-----[ FIND ]------------------------------------------------
#
$age = ( $bday_year_age ) ? gmdate('Y')-$bday_year_age-$fudge : false;
#
#-----[ AFTER, ADD ]------------------------------------------------
#
		$poster_birthdate=realdate('md', $postrow[$i]['user_birthday']);
		$poster_month=realdate('M', $postrow[$i]['user_birthday']);
		$poster_day=realdate('j', $postrow[$i]['user_birthday']);
		$poster_bday=$poster_month . ' ' . $poster_day;
		$poster_age2 = $poster_bday;
		$poster_text = $lang['Age'];
#
#-----[ FIND ]------------------------------------------------
#
$zodiac_img = '';
#
#-----[ AFTER, ADD ]------------------------------------------------
#
		$poster_age = '';
		$poster_age2 = '';
		$poster_text = $lang['Age'];
#
#-----[ FIND ]------------------------------------------------
#
$search =
#
#-----[ AFTER, ADD ]------------------------------------------------
#
		$search2 = '<a href="' . $temp_url . '" title="' . $lang['Search_u_posts'] . '">' . $postrow[$i]['user_posts'] . '</a>';
		$search_head2 = $lang['Posts'];
#
#-----[ FIND ]------------------------------------------------
#
'ZODIAC_IMG' => $zodiac_img,
#
#-----[ REPLACE WITH ]------------------------------------------------
#
		'ZODIAC_IMG' => ($zodiac_img) ? $zodiac_img : 'N/A',
#
#-----[ FIND ]------------------------------------------------
#
'SEARCH' =>
#
#-----[ AFTER, ADD ]------------------------------------------------
#
		'POSTER_AGE_TEXT' => $poster_text,
		'POSTER_AGE2' => ($poster_age2) ? $poster_age2 : 'N/A',
		'POSTER_GENDER2' => $gender_image2,
		'POSTER_GENDER_TEXT' => $gender_text,
		'POSTER_JOINED2' => $poster_joined2,
		'SEARCH2' => $search2,
		'SEARCH_TEXT' => $search_head2,
		'L_ZODIAC2' => $lang['Zodiac'],
		'TOTAL_WORDS_TEXT2' => $lang['Total_Words2'],
#
#-----[ OPEN ]------------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------------
#
// Add function realdate for Birthday MOD
// the originate php "date()", does not work proberly on all OS, especially when going back in time
// before year 1970 (year 0), this function "realdate()", has a mutch larger valid date range,
// from 1901 - 2099. it returns a "like" UNIX date format (only date, related letters may be used, due to the fact that
// the given date value should already be divided by 86400 - leaving no time information left)
// a input like a UNIX timestamp divided by 86400 is expected, so
// calculation from the originate php date and mktime is easy.
// e.g. realdate ("m d Y", 3) returns the string "1 3 1970"

// UNIX users should replace this function with the below code, since this should be faster
//
//function realdate($date_syntax="Ymd",$date=0) 
//{ return create_date($date_syntax,$date*86400+1,0); }

function realdate($date_syntax="Ymd",$date=0)
{
	global $lang;
	$i=2;
	if ($date>=0)
	{
	 	return create_date($date_syntax,$date*86400+1,0);
	} else
	{
		$year= -(date%1461);
		$days = $date + $year*1461;
		while ($days<0)
		{
			$year--;
			$days+=365;
			if ($i++==3)
			{
				$i=0;
				$days++;
			}
		}
	}
	$leap_year = ($i==0) ? TRUE : FALSE;
	$months_array = ($i==0) ?
		array (0,31,60,91,121,152,182,213,244,274,305,335,366) :
		array (0,31,59,90,120,151,181,212,243,273,304,334,365);
	for ($month=1;$month<12;$month++)
	{
		if ($days<$months_array[$month]) break;
	}

	$day=$days-$months_array[$month-1]+1;
	//you may gain speed performance by remove som of the below entry's if they are not needed/used
	return strtr ($date_syntax, array(
		'a' => '',
		'A' => '',
		'\\d' => 'd',
		'd' => ($day>9) ? $day : '0'.$day,
		'\\D' => 'D',
		'D' => $lang['day_short'][($date-3)%7],
		'\\F' => 'F',
		'F' => $lang['month_long'][$month-1],
		'g' => '',
		'G' => '',
		'H' => '',
		'h' => '',
		'i' => '',
		'I' => '',
		'\\j' => 'j',
		'j' => $day,
		'\\l' => 'l',
		'l' => $lang['day_long'][($date-3)%7],
		'\\L' => 'L',
		'L' => $leap_year,
		'\\m' => 'm',
		'm' => ($month>9) ? $month : '0'.$month,
		'\\M' => 'M',
		'M' => $lang['month_short'][$month-1],
		'\\n' => 'n',
		'n' => $month,
		'O' => '',
		's' => '',
		'S' => '',
		'\\t' => 't',
		't' => $months_array[$month]-$months_array[$month-1],
		'w' => '',
		'\\y' => 'y',
		'y' => ($year>29) ? $year-30 : $year+70,
		'\\Y' => 'Y',
		'Y' => $year+1970,
		'\\z' => 'z',
		'z' => $days,
		'\\W' => '',
		'W' => '') );
}
// End add - Birthday MOD
#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_main.php

# Note:
# These lang_main.php commands may need to be rearranged since 
# the Birthday and Word Count MODs that the FIND statements are based on
# may have been added in a different order than what I added them
#
#-----[ FIND ]------------------------------------------------
#
$lang['Total_Words'] = 'Total Words: ';
#
#-----[ REPLACE WITH ]------------------------------------------------
#
$lang['Total_Words2'] = 'Word Cnt.';
#
#-----[ FIND ]------------------------------------------------
#
$lang['Age'] = 'Age: %d<br />';
#
#-----[ REPLACE WITH ]------------------------------------------------
#
$lang['Age'] = 'BDay';
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------------
#
	<!-- BEGIN postrow -->
	<tr> 
		<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}"><span class="name"><a name="{postrow.U_POST_ID}"></a><b>{postrow.POSTER_NAME}</b></span><br /><span class="postdetails">{postrow.POSTER_RANK}<br />{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}<br /><br />{postrow.POSTER_JOINED}<br />{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM}</span><br /></td>
		<td class="{postrow.ROW_CLASS}" width="100%" height="28" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td width="100%"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_POSTED}: {postrow.POST_DATE}<span class="gen">&nbsp;</span>&nbsp; &nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td>
				<td valign="top" nowrap="nowrap">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}</td>
			</tr>
			<tr> 
				<td colspan="2"><hr /></td>
			</tr>
			<tr>
				<td colspan="2"><span class="postbody">{postrow.MESSAGE}{postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td>
			</tr>
		</table></td>
	</tr>
	<tr> 
		<td class="{postrow.ROW_CLASS}" width="150" align="left" valign="middle"><span class="nav"><a href="#top" class="nav">{L_BACK_TO_TOP}</a></span></td>
		<td class="{postrow.ROW_CLASS}" width="100%" height="28" valign="bottom" nowrap="nowrap"><table cellspacing="0" cellpadding="0" border="0" height="18" width="18">
			<tr> 
				<td valign="middle" nowrap="nowrap">{postrow.PROFILE_IMG} {postrow.PM_IMG} {postrow.EMAIL_IMG} {postrow.WWW_IMG} {postrow.AIM_IMG} {postrow.YIM_IMG} {postrow.MSN_IMG}<script language="JavaScript" type="text/javascript"><!-- 

	if ( navigator.userAgent.toLowerCase().indexOf('mozilla') != -1 && navigator.userAgent.indexOf('5.') == -1 && navigator.userAgent.indexOf('6.') == -1 )
		document.write(' {postrow.ICQ_IMG}');
	else
		document.write('</td><td>&nbsp;</td><td valign="top" nowrap="nowrap"><div style="position:relative"><div style="position:absolute">{postrow.ICQ_IMG}</div><div style="position:absolute;left:3px;top:-1px">{postrow.ICQ_STATUS_IMG}</div></div>');
				
				//--></script><noscript>{postrow.ICQ_IMG}</noscript></td>
			</tr>
		</table></td>
	</tr>
	<tr> 
		<td class="spaceRow" colspan="2" height="1"><img src="templates/subSilver/images/spacer.gif" alt="" width="1" height="1" /></td>
	</tr>
	<!-- END postrow -->
#
#-----[ REPLACE WITH ]-----------------------------------------
#
<!-- BEGIN postrow -->
<tr>
	<th align="center" valign="middle">
		<table border="0" cellspacing="0" cellpadding="3" width="100%">
		<tr>
			<td>
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="genmed">{L_POSTED}: {postrow.POST_DATE}</span></td>
					<td align="right" valign="middle" nowrap="nowrap">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG} </td>
				</tr>
				</table>
			</td>
		</tr>
		</table>
	</th>
</tr>
<tr>
	<td align="left" valign="top">
		<table border="0" cellspacing="0" cellpadding="0" width="100%">
		<tr>
			<td align="left" valign="top" rowspan="2" class="row2" width="160">
				<table border="0" cellspacing="0" cellpadding="3" width="100%">
				<tr>
					<td width="100%" align="left" valign="top">
						<table border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td nowrap="nowrap">
								<table>
								<tr>
									<td align=left valign=top>
										<table>
										<tr><td align="center"><span class="postdetails">{postrow.RANK_IMAGE}</span><td></tr>
										<tr><td align="center"><span class="name"><b>{postrow.POSTER_NAME}</b></span></td></tr>
										<tr><td align="center"><span class="postdetails">{postrow.POSTER_AVATAR}</span><td></tr>
										</table>
									</td>
									<td align=right valign=bottom>
										<table>
										<tr>
											<td align="center" nowrap="nowrap"><span class="postdetails">{postrow.POSTER_RANK}</span></td>
										</tr>
										<tr>
											<td>
												<table border=1>
												<tr>
													<td class="row4"><span class="postdetails">{postrow.SEARCH_TEXT}</span></td>
													<td class="row1" nowrap align=center><span class="postdetails">{postrow.SEARCH2}</span></td>
												</tr>
												<tr>
													<td class="row4" width=50><span class="postdetails">{postrow.TOTAL_WORDS_TEXT2}</span></td>
													<td class="row1" nowrap align=center><span class="postdetails">{postrow.WORD_COUNT}</span></td>
												</tr>
								   				<tr>
									   				<td class="row4"><span class="postdetails">{postrow.POSTER_AGE_TEXT}</span></td>
									   				<td class="row1" nowrap align=center><span class="postdetails">{postrow.POSTER_AGE2}</span></td>
								   				</tr>
												<tr>
													<td class="row4"><span class="postdetails">{postrow.L_ZODIAC2}</span></td>
													<td class="row1" nowrap align=center><span class="postdetails">{postrow.ZODIAC_IMG}</span></td>
												</tr>
												<tr>
													<td class="row4"><span class="postdetails">{postrow.POSTER_GENDER_TEXT}</span></td>
													<td class="row1" nowrap align=center><span class="postdetails">{postrow.POSTER_GENDER2}</span></td>
												</tr>
												</table>
											</td>
										</tr>
										</table>
									</td>
								</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td>
								<table width="100%">
								<tr>
									<td nowrap><span class="postdetails">
										{postrow.POSTER_JOINED}<br />
										{postrow.LOCAL_TIME}<br />
										{postrow.POSTER_FROM}</span>
									</td>
									<td align="right" valign=middle><span class="postdetails">{postrow.POSTER_FROM_FLAG}</span></td>
								</tr>
								</table>
							</td>
						</tr>
						</table>
					</td>
				</tr>
				</table>
			</td>
			<td width="1" rowspan="4" class="spacer"><img src="{T_TEMPLATE_PATH}/images/spacer.gif" width="1" height="1" border="0" alt="" /></td>
			<td width="100%" class="row1" align="left" valign="top"><table border="0" cellspacing="0" cellpadding="3" width="100%"><tr><td align="left" valign="top"><span class="postbody">{postrow.MESSAGE}</span></td></tr></table></td>
		</tr>
		<tr>
			<td class="row1" align="left" valign="middle" colspan="2"><table border="0" cellspacing="0" cellpadding="3" width="100%"><tr><td align="left" valign="bottom"><span class="postbody"><span class="gensmall">{postrow.EDITED_MESSAGE}</span></span>{postrow.ATTACHMENTS}<span class="postbody">{postrow.SIGNATURE}</span></td></tr></table></td>
		</tr>
		<tr>
			<td class="row2"><img src="{T_TEMPLATE_PATH}/images/spacer.gif" width="160" height="1" border="0" alt="" /></td>
			<td class="spacer" height="1"><img src="{T_TEMPLATE_PATH}/images/spacer.gif" width="1" height="1" border="0" alt="" /></td>
		</tr>
		<tr height="28">
			<td class="row2" align="center"><a href="#top">Back to Top</a></td>
			<td height="28" valign="bottom" class="row4" nowrap="nowrap"><table border="0" cellspacing="0" cellpadding="3" width="100%"><tr><td width="100%" align="left" valign="middle">{postrow.USER_PIX_IMG}{postrow.PROFILE_IMG} {postrow.SEARCH_IMG} {postrow.PM_IMG} {postrow.EMAIL_IMG} {postrow.WWW_IMG} {postrow.AIM_IMG} {postrow.YIM_IMG} {postrow.MSN_IMG} {postrow.BLOG_IMG} {postrow.GTALK_IMG} {postrow.ICQ_IMG}</td></tr></table></td>
		</tr>
		</table>
	</td>
</tr>
<!-- END postrow -->
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------
#
# EoM