<?php
#------
$ru = $_SERVER['SERVER_NAME'];
if(preg_match('#(.*?)\.vbl\.ir#si',$ru,$ru))
{
$unVar = $ru[1];
}
else
{
header("location:http://vasheghan.ir/");
}
if(empty($unVar))
{
header("location:http://vasheghan.ir/");
}
#------
require('../include/all.php');
#------
$start = isset($_GET['s'])?intval($_GET['s']):0;
if($start < 0 )$start = 0;
$start = floor($start/5)*5;
#------
$Query = "SELECT hw_config.*,profile.fname,profile.email,profile.photo FROM hw_config LEFT JOIN profile ON profile.username = '$unVar' WHERE hw_config.username = '$unVar' ";
$Result = mysql_db_query($DBname,$Query,$link) or die(mysql_error());
if(!$Cnf = mysql_fetch_array($Result))
{
include("nuf.php");
exit();
}
#------
$Cnf['dvisit'] = ($Cnf['date'] != date("Y-m-d")?'1':++$Cnf['dvisit']);
$Cnf['avisit']++;
$Query = "UPDATE `hw_config` SET `dvisit` = '".$Cnf['dvisit']."', `avisit` = '".$Cnf['avisit']."', `date` = '".date("y-m-d")."' WHERE `username` = '$unVar'";
$Result = mysql_db_query($DBname,$Query,$link);
#------
$inMyFriendList = 0;
if(!empty($_SesId))
{
$Query = "SELECT * FROM friends WHERE `user` = '{$_SesId}' AND `friend` = '$unVar'";
$Result = mysql_db_query($DBname,$Query,$link);
$inMyFriendList = mysql_num_rows($Result);
}
#------
if(isset($_GET['fav']))
{
if(empty($_SesId))
{
header("location:{$Root}/login.php");
exit();
}
if($_SesId != $unVar)
{
$Query =
$inMyFriendList?
"DELETE FROM friends WHERE `user` = '{$_SesId}' AND `friend` = '$unVar'"
:
"INSERT INTO friends VALUES('0','{$_SesId}','$unVar')";
$Result = mysql_db_query($DBname,$Query,$link);
if(!$inMyFriendList)
{
$title = 'انتخاب شما به عنوان دوست جدید';
$message = addslashes("کاربر گرامی <br />
شما توسط یکی از کاربران سایت با نام کاربری
<a target=\"_blank\" href=\""._profile($_SesId)."\" onmouseover=\"".$ttui->render($_SesId)."\" onmouseout=\"swapTooltip('default'); return false;\">{$_SesId}</a>
به عنوان دوست جدید انتخاب شده اید");
$Query = "INSERT INTO messages VALUES('0','".date("y-m-d")."','1','{$_SesId}','$unVar','$title','$message')";
$Result = mysql_db_query($DBname,$Query,$link);
$email = new email();
$email->assign(array(
'TPL' => "../include/mail/add.php",
'TO' => $Cnf['email'],
'SUBJECT' => "Notification For Friendship",
'VAR' => array(
'uname' => (empty($_SesNm)?$_SesId:$_SesNm),
'uid' => $_SesId
)
));
$email->compile();
$email->send();
unset($email);
}
}
header("location:"._weblog($unVar));
}
#------
$Query = "SELECT * FROM hw_notes WHERE `nid` = '".$Cnf['id']."' ORDER BY `id` DESC";
$pResult = mysql_db_query($DBname,$Query,$link) OR die(mysql_error());
$count = mysql_num_rows($pResult);
if($start > $count)$start = 0;
$pfn = ($start - 25 < 0)?0:$start - 25;
$pln = zRound(($count - ($pfn + 50) <= 0)?$count - ($count%5):$pfn + 50);
$pln = floor($pln/5)*5;
include('../include/header.php');
echo (strtolower($unVar) == 'mahsa')?'<bgsound src="http://vasheghan.ir/bg.mid" loop="-1">':'';
include('../include/top.php');
?>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" valign="top"> </td>
</tr>
<tr>
<td width="177" height="370" valign="top" style="border-right:1px dotted #EFEFEF">
<p><img src="<?=$Root?>album/?id=<?=$Cnf['photo']?>&size=medium" ></p>
<div align="right" style="padding-right:10px">
<p>
<a href="<?=_weblog($unVar)?>" target="_blank">صفحه اصلی</a> <img src="<?=$Root?>image/caret-rg.gif" width="11" height="7" /><br />
<a href="<?=_profile($unVar)?>" target="_blank">درباره من</a> <img src="<?=$Root?>image/caret-rg.gif" width="11" height="7" /><br />
<a href="<?=$Root?>messagesend.php?u=<?=$unVar?>" target="_blank">ارسال پیام</a> <img src="<?=$Root?>image/caret-rg.gif" width="11" height="7" /><br />
<?= ($_SesId != $unVar) ?'<a href="'._weblog($unVar).'?fav">'.($inMyFriendList?'حذف از لیست دوستان':'افزودن به لیست دوستان').'</a> <img src="'.$Root.'image/caret-rg.gif" width="11" height="7" />':''?>
</p>
</div>
<img src="<?=$Root?>image/vsubmenu.gif" />
<div align="right" style="font-size: 10px;font-weight: bold; padding:5px;">: لینک دوستان</div>
<div>
<div align="right" style="padding-right:10px" dir="rtl">
<?php
$Query = "SELECT * FROM friends WHERE `user` = '$unVar' ORDER BY `id` ASC";
$Result = mysql_db_query($DBname,$Query,$link);
if(mysql_num_rows($Result))
{
while($Row = mysql_fetch_array($Result))
{
$Query = "SELECT * FROM hw_config WHERE `username` = '".$Row['friend']."'";
$sResult = mysql_db_query($DBname,$Query,$link);
if($Row = mysql_fetch_array($sResult))
echo '<a href="'._weblog($Row['username']).'" target="_blank" dir="rtl">'.$Row['title'].'</a><br />';
}
}
else echo '<a href="'._weblog('saeed').' target="_blank">وبلاگ مدیر کلوب</a><br />';
?>
</div>
</div>
<p> </p>
<img src="<?=$Root?>image/vsubmenu.gif" />
<div align="right" style="font-size: 10px;font-weight: bold; padding:5px;">
: بازدید ها </div>
<div>
<div align="right" style="padding-right:10px"><br />
<table width="150" border="0" align="right" cellpadding="0" cellspacing="2">
<tr>
<td width="29%" align="left">بازدید</td>
<td width="43%" align="left">
<?=etop($Cnf['dvisit'])?> </td>
<td width="28%" align="left"> : امروز </td>
</tr>
<tr>
<td align="left">بازدید</td>
<td align="left">
<?=etop($Cnf['avisit'])?> </td>
<td align="left">: کل </td>
</tr>
</table>
</div>
</div>
</td>
<td align="center" valign="top" style="padding-left:10px;">
<!--Begin Iran-Ads.com code -->
<br />
<?php
@mysql_data_seek($pResult,$start);
for($j = 0; $j < 5; $j++)
{
if($Row = mysql_fetch_array($pResult))
{
?>
<table width="100%" border="0" align="center" cellpadding="10" cellspacing="2" style="border:1px solid #EFEFEF">
<tr bgcolor="#F2F2F2">
<td width="94%" align="right" background="<?=$Root?>image/top.gif" dir="rtl"><a href="javascript:void(0)" onclick="chngst('post<?=$Row['id']?>')"><?=$Row['title']?></a></td>
</tr>
</table>
<br />
<div id="post<?=$Row['id']?>">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="20" height="12" valign="top"><img src="<?=$Root?>image/quote_tl.gif" width="20" height="24" /></td>
<td background="<?=$Root?>image/frame_h0.gif"> </td>
<td width="58" height="12" valign="top"><img src="<?=$Root?>image/quote_tr.gif" width="58" height="24" /></td>
</tr>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td background="<?=$Root?>image/frame_l.gif"> </td>
<td height="50" colspan="2" valign="top" style="padding:5px " dir="rtl"><?=$Row['content']?></td>
<td background="<?=$Root?>image/frame_r.gif"> </td>
</tr>
<tr>
<td background="<?=$Root?>image/frame_l.gif"> </td>
<td colspan="2">
<hr size="0" noshade="noshade" style="color:#EFEFEF" />
</td>
<td background="<?=$Root?>image/frame_r.gif"> </td>
</tr>
<tr>
<td width="5" background="<?=$Root?>image/frame_l.gif"> </td>
<td width="100" align="center" >[ <a href="javascript:void(0)" onclick="javascript:NewWindow('comment.php?id=<?=$Row['id']?>','comments','353','380','no','center');">(<?=mysql_num_rows(mysql_db_query($DBname,"SELECT hw_comments.id FROM hw_notes,hw_comments WHERE hw_notes.id='".$Row['id']."' AND hw_comments.nid = hw_notes.id",$link))?>) نظرات</a> ]</td>
<td dir="rtl" align="right" style="font-size: 11px">نوشته شده توسط <?=empty($Cnf['fname'])?$Cnf['username']:$Cnf['fname']?> در تاریخ <?=pdate($Row['date'])?> </td>
<td width="5" background="<?=$Root?>image/frame_r.gif"> </td>
</tr>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="20" valign="top"><img src="<?=$Root?>image/quote_bl.gif" width="20" height="24" /></td>
<td background="<?=$Root?>image/frame_h1.gif"> </td>
<td width="20" height="12" align="right" background="image/frame_h1.gif"><img src="<?=$Root?>image/quote_rl.gif" width="20" height="24" /></td>
</tr>
</table>
</div>
<?php
}
else
{
if($j == 0)echo '<table width="350px" align="center"><tr><td colspan="7" align="center"><p> </p><p align="center" style="width:80%; background-color:#FAFAFA; border:1px dashed #EEEEEE;height:40px "><br>هیچ مطلبی ارسال نشده است</p><p> </p><p> </p><p> </p><p> </p></td></tr></table>';
}
}
?>
<br />
</td>
</tr>
<tr>
<td> </td>
<td height="40">
<table width="97%" border="0" align="right" cellpadding="5" cellspacing="0">
<tr>
<td width="100" align="center"><a href="?s=<?php if(($start-5) > 0)echo ($start-5); else echo '0' ?>"> « صفحه قبل </a></td>
<td width="250" align="center">
<?php
for($i = $pfn ; $i <= $pln ; $i += 5)
{
if($i != $start)
{
?>
<span style="font-weight: bold"><a href="?s=<?=$i?>">
<?=etop(floor($i/5)+1)?>
</a></span>
<?php
}else{
?>
<span class="rcolor" style="font-weight: bold">
<?=etop(floor($i/5)+1)?>
</span>
<?php
}
}
?> </td>
<td width="96" align="center"><a href="?s=<?php if(($start+5) < $count)echo ($start+5); else echo $start; ?>"> صفحه بعد » </a></td>
</tr>
</table>
</td>
</tr>
</table>
<?php include('../include/footer.php'); ?>