sibtracker/system/forum/sources/shapeshifter/showallposts.php
2019-05-18 13:46:03 +08:00

259 lines
9.2 KiB
PHP

<?php
if(!defined('DATALIFEENGINE')){die("Hacking attempt!");}
if ($cstart) $post_num_id = $cstart;
while ($row = $db->get_row($result_posts))
{
$forum_id = $row['forum_id'];
$tid = $row['tid'];
$check_read = check_access($forums_array[$forum_id]['access_read']);
$check_moderator = check_moderator($forums_array[$forum_id]['access_mod'], $forums_array[$forum_id]['moderators']);
$check_write = check_access($forums_array[$forum_id]['access_write']);
if ($check_moderator){
$deny_edit_post = moderator_value('edit_post', $forum_id, $m_member);
$deny_del_post = moderator_value('delete_post', $forum_id, $m_member);
}
if ($user_group[$member_id['user_group']]['forum_post_edit']){
$group_post_edit = true;
}else{
$group_post_edit = false;
}
if ($user_group[$member_id['user_group']]['forum_post_del']){
$group_post_del = true;
}else{
$group_post_del = false;
}
$post_num_id++;
$i++;
if($is_logged) {
$tpl->set( '[not-logged]', "" );
$tpl->set( '[/not-logged]', "" );
} else $tpl->set_block( "'\\[not-logged\\](.*?)\\[/not-logged\\]'si", "" );
if (!$row['user_group']) $row['user_group'] = 5;
if ($ajax_adds) $post_num_id = "--";
$row['post_text'] = stripslashes( $row['post_text'] );
if ($row['hidden']){
if ($check_moderator){
$row['post_text'] = "<div class=\"hidden_post\">{$f_lang['h_post']}:<br />".$row['post_text']."</div>";
}else{
$row['post_text'] = "<div class=\"hidden_post\">{$f_lang['h_post']}</div>";
}
}
if ($search_text){$row['post_text'] = hilites($search_text, $row['post_text']);}
// ********************************************************************************
// LOAD TEMPLATE
// ********************************************************************************
$tpl->load_template($tpl_dir.'post.tpl');
if( strlen( $row['title'] ) > 15 ) $title = substr( $row['title'], 0, 15 ) . " ...";
else $title = $row['title'];
$tpl->set( '{topic_url}', " Òåìà: <a href=\"".$config['http_home_url']."forum/topic_".$row['tid']."/last#reply\">".$row['title']."</a>, ");
$tpl->set('{post_id}', "<a href=\"javascript:PostLink($post_num_id);\" name=\"post-{$post_num_id}\">{$post_num_id}</a>");
if ($row['edit_time']) $tpl->set('{edit-info}', "<br /><span class='edit-info'>{$f_lang['edit_info']}&nbsp;<b>{$row['edit_user']}</b> - ".show_date($row['edit_time'])."</span>");
else $tpl->set('{edit-info}', "");
$go_page = "onClick=\"return dropdownmenu(this, event, FUserMenu('".urlencode($row['name'])."', '".$row['user_id']."', '".$member_id['user_group']."', '$a_forum_url'), '170px')\" onMouseout=\"delayhidemenu()\"";
$group_span = $user_group[$row['user_group']]['colour'];
if ($row['is_register'])
{
if ($config['skin'] == "Lite" OR $config['skin'] == "Wap")
$tpl->set('{author}', "<a href=\"".$config['http_home_url']."user/".urlencode($row['name'])."/\"><span style=\"color:{$group_span}\">{$row['post_author']}</span></a>");
else
$tpl->set('{author}', "<a {$go_page} href=\"#\"><span style=\"color:{$group_span}\">{$row['post_author']}</span></a>");
}
else $tpl->set('{author}', "<a href=\"mailto:".$row['e_mail']."\">{$row['post_author']}</a>");
$grav_url = 'http://gravatar.com/avatar/' . md5( stripslashes( $row['email'] ) ) . "?s=100&r=g&d=" . $config['http_home_url'] . 'templates/' . $config['skin'] . '/images/noavatar.png';
if ($row['foto'])
$tpl->set('{foto}', $config['http_home_url']."uploads/fotos/".$row['foto']);
else
$tpl->set('{foto}', $grav_url);
if ($row['icq']) $tpl->set('{icq}', stripslashes($row['icq']));
else $tpl->set('{icq}', '--');
if ($row['land']) $tpl->set('{land}', stripslashes($row['land']));
else $tpl->set('{land}', '--');
if ($row['fullname']) $tpl->set('{fullname}', stripslashes($row['fullname']));
else $tpl->set('{fullname}', '--');
if ($row['is_register']) $tpl->set('{registration}', langdate("j.m.Y", $row['reg_date']));
else $tpl->set('{registration}', '--');
if ($row['is_register'] AND $row['signature'])
{
$tpl->set_block("'\\[signature\\](.*?)\\[/signature\\]'si","\\1");
$tpl->set('{signature}', stripslashes($row['signature']));
}
else $tpl->set_block("'\\[signature\\](.*?)\\[/signature\\]'si","");
if ($user_group[$row['user_group']]['colour']){
$group_span = $user_group[$row['user_group']]['colour'];
$group_name = "<span style=\"color:{$group_span}\">".$user_group[$row['user_group']]['group_name']."</span>";
}else{
$group_name = $user_group[$row['user_group']]['group_name'];
}
if ($row['banned'])
{
$group_name = "BANNED";
}
$tpl->set('{group-name}', $group_name);
$tpl->set('{post-num}', intval($row['forum_post']));
$tpl->set('{news-num}', intval($row['news_num']));
$tpl->set('{comm-num}', intval($row['comm_num']));
// ********************************************************************************
// POST SELECTED
// ********************************************************************************
$tpl->set('{selected}', "");
// ********************************************************************************
// POST DATE
// ********************************************************************************
$row['post_date'] = strtotime($row['post_date']);
$tpl->set('{post-date}', show_date($row['post_date']));
if (!$forum_config['mod_report'] and $is_logged)
{
$tpl->set('[report]',"<a href=\"{$a_forum_url}act=_topic&code=report&tid={$tid}&pid={$post_num_id}\">");
$tpl->set('[/report]',"</a>");
}
else
{
$tpl->set_block("'\\[report\\](.*?)\\[/report\\]'si","");
}
// ********************************************************************************
// FAST
// ********************************************************************************
$tpl->set_block("'\\[fast\\](.*?)\\[/fast\\]'si","");
// ********************************************************************************
// RANK
// ********************************************************************************
if ($forum_config['mod_rank'] and $rank_array != 'empty')
{
if (!$row['forum_post']) $row['forum_post'] = 0;
foreach ($rank_array as $value)
{
if ($row['forum_post'] >= $value['posts'])
{
$rank_title = $value['title'];
$rank_num = $value['pips'];
}
}
if ($row['forum_rank']) $rank_title = $row['forum_rank'];
if ($row['forum_pips']) $rank_num = $row['forum_pips'];
$rating = $rank_num * 17;
$rank_image = "<div class=\"rank\" style=\"display:inline;\">
<ul class=\"unit-rank\">
<li class=\"current-rank\" style=\"width:{$rating}px;\">{$rating}</li>
</ul>
</div>";
}
$tpl->set('{rank-title}', $rank_title);
$tpl->set('{rank-image}', $rank_image);
// ********************************************************************************
// REPUTATION
// ********************************************************************************
@include (SYSTEM_DIR.'/modules/reputation.php');
if ($check_moderator)
$tpl->set('{ip}', "IP: <a onClick=\"return dropdownmenu(this, event, IPMenu('".$row['post_ip']."', '".$lang['ip_info']."', '".$lang['ip_tools']."', '".$lang['ip_ban']."'), '190px')\" onMouseout=\"delayhidemenu()\" href=\"http://www.nic.ru/whois/?ip={$row['post_ip']}\" target=\"_blank\">{$row['post_ip']}</a>");
else $tpl->set('{ip}', '');
if ($num_post_tid > 0)
$del_post = true;
else
$del_post = false;
// ********************************************************************************
// POST EDIT
// ********************************************************************************
if (($member_id['name'] == $row['post_author']) AND $group_post_edit OR $deny_edit_post)
{
$tpl->set('[post-edit]',"<a onClick=\"return dropdownmenu(this, event, PostEditMenu('$row[pid]', '$a_forum_url', '$post_num_id'), '170px')\" onMouseout=\"delayhidemenu()\" href=\"#\">");
$tpl->set('[/post-edit]',"</a>");
}
else
{
$tpl->set_block("'\\[post-edit\\](.*?)\\[/post-edit\\]'si","");
}
// ********************************************************************************
// POST DEL
// ********************************************************************************
$tpl->set_block("'\\[post-del\\](.*?)\\[/post-del\\]'si","");
// ********************************************************************************
// POST TEXT
// ********************************************************************************
$tpl->set('{text}', "<div id='post-id-".$row['pid']."'>".stripslashes($row['post_text'])."</div>");
// ********************************************************************************
// HIDE
// ********************************************************************************
if ($member_id['forum_post'] >= $forum_config['post_hide'])
{
$tpl->set_block("'\[hide\](.*?)\[/hide\]'si","\\1");
}
else
{
$hide_info = "Âíèìàíèå! Ó âàñ íåò ïðàâ, äëÿ ïðîñìîòðà ñêðûòîãî òåêñòà. Íåîáõîäèìî $forum_config[post_hide] ñîîáùåíèé.";
$tpl->set_block("'\\[hide\\](.*?)\\[/hide\\]'si","<div class=\"quote\">".$hide_info."</div>");
}
$tpl->compile('posts');
if (stristr ($tpl->result['posts'], "[attachment="))
{
$tid = $row['tid'];
require_once SYSTEM_DIR.'/forum/sources/components/attachment.php';
}
$tpl->clear();
}
$ban_short = array ();
unset( $ban_short );
?>