File: /home/httpd/html/tubeshemale.com/public_html/my_profile.php
<?
session_start();
include('admin/db.php');
if(!$_SESSION[userid]) {
header("Location: /login.php");
exit();
}
$title = 'My Profile';
$headertitle = "Welcome, $_SESSION[username]";
if($isMobile) {
include($basepath.'/templates/mobile.overall_header.php');
}
else {
include($basepath.'/templates/template.overall_header.php');
}
$user=$_SESSION[userid];
$userresult = mysql_query("SELECT * FROM users WHERE record_num = '$_SESSION[userid]'");
$urow = mysql_fetch_array($userresult);
$pageref = 'mystuff';
?>
<!-- PROFILE-->
<!-- general info-->
<div id="view_box" style="width:170px; padding-top:5px; height:125px;">
<center><? if($urow[avatar] != '') { ?><img src='<? echo $misc_url; ?>/<? echo $urow[avatar]; ?>' /><? } else { ?><img src='<? echo $basehttp; ?>/images/avatars/default.jpg' width=160 height=120 /><? } ?></center>
</div>
<!-- end-->
<!-- general info-->
<!-- PROFILE-->
<!-- general info-->
<div style="float: right; width:450px; margin-left:15px; padding-left:15px; height:120px; padding-top:10px; ">
<table width='100%' cellpadding="0" cellspacing="0" border="0">
<tr>
<td width='50%'><? if($urow[age] && $urow[gender]) { ?><strong><?=$urow[age];?> year old <?=$urow[gender];?></strong><? } ?></td>
<td width='50%'><? if($urow[location]) { ?><strong>Location:</strong> <? echo $urow[location]; ?><? } ?></td>
</tr>
<tr>
<td width='50%'><strong>Videos Uploaded:</strong> <? echo mysql_num_rows(mysql_query("SELECT record_num FROM content WHERE submitter = '$urow[record_num]' AND approved = 2")); ?>
<br /> <strong>Joined:</strong> <? echo date('F jS Y',strtotime($urow[date_joined])); ?></td>
<td width='50%'><strong>Total Video Views:</strong> <? $count = mysql_query("SELECT SUM(content_views.views) as viewcount FROM content, content_views WHERE content_views.content = content.record_num AND content.submitter = '$urow[record_num]' AND content.approved = 2") or die(mysql_error()); $crow = mysql_fetch_array($count); if($crow[viewcount]) { echo $crow[viewcount]; } else { echo "0"; } ?></td>
</tr>
</table>
<br />
<? if($urow[description]) { ?>
<strong>A little about me...</strong><br />
<? echo nl2br($urow[description]); ?>
<? } ?>
</div>
<!-- end-->
<!-- general info-->
<div style='clear: both; padding-top: 10px;'>
<h3>My Comments</h3>
<?
$cresult = mysql_query("SELECT * FROM profile_comments WHERE profile = '$user' ORDER BY timestamp DESC");
if(mysql_num_rows($cresult) > 0) {
?>
<div style='overflow : auto; max-height: 360px; font-family: Arial, Helvetica, sans-serif; font-size: 11px; clear: both;'>
<?
while($crow = mysql_fetch_array($cresult)) {
?>
<a href="<? echo $basehttp; ?>/profiles/<? echo $crow[userid]; ?>.html"><? echo $crow[name]; ?></a> wrote <? echo datediff('n',$crow[timestamp],time(),true); ?> ago:<br/>
<strong> <? echo $crow[comment]; ?></strong><br /><br />
<? } ?>
</div>
<? } else { ?>
<div style='font-family: Arial, Helvetica, sans-serif; font-size: 10px;'>
There is no comments for this profile.
</div>
<? } ?>
</div>
<!-- end-->
<!-- general info-->
<div style="width:100%; clear: both;">
<h3>My Uploads</h3>
<?
$result = mysql_query("SELECT content.*, (SELECT content_views.views FROM content_views WHERE content_views.content = content.record_num) as views FROM content WHERE content.submitter = '$user' AND enabled = 1 ORDER BY content.encoded_date DESC LIMIT 0,8") or die(mysql_error());
$total_results = mysql_num_rows($result);
if($total_results < 1) {
echo "<p>You have not uploaded anything!</p>";
$showMore = false;
}
else {
$counter = 0;
while($row = mysql_fetch_array($result)) {
if($row[photos] == 1) {
include($basepath.'/templates/template.content_item_photo.php');
}
else {
include($basepath.'/templates/template.content_item.php');
}
}
$showMore = true;
}
?>
<div style="width:100%; float:left; margin-top:10px; padding-left:10px;"><? if($showMore) { ?><a href="<? echo $basehttp; ?>/my-uploads/">Show More</a><? } ?></div>
<div style="float:left; height:5px; width:100%;"></div>
</div>
<!-- end-->
<!-- general info-->
<div style="clear: both; width:100%; padding-top: 10px;">
<h3>My Friends</h3>
<?
$result = mysql_query("SELECT users.* FROM users, subscriptions WHERE subscriptions.friend = users.record_num AND subscriptions.user = '$_SESSION[userid]' GROUP BY subscriptions.friend ORDER BY username ASC LIMIT 0,8") or die(mysql_error());
$total_results = mysql_num_rows($result);
if($total_results < 1) {
echo "<p>You do not have any friends added!</p>";
$showFriends = false;
}
else {
$showFriends = true;
$counter = 0;
while($row = mysql_fetch_array($result)) {
include($basepath.'/templates/template.friends_item.php');
}
}
?>
<div style="width:100%; float:left; margin-top:10px; padding-left:10px;"><? if($showFriends) { ?><a href="<? echo $basehttp; ?>/my-friends/page1.html">Show More</a><? } ?></div>
</div>
<?
if($isMobile) {
include($basepath.'/templates/mobile.overall_footer.php');
}
else {
include($basepath.'/templates/template.overall_footer.php');
}
?>