Часовой пояс: UTC + 3 часа




Начать новую тему Ответить на тему  [ Сообщений: 15 ] 
Автор Сообщение
 Заголовок сообщения: Изменяем автора поста
СообщениеДобавлено: 2010-12-12 02:20 
Не в сети
Администратор
Администратор
Аватара пользователя
Раздал: 51.58 ТБ
Скачал: 620.08 ГБ
Ратио: 85.182


Зарегистрирован: 2010-11-09 02:24
Сообщения: 44886
Откуда: Земля Санникова
Мод позволяет менять автора поста.

делаем бекапы перед установкой!



#
#-----[ открыть ]------------------------------------------
#

viewtopic.php

#
#-----[ найти ]------------------------------------------
#
Код:
   $search_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_search'] . '" alt="' . $lang['Search_user_posts'] . '" title="' . $lang['Search_user_posts'] . '" border="0" /></a>';
   $search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>';


#
#-----[ ниже добавить ]------------------------------------------
#

[hide]
Код:
// Change Poster Mod
   $temp_url = append_sid("changeuser.$phpEx?mode=start&amp;" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
   $reassign_img = ( $userdata['user_level'] == ADMIN ) ? '<a href="' . $temp_url . '"><img src="' . $images['icon_user'] . '" alt="' . $lang['Change_poster'] . '" border="0" /></a>' : '';
   $reassign = ( $userdata['user_level'] == ADMIN ) ? '<a href="' . $temp_url . '">' . $lang['Change_poster'] . '</a>' : '';
[/hide]
#
#-----[ найти ]------------------------------------------
#
Код:
   'DELETE_IMG' => $delpost_img,
   'DELETE' => $delpost,


#
#-----[ ниже добавить ]------------------------------------------
#

[hide]
Код:
'REASSIGN_IMG' => $reassign_img,
   'REASSIGN' => $reassign,
[/hide]

#
#-----[ открыть ]------------------------------------------
#

includes/init_bb.php

#
#-----[ найти ]------------------------------------------
#

Код:
define('PAGE_GROUPCP', -11);


#
#-----[ ниже добавить ]------------------------------------------
#
[hide]
Код:
   define('PAGE_CHANGEPOSTER', -12);
[/hide]

#
#-----[ открыть ]------------------------------------------
#

language/руский/lang_main.php

#
#-----[ в самый низ добавить ]------------------------------------------
#

[hide]
Код:
// Change Poster Mod
   $lang['Change_poster'] = 'Reassign this posting';
   $lang['ChgP_Admin'] = 'You are not allowed to do this!';
   $lang['ChgP_done'] = ' - номер сообщения,успешно изменен.';
   $lang['ChgP_enterUsername'] = 'Введите имя пользователя нового автора здесь:';
   $lang['ChgP_Error'] = 'Could not finish reassignment!';
   $lang['ChgP_NoID'] = 'No posting specified!';
   $lang['ChgP_NoUser'] = 'No user specified!';
   $lang['ChgP_Reassign'] = 'Меняем автора сообщения';
   $lang['ChgP_Submit'] = 'Изменить!';
   $lang['ChgP_wrote'] = 'wrote:<br /><br />';
   $lang['ChgP_WrongID'] = 'The posting you specified does not exist!';
[/hide]

#
#-----[ открыть ]------------------------------------------
#

templates/default/tpl_config.php

#
#-----[ найти ]------------------------------------------
#

Код:
$images['icon_newest_reply']   = $_main .'icon_newest_reply.gif';


#
#-----[ ниже добавить ]------------------------------------------
#

[hide]
Код:
$images['icon_user']           = $_lang .'icon_user.gif';
[/hide]
#
#-----[ открыть ]------------------------------------------
#

templates/default/viewtopic.tpl

#
#-----[ найти ]------------------------------------------
#

Код:
{postrow.EDIT_IMG}


#
#-----[ в линии добавить ]------------------------------------------
#

Код:
{postrow.REASSIGN_IMG}


#
#-----[ сохраняем, закрываем ]------------------------------------------
#

с архива все распихать по папкам


У вас нет необходимых прав для просмотра вложений в этом сообщении.


Последний раз редактировалось Гость 2011-02-18 23:06, всего редактировалось 1 раз.

Вернуться к началу
 Профиль  
Ответить с цитатой  
 Заголовок сообщения:
СообщениеДобавлено: 2011-01-17 14:21 
Не в сети
Аватара пользователя
Раздал: 500 МБ
Скачал: 0 байт
Ратио: Seed.


Зарегистрирован: 2011-01-06 19:03
Сообщения: 47
У мня в viewtopic.php

нету

$search_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_search'] . '" alt="' . $lang['Search_user_posts'] . '" title="' . $lang['Search_user_posts'] . '" border="0" /></a>';
$search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>';


Вернуться к началу
 Профиль  
Ответить с цитатой  
 Заголовок сообщения:
СообщениеДобавлено: 2011-01-17 18:34 
Не в сети
Администратор
Администратор
Аватара пользователя
Раздал: 51.58 ТБ
Скачал: 620.08 ГБ
Ратио: 85.182


Зарегистрирован: 2010-11-09 02:24
Сообщения: 44886
Откуда: Земля Санникова
после этого добавь

Код:
   $post_date = create_date($bb_cfg['post_date_format'], $postrow[$i]['post_time']);
   $max_post_time = max($max_post_time, $postrow[$i]['post_time']);

   $poster_posts = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $postrow[$i]['user_posts'] : '';


Вернуться к началу
 Профиль  
Ответить с цитатой  
 Заголовок сообщения:
СообщениеДобавлено: 2011-01-17 18:55 
Не в сети
Аватара пользователя
Раздал: 500 МБ
Скачал: 0 байт
Ратио: Seed.


Зарегистрирован: 2011-01-06 19:03
Сообщения: 47
admin писал(а):
'DELETE_IMG' => $delpost_img,
'DELETE' => $delpost,

спс но
Код:
  'DELETE_IMG' => $delpost_img,
  'DELETE' => $delpost,

тож нет


Вернуться к началу
 Профиль  
Ответить с цитатой  
 Заголовок сообщения:
СообщениеДобавлено: 2011-01-17 18:56 
Не в сети
Администратор
Администратор
Аватара пользователя
Раздал: 51.58 ТБ
Скачал: 620.08 ГБ
Ратио: 85.182


Зарегистрирован: 2010-11-09 02:24
Сообщения: 44886
Откуда: Земля Санникова
300849

кидай свой viewtopic.php


Вернуться к началу
 Профиль  
Ответить с цитатой  
 Заголовок сообщения:
СообщениеДобавлено: 2011-01-17 19:12 
Не в сети
Аватара пользователя
Раздал: 500 МБ
Скачал: 0 байт
Ратио: Seed.


Зарегистрирован: 2011-01-06 19:03
Сообщения: 47
Держи
<?php

define('BB_SCRIPT', 'topic');
require('./common.php');
require(INC_DIR .'bbcode.'. PHP_EXT);

$datastore->enqueue(array(
'ranks',
));

$page_cfg['load_tpl_vars'] = array(
'post_buttons',
'post_icons',
'topic_icons',
);

$newest = $next_topic_id = 0;
$start = isset($_GET['start']) ? abs(intval($_GET['start'])) : 0;
$topic_id = isset($_GET[POST_TOPIC_URL]) ? (int) $_GET[POST_TOPIC_URL] : 0;
$post_id = (!$topic_id && isset($_GET[POST_POST_URL])) ? (int) $_GET[POST_POST_URL] : 0;
$porno_forums = array_flip(explode(',', $bb_cfg['porno_forums']));

// Start session
$user->session_start();

// Posts per page
$posts_per_page = $bb_cfg['posts_per_page'];
$select_ppp = '';

if ($userdata['session_admin'])
{
if ($req_ppp = abs(intval(@$_REQUEST['ppp'])) AND in_array($req_ppp, $bb_cfg['allowed_posts_per_page']))
{
$posts_per_page = $req_ppp;
}

$select_ppp = array();
foreach ($bb_cfg['allowed_posts_per_page'] as $ppp)
{
$select_ppp[$ppp] = $ppp;
}
}

if (isset($_REQUEST['single']))
{
$posts_per_page = 1;
}
else
{
$start = floor($start/$posts_per_page) * $posts_per_page;
}

if (!$topic_id && !$post_id)
{
bb_die($lang['Topic_post_not_exist']);
}

$tracking_topics = get_tracks('topic');
$tracking_forums = get_tracks('forum');

// Find topic id if user requested a newer or older topic
if ($topic_id && isset($_GET['view']) && ($_GET['view'] == 'next' || $_GET['view'] == 'previous'))
{
$sql_condition = ($_GET['view'] == 'next') ? '>' : '<';
$sql_ordering = ($_GET['view'] == 'next') ? 'ASC' : 'DESC';

$sql = "SELECT t.topic_id
FROM ". TOPICS_TABLE ." t, ". TOPICS_TABLE ." t2
WHERE t2.topic_id = $topic_id
AND t.forum_id = t2.forum_id
AND t.topic_moved_id = 0
AND t.topic_last_post_id $sql_condition t2.topic_last_post_id
ORDER BY t.topic_last_post_id $sql_ordering
LIMIT 1";

if ($row = $db->fetch_row($sql))
{
$next_topic_id = $topic_id = $row['topic_id'];
}
else
{
$message = ($_GET['view'] == 'next') ? $lang['No_newer_topics'] : $lang['No_older_topics'];
bb_die($message);
}
}

// Get forum/topic data
if ($topic_id)
{
$sql = "SELECT t.*, f.*
FROM ". TOPICS_TABLE ." t, ". FORUMS_TABLE ." f
WHERE t.topic_id = $topic_id
AND f.forum_id = t.forum_id
LIMIT 1";
}
else if ($post_id)
{
$sql = "SELECT t.*, f.*, p.post_time
FROM ". TOPICS_TABLE ." t, ". FORUMS_TABLE ." f, ". POSTS_TABLE ." p
WHERE p.post_id = $post_id
AND t.topic_id = p.topic_id
AND f.forum_id = t.forum_id
LIMIT 1";
}
else
{
bb_die($lang['Topic_post_not_exist']);
}

if (!$t_data = $db->fetch_row($sql))
{
bb_die($lang['Topic_post_not_exist']);
}

$forum_topic_data =& $t_data;
$topic_id = $t_data['topic_id'];
$forum_id = $t_data['forum_id'];

if ($userdata['session_admin'] && !empty($_REQUEST['mod']))
{
if (IS_ADMIN)
{
$datastore->enqueue(array('viewtopic_forum_select'));
}
}
if ($t_data['topic_attachment'])
{
$datastore->enqueue(array(
'attach_extensions',
));
}

// Find newest post
if (($next_topic_id || @$_GET['view'] === 'newest') && !IS_GUEST && $topic_id)
{
$post_time = 'post_time >= '. get_last_read($topic_id, $forum_id);
$post_id_altern = ($next_topic_id) ? '' : ' OR post_id = '. $t_data['topic_last_post_id'];

$sql = "SELECT post_id, post_time
FROM ". POSTS_TABLE ."
WHERE topic_id = $topic_id
AND ($post_time $post_id_altern)
ORDER BY post_time ASC
LIMIT 1";

if ($row = $db->fetch_row($sql))
{
$post_id = $newest = $row['post_id'];
$t_data['post_time'] = $row['post_time'];
}
}

if ($post_id && !empty($t_data['post_time']) && ($t_data['topic_replies'] + 1) > $posts_per_page)
{
$sql = "SELECT COUNT(post_id) AS prev_posts
FROM ". POSTS_TABLE ."
WHERE topic_id = $topic_id
AND post_time <= {$t_data['post_time']}";

if ($row = $db->fetch_row($sql))
{
$t_data['prev_posts'] = $row['prev_posts'];
}
}

// Auth check
$is_auth = auth(AUTH_ALL, $forum_id, $userdata, $t_data);

if ($userdata['user_readonly'])
{
$is_auth['auth_post'] = $is_auth['auth_reply'] = $is_auth['auth_edit'] = $is_auth['auth_delete'] = $is_auth['auth_vote'] = 0;
}

if (!$is_auth['auth_read'])
{
if (IS_GUEST)
{
$redirect = ($post_id) ? POST_POST_URL . "=$post_id" : POST_TOPIC_URL . "=$topic_id";
$redirect .= ($start) ? "&start=$start" : '';
redirect("login.$phpEx?redirect=viewtopic.$phpEx&$redirect");
}
bb_die($lang['Topic_post_not_exist']);
}

$forum_name = $t_data['forum_name'];
$topic_title = $t_data['topic_title'];
$topic_id = $t_data['topic_id'];
$topic_time = $t_data['topic_time'];

$moderation = (!empty($_REQUEST['mod']) && $is_auth['auth_mod']);

// Redirect to login page if not admin session
$mod_redirect_url = '';

if ($is_auth['auth_mod'])
{
$redirect = isset($_POST['redirect']) ? $_POST['redirect'] : $_SERVER['REQUEST_URI'];
$redirect = url_arg($redirect, 'mod', 1, '&');
$mod_redirect_url = "login.$phpEx?redirect=$redirect&admin=1";

if ($moderation && !$userdata['session_admin'])
{
redirect($mod_redirect_url);
}
}

if ($moderation)
{
if (IS_ADMIN)
{
$forum_select = $datastore->get('viewtopic_forum_select');
$forum_select_html = $forum_select['viewtopic_forum_select'];
}
else
{
$not_auth_forums_csv = $user->get_not_auth_forums(AUTH_VIEW);
$forum_select_html = get_forum_select(explode(',', $not_auth_forums_csv), 'new_forum_id');
}
$template->assign_vars(array(
'S_FORUM_SELECT' => $forum_select_html,
));
}

if ($parent_id = $t_data['forum_parent'])
{
$forums = $datastore->get('cat_forums');

$template->assign_vars(array(
'HAS_PARENT_FORUM' => true,
'PARENT_FORUM_HREF' => FORUM_URL . $parent_id,
'PARENT_FORUM_NAME' => htmlCHR($forums['f'][$parent_id]['forum_name']),
));
unset($forums);
}
$datastore->rm('cat_forums');

if ($post_id && !empty($t_data['prev_posts']))
{
$start = floor(($t_data['prev_posts'] - 1) / $posts_per_page) * $posts_per_page;
}

//
// Is user watching this thread?
//
$can_watch_topic = $is_watching_topic = false;

if ($bb_cfg['topic_notify_enabled'])
{
if( $userdata['session_logged_in'] )
{
$can_watch_topic = TRUE;

$sql = "SELECT notify_status
FROM " . TOPICS_WATCH_TABLE . "
WHERE topic_id = $topic_id
AND user_id = " . $userdata['user_id'];

if ($row = $db->fetch_row($sql))
{
if ( isset($HTTP_GET_VARS['unwatch']) )
{
if ( $HTTP_GET_VARS['unwatch'] == 'topic' )
{
$is_watching_topic = 0;

$sql = "DELETE FROM " . TOPICS_WATCH_TABLE . "
WHERE topic_id = $topic_id
AND user_id = " . $userdata['user_id'];
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not delete topic watch information", '', __LINE__, __FILE__, $sql);
}
}

$message = $lang['No_longer_watching'] . '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . "viewtopic.$phpEx?t=$topic_id&amp;start=$start" . '">', '</a>');
bb_die($message);
}
else
{
$is_watching_topic = TRUE;

if ( $row['notify_status'] )
{
$sql = "UPDATE " . TOPICS_WATCH_TABLE . "
SET notify_status = 0
WHERE topic_id = $topic_id
AND user_id = " . $userdata['user_id'];
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not update topic watch information", '', __LINE__, __FILE__, $sql);
}
}
}
}
else
{
if ( isset($HTTP_GET_VARS['watch']) )
{
if ( $HTTP_GET_VARS['watch'] == 'topic' )
{
$is_watching_topic = TRUE;

$sql = "INSERT INTO " . TOPICS_WATCH_TABLE . " (user_id, topic_id, notify_status)
VALUES (" . $userdata['user_id'] . ", $topic_id, 0)";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not insert topic watch information", '', __LINE__, __FILE__, $sql);
}
}

$message = $lang['You_are_watching'] . '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . "viewtopic.$phpEx?t=$topic_id&amp;start=$start" . '">', '</a>');
bb_die($message);
}
else
{
$is_watching_topic = 0;
}
}
}
else
{
if ( isset($HTTP_GET_VARS['unwatch']) )
{
if ( $HTTP_GET_VARS['unwatch'] == 'topic' )
{
redirect("login.$phpEx?redirect=viewtopic.$phpEx&t=$topic_id&unwatch=topic");
}
}
}
}

