View file forum/forum/bookmark.php

File size: 3.92Kb
<?php
require_once"../template/start.php";
require_once"../template/regglobals.php";
require_once"../template/config.php";
require_once"../template/functions.php";
require_once"../template/antidos.php";
require_once"../template/cookies.php";
require_once"../template/gzip.php";
require_once"../template/header.php";
require_once"../template/referer.php";
include_once"../themes/$config_themes/index.php";
include_once"../template/isset.php";
require_once"../template/db.php";
include_once"fnc.php";
if ($provpar == md5($_SESSION['par']) && $provlog == $_SESSION['log']) {
echo "<img src='".$config_home."/images/img/partners.gif' alt=''>Мои закладки<br><br>\n";


function pages($start, $total, $onpage, $config_home){
if ($start != 0) echo '<a href="'.$config_home.'/forum/bookmark/'.($start - $onpage).'">&lt;-Назад</a> ';
else echo '&lt;-Назад';
echo ' | ';
if ($total > $start + $onpage)
echo ' <a href="'.$config_home.'/forum/bookmark/'.($start + $onpage).'">Далее-&gt;</a>';
else echo 'Далее-&gt;';
if($total>0){
$ba = ceil($total/$onpage);
$ba2 = $ba*$onpage-$onpage;
echo '<br/>Страницы:';
$asd = $start-($onpage*3);
$asd2 = $start+($onpage*4);
if($asd<$total && $asd>0) echo ' <a href="'.$config_home.'/forum/bookmark/0">1</a> ... ';
for($i=$asd; $i<$asd2;){
if($i<$total && $i>=0){
$ii = floor(1+$i/$onpage);
if ($start==$i) echo ' <b>['.$ii.']</b>';
else echo ' <a href="'.$config_home.'/forum/bookmark/'.$i.'">'.$ii.'</a>';}
$i=$i+$onpage;}
if($asd2<$total) echo ' ... <a href="'.$config_home.'/forum/bookmark/'.$ba2.'">'.$ba.'</a>';}}


$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `bookmark` WHERE `user` = '$log'"),0);
$start = isset($_GET['start']) ? abs((int)$_GET['start']) : 0;
if($start > $total) $start = 0;
if ($total < $start + 10) $end = $total;
else $end = $start + 10;
$tops = mysql_query("SELECT * FROM `bookmark` WHERE `user` = '$log' ORDER BY `id` DESC LIMIT $start, 10");
if(mysql_num_rows($tops) != '0'){
while($top = mysql_fetch_array($tops)){
echo "<div>\n";
$themes = mysql_query("SELECT * FROM `theme` WHERE `id` = '".$top['theme']."'");
$theme = mysql_fetch_array($themes);


echo "<img src='".$config_home."/forum/img/t.gif' alt=''> 
<a href='".$config_home."/forum/posts/".$theme['id']."/".strts($theme['id'],$config_forumpost)."'><b>".$theme['name']."</b></a> [".$theme['posts']."]<br> ";


$date = file(BASEDIR."local/profil/$theme[author].prof"); 
$filename = "".BASEDIR."local/profil/$theme[author].prof";
if (file_exists($filename)) {
$date = explode(":||:",$date[0]);
echo "Создал: <a href='../pages/anketa.php?uz=".$theme['author']."'>";
if ($date[65]) {echo "".$date['65']."</a><br>";
}else{echo "".$theme['author']."</a><br>";}
}else{echo "Создал: ".$theme['author']."<br>";}
echo "Кратко: ".$theme['description']." <br>\n";
$files = mysql_result(mysql_query("SELECT COUNT(*) FROM `posts` WHERE `theme`='".$theme['id']."' AND `fil`='1'"),0);
if ($files != '0'){echo "Вложений: $files<br>";}
echo "Последний: "; 
$date = file(BASEDIR."local/profil/$theme[last].prof"); 
$filename = "".BASEDIR."local/profil/$theme[last].prof";
if (file_exists($filename)) {
$date = explode(":||:",$date[0]);
echo "<a href='../pages/anketa.php?uz=".$theme['last']."'>";
if ($date[65]) {echo "".$date['65']."</a>";
}else{echo "".$theme['last']."</a>";}
}else{echo "".$theme['last']."";}
echo " (".date_fixed($theme['time']).")<br>\n";
echo "</div><hr>\n";
}}else{ echo "<br> <img src='".$config_home."/images/img/close.gif' alt=''> У вас нет закладок!<br><br><hr>\n";}
if ($_GET['start'] > 10 ){pages($start, $total, 10, $config_home); echo "<hr>\n";}

echo ": <a href='".$config_home."/forum/'>К форумам</a><br>"; 
echo ":: <a href='".$config_home."'>На главную</a>"; 
} else {header ("Location: ".$config_home."/forum/");} 
include_once"../themes/$config_themes/foot.php";
?>