viewtopic.php uçtuuu :( beyaz sayfa

Alınan hata mesajları ve çözüm yolları.

viewtopic.php uçtuuu :( beyaz sayfa

İleti h_era_ce 25.09.2006, 19:58

Selamlar,
Arkadaşlar Plus 1.53 e hide mod ve teşekkür modu kurdum hide mod sorunsuz çalıştı ama teşekkür modunu kurunca beyaz sayfa çıktı :( Aşağıda tüm dosya mevcut lütfen acil yardım eder misiniz?



[code]<?php
header ("Content-Type: text/html; charset=iso-8859-9");
/***************************************************************************
* viewtopic.php
* -------------------
* begin : Saturday, Feb 13, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id: viewtopic.php,v 1.186.2.35 2004/03/13 15:08:23 acydburn Exp $
*
*
***************************************************************************/

/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx);
include_once($phpbb_root_path . 'includes/functions_color_groups.'.$phpEx);
include($phpbb_root_path . 'includes/def_icons.'. $phpEx);
include_once($phpbb_root_path . 'includes/functions_calendar.'.$phpEx);
include($phpbb_root_path . 'includes/functions_bookmark.'.$phpEx);
include_once($phpbb_root_path . 'includes/functions_profile_fields.'.$phpEx);

//
// Start initial var setup
//
$topic_id = $post_id = 0;
if ( isset($_GET[POST_TOPIC_URL]) )
{
$topic_id = intval($_GET[POST_TOPIC_URL]);
}
else if ( isset($_GET['topic']) )
{
$topic_id = intval($_GET['topic']);
}

if ( isset($_GET[POST_POST_URL]))
{
$post_id = intval($_GET[POST_POST_URL]);
}


$start = ( isset($_GET['start']) ) ? intval($_GET['start']) : 0;

if (!$topic_id && !$post_id)
{
message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
}


//
// Find topic id if user requested a newer
// or older topic
//
if ( isset($_GET['view']) && empty($_GET[POST_POST_URL]) )
{
if ( $_GET['view'] == 'newest' )
{
if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) || isset($_GET['sid']) )
{
$session_id = isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) ? $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid'] : $_GET['sid'];

if (!preg_match('/^[A-Za-z0-9]*$/', $session_id))
{
$session_id = '';
}

if ( $session_id )
{
$sql = "SELECT p.post_id
FROM " . POSTS_TABLE . " p, " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u
WHERE s.session_id = '$session_id'
AND u.user_id = s.session_user_id
AND p.topic_id = $topic_id
AND p.post_time >= u.user_lastvisit
ORDER BY p.post_time ASC
LIMIT 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain newer/older topic information', '', __LINE__, __FILE__, $sql);
}

if ( !($row = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, 'No_new_posts_last_visit');
}

$post_id = $row['post_id'];

if (isset($_GET['sid']))
{
redirect("viewtopic.$phpEx?sid=$session_id&" . POST_POST_URL . "=$post_id#$post_id");
}
else
{
redirect("viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id");
}
}
}

redirect(append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id", true));
}
else if ( $_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 ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain newer/older topic information", '', __LINE__, __FILE__, $sql);
}

if ( $row = $db->sql_fetchrow($result) )
{
$topic_id = intval($row['topic_id']);
//-- mod : categories hierarchy --------------------------------------------------------------------
//-- add
redirect( "./viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id" );
//-- fin mod : categories hierarchy ----------------------------------------------------------------

}
else
{
$message = ( $_GET['view'] == 'next' ) ? 'No_newer_topics' : 'No_older_topics';
message_die(GENERAL_MESSAGE, $message);
}
}
}

//
// This rather complex gaggle of code handles querying for topics but
// also allows for direct linking to a post (and the calculation of which
// page the post is on and the correct display of viewtopic)
//
$join_sql_table = (!$post_id) ? '' : ", " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2 ";
$join_sql = (!$post_id) ? "t.topic_id = $topic_id" : "p.post_id = $post_id AND t.topic_id = p.topic_id AND p2.topic_id = p.topic_id AND p2.post_id <= $post_id";
$count_sql = (!$post_id) ? '' : ", COUNT(p2.post_id) AS prev_posts";

$order_sql = ( !$post_id ) ? '' : "GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments, f.auth_ban, f.auth_greencard, f.auth_bluecard ORDER BY p.post_id ASC";
//-- mod : calendar --------------------------------------------------------------------------------
// here we added
// , t.topic_first_post_id, t.topic_calendar_time, t.topic_calendar_duration
//-- modify

$sql = "SELECT t.topic_id, t.topic_bedankomat, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, t.topic_first_post_id, t.topic_calendar_time, t.topic_calendar_duration, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments, f.auth_ban, f.auth_greencard, f.auth_bluecard" . $count_sql . "
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f" . $join_sql_table . "
WHERE $join_sql
AND f.forum_id = t.forum_id
$order_sql";
attach_setup_viewtopic_auth($order_sql, $sql);
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain topic information", '', __LINE__, __FILE__, $sql);
}