// Generate a 'Show posts in previous x days' select box. If the postdays var is POSTed
// then get it's value, find the number of topics with dates newer than it (to properly
// handle pagination) and alter the main query
$post_days = 0;
$limit_posts_time = '';
$total_replies = $t_data['topic_replies'] + 1;

if (!empty($_REQUEST['postdays']))
{
if ($post_days = abs(intval($_REQUEST['postdays'])))
{
if (!empty($_POST['postdays']))
{
$start = 0;
}
$min_post_time = TIMENOW - ($post_days*86400);

$sql = "SELECT COUNT(p.post_id) AS num_posts
FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
WHERE t.topic_id = $topic_id
AND p.topic_id = t.topic_id
AND p.post_time > $min_post_time";

$total_replies = ($row = $db->fetch_row($sql)) ? $row['num_posts'] : 0;
$limit_posts_time = "AND p.post_time >= $min_post_time ";
}
}

// Decide how to order the post display
$post_order = (isset($_POST['postorder']) && $_POST['postorder'] !== 'asc') ? 'desc' : 'asc';

//
// Go ahead and pull all data for this topic
//
$sql = "
SELECT
u.username, u.user_id, u.user_posts, u.user_from, u.user_from_flag,
u.user_regdate, u.user_rank, u.user_sig, u.user_sig_bbcode_uid,
u.user_avatar, u.user_avatar_type, u.user_allowavatar,
u.user_level,
p.*,
h.post_html, IF(h.post_html IS NULL, pt.post_text, NULL) AS post_text,
pt.post_subject, pt.bbcode_uid
FROM ". POSTS_TABLE ." p
LEFT JOIN ". USERS_TABLE ." u ON(u.user_id = p.poster_id)
LEFT JOIN ". POSTS_TEXT_TABLE ." pt ON(pt.post_id = p.post_id)
LEFT JOIN ". POSTS_HTML_TABLE ." h ON(h.post_id = p.post_id)
WHERE
p.topic_id = $topic_id
$limit_posts_time
GROUP BY
p.post_id
ORDER BY
p.post_time
$post_order
LIMIT
$start, $posts_per_page
";

