Файл: sys/inc/classes/create.class.php
Строк: 123
<?php
class create
{
public static function them($them=0)
{
global $time,$user;
$them=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_t` WHERE `id`='$them' LIMIT 1"));
echo "<div class='nav2'>";
echo group($them['id_user']);
echo user::nick($them['id_user'], 1, 1, 1);
echo " : <b>".text($them['name'])."</b>";
echo "<span style='color:#666;float:right;'> " . vremja($them['time_create'])."</span><br/>";
echo output_text($them['text']);
create::votes($them['id']). " </div>";
if($them['close']==1 OR ($them['id_edit']!=null AND $them['id_edit'])){ echo "<div class='main'><span style='size:small;color:#666;'>";
if($them['close']==1)echo "Тема закрыта ".user::nick($them['id_close'])."<br/>";
if($them['id_edit']!=null AND $them['id_edit']) echo "Последний раз редактировалось ".user::nick($them['id_edit'])." ".vremja($them['time_edit'])."";
echo "</span></div>"; }
if (isset($user)) {
echo "<div class='mess'>";
$share=mysql_result(mysql_query("SELECT COUNT(`share_id_user`)FROM `notes` WHERE `share_id`='".$them['id']."' AND `share_type`='forum' "),0);
$markinfo = mysql_result(mysql_query("SELECT COUNT(*) FROM `bookmarks` WHERE `id_object` = '" . $them['id'] . "'"), 0);
if(mysql_result(mysql_query("SELECT COUNT(`share_id_user`)FROM `notes` WHERE `share_id`='".$them['id']."' AND `id_user`='".$user['id']."' AND `share_type`='forum' LIMIT 1"),0)==0){
echo '<a href="/forum/share.php?id='.$them['id'].'" title="Поделиться"><img src="/style/icons/action_share_color.gif"> Поделиться</a> ('.$share.')';
}else{
echo '<img src="/style/icons/action_share_color.gif"> Поделиться ('.$share.')';
}
echo "<br/><img src='/style/icons/fav.gif' alt='*' /> ";
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `bookmarks` WHERE `id_object` = '$them[id]' AND `id_user` = '$user[id]' AND `type`='forum'"), 0) == 0)
echo " <a href='/forum/".$them['id_forum']."/".$them['id_razdel']."/".$them['id']."/?zakl=1' title='Добавить в закладки'>Добавить в закладки</a><br />n";
else {
echo " <a href='/forum/".$them['id_forum']."/".$them['id_razdel']."/".$them['id']."/?zakl=0' title='Удалить из закладок'>Удалить из закладок</a><br />n";
}
echo "</div>";
}
}
public static function votes($t=0){
global $time,$user;
echo '<link rel="stylesheet" href="/style/vote.css" type="text/css">';
$them=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_t` WHERE `id`='".$t."' LIMIT 1"));
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `votes_forum` WHERE `them` = '".abs(intval($them['id']))."' LIMIT 1"),0)!=0){
echo '<div class="round_corners poll_block stnd_padd">';
echo "<div style='font-size:14px;'><b>" .output_text($them['vote'])."</b></div>";
if($them['id_user']!=$user['id'] OR user_access('forum_them_edit')){
echo "<span style='float:right;'><a href='?act=vote'><img src='/style/icons/diary.gif'></a></span>"; }
$q=mysql_query("SELECT * FROM `votes_forum` WHERE `them` = '".abs(intval($them['id']))."' AND `var` != '' LIMIT 6");
echo '<form action="" method="post">';
while ($row = mysql_fetch_assoc($q)){
$sum=mysql_result(mysql_query("SELECT COUNT(*) FROM `votes_user` WHERE `them` = '$row[them]'"), 0);
$var=mysql_result(mysql_query("SELECT COUNT(*) FROM `votes_user` WHERE `them` = '$row[them]' AND `var` = '$row[num]'"), 0);
if($sum==0)$poll=0;
elseif($var==0)$poll=0;
else $poll=($var/$sum)*100;
$us=mysql_result(mysql_query("SELECT COUNT(*) FROM `votes_user` WHERE `them` = '".abs(intval($them['id']))."' AND `id_user`='$user[id]' LIMIT 1"),0);
if($us=='0' && isset($user))
echo '<input type="radio" value="' . $row['num'] . '" name="vote"/> ' .output_text($row['var']).'</a> - <a href="?vote_user='.$row['num'].'">'.$var.' чел.</a></br>';
else
echo ''.output_text($row['var']).' <a href="?vote_user='.$row['num'].'">'.$var.'</a></br><img src="/forum/img.php?img='.$poll.'" alt="*"/></br>';
}
if( isset($user) && $us=='0' && $them['vote_close']!='1' && $them['close']=='0')
echo '<input type="submit" name="go" value="Голосовать"/>';
echo "</div></form>";
}
echo "</div>";
}
public static function notes($not=0){
global $time;
$notes=mysql_fetch_assoc(mysql_query("SELECT * FROM `notes` WHERE `id`='$not' LIMIT 1"));
echo "<div class="foot">n";
echo "<img src='/style/icons/str2.gif' alt='*'> <a href='index.php'>Дневники</a> | ".user::nick($notes['id_user'])."n";
echo ' | <b>' . output_text($notes['name']) . '</b>';
echo "</div>n";
echo "<div class='nav2'>n";
echo group($notes['id_user']);
echo user::nick($notes['id_user'],1,1,1). " : <span style='color:#06f;'>".output_text($notes['name'])."</span><a href='/user/post.php?d=n&post=$notes[id]'><span style='float:right;color:#066;'>".vremja($notes['time'])."</span></a><br/>n";
echo output_text($notes['msg']).' <br/>';
if($notes['share']==1){
if($notes['share_type']=='notes'){
?><div style="padding-left:5px;padding-top:5px;margin-left:17px;border-top:1px solid #b3b3b3;border-left:1px solid #b3b3b3;">
<img src="/style/icons/repostik.png"><? echo " <i>Репост записи <a href='/plugins/notes/list.php?id=".$notes['share_id']."'><b style='color:#758b9b;'>".text($notes['share_name'])."</b></a><br/>";
echo "Автор ".user::nick($notes['share_id_user'])."</i><br/>";
echo " ".output_text($notes['share_text'])." ";
?></div><?
}elseif($notes['share_type']=='forum'){
$them=mysql_fetch_assoc(mysql_query("SELECT `id_forum`,`id`,`id_razdel` FROM `forum_t` WHERE `id`='".$notes['share_id']."' LIMIT 1"));
?><div style="padding-left:5px;padding-top:5px;margin-left:17px;border-top:1px solid #b3b3b3;border-left:1px solid #b3b3b3;">
<img src="/style/icons/repostik.png"><? echo " <i>Репост темы форума <a href='/forum/".$them['id_forum']."/".$them['id_razdel']."/".$notes['share_id']."/'><b style='color:#758b9b'>".text($notes['share_name'])."</b></a><br/>";
echo "Автор ".user::nick($notes['share_id_user'])."</i><br/>";
echo " ".output_text($notes['share_text'])." ";
?></div><?
}
}
echo '<span style="float:right;">';
if($notes['id_dir']==0){ echo "<img src='/style/icons/rss_grey.png'> Без категории";}else{
$dir=mysql_fetch_assoc(mysql_query("SELECT(`name`)FROM `notes_dir` WHERE `id`='$notes[id_dir]' LIMIT 1"));
echo "Категория: <a href='dir.php?id=$notes[id_dir]'><img src='/style/icons/rss_grey.png'> <span style='color:#108210'>".text($dir['name'])."</span></a>";}echo "</span><br/></div>";
}
}
?>