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..
kaip man padaryti kad rodytu forume isp�jimus jau 2 dien� kankinuosi
modifikacija : snapso v3 �sp�jimai
viwthread.php
Code
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fu...
+--------------------------------------------------------+
| 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/licen... 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\";
//reputacija
function userreputation($user_id, $post_id=\"\", $type=\"\") {
global $db_prefix;
$result = dbquery(\"SELECT SUM(IF(type=1,1,-1)) as total FROM \".$db_prefix.\"reputation WHERE to_id = '$user_id' GROUP BY to_id\");
if (dbrows($result) != 0) {
$data = dbarray($result);
$total = $data['total'];
$info = \"[ 0?\"green\":\"black\")).\"'>\".($total<=0?\"\":\"+\").\"$total ]\";
} else {
$info = \"[ 0 ]\";
}
return $info;
}
//baigiasi
if (!isset($_GET['thread_id']) || !isnum($_GET['thread_id'])) { redirect(\"index.php\"); }
if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
$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'].\"'\"
);
if (dbrows($result)) {
$fdata = dbarray($result);
if (!checkgroup($fdata['forum_access']) || !$fdata['forum_cat']) { redirect(\"index.php\"); }
} else {
redirect(\"index.php\");
}
if (iMEMBER && isset($_POST['cast_vote']) && (isset($_POST['poll_option']) && isnum($_POST['poll_option']))) {
$result = dbquery(\"SELECT * FROM \".DB_FORUM_POLL_VOTERS.\" WHERE forum_vote_user_id='\".$userdata['user_id'].\"' AND thread_id='\".$_GET['thread_id'].\"'\");
if (!dbrows($result)) {
$result = dbquery(\"UPDATE \".DB_FORUM_POLL_OPTIONS.\" SET forum_poll_option_votes=forum_poll_option_votes+1 WHERE thread_id='\".$_GET['thread_id'].\"' AND forum_poll_option_id='\".$_POST['poll_option'].\"'\");
$result = dbquery(\"UPDATE \".DB_FORUM_POLLS.\" SET forum_poll_votes=forum_poll_votes+1 WHERE thread_id='\".$_GET['thread_id'].\"'\");
$result = dbquery(\"INSERT INTO \".DB_FORUM_POLL_VOTERS.\" (thread_id, forum_vote_user_id, forum_vote_user_ip) VALUES ('\".$_GET['thread_id'].\"', '\".$userdata['user_id'].\"', '\".USER_IP.\"')\");
}
redirect(FUSION_SELF.\"?thread_id=\".$_GET['thread_id']);
}
\n\";
if (!$fdata['thread_locked'] && $can_reply) {
echo \"\n\";
}
if ($can_post) {
echo \"\n
\n\";
}
if ($rows != 0) {
if ($_GET['rowstart'] == 0 && $fdata['thread_poll'] == \"1\") {
if (iMEMBER) {
$presult = dbquery(
\"SELECT tfp.*, tfv.forum_vote_user_id FROM \".DB_FORUM_POLLS.\" tfp
LEFT JOIN \".DB_FORUM_POLL_VOTERS.\" tfv
ON tfp.thread_id=tfv.thread_id AND forum_vote_user_id='\".$userdata['user_id'].\"'
WHERE tfp.thread_id='\".$_GET['thread_id'].\"'\"
);
} else {
$presult = dbquery(
\"SELECT tfp.* FROM \".DB_FORUM_POLLS.\" tfp
WHERE tfp.thread_id='\".$_GET['thread_id'].\"'\"
);
}
if (dbrows($presult)) {
$pdata = dbarray($presult); $i = 1;
if (iMEMBER) { echo \"\n\"; }
}
}
$result = dbquery(
\"SELECT p.*, fa.attach_id, fa.attach_name, fa.attach_ext, fa.attach_size, u.*, u2.user_name AS edit_name
FROM \".DB_POSTS.\" p
LEFT JOIN \".DB_FORUM_ATTACHMENTS.\" fa USING(post_id)
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'].\"' ORDER BY post_datestamp LIMIT \".$_GET['rowstart'].\",$posts_per_page\"
);
if (iMOD) { echo \"\n\";
}
list($postcount, $lastpid) = dbarraynum(dbquery(\"SELECT COUNT(post_id), MAX(post_id) FROM \".DB_POSTS.\" WHERE thread_id='\".$_GET['thread_id'].\"' GROUP BY thread_id\"));
if(isnum($postcount)){
dbquery(\"UPDATE \".DB_THREADS.\" SET thread_postcount='$postcount', thread_lastpostid=$lastpid WHERE thread_id='\".$_GET['thread_id'].\"'\");
}