<?php
// ------------------------------------------------------------------------- //
//               				 SermonIndex.net                            //
// ------------------------------------------------------------------------- //
//  This site is coded for the Glory of God and the spread of the Gospel.     //
// ------------------------------------------------------------------------- //

$xoopsOption['pagetype'] = "user";
include("mainfile.php");
include_once(XOOPS_ROOT_PATH."/class/module.textsanitizer.php");
include_once(XOOPS_ROOT_PATH."/class/xoopsmodule.php");

$uid = intval($_GET['uid']);
if ( empty($uid) ) {
	redirect_header("index.php",3,_US_SELECTNG);
	exit();
}

if ( $xoopsUser ) {
	if ( $uid == $xoopsUser->getVar("uid") ) {
		include("header.php");
		OpenTable();
		echo "<div>";
		echo "<h3>";
		printf(_US_WELCOME,$xoopsConfig['sitename']);
		echo "</h3><br />";
		echo "<h4>"._US_THISISYOURPAGE."</h4><br />";
		echo "<form name='usernav' action='user.php' method='post'>
		<table align='center' border='0'><tr><td><input type='button' class='button' value='"._US_EDITPROFILE."' onclick=\"location='edituser.php'\" /></td>";
		if ( $xoopsConfig['avatar_allow_upload'] == 1 ) {
			echo "<td><input type='button' class='button' value='"._US_UPLOADMYAVATAR."' onclick=\"location='edituser.php?op=avatarform'\" /></td>";
		}
		echo "<td></td>";

		if ( $xoopsConfig['self_delete'] ) {
			echo "<td><input type='button' class='button' value='"._US_DELACCOUNT."' onclick=\"location='user.php?op=delete'\" /></td>";
		}
		echo "<td><input type='button' class='button' value='"._US_LOGOUT."' onclick=\"location='user.php?op=logout'\" /></td>
		<td></td></tr></table></form><br /><br />\n\n";
		$thisUser =& $xoopsUser;
	} else {
		$thisUser= new XoopsUser($uid);
		if ( !$thisUser->isActive() ) {
			redirect_header("index.php",3,_US_SELECTNG);
			exit();
		}
		include("header.php");
		OpenTable();
		echo "<div>";
		echo "<script type='text/javascript'><!--
google_ad_client = 'ca-pub-2782595449860661';
/* sermonindex3 */
google_ad_slot = '3618960764';
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type='text/javascript'
src='https://pagead2.googlesyndication.com/pagead/show_ads.js'>
</script><br><br>
<table cellspacing=0 cellpadding=1 width=600 border=0 bgcolor=#BCBCAB><tr><td>
<table cellspacing=0 cellpadding=10 width=600 border=0 bgcolor=#f7f7e0><tr>
</tr>
<tr>
<td width=138><i>Freely access thousands of free audio sermon mp3 files for download <a href='https://www.sermonindex.net/modules/mydownloads/'>by speaker</a>, <a href='https://www.sermonindex.net/modules/mydownloads/scr_index.php?act=topicsList'>by topic</a>, <a href='https://www.sermonindex.net/modules/mydownloads/scr_index.php?act=booksList'>by scripture</a> or <a href='https://phobos.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=161123223' target='_blank'>by podcast</a>.</i><br><br>
Sermonindex is not an attempt by man to build something for God. It began as God gave the burden and only will continue as He is guiding the work being fully trusted. It began by a work of God's Spirit and for His glory: Not by might nor by power, but by my Spirit, says the LORD Almighty1. The work and ministry of SermonIndex can be encapsulated in this one word: Revival. Concepts such as Holiness, Purity, Christ-Likeness, Self-Denial and Discipleship are hardly the goal of much modern preaching. (Read more <a href=https://www.sermonindex.net/about.php>about SermonIndex.net</a>)
<br><br>
</td>
</tr></table></td></tr></table><br><br><h4>";
		printf(_US_PROFILEFOR,$thisUser->getVar("uname"));
		echo "</h4><br />";
	}
} else {
	$thisUser = new XoopsUser($uid);
	if ( !$thisUser->isActive() ) {
		redirect_header("index.php",3,_US_SELECTNG);
		exit();
	}
	include("header.php");
	OpenTable();
	echo "<div>";
	echo "<h4>";
	printf(_US_PROFILEFOR,$thisUser->getVar("uname"));
	echo "</h4><br />";
}
$myts =& MyTextSanitizer::getInstance();
if ( $thisUser->isActive() ) {
	echo "<table width='100%' border='0'><tr valign='top'><td width='50%'><table border='0' cellpadding='0' cellspacing='0' align='center' valign='top' width='80%'><tr><td class='bg2'><table border='0' cellpadding='4' cellspacing='1' width='100%'><tr valign='top' class='bg1'><td colspan='2' align='center'><b>".sprintf(_US_ALLABOUT,$thisUser->getVar("uname"))."</b></td></tr><tr valign='top' class='bg1'><td><b>"._US_REALNAME.":</b></td><td align='center'>".$thisUser->getVar("name")."</td></tr>";

	echo "</td></tr><tr valign='top' class='bg1'><td><b>"._US_EMAIL.":</b></td><td>"; 
	if ( $thisUser->getVar("user_viewemail") == 1 ) { 
		 echo "<a href='mailto:".$thisUser->getVar("email", "E")."'>".$thisUser->getVar("email")."</a><br />\n"; 
	} else {
		if ( $xoopsUser ) {
			if ( $xoopsUser->isAdmin() || ($xoopsUser->getVar("uid") == $thisUser->getVar("uid")) ) {
				echo "<a href='mailto:".$thisUser->getVar("email", "E")."'>".$thisUser->getVar("email")."</a><br />\n"; 
			}
		}
		echo "&nbsp;";
	}
	echo "";
	
	echo "<tr valign='top' class='bg1'><td><b>"._US_LOCATION.":</b></td><td>";
	echo $thisUser->getVar("user_from");
	echo "";
	echo $thisUser->getVar("user_occ");
	echo "</td></tr><tr valign='top' class='bg1'><td><b>"._US_INTEREST.":</b></td><td>";
	echo $thisUser->getVar("user_intrest");
	echo "</td></tr>";
	echo "</td></tr></table></td></tr></table>";
	echo "<td width='50%'><table border='0' cellpadding='0' cellspacing='0' align='center' valign='top' width='80%'><tr><td class='bg2'><table border='0' cellpadding='4' cellspacing='1' width='100%'><tr valign='top' class='bg3'><td><b>"._US_MEMBERSINCE.":</b></td><td align='center'>".formatTimestamp($thisUser->getVar("user_regdate"),"s")."</td></tr>\n";
	$userrank = $thisUser->rank();
	echo "<tr valign='top' class='bg1'><td><b>"._US_RANK.":</b></td><td align='center'>";
	if ( $userrank['image'] ) {
		echo "<img src='".XOOPS_URL."/images/ranks/".$userrank['image']."' alt='' /><br />";
	}
	echo $userrank['title']."</td></tr><tr valign='top' class='bg3'><td><b>"._US_POSTS.":</b></td><td align='center'>".$thisUser->getVar("posts")."</td></tr>\n";
	$date = $thisUser->getVar("last_login");
	if ( !empty($date) ) {
		echo "<tr valign='top' class='bg1'><td><b>"._US_LASTLOGIN.":</b></td><td align='center'>".formatTimestamp($date,"m")."</td></tr>\n";
	}
echo "</table></td></tr></table><br /><table border='0' cellpadding='0' cellspacing='0' align='center' valign='top' width='80%'><tr><td class='bg2'><table border='0' cellpadding='4' cellspacing='1' width='100%'><tr valign='top' class='bg1'><td colspan='2' align='center'><b>"._US_SIGNATURE."</b></td></tr><tr valign='top' class='bg3'><td>".$myts->makeTareaData4Show($thisUser->getVar("user_sig"),0,1,1)."</td></tr></table></td></tr></table></td></tr></table></div>";
} else {
	echo "<div>";
	printf(_US_INACTIVE,$uid);
	echo "</div>";
}

CloseTable();
echo "<br /><br /><div>";

echo "</div>";
include("footer.php");
?>