if ( !($forum_topic_data = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
}

$forum_id = intval($forum_topic_data['forum_id']);

// Start add - Who viewed a topic MOD
$topic_id = intval($forum_topic_data['topic_id']);
// End add - Who viewed a topic MOD

//
// Start session management
//
$userdata = session_pagestart($user_ip, $forum_id, $topic_id);
init_userprefs($userdata);
//
// End session management
//

//
// Set or remove bookmark
//
if ( isset($_GET['setbm']) || isset($_GET['removebm']) )
{
$redirect = "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&start=$start&postdays=$post_days&postorder=$post_order&highlight=" . $_GET['highlight'];
if ( $userdata['session_logged_in'] )
{
if (isset($_GET['setbm']) && $_GET['setbm'])
{
set_bookmark($topic_id);
}
else if (isset($_GET['removebm']) && $_GET['removebm'])
{
remove_bookmark($topic_id);
}
}
else
{
if (isset($_GET['setbm']) && $_GET['setbm'])
{
$redirect .= '&setbm=true';
}
else if (isset($_GET['removebm']) && $_GET['removebm'])
{
$redirect .= '&removebm=true';
}
redirect(append_sid("login.$phpEx?redirect=$redirect", true));
}
redirect(append_sid($redirect, true));
}

//
// Start auth check
//
$is_auth = array();
//-- mod : categories hierarchy --------------------------------------------------------------------
//-- delete
// $is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_topic_data);
//
// if( !$is_auth['auth_view'] || !$is_auth['auth_read'] )
//-- add
$is_auth = $tree['auth'][POST_FORUM_URL . $forum_id];

if ( !$is_auth['auth_read'] )
//-- fin mod : categories hierarchy ----------------------------------------------------------------

{
if ( !$userdata['session_logged_in'] )
{
$redirect = ($post_id) ? POST_POST_URL . "=$post_id" : POST_TOPIC_URL . "=$topic_id";
$redirect .= ($start) ? "&start=$start" : '';
redirect(append_sid("login.$phpEx?redirect=viewtopic.$phpEx&$redirect", true));
}

//-- mod : categories hierarchy --------------------------------------------------------------------
//-- delete
// $message = ( !$is_auth['auth_view'] ) ? $lang['Topic_post_not_exist'] : sprintf($lang['Sorry_auth_read'], $is_auth['auth_read_type']);
//-- add
$message = sprintf($lang['Sorry_auth_read'], $is_auth['auth_read_type']);
//-- fin mod : categories hierarchy ----------------------------------------------------------------


message_die(GENERAL_MESSAGE, $message);
}
//
// End auth check
//
// Start add - Who viewed a topic MOD
$user_id=$userdata['user_id'];
$sql='UPDATE '.TOPIC_VIEW_TABLE.' SET topic_id="'.$topic_id.'", view_time="'.time().'", view_count=view_count+1 WHERE topic_id='.$topic_id.' AND user_id='.$user_id;
if ( !$db->sql_query($sql) || !$db->sql_affectedrows() )
{
$sql = 'INSERT IGNORE INTO '.TOPIC_VIEW_TABLE.' (topic_id, user_id, view_time,view_count)
VALUES ('.$topic_id.', "'.$user_id.'", "'.time().'","1")';
if ( !($db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Error create user view topic information ', '', __LINE__, __FILE__, $sql);
}
}
// End add - Who viewed a topic MOD

//-- mod : categories hierarchy --------------------------------------------------------------------
//-- delete
// $forum_name = $forum_topic_data['forum_name'];
//-- add
$forum_name = get_object_lang(POST_FORUM_URL . $forum_topic_data['forum_id'], 'name');
//-- fin mod : categories hierarchy ----------------------------------------------------------------

$topic_title = $forum_topic_data['topic_title'];
$topic_id = intval($forum_topic_data['topic_id']);
$topic_time = $forum_topic_data['topic_time'];
//-- mod : calendar --------------------------------------------------------------------------------
//-- add
$topic_first_post_id = intval($forum_topic_data['topic_first_post_id']);
$topic_calendar_time = intval($forum_topic_data['topic_calendar_time']);
$topic_calendar_duration = intval($forum_topic_data['topic_calendar_duration']);
//-- fin mod : calendar ----------------------------------------------------------------------------


if ($post_id)
{
$start = floor(($forum_topic_data['prev_posts'] - 1) / intval($board_config['posts_per_page'])) * intval($board_config['posts_per_page']);
}

//
// Is user watching this thread?
//
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 ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain topic watch information", '', __LINE__, __FILE__, $sql);
}

if ( $row = $db->sql_fetchrow($result) )
{
if ( isset($_GET['unwatch']) )
{
if ( $_GET['unwatch'] == 'topic' )
{
$is_watching_topic = 0;

$sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : '';
$sql = "DELETE $sql_priority 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);
}
}

$template->assign_vars(array(
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;start=$start") . '">')
);

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

if ( $row['notify_status'] )
{
$sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : '';
$sql = "UPDATE $sql_priority " . 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($_GET['watch']) )
{
if ( $_GET['watch'] == 'topic' )
{
$is_watching_topic = TRUE;

$sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : '';
$sql = "INSERT $sql_priority 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);
}
}

$template->assign_vars(array(
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;start=$start") . '">')
);

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

//
// 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
//
$valid = FALSE;
if( $userdata['session_logged_in'] ) {
$sql = "SELECT p.poster_id, p.topic_id
FROM " . POSTS_TABLE . " p
WHERE p.topic_id = $topic_id
AND p.poster_id = " . $userdata['user_id'];
$resultat = $db->sql_query($sql);
$valid = $db->sql_numrows($resultat) ? TRUE : FALSE;}
$previous_days = array(0, 1, 7, 14, 30, 90, 180, 364);
$previous_days_text = array($lang['All_Posts'], $lang['1_Day'], $lang['7_Days'], $lang['2_Weeks'], $lang['1_Month'], $lang['3_Months'], $lang['6_Months'], $lang['1_Year']);

if( !empty($_POST['postdays']) || !empty($_GET['postdays']) )
{
$post_days = ( !empty($_POST['postdays']) ) ? intval($_POST['postdays']) : intval($_GET['postdays']);
$min_post_time = time() - (intval($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";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain limited topics count information", '', __LINE__, __FILE__, $sql);
}

$total_replies = ( $row = $db->sql_fetchrow($result) ) ? intval($row['num_posts']) : 0;

$limit_posts_time = "AND p.post_time >= $min_post_time ";

if ( !empty($_POST['postdays']))
{
$start = 0;
}
}
else
{
$total_replies = intval($forum_topic_data['topic_replies']) + 1;

$limit_posts_time = '';
$post_days = 0;
}

$select_post_days = '<select name="postdays">';
for($i = 0; $i < count($previous_days); $i++)
{
$selected = ($post_days == $previous_days[$i]) ? ' selected="selected"' : '';
$select_post_days .= '<option value="' . $previous_days[$i] . '"' . $selected . '>' . $previous_days_text[$i] . '</option>';
}
$select_post_days .= '</select>';

//
// Decide how to order the post display
//
if ( !empty($_POST['postorder']) || !empty($_GET['postorder']) )
{
$post_order = (!empty($_POST['postorder'])) ? htmlspecialchars($_POST['postorder']) : htmlspecialchars($_GET['postorder']);
$post_time_order = ($post_order == "asc") ? "ASC" : "DESC";
}
else
{
$post_order = 'asc';
$post_time_order = 'ASC';
}

$select_post_order = '<select name="postorder">';
if ( $post_time_order == 'ASC' )
{
$select_post_order .= '<option value="asc" selected="selected">' . $lang['Oldest_First'] . '</option><option value="desc">' . $lang['Newest_First'] . '</option>';
}
else
{
$select_post_order .= '<option value="asc">' . $lang['Oldest_First'] . '</option><option value="desc" selected="selected">' . $lang['Newest_First'] . '</option>';
}
$select_post_order .= '</select>';

// Custom Profile Fields MOD
$profile_data = get_fields('WHERE view_in_topic = ' . VIEW_IN_TOPIC . ' AND users_can_view = ' . ALLOW_VIEW);
$profile_data_sql = get_udata_txt($profile_data, 'u.');
// END Custom Profile Fields MOD

//
// Go ahead and pull all data for this topic
//
$sql = "SELECT u.username, u.user_absence, u.user_absence_mode, u.user_id, u.user_posts, u.user_from, u.user_from_flag, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, u.user_warnings, u.user_level, u.user_allow_viewonline, u.user_session_time, u.user_birthday, u.user_next_birthday_greeting, u.user_gender".$profile_data_sql.", p.*, pt.post_text, pt.post_subject, pt.bbcode_uid
FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
WHERE p.topic_id = $topic_id
$limit_posts_time
AND pt.post_id = p.post_id
AND u.user_id = p.poster_id
ORDER BY p.post_time $post_time_order
LIMIT $start, ".$board_config['posts_per_page'];
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain post/user information.", '', __LINE__, __FILE__, $sql);
}

$postrow = array();
if ($row = $db->sql_fetchrow($result))
{
do
{
$postrow[] = $row;
}
while ($row = $db->sql_fetchrow($result));
$db->sql_freeresult($result);

$total_posts = count($postrow);
}
else
{
include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
sync('topic', $topic_id);

message_die(GENERAL_MESSAGE, $lang['No_posts_topic']);
}

$resync = FALSE;
if ($forum_topic_data['topic_replies'] + 1 < $start + count($postrow))
{
$resync = TRUE;
}
elseif ($start + $board_config['posts_per_page'] > $forum_topic_data['topic_replies'])
{
$row_id = intval($forum_topic_data['topic_replies']) % intval($board_config['posts_per_page']);
if ($postrow[$row_id]['post_id'] != $forum_topic_data['topic_last_post_id'] || $start + count($postrow) < $forum_topic_data['topic_replies'])
{
$resync = TRUE;
}
}
elseif (count($postrow) < $board_config['posts_per_page'])
{
$resync = TRUE;
}

if ($resync)
{
include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
sync('topic', $topic_id);

$result = $db->sql_query('SELECT COUNT(post_id) AS total FROM ' . POSTS_TABLE . ' WHERE topic_id = ' . $topic_id);
$row = $db->sql_fetchrow($result);
$total_replies = $row['total'];
}

$sql = "SELECT *
FROM " . RANKS_TABLE . "
ORDER BY rank_special, rank_min";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain ranks information.", '', __LINE__, __FILE__, $sql);
}

$ranksrow = array();
while ( $row = $db->sql_fetchrow($result) )
{
$ranksrow[] = $row;
}
$db->sql_freeresult($result);

//
// 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);
}