if ($postrow = $db->fetch_rowset($sql))
{
$total_posts = count($postrow);
}
else
{
bb_die($lang['No_posts_topic']);
}

$ranks = $datastore->get('ranks');

//
// Define censored word matches
//
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);

//
// Censor topic title
//
if ( count($orig_word) )
{
$topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
}

//
// Post, reply and other URL generation for
// templating vars
//
$new_topic_url = "posting.$phpEx?mode=newtopic&amp;f=$forum_id";
$new_topic_url .= ($t_data['topic_tpl_id']) ? '&tpl=1' : '';
$reply_topic_url = "posting.$phpEx?mode=reply&amp;t=$topic_id";
$view_forum_url = "viewforum.$phpEx?f=$forum_id";
$view_prev_topic_url = "viewtopic.$phpEx?t=$topic_id&amp;view=previous#newest";
$view_next_topic_url = "viewtopic.$phpEx?t=$topic_id&amp;view=next#newest";

$reply_img = ( $t_data['forum_status'] == FORUM_LOCKED || $t_data['topic_status'] == TOPIC_LOCKED ) ? $images['reply_locked'] : $images['reply_new'];
$reply_alt = ( $t_data['forum_status'] == FORUM_LOCKED || $t_data['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked_short'] : $lang['Reply_to_topic'];

// Set 'body' template for attach_mod
$template->set_filenames(array('body' => 'viewtopic.tpl'));

//
// User authorisation levels output
//
$s_auth_can = ( ( $is_auth['auth_post'] ) ? $lang['Rules_post_can'] : $lang['Rules_post_cannot'] ) . '<br />';
$s_auth_can .= ( ( $is_auth['auth_reply'] ) ? $lang['Rules_reply_can'] : $lang['Rules_reply_cannot'] ) . '<br />';
$s_auth_can .= ( ( $is_auth['auth_edit'] ) ? $lang['Rules_edit_can'] : $lang['Rules_edit_cannot'] ) . '<br />';
$s_auth_can .= ( ( $is_auth['auth_delete'] ) ? $lang['Rules_delete_can'] : $lang['Rules_delete_cannot'] ) . '<br />';
$s_auth_can .= ( ( $is_auth['auth_vote'] ) ? $lang['Rules_vote_can'] : $lang['Rules_vote_cannot'] ) . '<br />';
$s_auth_can .= ( ($is_auth['auth_attachments'] ) ? $lang['Rules_attach_can'] : $lang['Rules_attach_cannot'] ) . '<br />';
$s_auth_can .= ( ($is_auth['auth_download'] ) ? $lang['Rules_download_can'] : $lang['Rules_download_cannot'] ) . '<br />';

$topic_mod = '';

if ( $is_auth['auth_mod'] )
{
$s_auth_can .= $lang['Rules_moderate'];

$topic_mod .= "<a href=\"modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;mode=delete&amp;sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_mod_delete'] . '" alt="' . $lang['DELETE_TOPIC'] . '" title="' . $lang['DELETE_TOPIC'] . '" border="0" /></a>&nbsp;';

$topic_mod .= "<a href=\"modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;mode=move&amp;sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_mod_move'] . '" alt="' . $lang['MOVE_TOPIC'] . '" title="' . $lang['MOVE_TOPIC'] . '" border="0" /></a>&nbsp;';

$topic_mod .= ( $t_data['topic_status'] == TOPIC_UNLOCKED ) ? "<a href=\"modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;mode=lock&amp;sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_mod_lock'] . '" alt="' . $lang['LOCK_TOPIC'] . '" title="' . $lang['LOCK_TOPIC'] . '" border="0" /></a>&nbsp;' : "<a href=\"modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;mode=unlock&amp;sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_mod_unlock'] . '" alt="' . $lang['UNLOCK_TOPIC'] . '" title="' . $lang['UNLOCK_TOPIC'] . '" border="0" /></a>&nbsp;';

$topic_mod .= "<a href=\"modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;mode=split&amp;sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_mod_split'] . '" alt="' . $lang['SPLIT_TOPIC'] . '" title="' . $lang['SPLIT_TOPIC'] . '" border="0" /></a>&nbsp;';
//bt
if ($t_data['allow_dl_topic'] || $t_data['topic_dl_type'] == TOPIC_DL_TYPE_DL || IS_ADMIN)
{
if ($t_data['topic_dl_type'] == TOPIC_DL_TYPE_DL)
{
$topic_mod .= "<a href=\"modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;mode=unset_download&amp;sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_normal'] . '" alt="' . $lang['Unset_DL_Status'] . '" title="' . $lang['Unset_DL_Status'] . '" border="0" /></a>';
}
else
{
$topic_mod .= "<a href=\"modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;mode=set_download&amp;sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_dl'] . '" alt="' . $lang['Set_DL_Status'] . '" title="' . $lang['Set_DL_Status'] . '" border="0" /></a>';
}
}
//bt end
}
//bt
else if (($t_data['topic_poster'] == $userdata['user_id']) && $userdata['session_logged_in'] && $t_data['self_moderated'])
{
$topic_mod .= "<a href=\"modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;mode=move&amp;sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_mod_move'] . '" alt="' . $lang['MOVE_TOPIC'] . '" title="' . $lang['MOVE_TOPIC'] . '" border="0" /></a>&nbsp;';
}
//bt end

