Aisku dabar tokie laikai, kai turinio valdymo sistemas valdome one-click principu. Ne kaip seniau kode ieskodavom klaidu, norint moda pasileist.. :D paciam reikdavo susidiegt viska i ftp..
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: viewthread.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once \"../maincore.php\";
require_once INCLUDES.\"forum_include.php\";
require_once THEMES.\"templates/header.php\";
include LOCALE.LOCALESET.\"forum/main.php\";
if (!isset($_GET['thread_id']) || !isnum($_GET['thread_id'])) { redirect(\"index.php\"); }
$result = dbquery(
\"SELECT t.*, f.*, f2.forum_name AS forum_cat_name
FROM \".DB_THREADS.\" t
LEFT JOIN \".DB_FORUMS.\" f ON t.forum_id=f.forum_id
LEFT JOIN \".DB_FORUMS.\" f2 ON f.forum_cat=f2.forum_id
WHERE t.thread_id='\".$_GET['thread_id'].\"' AND t.thread_hidden='0'\"
);
if (dbrows($result)) {
$fdata = dbarray($result);
if (!checkgroup($fdata['forum_access']) || !$fdata['forum_cat'] || $fdata['thread_hidden'] == \"1\") { redirect(\"index.php\"); }
} else {
redirect(\"index.php\");
}
if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
if (isset($_GET['pid']) && isnum($_GET['pid'])) {
$reply_count = dbcount(\"(post_id)\", DB_POSTS, \"thread_id='\".$fdata['thread_id'].\"' AND post_id<='\".$_GET['pid'].\"' AND post_hidden='0'\");
if ($reply_count > $posts_per_page) { $_GET['rowstart'] = ((ceil($reply_count / $posts_per_page)-1) * $posts_per_page); }
}
// thread
list($rows, $last_post) = dbarraynum(dbquery(
\"SELECT COUNT(post_id), MAX(post_id) FROM \".DB_POSTS.\" WHERE thread_id='\".$_GET['thread_id'].\"' AND post_hidden='0' GROUP BY thread_id\"));
if (($rows > $posts_per_page) || ($can_post || $can_reply)) {
echo \"\n\n\";
if ($rows > $posts_per_page) { echo \"\n\"; }
if (iMEMBER && $can_post) {
echo \"\n\";
}
echo \"\n
if ($rows != 0) {
dbquery(\"UPDATE \".DB_THREADS.\" SET thread_postcount='$rows', thread_lastpostid='$last_post', thread_views=thread_views+1 WHERE thread_id='\".$_GET['thread_id'].\"'\");
/* poll */
if ($poll_on_first_page_only && $poll_there && $poll_data) {
$i = 1;
if ($can_vote) { echo \"\n\"; }
}
/* end poll */
$result = dbquery(
\"SELECT p.forum_id, p.thread_id, p.post_id, p.post_message, p.post_showsig, p.post_smileys, p.post_author,
p.post_datestamp, p.post_ip, p.post_ip_type, p.post_edituser, p.post_edittime, p.post_editreason,
u.user_id, u.user_name, u.user_status, u.user_avatar, u.user_level, u.user_posts, u.user_groups, u.user_joined,
\".($user_field['user_sig'] ? \" u.user_sig,\" : \"\").($user_field['user_web'] ? \" u.user_web,\" : \"\").\"
u2.user_name AS edit_name, u2.user_status AS edit_status
FROM \".DB_POSTS.\" p
LEFT JOIN \".DB_USERS.\" u ON p.post_author = u.user_id
LEFT JOIN \".DB_USERS.\" u2 ON p.post_edituser = u2.user_id AND post_edituser > '0'
WHERE p.thread_id='\".$_GET['thread_id'].\"' AND post_hidden='0'
ORDER BY post_datestamp LIMIT \".$_GET['rowstart'].\",$posts_per_page\"
);
if (iMOD) { echo \"\n\";
}