//
// Was a highlight request part of the URI?
//
$highlight_match = $highlight = '';
if (isset($HTTP_GET_VARS['highlight']))
{
// Split words and phrases
$words = explode(' ', trim(htmlspecialchars($HTTP_GET_VARS['highlight'])));

for($i = 0; $i < sizeof($words); $i++)
{
if (trim($words[$i]) != '')
{
$highlight_match .= (($highlight_match != '') ? '|' : '') . str_replace('*', '\w*', preg_quote($words[$i], '#'));
}
}
unset($words);

$highlight = urlencode($HTTP_GET_VARS['highlight']);
$highlight_match = phpbb_rtrim($highlight_match, "\\");
}

//
// Post, reply and other URL generation for
// templating vars
//
$new_topic_url = append_sid("posting.$phpEx?mode=newtopic&amp;" . POST_FORUM_URL . "=$forum_id");
$reply_topic_url = append_sid("posting.$phpEx?mode=reply&amp;" . POST_TOPIC_URL . "=$topic_id");
$export_topic_url = append_sid("export.$phpEx?mode=txt&amp;" . POST_TOPIC_URL . "=$topic_id");
$view_forum_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id");
$view_prev_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;view=previous");
$view_next_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;view=next");

//
// Mozilla navigation bar
//
$nav_links['prev'] = array(
'url' => $view_prev_topic_url,
'title' => $lang['View_previous_topic']
);
$nav_links['next'] = array(
'url' => $view_next_topic_url,
'title' => $lang['View_next_topic']
);
$nav_links['up'] = array(
'url' => $view_forum_url,
'title' => $forum_name
);