// Report
//
// Get report topic module and create report link
//
require_once($phpbb_root_path . "includes/functions_report.$phpEx");
$report_topic = report_modules('name', 'report_topic');

if ($report_topic && $report_topic->auth_check('auth_write'))
{
if ($forum_topic_data['topic_reported'])
{
$report_auth = ($userdata['user_level'] == ADMIN || (!$bb_cfg['report_list_admin'] && (!$bb_cfg['report_subject_auth'] || $is_auth['auth_mod'])));
if ($report_topic->auth_check('auth_view') && $is_auth)
{
$target = ($bb_cfg['report_new_window']) ? ' target="_blank"' : '';
$s_report_topic ='&nbsp;<a href="' . append_sid("report.$phpEx?mode=reported&amp;" . POST_CAT_URL . '=' . $report_topic->id . "&amp;id=$topic_id") . '"' . $target . '><img src="' . $images['topic_mod_reported'] . '" alt="' . $report_topic->lang['Duplicate_report'] . '" title="' . $report_topic->lang['Duplicate_report'] . '" border="0" /></a>&nbsp;';
}
else
{
$s_report_topic = '&nbsp;<img src="' . $images['topic_mod_reported'] . '" alt="' . $report_topic->lang['Duplicate_report'] . '" title="' . $report_topic->lang['Duplicate_report'] . '" border="0" />&nbsp;';
}
}
else
{
$s_report_topic = '&nbsp;<a href="' . append_sid("report.$phpEx?mode=" . $report_topic->mode . "&amp;id=$topic_id") . '"><img src="' . $images['topic_mod_report'] . '" alt="' . $report_topic->lang['Write_report'] . '" title="' . $report_topic->lang['Write_report'] . '" border="0" /></a>&nbsp;';
}

$topic_mod .= $s_report_topic;
$template->assign_var('S_REPORT_TOPIC', $s_report_topic);
}
// Report [END]

//
// Topic watch information
//
$s_watching_topic = $s_watching_topic_img = '';
if ( $can_watch_topic )
{
if ( $is_watching_topic )
{
$s_watching_topic = "<a href=\"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;unwatch=topic&amp;start=$start&amp;sid=" . $userdata['session_id'] . '">' . $lang['Stop_watching_topic'] . '</a>';
$s_watching_topic_img = ( isset($images['topic_un_watch']) ) ? "<a href=\"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;unwatch=topic&amp;start=$start&amp;sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_un_watch'] . '" alt="' . $lang['Stop_watching_topic'] . '" title="' . $lang['Stop_watching_topic'] . '" border="0"></a>' : '';
}
else
{
$s_watching_topic = "<a href=\"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;watch=topic&amp;start=$start&amp;sid=" . $userdata['session_id'] . '">' . $lang['Start_watching_topic'] . '</a>';
$s_watching_topic_img = ( isset($images['Topic_watch']) ) ? "<a href=\"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;watch=topic&amp;start=$start&amp;sid=" . $userdata['session_id'] . '"><img src="' . $images['Topic_watch'] . '" alt="' . $lang['Start_watching_topic'] . '" title="' . $lang['Start_watching_topic'] . '" border="0"></a>' : '';
}
}

// If we've got a hightlight set pass it on to pagination,
$pg_url = TOPIC_URL . $topic_id;
$pg_url .= ($post_days) ? "&amp;postdays=$post_days" : '';
$pg_url .= ($post_order != 'asc') ? "&amp;postorder=$post_order" : '';
$pg_url .= isset($_REQUEST['single']) ? "&amp;single=1" : '';
$pg_url .= ($moderation) ? "&amp;mod=1" : '';
$pg_url .= ($posts_per_page != $bb_cfg['posts_per_page']) ? "&amp;ppp=$posts_per_page" : '';

$pagination = generate_pagination($pg_url, $total_replies, $posts_per_page, $start);

//
// Selects
//
$sel_previous_days = array(
0 => $lang['All_Posts'],
1 => $lang['1_Day'],
7 => $lang['7_Days'],
14 => $lang['2_Weeks'],
30 => $lang['1_Month'],
90 => $lang['3_Months'],
180 => $lang['6_Months'],
364 => $lang['1_Year'],
);

$sel_post_order_ary = array(
$lang['Oldest_First'] => 'asc',
$lang['Newest_First'] => 'desc',
);

//
// Send vars to template
//
$template->assign_vars(array(
'PAGE_URL' => $pg_url,
'PAGE_URL_PPP' => url_arg($pg_url, 'ppp', null),
'PAGE_START' => $start,
'SHOW_JUMPBOX' => true,

'FORUM_ID' => $forum_id,
'FORUM_NAME' => htmlCHR($forum_name),
'TOPIC_ID' => $topic_id,
'PAGE_TITLE' => $topic_title,
'TOPIC_TITLE' => wbr($topic_title),
'PAGINATION' => $pagination,
'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor($start/$posts_per_page) + 1 ), ceil( $total_replies / $posts_per_page )),
'PORNO_FORUM' => isset($porno_forums[$forum_id]),
'REPLY_IMG' => $reply_img,
'SHOW_BOT_NICK' => $bb_cfg['show_bot_nick'],
'T_POST_REPLY' => $reply_alt,

'HIDE_FLAGS' => ($user->opt_js['h_flag'] && $bb_cfg['show_poster_flag']),
'HIDE_AVATAR' => $user->opt_js['h_av'],
'HIDE_RANK_IMG' => ($user->opt_js['h_rnk_i'] && $bb_cfg['show_rank_image']),
'HIDE_POST_IMG' => $user->opt_js['h_post_i'],
'HIDE_SMILE' => $user->opt_js['h_smile'],
'HIDE_SIGNATURE' => $user->opt_js['h_sig'],
'SPOILER_OPENED' => $user->opt_js['sp_op'],

'HIDE_FLAGS_DIS' => !$bb_cfg['show_poster_flag'],
'HIDE_RANK_IMG_DIS' => !$bb_cfg['show_rank_image'],

'AUTH_MOD' => $is_auth['auth_mod'],
'IN_MODERATION' => $moderation,
'L_SELECT_PPP' => $lang['Select_posts_per_page'],
'SELECT_PPP' => ($moderation && $select_ppp && $total_replies > $posts_per_page) ? build_select('ppp', $select_ppp, $posts_per_page, null, null, 'onchange="$(\'#ppp\').submit();"') : '',

'S_SELECT_POST_DAYS' => build_select('postdays', array_flip($sel_previous_days), $post_days),
'S_SELECT_POST_ORDER' => build_select('postorder', $sel_post_order_ary, $post_order),
'S_POST_DAYS_ACTION' => "viewtopic.$phpEx?t=$topic_id&amp;start=$start",
'S_AUTH_LIST' => $s_auth_can,
'S_TOPIC_ADMIN' => $topic_mod,
'S_WATCH_TOPIC' => $s_watching_topic,
'S_WATCH_TOPIC_IMG' => $s_watching_topic_img,
'U_VIEW_TOPIC' => TOPIC_URL . $topic_id,
'U_VIEW_FORUM' => $view_forum_url,
'U_VIEW_OLDER_TOPIC' => $view_prev_topic_url,
'U_VIEW_NEWER_TOPIC' => $view_next_topic_url,
'U_POST_NEW_TOPIC' => $new_topic_url,
'U_POST_REPLY_TOPIC' => $reply_topic_url,
'U_SEARCH_SELF' => "search.$phpEx?uid={$userdata['user_id']}&t=$topic_id&dm=1",
));

// Does this topic contain DL-List?
$template->assign_vars(array(
'SHOW_TOR_ACT' => false,
'PEERS_FULL_LINK' => false,
'DL_LIST_HREF' => TOPIC_URL ."$topic_id&amp;dl=names&amp;spmode=full",
));
require(INC_DIR .'torrent_show_dl_list.'. PHP_EXT);

