Файл: Source/pages/cp.php
Строк: 398
<?php
/*
* Script name: Points4Prize
* Author: Soft Projects
* Date created: 15/07/2015
*/
require_once 'inc/header.php';
if (!isset($_SESSION['logged_in'])) {
header('Location: /login');
exit();
}
if (isset($_SESSION['user'], $_SESSION['pass'])) {
$user = str_replace(" ", "", $_SESSION['user']);
$user = sprintf("%s", mysql_real_escape_string($user));
} else {
$user = str_replace(" ", "", $_COOKIE['user']);
$user = sprintf("%s", mysql_real_escape_string($user));
}
$result = mysql_query("SELECT * FROM vn_users WHERE user='{$user}'") or die(mysql_error());
$row = mysql_fetch_array($result);
$mail = $row['email'];
$USERID = $row['id'];
$description = $row['about'];
$vzeti_nagradi = $row['wonprizes'];
$points = number_format($row['points'], 0, ',', ' ');
$query31 = mysql_query("SELECT count(id) as sms from `vn_sms` WHERE `userid` = '".$row['id']."'");
$row1 = mysql_fetch_array($query31);
$xaxa = $row1['sms'];
if ($row1['sms'] > 1) {
$sms = $xaxa;
} else {
$sms = $xaxa;
}
$regdate = date("j.F.Y", $row['regtime']);
if (empty($row['avatar'])) {
$avatar = "uploads/avatars/noavatar.png";
} else {
$avatar = $row['avatar'];
}
$result2 = mysql_query("SELECT forw FROM vn_messages WHERE forw='{$user}' and readed='0'") or die(mysql_error());
$countm = mysql_num_rows($result2);
if ($countm > 0) {
$countm = "<b>$countm</b>";
} else {
$countm = $countm;
}
?>
<body class="no-slider">
<!-- <body class="has-top-menu"> -->
<!-- BEGIN #slider-imgs -->
<div id="slider-imgs">
<div class="featured-img-box">
<div id="featured-img-1" class="featured-img"></div>
<div id="featured-img-2" class="featured-img invisible"></div>
<div id="featured-img-3" class="featured-img invisible"></div>
<div id="featured-img-4" class="featured-img invisible"></div>
</div>
<!-- END #slider-imgs -->
</div>
<!-- BEGIN #top-layer -->
<div id="top-layer">
<div id="header-top">
<?php
require_once 'inc/header_top.php';
?>
</div>
<section id="content">
<header id="header">
<div id="menu-bottom">
<?php
require_once 'inc/menu_bottom.php';
?>
</div>
<div class="wrapper">
<div class="header-breadcrumbs">
<?php require_once 'inc/stats.php';
?>
</div>
</div>
</header>
<br />
<br />
<div id="main-box" class="full-width">
<div id="main">
<!-- BEGIN .user-profile -->
<div class="user-profile">
<div class="profile-shadow"></div>
<!-- BEGIN .profile-left-side -->
<div class="profile-left-side">
<div class="the-profile-top">
<div class="profile-user-name">
<h1><?php echo $user;?></h1>
<div class="sttaa"><a href="/pm">Mesagess <b>(<?php echo $countm;?>)</b></a></div>
</div>
<div class="avatar online">
<div class="avatar-button"><a href="/avatar"><i class="fa fa-camera-retro"></i>Change avatar</a></div>
<img src="<?php echo $avatar;?>" class="setborder" style="width:100%;" alt="" />
</div>
<div class="user-panel-about">
<div>
<b><i class="fa fa-male"></i>Description</b>
<p>
<?php
if (empty($description)) {
$description = "None";
} else {
$description = htmlentities($description, ENT_COMPAT, 'UTF-8');
$description = $description;
$description = str_replace(":)", " <img border='0'src='assets/img/emoticons/01.gif'> ", "$description");
$description = str_replace(":(", " <img border='0'src='assets/img/emoticons/02.gif'> ", "$description");
$description = str_replace(":D", " <img border='0'src='assets/img/emoticons/03.gif'> ", "$description");
$description = str_replace("8-)", " <img border='0'src='assets/img/emoticons/04.gif'> ", "$description");
$description = str_replace(":O", " <img border='0'src='assets/img/emoticons/05.gif'> ", "$description");
$description = str_replace(";)", " <img border='0'src='assets/img/emoticons/06.gif'> ", "$description");
$description = str_replace(";(", " <img border='0'src='assets/img/emoticons/07.gif'> ", "$description");
$description = str_replace("(sweat)", " <img border='0'src='assets/img/emoticons/08.gif'> ", "$description");
$description = str_replace(":|", " <img border='0'src='assets/img/emoticons/09.gif'> ", "$description");
$description = str_replace(":*", " <img border='0'src='assets/img/emoticons/10.gif'> ", "$description");
$description = str_replace(":p", " <img border='0'src='assets/img/emoticons/11.gif'> ", "$description");
$description = str_replace("(blush)", " <img border='0'src='assets/img/emoticons/12.gif'> ", "$description");
$description = str_replace(":^)", " <img border='0'src='assets/img/emoticons/13.gif'> ", "$description");
$description = str_replace(":-)", " <img border='0'src='assets/img/emoticons/14.gif'> ", "$description");
$description = str_replace(":-(", " <img border='0'src='assets/img/emoticons/15.gif'> ", "$description");
$description = str_replace("(love)", " <img border='0'src='assets/img/emoticons/16.gif'> ", "$description");
$description = str_replace("(inlove)", " <img border='0'src='assets/img/emoticons/16.gif'> ", "$description");
$description = str_replace(":_)", " <img border='0'src='assets/img/emoticons/17.gif'> ", "$description");
$description = str_replace("(talk)", " <img border='0'src='assets/img/emoticons/18.gif'> ", "$description");
$description = str_replace("(yawn)", " <img border='0'src='assets/img/emoticons/19.gif'> ", "$description");
$description = str_replace("(puke)", " <img border='0'src='assets/img/emoticons/20.gif'> ", "$description");
$description = str_replace("(doh)", " <img border='0'src='assets/img/emoticons/21.gif'> ", "$description");
$description = str_replace(":@", " <img border='0'src='assets/img/emoticons/22.gif'> ", "$description");
$description = str_replace("@", " <img border='0'src='assets/img/emoticons/22.gif'> ", "$description");
$description = str_replace(";@", " <img border='0'src='assets/img/emoticons/22.gif'> ", "$description");
$description = str_replace("(wasntme)", " <img border='0'src='assets/img/emoticons/23.gif'> ", "$description");
$description = str_replace("(party)", " <img border='0'src='assets/img/emoticons/24.gif'> ", "$description");
$description = str_replace(":s", " <img border='0'src='assets/img/emoticons/25.gif'> ", "$description");
$description = str_replace("(mm)", " <img border='0'src='assets/img/emoticons/26.gif'> ", "$description");
$description = str_replace("8-|", " <img border='0'src='assets/img/emoticons/27.gif'> ", "$description");
$description = str_replace(":x", " <img border='0'src='assets/img/emoticons/28.gif'> ", "$description");
$description = str_replace("(wave)", " <img border='0'src='assets/img/emoticons/29.gif'> ", "$description");
$description = str_replace("(hi)", " <img border='0'src='assets/img/emoticons/29.gif'> ", "$description");
$description = str_replace("(devil)", " <img border='0'src='assets/img/emoticons/31.gif'> ", "$description");
$description = str_replace("(hug)", " <img border='0'src='assets/img/emoticons/35.gif'> ", "$description");
$description = str_replace("(thing)", " <img border='0'src='assets/img/emoticons/39.gif'> ", "$description");
$description = str_replace("(rofl)", " <img border='0'src='assets/img/emoticons/41.gif'> ", "$description");
$description = str_replace("(whew)", " <img border='0'src='assets/img/emoticons/42.gif'> ", "$description");
$description = str_replace("(happy)", " <img border='0'src='assets/img/emoticons/43.gif'> ", "$description");
$description = str_replace("(punch)", " <img border='0'src='assets/img/emoticons/47.gif'> ", "$description");
$description = str_replace("(skype)", " <img border='0'src='assets/img/emoticons/52.gif'> ", "$description");
$description = str_replace("(h)", " <img border='0'src='assets/img/emoticons/53.gif'> ", "$description");
$description = str_replace("(u)", " <img border='0'src='assets/img/emoticons/54.gif'> ", "$description");
$description = str_replace("(rain)", " <img border='0'src='assets/img/emoticons/57.gif'> ", "$description");
$description = str_replace("(sun)", " <img border='0'src='assets/img/emoticons/58.gif'> ", "$description");
$description = str_replace("(o)", " <img border='0'src='assets/img/emoticons/59.gif'> ", "$description");
$description = str_replace("(mp)", " <img border='0'src='assets/img/emoticons/62.gif'> ", "$description");
$description = str_replace("(pi)", " <img border='0'src='assets/img/emoticons/64.gif'> ", "$description");
$description = str_replace("(^)", " <img border='0'src='assets/img/emoticons/67.gif'> ", "$description");
$description = str_replace("(beer)", " <img border='0'src='assets/img/emoticons/68.gif'> ", "$description");
$description = str_replace("(d)", " <img border='0'src='assets/img/emoticons/69.gif'> ", "$description");
$description = str_replace("(drunk)", " <img border='0'src='assets/img/emoticons/75.gif'> ", "$description");
$description = str_replace("(flag:bg)", " <img border='0'src='assets/img/emoticons/77.gif'> ", "$description");
$description = str_replace("(bg)", " <img border='0'src='assets/img/emoticons/77.gif'> ", "$description");
$description = str_replace("(headbang)", " <img border='0'src='assets/img/emoticons/79.gif'> ", "$description");
$description = str_replace("(mooning)", " <img border='0'src='assets/img/emoticons/80.gif'> ", "$description");
$description = str_replace("(poolparty)", " <img border='0'src='assets/img/emoticons/81.gif'> ", "$description");
$description = str_replace("(smoke)", " <img border='0'src='assets/img/emoticons/83.gif'> ", "$description");
$description = str_replace("<plaintext></plaintext>", " <img border='0'src='assets/img/emoticons/01.gif'> ", "$description");
$description = str_replace("<plaintext>", " <img border='0'src='assets/img/emoticons/01.gif'> ", "$description");
$description = str_replace("</plaintext>", " <img border='0'src='assets/img/emoticons/01.gif'> ", "$description");
$description = str_replace("alert", " <img border='0'src='assets/img/emoticons/01.gif'> ", "$description");
$description = str_replace("<table>", " <img border='0'src='assets/img/emoticons/01.gif'> ", "$description");
$description = str_replace("<div>", " <img border='0'src='assets/img/emoticons/01.gif'> ", "$description");
$description = str_replace("<fieldset>", " <img border='0'src='assets/img/emoticons/01.gif'> ", "$description");
$description = str_replace("<script>", " <img border='0'src='assets/img/emoticons/01.gif'> ", "$description");
$description = str_replace("<body>", " <img border='0'src='assets/img/emoticons/01.gif'> ", "$description");
}
echo $description;
?>
</p>
</div>
<style>
.maibaton{
font-family: "Cuprum",sans-serif;
text-transform: uppercase;
font-size: 13px;
font-weight: bold;
width:100%;padding:9px;color:#4D4D4D;border:0px;backround:#EAEAEA;
}
</style>
</div>
<div>
<ul class="user-button-list">
<li><a href="/cp" class="defbutton profile-button"><i class="fa fa-user"></i>Profile</a></li>
<li><a href="/messages" class="defbutton profile-button"><i class="fa fa-comment"></i>Mesagess</a></li>
<li><a href="/getprize" class="defbutton profile-button"><i class="fa fa-gift"></i>Get Prize</a></li>
<li><a href="/smspoints" class="defbutton profile-button"><i class="fa fa-mobile"></i>SMS Points</a></li>
<li><a href="/settings" class="defbutton profile-button"><i class="fa fa-cog"></i>Settings</a></li>
<li><a href="/logout" class="defbutton profile-button"><i class="fa fa-toggle-on"></i>Logout</a></li>
</ul>
</div>
</div>
<!-- END .profile-left-side -->
</div>
<!-- BEGIN .profile-right-side -->
<div class="profile-right-side">
<h2><span>Profile</span></h2>
<!-- BEGIN .content-padding -->
<div class="content-padding">
<!-- BEGIN .info-blocks -->
<div class="info-blocks">
<ul>
<li><a href="#" class="info-block"><b><?php echo $points;?></b><span>Points</span></a></li>
<li><a href="#" class="info-block"><b><?php echo $vzeti_nagradi;?></b><span>Get Prizes</span></a></li>
<li><a href="#" class="info-block"><b><?php echo nomer_v_klasaciqta($user);?></b><span>Number in rankings</span></a></li>
<li><a href="#" class="info-block"><b><?php echo $sms;?></b><span>Sent SMS</span></a></li>
</ul>
<div class="clear-float"></div>
<!-- END .info-blocks -->
</div>
<div>
<div style="width:350px;" class="left">
<h2 style="margin-left:-30px;"><span>Information</span></h2>
<ul class="profile-info">
<li>
<span class="first">Username:</span>
<span class="last"><?php echo $user;?></span>
</li>
<li>
<span class="first">E-mail:</span>
<span class="last"><?php echo $mail;?></span>
</li>
<li>
<span class="first">Register on:</span>
<span class="last"><?php echo $regdate;?></span>
</li>
</ul>
<div class="clear-float"></div>
</div>
<div style="width:300px;" class="right">
<h2 style="margin-left: -30px;"><span>Control Panel</span></h2>
<ul class="profile-friends-list">
<div class="accordion">
<div class="accordion-tab">
<a href="#">Link voting.</a>
<div class="accordion-block">
<center>
<h5>Send your link to friends and acquaintances. <br />
A voice gives you 1 point.</h5>
<br />
<div class="form-group">
<input class="form-control" id="Input" readonly="readonly" style="padding:12px;"
value="<?php echo $GLOBALS['site_url']; ?>/u:<?php echo $user;?>" type="text">
</div>
<br />
</center>
</div>
</div>
<?php
$ttime = time();
$showtopq = mysql_query("SELECT * FROM vn_tops WHERE userid='$USERID' and time > $ttime") or die(mysql_error());
if ($row['vip'] == "1") {
$vpoints = 5;
} else {
$vpoints = 5;
}
if (mysql_num_rows($showtopq) <= 0 and !isset($_POST['topvote'])) {
?>
<?php
}?>
</div>
</ul>
<div class="clear-float"></div>
</div>
<div class="clear-float"></div>
</div>
<div>
</div>
<!-- END .content-padding -->
</div>
<!-- END .profile-right-side -->
</div>
<div class="clear-float"></div>
<!-- END .user-profile -->
</div>
</div>
<div class="clear-float"></div>
</div>
</div>
</div>
<?php
require_once 'inc/footer.php';
?>