$reply_img = ( $forum_topic_data['forum_status'] == FORUM_LOCKED || $forum_topic_data['topic_status'] == TOPIC_LOCKED ) ? $images['reply_locked'] : $images['reply_new'];
$reply_alt = ( $forum_topic_data['forum_status'] == FORUM_LOCKED || $forum_topic_data['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['Reply_to_topic'];
$post_img = ( $forum_topic_data['forum_status'] == FORUM_LOCKED ) ? $images['post_locked'] : $images['post_new'];
$post_alt = ( $forum_topic_data['forum_status'] == FORUM_LOCKED ) ? $lang['Forum_locked'] : $lang['Post_new_topic'];

//
// Set a cookie for this topic
//
if ( $userdata['session_logged_in'] )
{
$tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) : array();
$tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) : array();

if ( !empty($tracking_topics[$topic_id]) && !empty($tracking_forums[$forum_id]) )
{
$topic_last_read = ( $tracking_topics[$topic_id] > $tracking_forums[$forum_id] ) ? $tracking_topics[$topic_id] : $tracking_forums[$forum_id];
}
else if ( !empty($tracking_topics[$topic_id]) || !empty($tracking_forums[$forum_id]) )
{
$topic_last_read = ( !empty($tracking_topics[$topic_id]) ) ? $tracking_topics[$topic_id] : $tracking_forums[$forum_id];
}
else
{
$topic_last_read = $userdata['user_lastvisit'];
}

if ( count($tracking_topics) >= 150 && empty($tracking_topics[$topic_id]) )
{
asort($tracking_topics);
unset($tracking_topics[key($tracking_topics)]);
}

$tracking_topics[$topic_id] = time();

setcookie($board_config['cookie_name'] . '_t', serialize($tracking_topics), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
}

//
// Load templates
//
$template->set_filenames(array(
'body' => 'viewtopic_body.tpl')
);
make_jumpbox('viewforum.'.$phpEx, $forum_id);

//
// Output page header
//
// Start add - Topic in Who is online MOD
if ($board_config['display_viewonline'] == 2) define('SHOW_ONLINE', true);
// End add - Topic in Who is online MOD
$page_title = $lang['View_topic'] .' - ' . $topic_title;
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

//
// 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_ban'] ) ? $lang['Rules_ban_can'] . '<br />' : '';
$s_auth_can .= ( $is_auth['auth_greencard'] ) ? $lang['Rules_greencard_can'] . '<br />' : '';
$s_auth_can .= ( $is_auth['auth_bluecard'] ) ? $lang['Rules_bluecard_can'] . '<br />' : '';
attach_build_auth_levels($is_auth, $s_auth_can);
$topic_mod = '';

if ( $is_auth['auth_mod'] )
{
$s_auth_can .= sprintf($lang['Rules_moderate'], "<a href=\"modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id&amp;sid=" . $userdata['session_id'] . '">', '</a>');

$topic_mod .= ( $is_auth['auth_delete'] ) ? "<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 .= ( $forum_topic_data['topic_status'] == TOPIC_UNLOCKED ) ? "<a id=\"topic_locklink\" onclick=\"return AJAXLockTopic($topic_id, 1);\" href=\"modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;mode=lock&amp;sid=" . $userdata['session_id'] . '"><img id="topic_lockimg" src="' . $images['topic_mod_lock'] . '" alt="' . $lang['Lock_topic'] . '" title="' . $lang['Lock_topic'] . '" border="0" /></a>&nbsp;' : "<a id=\"topic_locklink\" onclick=\"return AJAXLockTopic($topic_id, 0);\" href=\"modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;mode=unlock&amp;sid=" . $userdata['session_id'] . '"><img id="topic_lockimg" 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;&nbsp;';
//-- mod : merge -----------------------------------------------------------------------------------
//-- add
$topic_mod .= '<a href="' . append_sid("merge.$phpEx?" . POST_TOPIC_URL . '=' . $topic_id) . '"><img src="' . $images['topic_mod_merge'] . '" alt="' . $lang['Merge_topics'] . '" title="' . $lang['Merge_topics'] . '" border="0" /></a>&nbsp;';
//-- fin mod : merge -------------------------------------------------------------------------------

// MOD Modcp Extansion BEGIN
$normal_button = "<a href=\"modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;mode=normalise&amp;sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_mod_normal'] . '" alt="' . $lang['Normal_topic'] . '" title="' . $lang['Normal_topic'] . '" border="0" /></a>&nbsp;';
$sticky_button = ( $is_auth['auth_sticky'] ) ? "<a href=\"modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;mode=sticky&amp;sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_mod_sticky'] . '" alt="' . $lang['Sticky_topic'] . '" title="' . $lang['Sticky_topic'] . '" border="0" /></a>&nbsp;' : "";
$announce_button = ( $is_auth['auth_announce'] ) ? "<a href=\"modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;mode=announce&amp;sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_mod_announce'] . '" alt="' . $lang['Announce_topic'] . '" title="' . $lang['Announce_topic'] . '" border="0" /></a>&nbsp;' : "";
switch( $forum_topic_data['topic_type'] )
{
case POST_NORMAL:
$topic_mod .= $sticky_button . $announce_button;
break;
case POST_STICKY:
$topic_mod .= $announce_button . $normal_button;
break;
case POST_ANNOUNCE:
$topic_mod .= $sticky_button . $normal_button;
break;
}
// MOD Modcp Extansion END
}


/////////////////////////////////////////////////////////
//
// Bedankomat-Start (2)
//
/////////////////////////////////////////////////////////


// nungut - erstmal soll das Teil nur fuer registrierte Benuzer vorhanden sein.
//
// Bedankomat START (Inclusive Add-On by OXPUS)
//


$sql = 'SELECT b.user_id, b.topic_id, u.username, u.user_level FROM ' .BEDANKOMAT_TABLE. ' b, ' .USERS_TABLE. ' u
WHERE (b.user_id = u.user_id) AND (b.topic_id = ' .$topic_id. ')';
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain topic-bedankomat information', '', __LINE__, __FILE__, $sql);
}

$thx_users = array();
$num_thxs = $db->sql_numrows($result);
$thx_users = $db->sql_fetchrowset($result);
$thx_own = 0;

if ($num_thxs > 0 && $forum_topic_data['topic_bedankomat'] == TRUE)
{
$l_thx_userlist = '';
$l_thx_user = sprintf($lang['Thanking_user'], $num_thxs);

for ($index=0; $index<$num_thxs; $index++)
{
include_once($phpbb_root_path.'includes/functions_color_groups.'.$phpEx);
$bed_username = $thx_users[$index]['username'];
$bed_userlevel = $thx_users[$index]['user_level'];

$bed_username = color_group_colorize_name($thx_users[$index]['user_id'], true);

$temp = $thx_users[$index]['user_id'];
$temp = '<a href="' . append_sid("./profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $temp) . '"' . $style_color .'>' . $bed_username . '</a>';
$l_thx_userlist .= ($index==0) ? $temp : ', ' . $temp;
}

$template->assign_block_vars('switch_bedankomat', array() );
}

else
{
$l_thx_userlist = '';
$l_thx_user = '';
}

$sql = "SELECT f.forum_bedankomat FROM " . FORUMS_TABLE . " f WHERE f.forum_id = $forum_id";

if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not create download stream for post.", '', __LINE__, __FILE__, $sql);
}

while ( $row = $db->sql_fetchrow($result) )
{
$forum_bedankomatexist = $row['forum_bedankomat'];
}

if ($forum_bedankomatexist == 1)
{


if ($userdata['session_logged_in'])
{
if ($forum_topic_data['topic_bedankomat'] == TRUE)

{
$template->assign_block_vars('switch_bedankomat_on', array());
}


$sql = "SELECT t.topic_id, t.topic_first_post_id, p.post_id, p.poster_id
FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
WHERE t.topic_id = " . $topic_id . "
AND t.topic_first_post_id = p.post_id";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);

if ($row['poster_id'] == $userdata['user_id'] AND $userdata['user_id'] != '-1')
{
$l_bedankomat = '';
$u_bedankomat = '';
}


else
{

$sql = 'SELECT * FROM ' .BEDANKOMAT_TABLE. ' WHERE (user_id=' . $userdata['user_id'] . ') AND (topic_id=' .$topic_id. ') LIMIT 1';
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user-bedankomat information', '', __LINE__, __FILE__, $sql);
}


if ($db->sql_numrows($result) == 1)
{
$thx_own = 1;
$l_bedankomat = '';
$u_bedankomat = '';
}

else
{

$l_bedankomat = '<img src="'.$images['Say_thanks'].'" border="0" alt="Teşekkür Et" align="middle" />';
$u_bedankomat = append_sid('viewtopic.'.$phpEx.'?mode=add_thx&amp;u='.$userdata['user_id'].'&amp;t='.$topic_id);
$a_bedankomat = $lang['Say_thanks'];
}
}
}
else
{
$l_bedankomat = '';
$u_bedankomat = '';
}
}
unset( $num_thxs );
unset( $thx_users );
//
// Bedankomat END (Inclusive Add-On by OXPUS)
//

/////////////////////////////////////////////////////////
//
// Bedankomat-Ende (2)
//
/////////////////////////////////////////////////////////

