<?php
////////////////////////////
//modded by phpfusion.lt //
//By nepster            //   
/////////////////////////
if (!defined("IN_FUSION")) { header("Location:../../index.php"); exit; }
include INFUSIONS."user_info_panel/locale/".$settings['locale'].".php";

$ui_img="".INFUSIONS."user_info_panel/images/";
//padarius true administravimo meniu matys paprasti administratoriai
//if true admin meniu for only super admins
$SADMIN=true;
//admin url, if false will be all navigation of administration
$simple_admin_url=false;

if (iMEMBER) {
openside($userdata['user_name']);
$msg_count = dbcount("(message_id)", DB_MESSAGES, "message_to='".$userdata['user_id']."' AND message_read='0'AND message_folder='0'");
if ($msg_count) { echo "<br /><br /><div style='text-align:center'><strong><a href='".BASEDIR."messages.php' class='side'>".sprintf($locale['global_125'], $msg_count).($msg_count == 1 ? $locale['global_126'] : $locale['global_127'])."</a></strong></div>\n"; 
}
if (file_exists(INFUSIONS."user_info_panel/locale/".$settings['locale'].".php")) {
    include INFUSIONS."user_info_panel/locale/".$settings['locale'].".php";
} else {
    include INFUSIONS."user_info_panel/locale/English.php";
}

$time = strftime("%H");

if ($time == "0") {
$pix="720";
$title="".$userdata['user_name'].", ".$locale['tday06']."";
}
if ($time == "1") {
$pix="730"; 
$title="".$userdata['user_name'].", ".$locale['tday06']."";
}
if ($time == "2") {
$pix="735"; 
$title="".$userdata['user_name'].", ".$locale['tday07']."";
}
if ($time == "3") {
$pix="740"; 
$title="".$userdata['user_name'].", ".$locale['tday08']."";
}
if ($time == "4") {
$pix="60"; 
$title="".$userdata['user_name'].", ".$locale['tday08']."";
}
if ($time == "5") {
$pix="90"; 
$title="".$userdata['user_name'].", ".$locale['tday09']."";
}
if ($time == "6") {
$pix="110"; 
$title="".$locale['tday10']." ".$userdata['user_name']."";
}
if ($time == "7") {
$pix="140"; 
$title="".$locale['tday10']." ".$userdata['user_name']."";
}
if ($time == "8") {
$pix="200"; 
$title="".$locale['tday10']." ".$userdata['user_name']."";
}
if ($time == "9") {
$pix="230"; 
$title="".$locale['tday10']." ".$userdata['user_name']."";
}
if ($time == "10") {
$pix="290"; 
$title="".$locale['tday11']." ".$userdata['user_name']."";
}
if ($time == "11") {
$pix="320"; 
$title="".$locale['tday11']." ".$userdata['user_name']."";
}
if ($time == "12") {
$pix="350"; 
$title="".$locale['tday12']." ".$userdata['user_name']."";
}
if ($time == "13") {
$pix="380"; 
$title="".$locale['tday12']." ".$userdata['user_name']."";
}
if ($time == "14") {
$pix="386"; 
$title="".$locale['tday12']." ".$userdata['user_name']."";
}
if ($time == "15") {
$pix="400"; 
$title="".$locale['tday13']." ".$userdata['user_name']."";
}
if ($time == "16") {
$pix="430"; 
$title="".$locale['tday13']." ".$userdata['user_name']."";
}
if ($time == "17") {
$pix="460"; 
$title="".$locale['tday13']." ".$userdata['user_name']."";
}
if ($time == "18") {
$pix="490"; 
$title="".$locale['tday14']." ".$userdata['user_name']."";
}
if ($time == "19") {
$pix="530"; 
$title="".$locale['tday14']." ".$userdata['user_name']."";
}
if ($time == "20") {
$pix="560"; 
$title="".$locale['tday14']." ".$userdata['user_name']."";
}
if ($time == "21") {
$pix="590"; 
$title="".$userdata['user_name'].", ".$locale['tday15']."";
}
if ($time == "22") {
$pix="650"; 
$title="".$userdata['user_name'].", ".$locale['tday15']."";
}
if ($time == "23") {
$pix="700"; 
$title="".$userdata['user_name'].", ".$locale['tday16']."";
}
    $width = 800;
    $height = 50;
    $array=array('height'=>$height,'width'=>$width,'offset'=>$pix);

echo "
<table cellpadding='0' cellspacing='0' border='0' width='100%' align='center'>
<tr>
<td>
";


echo "<div class='small' align='center'><b> $title </b>";
echo "<div style='display:none;'>Time of the Day by <a href='http://www.venue.nu'>Venue</a></div>
<div align='left' style='background-image: url(".INFUSIONS."user_info_panel/images/sky_bg.png);background-repeat: repeat;border:0;clip:auto;clear:both;width:140px;height:48;overflow:hidden;position:relative'>
<img src='".INFUSIONS."user_info_panel/images/sky.png' alt='' style='width:".$array['width']."px;height:".$array['height']."px;border:0;position:relative;top:0px;left:-".$array['offset']."px;' /></div>
";
if ($userdata['user_avatar'] != "") {
echo "<p><center><img border='0' src='".BASEDIR."images/avatars/".$userdata['user_avatar']."' height='85' width='100' ></center>\n";
} else {
echo "<center><img border='0' src='{$ui_img}noimage.gif'></center>\n";
}
if($simple_admin_url!=false) {
if (iADMIN && (iUSER_RIGHTS != "" || iUSER_RIGHTS != "C")) {
echo"<br><a href='".ADMIN."index.php".$aidlink."' class='side'>".$locale['global_123']."</a><br>";
    }
} else {
if (iADMIN && (iUSER_RIGHTS != "" || iUSER_RIGHTS != "C" || !$SADMIN=true)){
include INFUSIONS."user_info_panel/navigation.php";
    }
}
echo "<script>
var linktext=new Array()
linktext[0]=\"".THEME_BULLET.$locale['ui02']."\"
linktext[1]=\"".THEME_BULLET.$locale['ui03']."\"
linktext[2]=\"".THEME_BULLET.$locale['ui04']."\"
linktext[3]=\"".THEME_BULLET.$locale['ui05']."\"
linktext[4]=\"".THEME_BULLET.$locale['ui12']."\"
var ns6=document.getElementById&&!document.all
var ie=document.all
function show_text(thetext, whichdiv){
if (ie) eval(\"document.all.\"+whichdiv).innerHTML=linktext[thetext]
else if (ns6) document.getElementById(whichdiv).innerHTML=linktext[thetext]
}
function resetit(whichdiv){
if (ie) eval(\"document.all.\"+whichdiv).innerHTML=' '
else if (ns6) document.getElementById(whichdiv).innerHTML=' '
}
</script>";
echo "<br><a href='".BASEDIR."edit_profile.php' class='side'>
<img src='{$ui_img}profile.png' onMouseover=\"show_text(0,'div2')\" onMouseout=\"resetit('div2')\" border='0'></a>";
echo "<a href='".BASEDIR."messages.php' class='side'>
<img src='{$ui_img}private.png' onMouseover=\"show_text(1,'div2')\" onMouseout=\"resetit('div2')\" border='0'></a>";
echo "<a href='".BASEDIR."members.php' class='side'>
<img src='{$ui_img}users.png' onMouseover=\"show_text(2,'div2')\" onMouseout=\"resetit('div2')\" border='0'></a>";
echo "<a href='".BASEDIR."edit_userprofilepics.php' class='side'>
<img src='{$ui_img}gallery.png' onMouseover=\"show_text(4,'div2')\" onMouseout=\"resetit('div2')\" border='0'></a>";
echo "<a href='".BASEDIR."setuser.php?logout=yes' class='side'>
<img src='{$ui_img}exit.png' onMouseover=\"show_text(3,'div2')\" onMouseout=\"resetit('div2')\" border='0'></a>\n<br>";

echo "<span id=\"div2\"></span>";
echo "<br><br><hr>";
//ranks    
require_once "exp_include.php";
showexp($userdata['user_id'],$userdata['user_posts'], "1");
} else {
openside($locale['global_100']);
echo "<div style='text-align:center'>\n";
echo "<form name='loginform' method='post' action='".FUSION_SELF."'>\n";
echo $locale['global_101']."<br />\n<input type='text' name='user_name' class='textbox' style='width:100px' /><br />\n";
echo $locale['global_102']."<br />\n<input type='password' name='user_pass' class='textbox' style='width:100px' />
<br />\n";
echo "<input type='checkbox' name='remember_me' value='y' title='".$locale['global_103']."' style='vertical-align:middle;' />\n";
echo "<input type='submit' name='login' value='".$locale['global_104']."' class='button' /><br />\n";
echo "</form>\n<br />\n";
    if ($settings['enable_registration']) {
echo "".$locale['global_105']."<br /><br />\n";
    }
echo $locale['global_106']."\n</div>\n";
}
echo "<style type=\"text/css\">
#dhtmltooltip{
position: absolute;
width: 150px;
border: 1px solid #c2d0d8;
padding: 2px;
background-color: lightyellow;
visibility: hidden;
z-index: 100;
filter: progid:DXImageTransform.Microsoft.Shadow(color=gray,direction=135);
}
</style>";
echo "<div id=\"dhtmltooltip\"></div><script type=\"text/javascript\">
var offsetxpoint=-60 
var offsetypoint=20 
var ie=document.all
var ns6=document.getElementById && !document.all
var ena*a?*ip=false
if (ie||ns6)
var tipobj=document.all? document.all[\"dhtmltooltip\"] : document.getElementById? document.getElementById(\"dhtmltooltip\") : \"\"
function ietruebody(){
return (document.compatMode && document.compatMode!=\"BackCompat\")? document.documentElement : document.body
}
function ddrivetip(thetext, thecolor, thewidth){
if (ns6||ie){
if (typeof thewidth!=\"undefined\") tipobj.style.width=thewidth+\"px\"
if (typeof thecolor!=\"undefined\" && thecolor!=\"\") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
ena*a?*ip=true
return false
    }
}
function positiontip(e){
if (ena*a?*ip){
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20
var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000
if (rightedge<tipobj.offsetWidth)
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+\"px\" : window.pageXOffset+e.clientX-tipobj.offsetWidth+\"px\"
else if (curX<leftedge)
tipobj.style.left=\"5px\"
else
tipobj.style.left=curX+offsetxpoint+\"px\"
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+\"px\" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+\"px\"
else
tipobj.style.top=curY+offsetypoint+\"px\"
tipobj.style.visibility=\"visible\"
    }
}
function hideddrivetip(){
if (ns6||ie){
ena*a?*ip=false
tipobj.style.visibility=\"hidden\"
tipobj.style.left=\"-1000px\"
tipobj.style.backgroundColor=''
tipobj.style.width=''
    }
}
document.onmousemove=positiontip
</script>";

closeside();
?>