//
// Does this topic contain a poll?
//
if ( !empty($t_data['topic_vote']) )
{
$s_hidden_fields = '';

$sql = "SELECT vd.vote_id, vd.vote_text, vd.vote_start, vd.vote_length, vr.vote_option_id, vr.vote_option_text, vr.vote_result
FROM " . VOTE_DESC_TABLE . " vd, " . VOTE_RESULTS_TABLE . " vr
WHERE vd.topic_id = $topic_id
AND vr.vote_id = vd.vote_id
ORDER BY vr.vote_option_id ASC";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain vote data for this topic", '', __LINE__, __FILE__, $sql);
}

if ( $vote_info = $db->sql_fetchrowset($result) )
{
$db->sql_freeresult($result);
$vote_options = count($vote_info);

$vote_id = $vote_info[0]['vote_id'];
$vote_title = $vote_info[0]['vote_text'];

$sql = "SELECT vote_id
FROM " . VOTE_USERS_TABLE . "
WHERE vote_id = $vote_id
AND vote_user_id = " . intval($userdata['user_id']);
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain user vote data for this topic", '', __LINE__, __FILE__, $sql);
}

$user_voted = ( $row = $db->sql_fetchrow($result) ) ? TRUE : 0;
$db->sql_freeresult($result);

if ( isset($HTTP_GET_VARS['vote']) || isset($HTTP_POST_VARS['vote']) )
{
$view_result = ( ( ( isset($HTTP_GET_VARS['vote']) ) ? $HTTP_GET_VARS['vote'] : $HTTP_POST_VARS['vote'] ) == 'viewresult' ) ? TRUE : 0;
}
else
{
$view_result = 0;
}

$poll_expired = ( $vote_info[0]['vote_length'] ) ? ( ( $vote_info[0]['vote_start'] + $vote_info[0]['vote_length'] < time() ) ? TRUE : 0 ) : 0;

if ( $user_voted || $view_result || $poll_expired || !$is_auth['auth_vote'] || $t_data['topic_status'] == TOPIC_LOCKED )
{
$vote_results_sum = 0;

for($i = 0; $i < $vote_options; $i++)
{
$vote_results_sum += $vote_info[$i]['vote_result'];
}

$vote_graphic = 0;
$vote_graphic_max = count($images['voting_graphic']);

for($i = 0; $i < $vote_options; $i++)
{
$vote_percent = ( $vote_results_sum > 0 ) ? $vote_info[$i]['vote_result'] / $vote_results_sum : 0;
$vote_graphic_length = round($vote_percent * $bb_cfg['vote_graphic_length']);

$vote_graphic_img = $images['voting_graphic'][$vote_graphic];
$vote_graphic = ($vote_graphic < $vote_graphic_max - 1) ? $vote_graphic + 1 : 0;

if ( count($orig_word) )
{
$vote_info[$i]['vote_option_text'] = preg_replace($orig_word, $replacement_word, $vote_info[$i]['vote_option_text']);
}

$template->assign_block_vars("poll_option", array(
'POLL_OPTION_CAPTION' => $vote_info[$i]['vote_option_text'],
'POLL_OPTION_RESULT' => $vote_info[$i]['vote_result'],
'POLL_OPTION_PERCENT' => sprintf("%.1d%%", ($vote_percent * 100)),

'POLL_OPTION_IMG' => $vote_graphic_img,
'POLL_OPTION_IMG_WIDTH' => $vote_graphic_length)
);
}

$template->assign_vars(array(
'TPL_POLL_RESULT' => true,
'TOTAL_VOTES' => $vote_results_sum,
));
}
else
{
for($i = 0; $i < $vote_options; $i++)
{
if ( count($orig_word) )
{
$vote_info[$i]['vote_option_text'] = preg_replace($orig_word, $replacement_word, $vote_info[$i]['vote_option_text']);
}

$template->assign_block_vars("poll_option", array(
'POLL_OPTION_ID' => $vote_info[$i]['vote_option_id'],
'POLL_OPTION_CAPTION' => $vote_info[$i]['vote_option_text'])
);
}

$template->assign_vars(array(
'TPL_POLL_BALLOT' => true,
'U_VIEW_RESULTS' => TOPIC_URL ."$topic_id&amp;vote=viewresult",
));

$s_hidden_fields = '<input type="hidden" name="topic_id" value="' . $topic_id . '" /><input type="hidden" name="mode" value="vote" />';
}

if ( count($orig_word) )
{
$vote_title = preg_replace($orig_word, $replacement_word, $vote_title);
}

$s_hidden_fields .= '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />';

$template->assign_vars(array(
'TOPIC_HAS_POLL' => true,
'POLL_QUESTION' => $vote_title,

'S_HIDDEN_FIELDS' => $s_hidden_fields,
'S_POLL_ACTION' => "posting.$phpEx?mode=vote&amp;t=$topic_id",
));
}
}

if ($t_data['topic_attachment'])
{
require(BB_ROOT .'attach_mod/attachment_mod.'. PHP_EXT);
init_display_post_attachments($t_data['topic_attachment']);
}

//
// Update the topic view counter
//
$sql = "INSERT INTO ". BUF_TOPIC_VIEW_TABLE ."
(topic_id, topic_views) VALUES
($topic_id, 1)
ON DUPLICATE KEY UPDATE
topic_views = topic_views + 1";

if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Could not update topic views.", '', __LINE__, __FILE__, $sql);
}

$prev_post_time = $max_post_time = 0;

// Report
//
// Get report post module
//
require_once($phpbb_root_path . "includes/functions_report.$phpEx");
$report_post = report_modules('name', 'report_post');
// Report [END]

// [begin] Warnings Mod 1.0.7
$min_post_id = $postrow[0]['post_id'];
$max_post_id = $postrow[count($postrow) - 1]['post_id'];

$sql = "SELECT w.*, wt.*, u.username FROM " . WARNINGS_TABLE . " w, " . WARNINGS_TEXT_TABLE . " wt, " . USERS_TABLE . " u, " . POSTS_TABLE . " p WHERE p.topic_id = $topic_id AND p.post_id >= $min_post_id AND p.post_id <= $max_post_id AND w.warning_post_id = p.post_id AND w.warning_id = wt.warning_id AND w.warning_proceed = 0 AND u.user_id = w.warning_poster_id";
$result = $db->sql_query($sql) or message_die(GENERAL_ERROR, 'Could not insert warning information', '', __LINE__, __FILE__, $sql);

$warnings_row = array();
while ( $row = $db->sql_fetchrow($result) )
{
$warnings_row[$row['warning_post_id']][] = $row;
}

$db->sql_freeresult($result);
// [end] Warnings Mod 1.0.7