//
// Topic watch information
//
$s_watching_topic = '';
if ( $can_watch_topic )
{
if ( $is_watching_topic )
{
$s_watching_topic = "<a id=\"watchlink\" onclick=\"return AJAXWatchTopic($topic_id, $start, 0);\" 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 id=\"watchlink_img\" onclick=\"return AJAXWatchTopic($topic_id, $start, 0);\" href=\"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;unwatch=topic&amp;start=$start&amp;sid=" . $userdata['session_id'] . '"><img id="watchimage" src="' . $images['topic_un_watch'] . '" alt="' . $lang['Stop_watching_topic'] . '" title="' . $lang['Stop_watching_topic'] . '" border="0"></a>' : '';
}
else
{
$s_watching_topic = "<a id=\"watchlink\" onclick=\"return AJAXWatchTopic($topic_id, $start, 1);\" 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 id=\"watchlink_img\" onclick=\"return AJAXWatchTopic($topic_id, $start, 1);\" href=\"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;watch=topic&amp;start=$start&amp;sid=" . $userdata['session_id'] . '"><img id="watchimage" src="' . $images['Topic_watch'] . '" alt="' . $lang['Start_watching_topic'] . '" title="' . $lang['Start_watching_topic'] . '" border="0"></a>' : '';
}
}
//
// Bookmark information
//
if ( $userdata['session_logged_in'] )
{
$template->assign_block_vars('bookmark_state', array());
// Send vars to template
if (is_bookmark_set($topic_id))
{
$bm_action = "&amp;removebm=true";
$bm_action_l = $lang['Remove_Bookmark'];
}else{
$bm_action = "&amp;setbm=true";
$bm_action_l = $lang['Set_Bookmark'];
}
$template->assign_vars(array(
'L_BOOKMARK_ACTION' => $bm_action_l,
'U_BOOKMARK_ACTION' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;start=$start&amp;postdays=$post_days&amp;postorder=$post_order&amp;highlight=" . $_GET['highlight'] . $bm_action))
);
}
//
// If we've got a hightlight set pass it on to pagination,
// I get annoyed when I lose my highlight after the first page.
//
$pagination = ( $highlight != '' ) ? generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;postdays=$post_days&amp;postorder=$post_order&amp;highlight=$highlight", $total_replies, $board_config['posts_per_page'], $start) : generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;postdays=$post_days&amp;postorder=$post_order", $total_replies, $board_config['posts_per_page'], $start);
$watch_topic_url = "topic_view_users.$phpEx?".POST_TOPIC_URL."=$topic_id";
//
// Send vars to template
//
$template->assign_vars(array(
'FORUM_ID' => $forum_id,
'FORUM_NAME' => $forum_name,
'TOPIC_ID' => $topic_id,
'TOPIC_TITLE' => $topic_title,
'PAGINATION' => $pagination,
'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / intval($board_config['posts_per_page']) ) + 1 ), ceil( $total_replies / intval($board_config['posts_per_page']) )),
'HIGHLIGHT' => $highlight,

'POST_IMG' => $post_img,
'REPLY_IMG' => $reply_img,
'L_PRINT' => ($lang['Print_View']) ? $lang['Print_View'] : 'Printable version',
'U_PRINT' => append_sid("printview.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;start=$start"),
'L_AUTHOR' => $lang['Author'],
'L_MESSAGE' => $lang['Message'],
'L_POSTED' => $lang['Posted'],
'L_POST_SUBJECT' => $lang['Post_subject'],
'L_VIEW_NEXT_TOPIC' => $lang['View_next_topic'],
'L_VIEW_PREVIOUS_TOPIC' => $lang['View_previous_topic'],
'L_POST_NEW_TOPIC' => $post_alt,
'L_POST_REPLY_TOPIC' => $reply_alt,
'L_BACK_TO_TOP' => $lang['Back_to_top'],
'L_DISPLAY_POSTS' => $lang['Display_posts'],
'L_LOCK_TOPIC' => $lang['Lock_topic'],
'L_UNLOCK_TOPIC' => $lang['Unlock_topic'],
'L_MOVE_TOPIC' => $lang['Move_topic'],
'L_SPLIT_TOPIC' => $lang['Split_topic'],
'L_DELETE_TOPIC' => $lang['Delete_topic'],
'L_GOTO_PAGE' => $lang['Goto_page'],
'L_BEDANKOMAT' => $l_bedankomat,
'U_BEDANKOMAT' => $u_bedankomat,
'L_BEDANKOMAT_USERS' => $l_thx_userlist,
'L_BEDANKOMAT_TEXT' => $l_thx_user,
'L_FULL_EDIT' => $lang['Full_edit'],
'L_SAVE_CHANGES' => $lang['Save_changes'],
'L_CANCEL' => $lang['Cancel'],
// Bottom of Page Link MOD - Daz - ForumImages.com - START
'PAGE_BOTTOM_IMG' => '<a href="#bot"><img src="' . $images['icon_down'] . '" alt="' . $lang['Go_to_bottom'] . '" title="' . $lang['Go_to_bottom'] . '" border="0" /></a>',
'PAGE_BOTTOM' => '<a href="#bot">' . $lang['Go_to_bottom'] . '</a>',
'PAGE_TOP_IMG' => '<a href="#top"><img src="' . $images['icon_up'] . '" alt="' . $lang['Back_to_top'] . '" title="' . $lang['Back_to_top'] . '" border="0" /></a>',
'PAGE_TOP' => '<a href="#top">' . $lang['Back_to_top'] . '</a>',
// Bottom of Page Link MOD - Daz - ForumImages.com - END
'L_TELL_FRIEND' => $lang['Tell_Friend'],
'L_TOPIC_VIEW_USERS' => $lang['Topic_view_users'],
'L_SAVE_TOPIC' => $lang['Save_Topic'],
'S_TOPIC_LINK' => POST_TOPIC_URL,
'S_SELECT_POST_DAYS' => $select_post_days,
'S_SELECT_POST_ORDER' => $select_post_order,
'S_POST_DAYS_ACTION' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $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' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;start=$start&amp;postdays=$post_days&amp;postorder=$post_order&amp;highlight=$highlight"),
'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_EXPORT_TOPIC' => $export_topic_url,
'U_WATCH_TOPIC' => $watch_topic_url,
'U_POST_REPLY_TOPIC' => $reply_topic_url)
);