//
// Okay, let's do the loop, yeah come on baby let's do the loop
// and it goes like this ...
//
// Advanced Meta Tags
$first_post_text = '';
// Advanced Meta Tags [END]
for($i = 0; $i < $total_posts; $i++)
{
$poster_id = $postrow[$i]['user_id'];
$poster = ( $poster_id == ANONYMOUS ) ? $lang['Guest'] : $postrow[$i]['username'];

$post_date = create_date($bb_cfg['post_date_format'], $postrow[$i]['post_time']);
$max_post_time = max($max_post_time, $postrow[$i]['post_time']);

$poster_posts = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $postrow[$i]['user_posts'] : '';
// Change Poster Mod
$temp_url = append_sid("changeuser.$phpEx?mode=start&amp;" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
$reassign_img = ( $userdata['user_level'] == ADMIN ) ? '<a href="' . $temp_url . '"><img src="' . $images['icon_user'] . '" alt="' . $lang['Change_poster'] . '" border="0" /></a>' : '';
$reassign = ( $userdata['user_level'] == ADMIN ) ? '<a href="' . $temp_url . '">' . $lang['Change_poster'] . '</a>' : '';
$poster_from = ( $postrow[$i]['user_from'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? $postrow[$i]['user_from'] : '';

// FLAGHACK-start
$poster_from_flag = ( !$user->opt_js['h_flag'] && $postrow[$i]['user_from_flag'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? make_user_flag($postrow[$i]['user_from_flag']) : "";
// FLAGHACK-end

$poster_joined = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['JOINED'] . ': ' . create_date($lang['DATE_FORMAT'], $postrow[$i]['user_regdate'], $bb_cfg['board_timezone']) : '';

$poster_longevity = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? delta_time($postrow[$i]['user_regdate']) : '';

$poster_avatar = '';
if ( !$user->opt_js['h_av'] && $postrow[$i]['user_avatar_type'] && $poster_id != ANONYMOUS && $postrow[$i]['user_allowavatar'] )
{
switch( $postrow[$i]['user_avatar_type'] )
{
case USER_AVATAR_UPLOAD:
$poster_avatar = ( $bb_cfg['allow_avatar_upload'] ) ? '<img src="' . $bb_cfg['avatar_path'] . '/' . $postrow[$i]['user_avatar'] . '" alt="" border="0" />' : '';
break;
case USER_AVATAR_REMOTE:
$poster_avatar = ( $bb_cfg['allow_avatar_remote'] ) ? '<img src="' . $postrow[$i]['user_avatar'] . '" alt="" border="0" onload="imgFit(this, 100);" onclick="return imgFit(this, 100);" />' : '';
break;
case USER_AVATAR_GALLERY:
$poster_avatar = ( $bb_cfg['allow_avatar_local'] ) ? '<img src="' . $bb_cfg['avatar_gallery_path'] . '/' . $postrow[$i]['user_avatar'] . '" alt="" border="0" />' : '';
break;
}
}

//
// Generate ranks, set them to empty string initially.
//
$poster_rank = $rank_image = '';

if (!$user->opt_js['h_rnk_i'] AND $user_rank = $postrow[$i]['user_rank'] AND isset($ranks[$user_rank]))
{
$rank_image = ($bb_cfg['show_rank_image'] && $ranks[$user_rank]['rank_image']) ? '<img src="'. $ranks[$user_rank]['rank_image'] .'" alt="" title="" border="0" />' : '';
$poster_rank = ($bb_cfg['show_rank_text']) ? $ranks[$user_rank]['rank_title'] : '';
}

// [begin] Warnings Mod 1.0.7
elseif ( $postrow[$i]['user_warnings'] || $postrow[$i]['user_banned'] )
{
if ( ( $postrow[$i]['user_warnings'] >= $board_config['warnings_per_ban'] ) || $postrow[$i]['user_banned'] )
{
$poster_rank = $lang['Banned_rank'];
$rank_image = '<img src="' . $images['user_banned_rank'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" />';
}
elseif ( $postrow[$i]['user_warnings'] )
{
$poster_rank = sprintf($lang['Warned_rank'], $postrow[$i]['user_warnings']);
$rank_image = '<img src="' . $images['user_warned_rank'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" />&nbsp;';
$rank_image = str_repeat($rank_image, $postrow[$i]['user_warnings']);
}
$rank_image .= '<br />';
}
// [end] Warnings Mod 1.0.7

//
// Handle anon users posting with usernames
//
if ( $poster_id == ANONYMOUS && $postrow[$i]['post_username'] != '' )
{
$poster = $postrow[$i]['post_username'];
}

// Buttons
$pm_btn = '';
$profile_btn = '';

$delpost_btn = '';
$edit_btn = '';
$ip_btn = '';
$quote_btn = '';

if ($poster_id != ANONYMOUS)
{
// profile
$profile_btn = true;
// pm
$pm_btn = true;
}

if ($poster_id != BOT_UID)
{
// Quote
$quote_btn = true;
// Edit
$edit_btn = (($userdata['user_id'] == $poster_id && $is_auth['auth_edit']) || $is_auth['auth_mod']);
// IP
$ip_btn = ($is_auth['auth_mod'] || IS_MOD);
// [begin] ReadOnly mod addon
if ( !in_array($postrow[$i]['user_level'], array(ADMIN,MOD)) && ($poster_id != ANONYMOUS) )
{
$ro_pre = '';
$ro_post = '';
}
else
{
$ro_pre = '<!-- ';
$ro_post = ' -->';
}
// [end] ReadOnly mod addon
// [begin] Warnings Mod 1.0.7
if ( !in_array($postrow[$i]['user_level'], array(ADMIN,MOD)) && ($poster_id != ANONYMOUS) )
{
$temp_url = "warnings.$phpEx?" . POST_POST_URL . "=" . $postrow[$i]['post_id'] . "&amp;mode=add_warning&amp;sid=" . $userdata['session_id'];
$warning_img = '<a class="txtb" href="' . $temp_url . '"><!-- img src="' . $images['user_warn'] . '" alt="' . $lang['Warn_user'] . '" title="' . $lang['Warn_user'] . '" border="0" / -->[Предупредить]</a>';
$warning = '<a href="' . $temp_url . '">' . $lang['Warn_user'] . '</a>';
}
else
{
$temp_url = '';
$warning_img = '';
$warning = '';
}
// [end] Warnings Mod 1.0.7
}
// Delete
$delpost_btn = ($is_auth['auth_mod'] || ($userdata['user_id'] == $poster_id && $is_auth['auth_delete'] && $t_data['topic_last_post_id'] == $postrow[$i]['post_id'] && $postrow[$i]['post_time'] + 3600*3 > TIMENOW));

//
// Parse message and sig
//
$post_subject = ( $postrow[$i]['post_subject'] != '' ) ? $postrow[$i]['post_subject'] : '';

$message = get_parsed_post($postrow[$i]);

// Advanced Meta Tags
if ($i == 0)
{
$first_post_text = $message;
$global_keywords = $bb_cfg['global_keywords'];
$site_description = $bb_cfg['site_desc'];

$post_text = $first_post_text;
if (!empty($post_text))
{
$post_text = strtolower(strip_tags($post_text));
$post_text = preg_split("/[\s,.-:]+/", $post_text);
if ($bb_cfg['use_dynamic_keywords'])
{
$count = 0;
$rnd_keywords = array();
foreach ($post_text as $word)
{
$word = str_replace("'", '', $word);
if (strlen($word) > 2)
{
if (!empty($rnd_keywords) && in_array($word, $rnd_keywords))
{
continue;
}
$rnd_keywords[] = $word;
$count++;
}
if ($count == $bb_cfg['keyword_word_count'])
{
break;
}
}
$config_keywords = ($bb_cfg['append_global_keywords']) ? $bb_cfg['global_keywords'] : '';
$rnd_keywords = ($bb_cfg['append_keywords_first']) ? $config_keywords . ', ' . implode(', ', $rnd_keywords) : implode(', ', $rnd_keywords) . ', ' . $config_keywords;
}

if ($bb_cfg['use_dynamic_description'])
{
$count = 0;
$rnd_description = '';
foreach ($post_text as $word)
{
$rnd_description .= $word . ' ';
$count++;

if ($count == $bb_cfg['description_word_count'])
{
break;
}
}
}
}
}
// Advanced Meta Tags [END]

$bbcode_uid = $postrow[$i]['bbcode_uid'];

$user_sig = ($bb_cfg['allow_sig'] && !$user->opt_js['h_sig'] && $postrow[$i]['enable_sig'] && $postrow[$i]['user_sig']) ? $postrow[$i]['user_sig'] : '';
$user_sig_bbcode_uid = $postrow[$i]['user_sig_bbcode_uid'];

if ($user_sig && $user_sig_bbcode_uid)
{
$user_sig = ($bb_cfg['allow_bbcode']) ? bbencode_second_pass($user_sig, $user_sig_bbcode_uid) : preg_replace("/\:$user_sig_bbcode_uid/si", '', $user_sig);
}
if ($user_sig)
{
$user_sig = make_clickable($user_sig);
}

//
// Parse smilies
//
if ($user_sig && $bb_cfg['allow_smilies'])
{
$user_sig = smilies_pass($user_sig);
}

//
// Replace naughty words
//
if (count($orig_word))
{
$post_subject = preg_replace($orig_word, $replacement_word, $post_subject);

if ($user_sig)
{
$user_sig = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $user_sig . '<'), 1, -1));
}

$message = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $message . '<'), 1, -1));
}

//
// Replace newlines (we use this rather than nl2br because
// till recently it wasn't XHTML compliant)
//
if ($user_sig)
{
$user_sig = '<br />_________________<br />' . str_replace("\n", "\n<br />\n", $user_sig);
}

//
// Editing information
//
if ( $postrow[$i]['post_edit_count'] )
{
$l_edit_time_total = ( $postrow[$i]['post_edit_count'] == 1 ) ? $lang['Edited_time_total'] : $lang['Edited_times_total'];

$l_edited_by = '<br /><br />' . sprintf($l_edit_time_total, $poster, create_date($bb_cfg['default_dateformat'], $postrow[$i]['post_edit_time'], $bb_cfg['board_timezone']), $postrow[$i]['post_edit_count']);
}
else
{
$l_edited_by = '';
}
// [begin] Warnings Mod 1.0.7
if ( isset($warnings_row[$postrow[$i]['post_id']]) )
{
$warnings = array();

foreach ($warnings_row[$postrow[$i]['post_id']] as $warning_row)
{
$warning_icon = ( $warning_row['warning_type'] == WARNING_TYPE_WARNING ) ? $images['user_warned_rank'] : $images['user_banned_rank'];
$warning_icon = '<img src="' . $warning_icon . '" border="0" alt="">';
$warning_text = htmlspecialchars($warning_row['warning_text']);
$warning_poster = '<a class="gensmall" href="' . append_sid('profile.' . $phpEx . '?mode=viewprofile&amp;' . POST_USERS_URL . '=' . $warning_row['warning_poster_id']) . '">' . $warning_row['username'] . '</a>';

$warnings[] = sprintf($lang['Warnings_viewtopic'], $warning_icon, $warning_text, $warning_poster);
}

$warnings_info = '<br /><br />' . implode('<br />', $warnings);
}
else
{
$warnings_info = '';
}
// [end] Warnings Mod 1.0.7

if ( $postrow[$i]['user_readonly'] != 0 )
{
$user_ro = "<i>ЗАПРЕТ НА ПОСТ</i>";
}
else
{
$user_ro = "";
}

//
// Again this will be handled by the templating
// code at some point
//
if( $postrow[$i]['user_level'] == ADMIN )
{
$poster_name = '<b class="colorAdmin">' . wbr($poster) . '';
}
else if( $postrow[$i]['user_level'] == MOD )
{
$poster_name = '<b class="colorMod">' . wbr($poster) . '';
}
else
{
$poster_name = wbr($poster);
}
$pg_row_class = !($i % 2) ? 'row2' : 'row1';

// Report
//
// Create report links
//
if ($report_post && $report_post->auth_check('auth_write'))
{
if ($postrow[$i]['post_reported'])
{
$report_auth = ($userdata['user_level'] == ADMIN || (!$bb_cfg['report_list_admin'] && (!$bb_cfg['report_subject_auth'] || $is_auth['auth_mod'])));
if ($report_post->auth_check('auth_view') && $report_auth)
{
$temp_url = append_sid("report.$phpEx?mode=reported&amp;" . POST_CAT_URL . '=' . $report_post->id . '&amp;id=' . $postrow[$i]['post_id']);
$target = ($bb_cfg['report_new_window']) ? ' target="_blank"' : '';
$report_img = '<a href="' . $temp_url . '"' . $target . '><img src="' . $images['icon_reported'] . '" alt="' . $report_post->lang['Duplicate_report'] . '" title="' . $report_post->lang['Duplicate_report'] . '" border="0" /></a>';
$report = '<a href="' . $temp_url . '"' . $target . '>' . $report_post->lang['Duplicate_report'] . '</a>';
}
else
{
$report_img = '<img src="' . $images['icon_reported'] . '" alt="' . $report_post->lang['Duplicate_report'] . '" title="' . $report_post->lang['Duplicate_report'] . '" border="0" />';
$report = $report_post->lang['Duplicate_report'];
}
}
else
{
$temp_url = append_sid("report.$phpEx?mode=" . $report_post->mode . '&amp;id=' . $postrow[$i]['post_id']);
$report_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_report'] . '" alt="' . $report_post->lang['Write_report'] . '" title="' . $report_post->lang['Write_report'] . '" border="0" /></a>';
$report = '<a class="txtb" href="' . $temp_url . '">' . $report_post->lang['Write_report'] . '</a>';
}
}
else
{
$report_img = $report = '';
}
// Report [END]

//Online/Offline
if (($postrow[$i]['user_timer'] >= ( time() - 300 )) && ($postrow[$i]['user_allow_viewonline']))
{
$on_off_hidden = '<img src="' . $images['icon_online'] . '" alt="' . $lang['Online'] . '" title="' . $lang['Online'] . '" border="0" />';
}
else if ($postrow[$i]['user_allow_viewonline'] == 0)
{
$on_off_hidden = '<img src="' . $images['icon_hidden'] . '" alt="' . $lang['Hidden'] . '" title="' . $lang['Hidden'] . '" border="0" />';
}
else if ($poster_id == ANONYMOUS)
{
$on_off_hidden = '';
}
else
{
$on_off_hidden = '<img src="' . $images['icon_offline'] . '" alt="' . $lang['Offline'] . '" title="' . $lang['Offline'] . '" border="0" />';
}

$template->assign_block_vars('postrow', array(
'ROW_CLASS' => !($i % 2) ? 'row1' : 'row2',
'RO' => $user_ro,
'RO_PRE' => $ro_pre,
'RO_POST' => $ro_post,
'POST_ID' => $postrow[$i]['post_id'],
'IS_NEWEST' => ($postrow[$i]['post_id'] == $newest),
'POSTER_NAME' => $poster_name,
'POSTER_NAME_JS' => addslashes($poster),
'POSTER_RANK' => $poster_rank,
'RANK_IMAGE' => $rank_image,
'POSTER_JOINED' => ($bb_cfg['show_poster_joined']) ? $poster_longevity : '',

'POSTER_JOINED_DATE' => $poster_joined,
'POSTER_POSTS' => ($bb_cfg['show_poster_posts']) ? $poster_posts : '',
'POSTER_FROM' => ($bb_cfg['show_poster_from']) ? wbr($poster_from) : '',
'POSTER_BOT' => ($poster_id == BOT_UID),
'POSTER_ID' => $poster_id,
'POSTED_AFTER' => ($prev_post_time) ? delta_time($postrow[$i]['post_time'], $prev_post_time) : '',
'POSTER_FROM_FLAG' => ($bb_cfg['show_poster_flag']) ? $poster_from_flag : '',
'IS_UNREAD' => is_unread($postrow[$i]['post_time'], $topic_id, $forum_id),
'IS_FIRST_POST' => (!$start && ($postrow[$i]['post_id'] == $t_data['topic_first_post_id'])),
'MOD_CHECKBOX' => ($moderation && ($start || defined('SPLIT_FORM_START'))),
'POSTER_AVATAR' => $poster_avatar,
'POSTER_ONLINE' => $on_off_hidden,
'POST_NUMBER' => ($i + $start + 1),
'POST_DATE' => $post_date,
'POST_SUBJECT' => $post_subject,
'MESSAGE' => $message,
'SIGNATURE' => $user_sig,
'EDITED_MESSAGE' => $l_edited_by,

'PM' => $pm_btn,
'PROFILE' => $profile_btn,

'QUOTE' => $quote_btn,
'EDIT' => $edit_btn,
'DELETE' => $delpost_btn,
// [begin] Warnings Mod 1.0.7
'WARNING_IMG' => $warning_img,
'WARNING' => $warning,
'WARNINGS_INFO' => $warnings_info,
// [end] Warnings Mod 1.0.7
'IP' => $ip_btn,

// Report
'REPORT' => ($bb_cfg['text_buttons']) ? '['. $report .']' : $report_img,
// Report [END]
));

if ($postrow[$i]['post_attachment'] && $is_auth['auth_download'] && function_exists('display_post_attachments'))
{
display_post_attachments($postrow[$i]['post_id'], $postrow[$i]['post_attachment']);
}

if ($moderation && !defined('SPLIT_FORM_START') && ($start || $postrow[$i]['post_id'] == $t_data['topic_first_post_id']))
{
define('SPLIT_FORM_START', TRUE);
}

if ($poster_id != BOT_UID)
{
$prev_post_time = $postrow[$i]['post_time'];
}
}

set_tracks(COOKIE_TOPIC, $tracking_topics, $topic_id, $max_post_time);

if (defined('SPLIT_FORM_START'))
{
$template->assign_vars(array(
'SPLIT_FORM' => true,
'START' => $start,
'S_SPLIT_ACTION' => "modcp.$phpEx",
'POST_FORUM_URL' => POST_FORUM_URL,
'POST_TOPIC_URL' => POST_TOPIC_URL,
));
}

//
// Quick Reply
//
if ($bb_cfg['show_quick_reply'])
{
if ($is_auth['auth_reply'] && !($t_data['forum_status'] == FORUM_LOCKED || $t_data['topic_status'] == TOPIC_LOCKED))
{
$template->assign_vars(array(
'QUICK_REPLY' => true,
'QR_POST_ACTION' => "posting.$phpEx",
'QR_TOPIC_ID' => $topic_id,
));
if (!IS_GUEST)
{
$template->assign_vars(array(
'QR_ATTACHSIG_CHECKED' => bf($userdata['user_opt'], 'user_opt', 'attachsig'),
'QR_NOTIFY_CHECKED' => ($userdata['user_notify'] || $is_watching_topic),
));
}
}
}

$template->assign_vars(array(
'PG_ROW_CLASS' => isset($pg_row_class) ? $pg_row_class : 'row1',
));

if (IS_ADMIN)
{
$template->assign_vars(array(
'U_LOGS' => "admin/admin_log.$phpEx?sid={$userdata['session_id']}&amp;t=$topic_id&amp;db=900",
'L_LOGS' => 'Logs',
));
}

// Advanced Meta Tags
if (!$bb_cfg['use_dynamic_description'])
{
$template->assign_vars(array(
'PAGE_DESCRIPTION_ON' => true,
'PAGE_DESCRIPTION' => $site_description,
));
}else
{
$template->assign_vars(array(
'PAGE_DESCRIPTION_ON' => true,
'PAGE_DESCRIPTION' => $rnd_description,
));
}
if (!$bb_cfg['use_dynamic_keywords'])
{
$template->assign_vars(array(
'PAGE_KEYWORDS_ON' => true,
'PAGE_KEYWORDS' => $global_keywords,
));
}else
{
$template->assign_vars(array(
'PAGE_KEYWORDS_ON' => true,
'PAGE_KEYWORDS' => $rnd_keywords,
));
}
// Advanced Meta Tags [END]

print_page('viewtopic.tpl');


Вернуться к началу
 Профиль  
Ответить с цитатой  
 Заголовок сообщения:
СообщениеДобавлено: 2011-01-17 19:26 
Не в сети
Администратор
Администратор
Аватара пользователя
Раздал: 51.58 ТБ
Скачал: 620.08 ГБ
Ратио: 85.182


Зарегистрирован: 2010-11-09 02:24
Сообщения: 44886
Откуда: Земля Санникова
добавь после этого

Код:
'QUOTE' => $quote_btn,
'EDIT' => $edit_btn,
'DELETE' => $delpost_btn,


Вернуться к началу
 Профиль  
Ответить с цитатой  
 Заголовок сообщения:
СообщениеДобавлено: 2011-01-17 20:07 
Не в сети
Аватара пользователя
Раздал: 500 МБ
Скачал: 0 байт
Ратио: Seed.


Зарегистрирован: 2011-01-06 19:03
Сообщения: 47
includes/init_bb.php
тож нет

define('PAGE_GROUPCP', -11);


Вернуться к началу
 Профиль  
Ответить с цитатой  
 Заголовок сообщения:
СообщениеДобавлено: 2011-01-17 22:41 
Не в сети
Администратор
Администратор
Аватара пользователя
Раздал: 51.58 ТБ
Скачал: 620.08 ГБ
Ратио: 85.182


Зарегистрирован: 2010-11-09 02:24
Сообщения: 44886
Откуда: Земля Санникова
да куда нить в пихай, это не столь важно

можно после этого

Код:
define('SEARCH_REBUILD_TABLE',       $t .'search_rebuild');
define('SEARCH_TABLE',               $t .'search_results');
define('SESSIONS_TABLE',             $t .'sessions');
define('SMILIES_TABLE',              $t .'smilies');
define('TOPIC_TPL_TABLE',            $t .'topic_templates');
define('TOPICS_TABLE',               $t .'topics');
define('TOPICS_WATCH_TABLE',         $t .'topics_watch');
define('USER_GROUP_TABLE',           $t .'user_group');
define('USERS_TABLE',                $t .'users');
define('VOTE_DESC_TABLE',            $t .'vote_desc');
define('VOTE_RESULTS_TABLE',         $t .'vote_results');
define('VOTE_USERS_TABLE',           $t .'vote_voters');


Вернуться к началу
 Профиль  
Ответить с цитатой  
 Заголовок сообщения:
СообщениеДобавлено: 2011-01-17 23:46 
Не в сети
Аватара пользователя
Раздал: 500 МБ
Скачал: 0 байт
Ратио: Seed.


Зарегистрирован: 2011-01-06 19:03
Сообщения: 47
Тож нет templates/default/viewtopic.tpl

{postrow.EDIT_IMG}


Вернуться к началу
 Профиль  
Ответить с цитатой  
 Заголовок сообщения:
СообщениеДобавлено: 2011-01-18 01:51 
Не в сети
Администратор
Администратор
Аватара пользователя
Раздал: 51.58 ТБ
Скачал: 620.08 ГБ
Ратио: 85.182


Зарегистрирован: 2010-11-09 02:24
Сообщения: 44886
Откуда: Земля Санникова
блин ну ты даешь, ведь на скрине видно картинку где размещена, вот у себя в тоже место надо всавить


Вернуться к началу
 Профиль  
Ответить с цитатой  
 Заголовок сообщения:
СообщениеДобавлено: 2011-01-18 02:14 
Не в сети
Администратор
Администратор
Аватара пользователя
Раздал: 51.58 ТБ
Скачал: 620.08 ГБ
Ратио: 85.182


Зарегистрирован: 2010-11-09 02:24
Сообщения: 44886
Откуда: Земля Санникова
к стати не потеме, в кузне увидел твое сообщение по поводу гмаила вот держи нормальная служба https://www.google.com/a/cpanel/domain/new


Вернуться к началу
 Профиль  
Ответить с цитатой  
 Заголовок сообщения:
СообщениеДобавлено: 2011-01-18 16:15 
Не в сети
Аватара пользователя
Раздал: 500 МБ
Скачал: 0 байт
Ратио: Seed.


Зарегистрирован: 2011-01-06 19:03
Сообщения: 47
admin писал(а):
{postrow.REASSIGN_IMG}

спс всё ок мод работает ЗЫ а по подродней по настройке почты??


Вернуться к началу
 Профиль  
Ответить с цитатой  
 Заголовок сообщения:
СообщениеДобавлено: 2011-01-18 19:41 
Не в сети
Администратор
Администратор
Аватара пользователя
Раздал: 51.58 ТБ
Скачал: 620.08 ГБ
Ратио: 85.182


Зарегистрирован: 2010-11-09 02:24
Сообщения: 44886
Откуда: Земля Санникова
Цитата:
ЗЫ а по подродней по настройке почты??


читай, там все есть написано, как правильно настроить


Вернуться к началу
 Профиль  
Ответить с цитатой  
 Заголовок сообщения:
СообщениеДобавлено: 2011-01-18 21:29 
Не в сети
Аватара пользователя
Раздал: 500 МБ
Скачал: 0 байт
Ратио: Seed.


Зарегистрирован: 2011-01-06 19:03
Сообщения: 47
я что то просто немогу понять в серверы что писать :ak: :ak: :ak:


Вернуться к началу
 Профиль  
Ответить с цитатой  
Показать сообщения за:  Поле сортировки  
Начать новую тему Ответить на тему  [ Сообщений: 15 ] 

Часовой пояс: UTC + 3 часа


Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 36


Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете добавлять вложения

Найти:
Перейти:  
cron
Переместиться наверх
 Главная |  Список форумов |   Time : 0.652s | 16 Queries | GZIP : Off |