//
// Does this topic contain a poll?
//
if ( !empty($forum_topic_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($_GET['vote']) || isset($_POST['vote']) )
{
$view_result = ( ( ( isset($_GET['vote']) ) ? $_GET['vote'] : $_POST['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'] || $forum_topic_data['topic_status'] == TOPIC_LOCKED )
{
$template->set_filenames(array(
'pollbox' => 'viewtopic_poll_result.tpl')
);

$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 * $board_config['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(
'L_TOTAL_VOTES' => $lang['Total_votes'],
'TOTAL_VOTES' => $vote_results_sum)
);

}
else
{
$template->set_filenames(array(
'pollbox' => 'viewtopic_poll_ballot.tpl')
);

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(
'L_SUBMIT_VOTE' => $lang['Submit_vote'],
'L_VIEW_RESULTS' => $lang['View_results'],

'U_VIEW_RESULTS' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;postdays=$post_days&amp;postorder=$post_order&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(
'POLL_QUESTION' => $vote_title,

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

$template->assign_var_from_handle('POLL_DISPLAY', 'pollbox');
}
}
init_display_post_attachments($forum_topic_data['topic_attachment']);
//
// Update the topic view counter
//
$sql = "UPDATE " . TOPICS_TABLE . "
SET topic_views = topic_views + 1
WHERE topic_id = $topic_id";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Could not update topic views.", '', __LINE__, __FILE__, $sql);
}
include($phpbb_root_path . 'includes/chinese.'.$phpEx);
//
// Okay, let's do the loop, yeah come on baby let's do the loop
// and it goes like this ...
//
// Start add - Birthday MOD
$this_year = create_date('Y', time(), $board_config['board_timezone']);
$this_date = create_date('md', time(), $board_config['board_timezone']);
// End add - Birthday MOD
$num_post = 0;
for($i = 0; $i < $total_posts; $i++)
{
$poster_id = $postrow[$i]['user_id'];
$poster = ( $poster_id == ANONYMOUS ) ? $lang['Guest'] : color_group_colorize_name($postrow[$i]['user_id']);

// Start add - Birthday MOD
if ( $postrow[$i]['user_birthday'] != 999999 )
{
$poster_birthdate=realdate('md', $postrow[$i]['user_birthday']);
$n=0;
while ($n<26)
{
if ($poster_birthdate>=$zodiacdates[$n] && $poster_birthdate<=$zodiacdates[$n+1])
{
$zodiac = $lang[$zodiacs[($n/2)]];
$u_zodiac = $images[$zodiacs[($n/2)]];
$zodiac_img = '<img src="' . $u_zodiac . '" alt="' . $zodiac . '" title="' . $zodiac . '" align="top" border="0" />';
$n=26;
} else
{
$n=$n+2;
}
}
$poster_age = $this_year - realdate ('Y',$postrow[$i]['user_birthday']);
if ($this_date < $poster_birthdate) $poster_age--;
$poster_age = $lang['Age'] . ': ' . $poster_age;
$chinese = get_chinese_year (realdate('Ymd', $postrow[$i]['user_birthday']));
$u_chinese = $images[$chinese];
$chinese_img = ($chinese=='Unknown') ? '' : '<img src="' . $u_chinese . '" alt="' . $lang[$chinese] . '" title="' . $lang[$chinese] . '" align="top" border="0" />';
} else
{
$zodiac = '';
$u_zodiac = '';
$zodiac_img = '';
$poster_age = '';
$chinese = '';
$u_chinese = '';
$chinese_img = '';
}
// End add - Birthday MOD

//-- mod : today at yesterday at ------------------------------------------------------------------------
//-- add
$post_date = create_date_day($board_config['default_dateformat'], $postrow[$i]['post_time'], $board_config['board_timezone']);
//-- end mod : today at yesterday at ------------------------------------------------------------------------


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

$poster_from = ( $postrow[$i]['user_from'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Location'] . ': ' . $postrow[$i]['user_from'] : '';
// FLAGHACK-start
$poster_from_flag = ( $postrow[$i]['user_from_flag'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? "<img src=\"images/flags/" . $postrow[$i]['user_from_flag'] . "\" alt=\"" . $postrow[$i]['user_from_flag'] . "\" border=\"0\" width=\"32\" height=\"20\" /><br />" : "";
// FLAGHACK-end
$poster_joined = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Joined'] . ': ' . create_date($lang['DATE_FORMAT'], $postrow[$i]['user_regdate'], $board_config['board_timezone']) : '';

$poster_avatar = '';

if ( $postrow[$i]['user_avatar_type'] && $poster_id != ANONYMOUS && $postrow[$i]['user_allowavatar'] )
{
switch( $postrow[$i]['user_avatar_type'] )
{
case USER_AVATAR_UPLOAD:
$size = check_avatar_size($board_config['avatar_path'] . '/' . $postrow[$i]['user_avatar'], $board_config['avatar_max_width']);
$poster_avatar = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $postrow[$i]['user_avatar'] . '" '.$size.' alt="" border="0" />' : '';
break;
case USER_AVATAR_REMOTE:
$size = check_avatar_size($postrow[$i]['user_avatar'], $board_config['avatar_max_width'], true);
$poster_avatar = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $postrow[$i]['user_avatar'] . '" '.$size.' alt="" border="0" />' : '';
break;
case USER_AVATAR_GALLERY:
$size = check_avatar_size($board_config['avatar_gallery_path'] . '/' . $postrow[$i]['user_avatar'], $board_config['avatar_max_width']);
$poster_avatar = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $postrow[$i]['user_avatar'] . '" '.$size.' alt="" border="0" />' : '';
break;
}
}
else {
if ( $plus_config['default_avatar'] == 1)
{
if ( $postrow[$i]['user_avatar'] == '' ) {
$poster_avatar = ( $board_config['allow_avatar_local'] ) ? '<img src="images/default_avatar.gif" alt="" border="0" />' : '';
}
}}
//
// Define the little post icon
//
if ( $userdata['session_logged_in'] && $postrow[$i]['post_time'] > $userdata['user_lastvisit'] && $postrow[$i]['post_time'] > $topic_last_read )
{
$mini_post_img = $images['icon_minipost_new'];
$mini_post_alt = $lang['New_post'];
}
else
{
$mini_post_img = $images['icon_minipost'];
$mini_post_alt = $lang['Post'];
}

$mini_post_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $postrow[$i]['post_id']) . '#' . $postrow[$i]['post_id'];

//
// Generate ranks, set them to empty string initially.
//
$poster_rank = '';
$rank_image = '';
// Start add - Gender MOD
$gender_image = '';
// End add - Gender MOD
if ( $postrow[$i]['user_id'] == ANONYMOUS )
{
}
else if ( $postrow[$i]['user_rank'] )
{
for($j = 0; $j < count($ranksrow); $j++)
{
if ( $postrow[$i]['user_rank'] == $ranksrow[$j]['rank_id'] && $ranksrow[$j]['rank_special'] )
{
$poster_rank = $ranksrow[$j]['rank_title'];
$rank_image = ( $ranksrow[$j]['rank_image'] ) ? '<img src="' . $images['rank_path'] . $ranksrow[$j]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
}
}
}
else
{
for($j = 0; $j < count($ranksrow); $j++)
{
if ( $postrow[$i]['user_posts'] >= $ranksrow[$j]['rank_min'] && !$ranksrow[$j]['rank_special'] )
{
$poster_rank = $ranksrow[$j]['rank_title'];
$rank_image = ( $ranksrow[$j]['rank_image'] ) ? '<img src="' . $images['rank_path'] . $ranksrow[$j]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
}
}
}

//
// Handle anon users posting with usernames
//
if ( $poster_id == ANONYMOUS && $postrow[$i]['post_username'] != '' )
{
view topic.php tamamen uçtu arkadaşlar beyaz sayfa çıkıyor aşağıda viewtopic.php nin kodları bir zahmet yardımcı olur musunuz ben biraz kurcaladaım ama düzelmedi [code]<?php header ("Content-Type: text/html; charset=iso-8859-9"); /*************************************************************************** * viewtopic.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group * email : support@phpbb.com * * $Id: viewtopic.php,v 1.186.2.35 2004/03/13 15:08:23 acydburn Exp $ * * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ define('IN_PHPBB', true); $phpbb_root_path = './'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx); include_once($phpbb_root_path . 'includes/functions_color_groups.'.$phpEx); include($phpbb_root_path . 'includes/def_icons.'. $phpEx); include_once($phpbb_root_path . 'includes/functions_calendar.'.$phpEx); include($phpbb_root_path . 'includes/functions_bookmark.'.$phpEx); include_once($phpbb_root_path . 'includes/functions_profile_fields.'.$phpEx); // // Start initial var setup // $topic_id = $post_id = 0; if ( isset($_GET[POST_TOPIC_URL]) ) { $topic_id = intval($_GET[POST_TOPIC_URL]); } else if ( isset($_GET['topic']) ) { $topic_id = intval($_GET['topic']); } if ( isset($_GET[POST_POST_URL])) { $post_id = intval($_GET[POST_POST_URL]); } $start = ( isset($_GET['start']) ) ? intval($_GET['start']) : 0; if (!$topic_id && !$post_id) { message_die(GENERAL_MESSAGE, 'Topic_post_not_exist'); } // // Find topic id if user requested a newer // or older topic // if ( isset($_GET['view']) && empty($_GET[POST_POST_URL]) ) { if ( $_GET['view'] == 'newest' ) { if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) || isset($_GET['sid']) ) { $session_id = isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) ? $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid'] : $_GET['sid']; if (!preg_match('/^[A-Za-z0-9]*$/', $session_id)) { $session_id = ''; } if ( $session_id ) { $sql = "SELECT p.post_id FROM " . POSTS_TABLE . " p, " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u WHERE s.session_id = '$session_id' AND u.user_id = s.session_user_id AND p.topic_id = $topic_id AND p.post_time >= u.user_lastvisit ORDER BY p.post_time ASC LIMIT 1"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not obtain newer/older topic information', '', __LINE__, __FILE__, $sql); } if ( !($row = $db->sql_fetchrow($result)) ) { message_die(GENERAL_MESSAGE, 'No_new_posts_last_visit'); } $post_id = $row['post_id']; if (isset($_GET['sid'])) { redirect("viewtopic.$phpEx?sid=$session_id&" . POST_POST_URL . "=$post_id#$post_id"); } else { redirect("viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id"); } } } redirect(append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id", true)); } else if ( $_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 ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Could not obtain newer/older topic information", '', __LINE__, __FILE__, $sql); } if ( $row = $db->sql_fetchrow($result) ) { $topic_id = intval($row['topic_id']); //-- mod : categories hierarchy -------------------------------------------------------------------- //-- add redirect( "./viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id" ); //-- fin mod : categories hierarchy ---------------------------------------------------------------- } else { $message = ( $_GET['view'] == 'next' ) ? 'No_newer_topics' : 'No_older_topics'; message_die(GENERAL_MESSAGE, $message); } } } // // This rather complex gaggle of code handles querying for topics but // also allows for direct linking to a post (and the calculation of which // page the post is on and the correct display of viewtopic) // $join_sql_table = (!$post_id) ? '' : ", " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2 "; $join_sql = (!$post_id) ? "t.topic_id = $topic_id" : "p.post_id = $post_id AND t.topic_id = p.topic_id AND p2.topic_id = p.topic_id AND p2.post_id <= $post_id"; $count_sql = (!$post_id) ? '' : ", COUNT(p2.post_id) AS prev_posts"; $order_sql = ( !$post_id ) ? '' : "GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments, f.auth_ban, f.auth_greencard, f.auth_bluecard ORDER BY p.post_id ASC"; //-- mod : calendar -------------------------------------------------------------------------------- // here we added // , t.topic_first_post_id, t.topic_calendar_time, t.topic_calendar_duration //-- modify $sql = "SELECT t.topic_id, t.topic_bedankomat, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, t.topic_first_post_id, t.topic_calendar_time, t.topic_calendar_duration, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments, f.auth_ban, f.auth_greencard, f.auth_bluecard" . $count_sql . " FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f" . $join_sql_table . " WHERE $join_sql AND f.forum_id = t.forum_id $order_sql"; attach_setup_viewtopic_auth($order_sql, $sql); if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Could not obtain topic information", '', __LINE__, __FILE__, $sql); } if ( !($forum_topic_data = $db->sql_fetchrow($result)) ) { message_die(GENERAL_MESSAGE, 'Topic_post_not_exist'); } $forum_id = intval($forum_topic_data['forum_id']); // Start add - Who viewed a topic MOD $topic_id = intval($forum_topic_data['topic_id']); // End add - Who viewed a topic MOD // // Start session management // $userdata = session_pagestart($user_ip, $forum_id, $topic_id); init_userprefs($userdata); // // End session management // // // Set or remove bookmark // if ( isset($_GET['setbm']) || isset($_GET['removebm']) ) { $redirect = "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&start=$start&postdays=$post_days&postorder=$post_order&highlight=" . $_GET['highlight']; if ( $userdata['session_logged_in'] ) { if (isset($_GET['setbm']) && $_GET['setbm']) { set_bookmark($topic_id); } else if (isset($_GET['removebm']) && $_GET['removebm']) { remove_bookmark($topic_id); } } else { if (isset($_GET['setbm']) && $_GET['setbm']) { $redirect .= '&setbm=true'; } else if (isset($_GET['removebm']) && $_GET['removebm']) { $redirect .= '&removebm=true'; } redirect(append_sid("login.$phpEx?redirect=$redirect", true)); } redirect(append_sid($redirect, true)); } // // Start auth check // $is_auth = array(); //-- mod : categories hierarchy -------------------------------------------------------------------- //-- delete // $is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_topic_data); // // if( !$is_auth['auth_view'] || !$is_auth['auth_read'] ) //-- add $is_auth = $tree['auth'][POST_FORUM_URL . $forum_id]; if ( !$is_auth['auth_read'] ) //-- fin mod : categories hierarchy ---------------------------------------------------------------- { if ( !$userdata['session_logged_in'] ) { $redirect = ($post_id) ? POST_POST_URL . "=$post_id" : POST_TOPIC_URL . "=$topic_id"; $redirect .= ($start) ? "&start=$start" : ''; redirect(append_sid("login.$phpEx?redirect=viewtopic.$phpEx&$redirect", true)); } //-- mod : categories hierarchy -------------------------------------------------------------------- //-- delete // $message = ( !$is_auth['auth_view'] ) ? $lang['Topic_post_not_exist'] : sprintf($lang['Sorry_auth_read'], $is_auth['auth_read_type']); //-- add $message = sprintf($lang['Sorry_auth_read'], $is_auth['auth_read_type']); //-- fin mod : categories hierarchy ---------------------------------------------------------------- message_die(GENERAL_MESSAGE, $message); } // // End auth check // // Start add - Who viewed a topic MOD $user_id=$userdata['user_id']; $sql='UPDATE '.TOPIC_VIEW_TABLE.' SET topic_id="'.$topic_id.'", view_time="'.time().'", view_count=view_count+1 WHERE topic_id='.$topic_id.' AND user_id='.$user_id; if ( !$db->sql_query($sql) || !$db->sql_affectedrows() ) { $sql = 'INSERT IGNORE INTO '.TOPIC_VIEW_TABLE.' (topic_id, user_id, view_time,view_count) VALUES ('.$topic_id.', "'.$user_id.'", "'.time().'","1")'; if ( !($db->sql_query($sql)) ) { message_die(CRITICAL_ERROR, 'Error create user view topic information ', '', __LINE__, __FILE__, $sql); } } // End add - Who viewed a topic MOD //-- mod : categories hierarchy -------------------------------------------------------------------- //-- delete // $forum_name = $forum_topic_data['forum_name']; //-- add $forum_name = get_object_lang(POST_FORUM_URL . $forum_topic_data['forum_id'], 'name'); //-- fin mod : categories hierarchy ---------------------------------------------------------------- $topic_title = $forum_topic_data['topic_title']; $topic_id = intval($forum_topic_data['topic_id']); $topic_time = $forum_topic_data['topic_time']; //-- mod : calendar -------------------------------------------------------------------------------- //-- add $topic_first_post_id = intval($forum_topic_data['topic_first_post_id']); $topic_calendar_time = intval($forum_topic_data['topic_calendar_time']); $topic_calendar_duration = intval($forum_topic_data['topic_calendar_duration']); //-- fin mod : calendar ---------------------------------------------------------------------------- if ($post_id) { $start = floor(($forum_topic_data['prev_posts'] - 1) / intval($board_config['posts_per_page'])) * intval($board_config['posts_per_page']); } // // Is user watching this thread? // 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 ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Could not obtain topic watch information", '', __LINE__, __FILE__, $sql); } if ( $row = $db->sql_fetchrow($result) ) { if ( isset($_GET['unwatch']) ) { if ( $_GET['unwatch'] == 'topic' ) { $is_watching_topic = 0; $sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : ''; $sql = "DELETE $sql_priority 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); } } $template->assign_vars(array( 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;start=$start") . '">') ); $message = $lang['No_longer_watching'] . '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;start=$start") . '">', '</a>'); message_die(GENERAL_MESSAGE, $message); } else { $is_watching_topic = TRUE; if ( $row['notify_status'] ) { $sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : ''; $sql = "UPDATE $sql_priority " . 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($_GET['watch']) ) { if ( $_GET['watch'] == 'topic' ) { $is_watching_topic = TRUE; $sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : ''; $sql = "INSERT $sql_priority 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); } } $template->assign_vars(array( 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;start=$start") . '">') ); $message = $lang['You_are_watching'] . '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;start=$start") . '">', '</a>'); message_die(GENERAL_MESSAGE, $message); } else { $is_watching_topic = 0; } } } else { if ( isset($_GET['unwatch']) ) { if ( $_GET['unwatch'] == 'topic' ) { redirect(append_sid("login.$phpEx?redirect=viewtopic.$phpEx&" . POST_TOPIC_URL . "=$topic_id&unwatch=topic", true)); } } else { $can_watch_topic = 0; $is_watching_topic = 0; } } // // 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 // $valid = FALSE; if( $userdata['session_logged_in'] ) { $sql = "SELECT p.poster_id, p.topic_id FROM " . POSTS_TABLE . " p WHERE p.topic_id = $topic_id AND p.poster_id = " . $userdata['user_id']; $resultat = $db->sql_query($sql); $valid = $db->sql_numrows($resultat) ? TRUE : FALSE;} $previous_days = array(0, 1, 7, 14, 30, 90, 180, 364); $previous_days_text = array($lang['All_Posts'], $lang['1_Day'], $lang['7_Days'], $lang['2_Weeks'], $lang['1_Month'], $lang['3_Months'], $lang['6_Months'], $lang['1_Year']); if( !empty($_POST['postdays']) || !empty($_GET['postdays']) ) { $post_days = ( !empty($_POST['postdays']) ) ? intval($_POST['postdays']) : intval($_GET['postdays']); $min_post_time = time() - (intval($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"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Could not obtain limited topics count information", '', __LINE__, __FILE__, $sql); } $total_replies = ( $row = $db->sql_fetchrow($result) ) ? intval($row['num_posts']) : 0; $limit_posts_time = "AND p.post_time >= $min_post_time "; if ( !empty($_POST['postdays'])) { $start = 0; } } else { $total_replies = intval($forum_topic_data['topic_replies']) + 1; $limit_posts_time = ''; $post_days = 0; } $se
h_era_ce
Üye
Üye
 
İleti: 71
Kayıt: 21.12.2005, 16:49

İleti Simuzer 25.09.2006, 20:15

teşekkür bot modunu kurarken bir daha gözden geçir. Mutlaka bir yerde hata yapıyorsundur.
Kullanıcı avatarı
Simuzer
Geliştirme Grubu
Geliştirme Grubu
 
İleti: 669
Kayıt: 09.11.2005, 09:34
Konum: İstanbul

İleti h_era_ce 26.09.2006, 19:47

teşekkür botu plus için farklı kodlar içeriyormuş öyle yaptım bir de $HTTP_POST_VARS gibi bişey vardı plusta onlar $_POST şeklindeydi ben de değiştirdim ama işte olan bu :D

plus a hide mod ve tşk modu sorunsuz kuran bir arkadaş yok mu? lütfen yardım edin kaç gündür çözemedim sorunu :(
h_era_ce
Üye
Üye
 
İleti: 71
Kayıt: 21.12.2005, 16:49


Hata Mesajları



Kimler çevrimiçi

Bu forumu görüntüleyenler: Kayıtlı kullanıcı yok ve 0 misafir

cron