Bywalec
Postów: 915 Pomógł: 41
Data rejestracji: 12.03.2006 07:28
|
hmm...
wklejaj kody w poszczegolne pliki :D
wszystkie te pliki znajduja sie w katalogu forum
Ps.bylem nawet tak mily ze przerobilem tez forum_threads_list_panel (na samym koncu kod)
index.php
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "../maincore.php";
require_once BASEDIR."subheader.php";
require_once BASEDIR."side_left.php";
include LOCALE.LOCALESET."forum/main.php";
if (!isset($lastvisited) || !isNum($lastvisited)) $lastvisited = time();
opentable($locale['400']);
echo "<table cellpadding='0' cellspacing='0' width='100%' class='tbl-border'>
<tr>
<td>
<table border='0' cellpadding='0' cellspacing='1' width='100%'>
<tr>
<td colspan='2' class='tbl2'>".$locale['401']."</td>
<td align='center' width='50' class='tbl2'>".$locale['402']."</td>
<td align='center' width='50' class='tbl2'>".$locale['403']."</td>
<td width='120' class='tbl2'>".$locale['404']."</td>
</tr>\n";
$forum_list = ""; $current_cat = "";
[b]if(iSUPERADMIN){
$result = dbquery(
"SELECT f.*, COUNT(t.thread_id) AS thread_count, MAX(t.thread_lastpost) AS last_post, f2.forum_name AS forum_cat_name, u.user_id, u.user_name FROM ".$db_prefix."forums f
LEFT JOIN ".$db_prefix."threads t USING(forum_id)
LEFT JOIN ".$db_prefix."forums f2 ON f.forum_cat = f2.forum_id
LEFT JOIN ".$db_prefix."users u ON f.forum_lastuser = u.user_id
WHERE f.forum_cat!='0' GROUP BY forum_id ORDER BY f2.forum_order ASC, f.forum_order ASC"
);
} else {
$result = dbquery(
"SELECT f.*, COUNT(t.thread_id) AS thread_count, MAX(t.thread_lastpost) AS last_post, f2.forum_name AS forum_cat_name, u.user_id, u.user_name FROM ".$db_prefix."forums f
LEFT JOIN ".$db_prefix."threads t USING(forum_id)
LEFT JOIN ".$db_prefix."forums f2 ON f.forum_cat = f2.forum_id
LEFT JOIN ".$db_prefix."users u ON f.forum_lastuser = u.user_id
WHERE ".groupaccess('f.forum_access')." AND f.forum_cat!='0' GROUP BY forum_id ORDER BY f2.forum_order ASC, f.forum_order ASC"
);
}[/b]
if (dbrows($result) != 0) {
while ($data = dbarray($result)) {
if ($data['forum_cat_name'] != $current_cat) {
$current_cat = $data['forum_cat_name'];
echo "<tr>\n<td colspan='5' class='forum-caption'>".$data['forum_cat_name']."</td>\n</tr>\n";
}
$moderators = "";
if ($data['forum_moderators'] || iSUPERADMIN) {
$res = "user_id='".str_replace(".", "' OR user_id='", $data['forum_moderators'])."'";
$result2 = dbquery("SELECT user_id,user_name FROM ".$db_prefix."users WHERE (".$res.")");
while ($data2 = dbarray($result2)) {
if ($moderators) $moderators .= ", ";
$moderators .= "<a href='".BASEDIR."profile.php?lookup=".$data2['user_id']."'>".$data2['user_name']."</a>";
}
}
if ($data['last_post'] > $lastvisited) {
$fim = "<img src='".THEME."forum/foldernew.gif' alt='".$locale['560']."'>";
} else {
$fim = "<img src='".THEME."forum/folder.gif' alt='".$locale['561']."'>";
}
echo "<tr>
<td align='center' class='tbl2'>$fim</td>
<td class='tbl1'><a href='viewforum.php?forum_id=".$data['forum_id']."'>".$data['forum_name']."</a><br>
<span class='small'>".$data['forum_description'].($moderators ? "<br>\n".$locale['411'].$moderators."</span></td>\n" : "</span></td>\n")."
<td align='center' class='tbl2'>".$data['thread_count']."</td>
<td align='center' class='tbl1'>".dbcount("(post_id)", "posts", "forum_id='".$data['forum_id']."'")."</td>
<td class='tbl2'>";
if ($data['forum_lastpost'] == 0) {
echo $locale['405']."</td>\n</tr>\n";
} else {
echo showdate("forumdate", $data['forum_lastpost'])."<br>
<span class='small'>".$locale['406']."<a href='".BASEDIR."profile.php?lookup=".$data['forum_lastuser']."'>".$data['user_name']."</a></span></td>
</tr>\n";
}
}
} else {
echo "<tr>\n<td colspan='5' class='tbl1'>".$locale['407']."</td>\n</tr>\n";
}
echo "</table>
</td>
</tr>
</table>
<table cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td class='forum'><br>
<img src='".THEME."forum/foldernew.gif' alt='".$locale['560']."' style='vertical-align:middle;'> - ".$locale['409']."<br>
<img src='".THEME."forum/folder.gif' alt='".$locale['561']."' style='vertical-align:middle;'> - ".$locale['410']."
</td><td align='right' valign='bottom' class='forum'>
<form name='searchform' method='post' action='".BASEDIR."search.php?stype=f'>
<input type='text' name='stext' class='textbox' style='width:150px'>
<input type='submit' name='search' value='".$locale['550']."' class='button'>
</form>
</td>
</tr>
</table>\n";
closetable();
require_once BASEDIR."side_right.php";
require_once BASEDIR."footer.php";
?>
post.php
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "../maincore.php";
require_once BASEDIR."subheader.php";
require_once BASEDIR."side_left.php";
include LOCALE.LOCALESET."forum/post.php";
require_once INCLUDES."forum_functions_include.php";
if (!FUSION_QUERY || !isset($forum_id) || !isNum($forum_id)) fallback("index.php");
$result = dbquery(
"SELECT f.*, f2.forum_name AS forum_cat_name
FROM ".$db_prefix."forums f
LEFT JOIN ".$db_prefix."forums f2 ON f.forum_cat=f2.forum_id
WHERE f.forum_id='".$forum_id."'"
);
if (dbrows($result)) {
$fdata = dbarray($result);
[b]if(!iSUPERADMIN){
if (!checkgroup($fdata['forum_access']) || !$fdata['forum_cat']) fallback("index.php");
}[/b]
} else {
fallback("index.php");
}
if(!iSUPERADMIN){
if (!checkgroup($fdata['forum_posting'])) fallback("index.php");
}
$forum_mods = explode(".", $fdata['forum_moderators']);
if (iMEMBER && in_array($userdata['user_id'], $forum_mods) [b]|| iSUPERADMIN[/b]) { define("iMOD", true); } else { define("iMOD", false); }
$caption = $fdata['forum_cat_name']." | ".$fdata['forum_name'];
if ($action == "newthread") {
include "postnewthread.php";
} elseif ($action == "reply") {
if (!isset($thread_id) || !isNum($thread_id)) fallback("index.php");
$result = dbquery("SELECT * FROM ".$db_prefix."threads WHERE thread_id='".$thread_id."' AND forum_id='".$fdata['forum_id']."'");
if (dbrows($result)) { $tdata = dbarray($result); } else { fallback("index.php"); }
if (!$tdata['thread_locked']) { include "postreply.php"; } else { fallback("index.php"); }
} elseif ($action == "edit") {
if (!isset($thread_id) || !isNum($thread_id) || !isset($post_id) || !isNum($post_id)) { fallback("index.php"); exit; }
$result = dbquery("SELECT * FROM ".$db_prefix."threads WHERE thread_id='".$thread_id."' AND forum_id='".$fdata['forum_id']."'");
if (dbrows($result)) { $tdata = dbarray($result); } else { fallback("index.php"); }
$result = dbquery("SELECT * FROM ".$db_prefix."posts WHERE post_id='".$post_id."' AND thread_id='".$tdata['thread_id']."' AND forum_id='".$fdata['forum_id']."'");
if (dbrows($result)) { $pdata = dbarray($result); } else { fallback("index.php"); }
if ($userdata['user_id'] != $pdata['post_author'] && !iMOD && !iSUPERADMIN) fallback("index.php");
if (!$tdata['thread_locked']) {
include "postedit.php";
} else {
if (iMOD || iSUPERADMIN) { include "postedit.php"; } else { fallback("index.php"); }
}
} else {
header("Location: index.php");
}
require_once BASEDIR."side_right.php";
require_once BASEDIR."footer.php";
?>
viewforum.php
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "../maincore.php";
require_once BASEDIR."subheader.php";
require_once BASEDIR."side_left.php";
include LOCALE.LOCALESET."forum/main.php";
if (!isset($lastvisited) || !isNum($lastvisited)) $lastvisited = time();
$threads_per_page = 20;
if (!FUSION_QUERY || !$forum_id || !isNum($forum_id)) fallback("index.php");
$result = dbquery(
"SELECT f.*, f2.forum_name AS forum_cat_name
FROM ".$db_prefix."forums f
LEFT JOIN ".$db_prefix."forums f2 ON f.forum_cat=f2.forum_id
WHERE f.forum_id='".$forum_id."'"
);
if (dbrows($result)) {
$data = dbarray($result);
[b]if(!iSUPERADMIN) {
if (!checkgroup($data['forum_access']) || !$data['forum_cat']) fallback("index.php");
}[/b]
} else {
fallback("index.php");
}
$can_post = checkgroup($data['forum_posting']);
$caption = $data['forum_cat_name']." | ".$data['forum_name'];
opentable($locale['450']);
echo "<table cellspacing='0' cellpadding='0' width='100%'>
<tr>
<td class='smallalt'>
<a href='index.php'>".$settings['sitename']."</a> | $caption</td>\n";
if (iMEMBER && $can_post [b]|| iSUPERADMIN[/b]) {
echo "<td align='right'>
<a href='post.php?action=newthread&forum_id=$forum_id'><img src='".THEME."forum/newthread.gif' alt='".$locale['566']."' style='border:0px;'></a>
</td>\n";
}
echo "</tr>
</table>\n";
$rows = dbrows(dbquery("SELECT * FROM ".$db_prefix."threads WHERE forum_id='$forum_id' AND thread_sticky='0'"));
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if ($rows > $threads_per_page) {
echo "<div align='center' style='margin-top:5px;margin-bottom:5px;'>
".makePageNav($rowstart,20,$rows,3,FUSION_SELF."?forum_id=$forum_id&")."
</div>\n";
}
echo "<table cellpadding='0' cellspacing='0' width='100%' class='tbl-border'>
<tr>
<td>
<table cellspacing='1' cellpadding='0' width='100%'>
<tr>
<td width='20' class='tbl2'> </td>
<td class='tbl2'>".$locale['451']."</td>
<td width='100' class='tbl2'>".$locale['452']."</td>
<td align='center' width='50' class='tbl2'>".$locale['453']."</td>
<td align='center' width='50' class='tbl2'>".$locale['454']."</td>
<td width='120' class='tbl2'>".$locale['404']."</td>
</tr>\n";
if ($rowstart == 0) {
$result = dbquery(
"SELECT t.*, COUNT(p.post_id) AS thread_replies, tu1.user_name AS user_author, tu2.user_name AS user_lastuser FROM ".$db_prefix."threads t
LEFT JOIN ".$db_prefix."posts p USING(thread_id)
LEFT JOIN ".$db_prefix."users tu1 ON t.thread_author = tu1.user_id
LEFT JOIN ".$db_prefix."users tu2 ON t.thread_lastuser = tu2.user_id
WHERE t.forum_id='$forum_id' AND thread_sticky='1' GROUP BY thread_id ORDER BY thread_lastpost DESC"
);
if (dbrows($result) != 0) {
while ($data = dbarray($result)) {
if ($data['thread_locked']) {
echo "<tr>\n<td align='center' width='25' class='tbl2'><img src='".THEME."forum/folderlock.gif' alt='".$locale['564']."'></td>";
} else {
if ($data['thread_lastpost'] > $lastvisited) {
$folder = "<img src='".THEME."forum/foldernew.gif' alt='".$locale['560']."'>";
} else {
$folder = "<img src='".THEME."forum/folder.gif' alt='".$locale['561']."'>";
}
echo "<tr>\n<td align='center' width='25' class='tbl2'>$folder</td>";
}
$reps = ceil($data['thread_replies'] / $threads_per_page);
$threadsubject = "<a href='viewthread.php?forum_id=$forum_id&thread_id=".$data['thread_id']."'>".$data['thread_subject']."</a>";
if ($reps > 1) {
$ctr = 0; $ctr2 = 1; $pages = "";
while ($ctr2 <= $reps) {
$pnum = "<a href='viewthread.php?forum_id=$forum_id&thread_id=".$data['thread_id']."&rowstart=$ctr'>$ctr2</a> ";
$pages = $pages.$pnum; $ctr = $ctr + $threads_per_page; $ctr2++;
}
$threadsubject .= " - (".$locale['412'].trim($pages).")";
}
echo "<td class='tbl1'><img src='".THEME."forum/stickythread.gif' alt='".$locale['560']."' style='vertical-align:middle;'>
$threadsubject</td>
<td class='tbl2'><a href='../profile.php?lookup=".$data['thread_author']."'>".$data['user_author']."</a></td>
<td align='center' class='tbl1'>".$data['thread_views']."</td>
<td align='center' class='tbl2'>".($data['thread_replies']-1)."</td>
<td class='tbl1'>".showdate("forumdate", $data['thread_lastpost'])."<br>
<span class='small'>".$locale['406']."<a href='../profile.php?lookup=".$data['thread_lastuser']."'>".$data['user_lastuser']."</a></span></td>
</tr>\n";
}
$threadcount = dbrows($result);
} else {
$threadcount = 0;
}
}
if ($rows != 0) {
$result = dbquery(
"SELECT t.*, COUNT(p.post_id) AS thread_replies, tu1.user_name AS user_author, tu2.user_name AS user_lastuser FROM ".$db_prefix."threads t
LEFT JOIN ".$db_prefix."posts p USING(thread_id)
LEFT JOIN ".$db_prefix."users tu1 ON t.thread_author = tu1.user_id
LEFT JOIN ".$db_prefix."users tu2 ON t.thread_lastuser = tu2.user_id
WHERE t.forum_id='$forum_id' AND thread_sticky='0' GROUP BY thread_id ORDER BY thread_lastpost DESC LIMIT $rowstart,20"
);
$numrows = dbrows($result);
while ($data = dbarray($result)) {
if ($data['thread_locked']) {
echo "<tr>\n<td align='center' width='25' class='tbl2'><img src='".THEME."forum/folderlock.gif' alt='".$locale['564']."'></td>";
} else {
if ($data['thread_lastpost'] > $lastvisited) {
$folder = "<img src='".THEME."forum/foldernew.gif' alt='".$locale['560']."'>";
} else {
$folder = "<img src='".THEME."forum/folder.gif' alt='".$locale['561']."'>";
}
echo "<tr>\n<td align='center' width='25' class='tbl2'>$folder</td>";
}
$reps = ceil($data['thread_replies'] / $threads_per_page);
$threadsubject = "<a href='viewthread.php?forum_id=$forum_id&thread_id=".$data['thread_id']."'>".$data['thread_subject']."</a>";
if ($reps > 1) {
$ctr = 0; $ctr2 = 1; $pages = "";
while ($ctr2 <= $reps) {
$pnum = "<a href='viewthread.php?forum_id=$forum_id&thread_id=".$data['thread_id']."&rowstart=$ctr'>$ctr2</a> ";
$pages = $pages.$pnum; $ctr = $ctr + $threads_per_page; $ctr2++;
}
$threadsubject .= " - (".$locale['412'].trim($pages).")";
}
echo "<td class='tbl1'>$threadsubject</td>
<td class='tbl2'><a href='../profile.php?lookup=".$data['thread_author']."'>".$data['user_author']."</a></td>
<td align='center' class='tbl1'>".$data['thread_views']."</td>
<td align='center' class='tbl2'>".($data['thread_replies']-1)."</td>
<td class='tbl1'>".showdate("forumdate", $data['thread_lastpost'])."<br>
<span class='small'>".$locale['406']."<a href='../profile.php?lookup=".$data['thread_lastuser']."'>".$data['user_lastuser']."</a></span></td>
</tr>\n";
}
} else {
if ($threadcount == 0) {
echo "<tr>\n<td colspan='6' class='tbl1'>".$locale['455']."</td>\n</tr>\n";
}
}
echo "</table>
</td>
</tr>
</table>\n";
if ($rows > $threads_per_page) {
echo "<div align='center' style='margin-top:5px;'>
".makePageNav($rowstart,20,$rows,3,FUSION_SELF."?forum_id=$forum_id&")."
</div>\n";
}
$forum_list = ""; $current_cat = "";
[b]if(iSUPERADMIN){
$result = dbquery(
"SELECT f.forum_id, f.forum_name, f2.forum_name AS forum_cat_name
FROM ".$db_prefix."forums f
INNER JOIN ".$db_prefix."forums f2 ON f.forum_cat=f2.forum_id
WHERE f.forum_cat!='0' ORDER BY f2.forum_order ASC, f.forum_order ASC"
);
} else {
$result = dbquery(
"SELECT f.forum_id, f.forum_name, f2.forum_name AS forum_cat_name
FROM ".$db_prefix."forums f
INNER JOIN ".$db_prefix."forums f2 ON f.forum_cat=f2.forum_id
WHERE ".groupaccess('f.forum_access')." AND f.forum_cat!='0' ORDER BY f2.forum_order ASC, f.forum_order ASC"
);
}[/b]
while ($data2 = dbarray($result)) {
if ($data2['forum_cat_name'] != $current_cat) {
if ($current_cat != "") $forum_list .= "</optgroup>\n";
$current_cat = $data2['forum_cat_name'];
$forum_list .= "<optgroup label='".$data2['forum_cat_name']."'>\n";
}
$sel = ($data2['forum_id'] == $data['forum_id'] ? " selected" : "");
$forum_list .= "<option value='".$data2['forum_id']."'$sel>".$data2['forum_name']."</option>\n";
}
$forum_list .= "</optgroup>\n";
echo "<table width='100%' cellpadding='0' cellspacing='0' style='margin-top:5px;'>
<tr>
<td align='left' class='tbl'>".$locale['540']."<br>
<select name='jump_id' class='textbox' onChange=\"jumpForum(this.options[this.selectedIndex].value);\">
$forum_list</select></td>\n";
if (iMEMBER && $can_post [b]|| iSUPERADMIN[/b]) {
echo "<td align='right'>
<a href='post.php?action=newthread&forum_id=$forum_id'><img src='".THEME."forum/newthread.gif' alt='".$locale['566']."' style='border:0px;'></a>
</td>\n";
}
echo "</tr>
</table>\n";
echo "<table cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td class='tbl1'>
<img src='".THEME."forum/foldernew.gif' alt='".$locale['560']."' style='vertical-align:middle;'> - ".$locale['456']."(
<img src='".THEME."forum/folderhot.gif' alt='".$locale['562']."' style='vertical-align:middle;'> - ".$locale['457']." )<br>
<img src='".THEME."forum/folder.gif' alt='".$locale['561']."' style='vertical-align:middle;'> - ".$locale['458']."<br>
<img src='".THEME."forum/folderlock.gif' alt='".$locale['564']."' style='vertical-align:middle;'> - ".$locale['459']."<br>
<img src='".THEME."forum/stickythread.gif' alt='".$locale['563']."' style='vertical-align:middle;'> - ".$locale['460']."</td>
</tr>
</table>\n";
closetable();
echo "<script type='text/javascript'>
function DeleteItem() {
return confirm('Delete this thread?');
}
function jumpForum(forumid) {
document.location.href='".FORUM."viewforum.php?forum_id='+forumid;
}
</script>\n";
require_once BASEDIR."side_right.php";
require_once BASEDIR."footer.php";
?>
viewthread.php
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "../maincore.php";
require_once INCLUDES."forum_functions_include.php";
require_once BASEDIR."subheader.php";
require_once BASEDIR."side_left.php";
include LOCALE.LOCALESET."forum/main.php";
$posts_per_page = 20;
if (!FUSION_QUERY || !isset($forum_id) || !isNum($forum_id) || !isset($thread_id) || !isNum($thread_id)) fallback("index.php");
$result = dbquery(
"SELECT f.*, f2.forum_name AS forum_cat_name
FROM ".$db_prefix."forums f
LEFT JOIN ".$db_prefix."forums f2 ON f.forum_cat=f2.forum_id
WHERE f.forum_id='".$forum_id."'"
);
if (dbrows($result)) {
$fdata = dbarray($result);
[b]if(!iSUPERADMIN){
if (!checkgroup($fdata['forum_access']) || !$fdata['forum_cat']) fallback("index.php");
}[/b]
} else {
fallback("index.php");
}
$can_post = checkgroup($fdata['forum_posting']);
$forum_mods = explode(".", $fdata['forum_moderators']);
if (iMEMBER && in_array($userdata['user_id'], $forum_mods) [b]|| iSUPERADMIN[/b]) { define("iMOD", true); } else { define("iMOD", false); }
$result = dbquery("SELECT * FROM ".$db_prefix."threads WHERE thread_id='".$thread_id."' AND forum_id='".$fdata['forum_id']."'");
if (dbrows($result)) { $tdata = dbarray($result); } else { fallback("index.php"); }
$caption = $fdata['forum_cat_name']." | <a href='viewforum.php?forum_id=".$fdata['forum_id']."'>".$fdata['forum_name']."</a>";
$result = dbquery("UPDATE ".$db_prefix."threads SET thread_views=thread_views+1 WHERE thread_id='$thread_id'");
if (iMEMBER && $can_post && isset($_POST['postquickreply']) [b]|| iSUPERADMIN && isset($_POST['postquickreply'])[/b]) {
$flood = false;
$message = stripinput(censorwords($_POST['message']));
if ($message != "") {
$result = dbquery("SELECT MAX(post_datestamp) AS last_post FROM ".$db_prefix."posts WHERE post_author='".$userdata['user_id']."'");
if (dbrows($result) > 0) {
$data = dbarray($result);
if ((time() - $data['last_post']) < $settings['flood_interval']) {
$flood = true;
$result = dbquery("INSERT INTO ".$db_prefix."flood_control (flood_ip, flood_timestamp) VALUES ('".USER_IP."', '".time()."')");
if (dbcount("(flood_ip)", "flood_control", "flood_ip='".USER_IP."'") > 4) {
$result = dbquery("UPDATE ".$db_prefix."users SET user_status='1' WHERE user_id='".$userdata['user_id']."'");
}
fallback("viewforum.php?forum_id=$forum_id");
}
}
if (!$flood) {
$sig = ($userdata['user_sig'] ? '1' :'0');
$smileys = isset($_POST['disable_smileys']) ? "0" : "1";
$subject = "RE: ".$tdata['thread_subject'];
$result = dbquery("UPDATE ".$db_prefix."forums SET forum_lastpost='".time()."', forum_lastuser='".$userdata['user_id']."' WHERE forum_id='$forum_id'");
$result = dbquery("UPDATE ".$db_prefix."threads SET thread_lastpost='".time()."', thread_lastuser='".$userdata['user_id']."' WHERE thread_id='$thread_id'");
$result = dbquery("INSERT INTO ".$db_prefix."posts (forum_id, thread_id, post_subject, post_message, post_showsig, post_smileys, post_author, post_datestamp, post_ip, post_edituser, post_edittime) VALUES ('$forum_id', '$thread_id', '$subject', '$message', '$sig', '$smileys', '".$userdata['user_id']."', '".time()."', '".USER_IP."', '0', '0')");
$newpost_id = mysql_insert_id();
$result = dbquery("UPDATE ".$db_prefix."users SET user_posts=user_posts+1 WHERE user_id='".$userdata['user_id']."'");
redirect("postify.php?post=reply&error=0&forum_id=$forum_id&thread_id=$thread_id&post_id=$newpost_id");
}
}
}
opentable($locale['500']);
echo "<table cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td class='smallalt'><a href='index.php'>".$settings['sitename']."</a> | $caption</td>\n";
if (iMEMBER && $can_post [b]|| iSUPERADMIN[/b]) {
echo "<td align='right'>\n";
if (!$tdata['thread_locked']) {
echo "<a href='post.php?action=reply&forum_id=$forum_id&thread_id=$thread_id'><img src='".THEME."forum/reply.gif' alt='".$locale['565']."' style='border:0px;'></a>\n";
}
echo "<a href='post.php?action=newthread&forum_id=$forum_id'><img src='".THEME."forum/newthread.gif' alt='".$locale['566']."' style='border:0px;'></a></td>\n";
}
echo "</tr>
</table>\n";
$rows = dbcount("(thread_id)", "posts", "thread_id='$thread_id'");
if (isset($pid) && isNum($pid)) {
$reply_count = dbcount("(post_id)", "posts", "thread_id='".$tdata['thread_id']."' AND post_id<='".$pid."'");
if ($reply_count > $posts_per_page) $rowstart = ((ceil($reply_count / $posts_per_page)-1)*$posts_per_page);
}
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if ($rows > $posts_per_page) {
echo "<div align='center' style='margin-top:5px;margin-bottom:5px;'>
".makePageNav($rowstart,$posts_per_page,$rows,3,FUSION_SELF."?forum_id=$forum_id&thread_id=$thread_id&")."
</div>\n";
}
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n";
if ($rows != 0) {
$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_prefix."posts p
LEFT JOIN ".$db_prefix."forum_attachments fa USING(post_id)
LEFT JOIN ".$db_prefix."users u ON p.post_author = u.user_id
LEFT JOIN ".$db_prefix."users u2 ON p.post_edituser = u2.user_id AND post_edituser > '0'
WHERE p.thread_id='$thread_id' ORDER BY post_datestamp LIMIT $rowstart,$posts_per_page"
);
$numrows = dbrows($result);
while ($data = dbarray($result)) {
$message = $data['post_message'];
if ($data['post_showsig']) { $message = $message."\n\n<hr>".$data['user_sig']; }
if ($data['post_smileys']) { $message = parsesmileys($message); }
$message = parseubb($message);
$message = nl2br($message);
if ($data['post_edittime'] != "0") {
$edituser = "<a href='../profile.php?lookup=".$data['post_edituser']."'>".$data['edit_name']."</a>";
$edittime = showdate("forumdate", $data['post_edittime']);
}
$is_mod = in_array($data['user_id'], $forum_mods) && $data['user_level'] < "102" ? true : false;
echo "<tr>
<td width='145' class='tbl2'>".$locale['501']."</td>
<td class='tbl2'><a name='post_".$data['post_id']."' id='post_".$data['post_id']."'></a>".$data['post_subject']."</td>
</tr>
<tr>
<td valign='top' rowspan='3' width='145' class='tbl1'>
<a href='../profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a><br>
<span class='alt'>".($is_mod ? $locale['userf1'] : getuserlevel($data['user_level']))."</span><br><br>\n";
if ($data['user_avatar'] != "") {
echo "<img src='".IMAGES."avatars/".$data['user_avatar']."' alt='".$locale['567']."'><br><br>\n";
$height = "185";
} else {
$height = "70";
}
echo "<span class='alt'>".$locale['502']."</span> ".$data['user_posts']."<br>\n";
if ($data['user_location']) echo "<span class='alt'>".$locale['503']."</span> ".$data['user_location']."<br>\n";
echo "<span class='alt'>".$locale['504']."</span> ".showdate("%d.%m.%y", $data['user_joined'])."</td>
<td>
<table cellspacing='0' cellpadding='0' width='100%'>
<tr>
<td class='tbl1'>".$locale['505'].showdate("forumdate", $data['post_datestamp'])."</td>
<td align='right' class='tbl1'>\n";
if (iMEMBER && $can_post [b]|| iSUPERADMIN[/b]) {
if (!$tdata['thread_locked']) {
if ($userdata['user_id'] == $data['post_author'] || iMOD || iSUPERADMIN) {
echo "<a href='post.php?action=edit&forum_id=$forum_id&thread_id=".$data['thread_id']."&post_id=".$data['post_id']."'><img src='".THEME."forum/edit.gif' alt='".$locale['568']."' style='border:0px;'></a>\n";
}
echo "<a href='post.php?action=reply&forum_id=$forum_id&thread_id=".$data['thread_id']."&post_id=".$data['post_id'].""e=".$data['post_id']."'><img src='".THEME."forum/quote.gif' alt='".$locale['569']."' style='border:0px;'></a>\n";
if (iMOD || iSUPERADMIN && $data['post_ip'] != "0.0.0.0" && file_exists(THEME."forum/ip.gif")) echo "<img src='".THEME."forum/ip.gif' alt='".$locale['570']."' title='".$data['post_ip']."' style='border:0px;'>\n";
} else {
if (iMOD || iSUPERADMIN) {
echo "<a href='post.php?action=edit&forum_id=$forum_id&thread_id=".$data['thread_id']."&post_id=".$data['post_id']."'><img src='".THEME."forum/edit.gif' alt='".$locale['568']."' style='border:0px;'></a>\n";
if ($data['post_ip'] != "0.0.0.0" && file_exists(THEME."forum/ip.gif")) echo "<img src='".THEME."forum/ip.gif' alt='".$locale['570']."' title='".$data['post_ip']."' style='border:0px;'>\n";
}
}
}
echo "</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign='top' height='$height' class='tbl1'>
$message";
if ($data['attach_id']) {
if (in_array($data['attach_ext'], $imagetypes) && @getimagesize(FORUM."attachments/".$data['attach_name'])) {
echo "<hr>\n".$data['user_name'].$locale['506']."<br><br>\n<img src='".FORUM."attachments/".$data['attach_name']."'>";
} else {
echo "<hr>\n".$data['user_name'].$locale['507']."<br>\n<a href='".FUSION_SELF."?forum_id=$forum_id&thread_id=$thread_id&getfile=".$data['post_id']."'>".$data['attach_name']."</a>";
}
}
if ($data['post_edittime'] != "0") {
echo "<hr>\n".$locale['508'].$edituser.$locale['509']."$edittime";
}
echo "</td>
</tr>
<tr>
<td class='tbl1'>\n";
if ($data['user_aim'] && file_exists(THEME."forum/aim.gif")) {
echo "<a href='aim:goim?screenname=".str_replace(" ", "+", $data['user_aim'])."' target='_blank'><img src='".THEME."forum/aim.gif' alt='".$data['user_aim']."' style='border:0px;'></a> ";
}
if ($data['user_icq']) {
echo "<a href='http://web.icq.com/wwp?Uin=".$data['user_icq']."' target='_blank'><img src='".THEME."forum/icq.gif' alt='".$data['user_icq']."' style='border:0px;'></a> ";
}
if ($data['user_msn']) {
echo "<a href='mailto:$data[user_msn]'><img src='".THEME."forum/msn.gif' alt='".$data['user_msn']."' style='border:0px;'></a> ";
}
if ($data['user_yahoo']) {
echo "<a href='http://uk.profiles.yahoo.com/$data[user_yahoo]' target='_blank'><img src='".THEME."forum/yahoo.gif' alt='".$data['user_yahoo']."' style='border:0px;'></a> ";
}
if ($data['user_web']) {
if (!strstr($data['user_web'], "http://")) { $urlprefix = "http://"; } else { $urlprefix = ""; }
echo "<a href='".$urlprefix."".$data['user_web']."' target='_blank'><img src='".THEME."forum/web.gif' alt='".$data['user_web']."' style='border:0px;'></a> ";
}
echo "<a href='".BASEDIR."messages.php?msg_send=".$data['user_id']."'><img src='".THEME."forum/pm.gif' alt='".$locale['571']."' style='border:0px;'></a>
</td>
</tr>\n";
}
}
echo "</table>\n";
if ($rows > $posts_per_page) {
echo "<div align='center' style='margin-top:5px;'>
".makePageNav($rowstart,$posts_per_page,$rows,3,FUSION_SELF."?forum_id=$forum_id&thread_id=$thread_id&")."
</div>\n";
}
echo "<table cellpadding='0' cellspacing='0' width='100%' style='margin-top:5px;'>\n<tr>\n";
$forum_list = ""; $current_cat = "";
[b]if(iSUPERADMIN){
$result = dbquery(
"SELECT f.forum_id, f.forum_name, f2.forum_name AS forum_cat_name
FROM ".$db_prefix."forums f
INNER JOIN ".$db_prefix."forums f2 ON f.forum_cat=f2.forum_id
WHERE f.forum_cat!='0' ORDER BY f2.forum_order ASC, f.forum_order ASC"
);
} else {
$result = dbquery(
"SELECT f.forum_id, f.forum_name, f2.forum_name AS forum_cat_name
FROM ".$db_prefix."forums f
INNER JOIN ".$db_prefix."forums f2 ON f.forum_cat=f2.forum_id
WHERE ".groupaccess('f.forum_access')." AND f.forum_cat!='0' ORDER BY f2.forum_order ASC, f.forum_order ASC"
);
}[/b]
while ($data = dbarray($result)) {
if ($data['forum_cat_name'] != $current_cat) {
if ($current_cat != "") $forum_list .= "</optgroup>\n";
$current_cat = $data['forum_cat_name'];
$forum_list .= "<optgroup label='".$data['forum_cat_name']."'>\n";
}
$sel = ($data['forum_id'] == $fdata['forum_id'] ? " selected" : "");
$forum_list .= "<option value='".$data['forum_id']."'$sel>".$data['forum_name']."</option>\n";
}
$forum_list .= "</optgroup>\n";
echo "<td align='left' class='tbl'>".$locale['540']."<br>
<select name='jump_id' class='textbox' onChange=\"jumpForum(this.options[this.selectedIndex].value);\">
$forum_list</select></td>\n";
if (iMEMBER && $can_post [b]|| iSUPERADMIN[/b]) {
if (iMOD || iSUPERADMIN) {
echo "<td align='right' class='tbl'>
<form name='modopts' method='post' action='options.php?forum_id=$forum_id&thread_id=$thread_id'>
".$locale['520']."<br>
<select name='step' class='textbox'>
<option value='none'> </option>
<option value='renew'>".$locale['527']."</option>
<option value='delete'>".$locale['521']."</option>\n";
if (!$tdata['thread_locked']) {
echo "<option value='lock'>".$locale['522']."</option>\n";
} else {
echo "<option value='unlock'>".$locale['523']."</option>\n";
}
if (!$tdata['thread_sticky']) {
echo "<option value='sticky'>".$locale['524']."</option>\n";
} else {
echo "<option value='nonsticky'>".$locale['525']."</option>\n";
}
echo "<option value='move'>".$locale['526']."</option>\n";
echo "</select>
<input type='submit' name='go' value='".$locale['528']."' class='button'>
</form>
</td>
</tr>\n";
}
}
echo "</table>\n";
if (iMEMBER) {
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
if ($settings['thread_notify']) {
echo "<td valign='top' class='tbl'>";
if (dbcount("(thread_id)", "thread_notify", "thread_id='$thread_id' AND notify_user='".$userdata['user_id']."'")) {
$result = dbquery("UPDATE ".$db_prefix."thread_notify SET notify_datestamp='".time()."', notify_status='1' WHERE thread_id='$thread_id' AND notify_user='".$userdata['user_id']."'");
$notify_link = "<a href='postify.php?post=off&forum_id=$forum_id&thread_id=$thread_id'>".$locale['515']."</a>";
} else {
$notify_link = "<a href='postify.php?post=on&forum_id=$forum_id&thread_id=$thread_id'>".$locale['516']."</a>";
}
echo "$notify_link</td>\n";
}
if ($can_post [b]|| iSUPERADMIN[/b]) {
echo "<td align='right' class='tbl'>";
if (!$tdata['thread_locked']) {
echo "<a href='post.php?action=reply&forum_id=$forum_id&thread_id=$thread_id'><img src='".THEME."forum/reply.gif' alt='".$locale['565']."' style='border:0px;'></a>\n";
}
echo "<a href='post.php?action=newthread&forum_id=$forum_id'><img src='".THEME."forum/newthread.gif' alt='".$locale['566']."' style='border:0px;'></a>\n";
echo "</td>\n";
}
echo "</tr>\n</table>\n";
}
closetable();
tablebreak();
if (iMEMBER && $can_post && !$tdata['thread_locked'] [b]|| iSUPERADMIN[/b]) {
opentable($locale['512']);
echo "<form name='inputform' method='post' action='".FUSION_SELF."?forum_id=$forum_id&thread_id=$thread_id'>
<table align='center' cellpadding='0' cellspacing='1' class='tbl-border'>
<tr>
[b]TU POWINNY BYC BUTTONY Z BBCODE, TRZEBA TO UZUPELNIC RECZNIE[/b]
</tr>
<tr>
<td align='center' class='tbl2'>".displaysmileys("message")."<br>
<input type='checkbox' name='disable_smileys' value='1'>".$locale['513']."</td>
</tr>
<tr>
<td align='center' class='tbl1'><input type='submit' name='postquickreply' value='".$locale['514']."' class='button'></td>
</tr>
</table>
</form>\n";
closetable();
}
echo "<script type='text/javascript'>
function jumpForum(forumid) {
document.location.href='".FORUM."viewforum.php?forum_id='+forumid;
}
</script>\n";
require_once BASEDIR."side_right.php";
require_once BASEDIR."footer.php";
?>
//////////forum_threads_list_panel///////////////
forum_threads_list_panel.php
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location:../../index.php"); exit; }
[b]if(iSUPERADMIN){
$result = dbquery(
"SELECT tf.*, tt.*, tu.user_id,user_name, MAX(tp.post_id) as last_id, COUNT(tp.post_id) as count_posts FROM ".$db_prefix."forums tf
INNER JOIN ".$db_prefix."threads tt USING(forum_id)
INNER JOIN ".$db_prefix."posts tp USING(thread_id)
INNER JOIN ".$db_prefix."users tu ON tt.thread_lastuser=tu.user_id
GROUP BY thread_id ORDER BY thread_lastpost DESC LIMIT 0,".$settings['numofthreads']
);
} else {
$result = dbquery(
"SELECT tf.*, tt.*, tu.user_id,user_name, MAX(tp.post_id) as last_id, COUNT(tp.post_id) as count_posts FROM ".$db_prefix."forums tf
INNER JOIN ".$db_prefix."threads tt USING(forum_id)
INNER JOIN ".$db_prefix."posts tp USING(thread_id)
INNER JOIN ".$db_prefix."users tu ON tt.thread_lastuser=tu.user_id
WHERE ".groupaccess('forum_access')." GROUP BY thread_id ORDER BY thread_lastpost DESC LIMIT 0,".$settings['numofthreads']
);
}[/b]
if (dbrows($result) != 0) {
$i = 0;
opentable($locale['025']);
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n<tr>\n";
if ($theme_width == "100%") echo "<td class='tbl2'><span class='small'><b>".$locale['030']."</b></span></td>\n";
echo "<td class='tbl2'><span class='small'><b>".$locale['031']."</b></span></td>
<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><span class='small'><b>".$locale['033']."</b></span></td>
<td align='center' colspan='2' width='1%' class='tbl2' style='white-space:nowrap'><span class='small'><b>".$locale['034']."</b></span></td>
</tr>\n";
while ($data = dbarray($result)) {
if ($i % 2 == 0) { $row_color = "tbl1"; } else { $row_color = "tbl2"; }
echo "<tr>\n";
if ($theme_width == "100%") {
echo "<td width='45%' class='$row_color'><span class='small'>".$data['forum_name']."</span></td>
<td width='55%' class='$row_color'><span class='small'><a href='".FORUM."viewthread.php?forum_id=".$data['forum_id']."&thread_id=".$data['thread_id']."&pid=".$data['last_id']."#post_".$data['last_id']."' title='".$data['thread_subject']."'>".trimlink($data['thread_subject'], 30)."</a></span></td>\n";
} else {
echo "<td width='100%' class='$row_color'><span class='small'><a href='".FORUM."viewthread.php?forum_id=".$data['forum_id']."&thread_id=".$data['thread_id']."&pid=".$data['last_id']."#post_".$data['last_id']."' title='".$data['thread_subject']." (".$data['forum_name'].")'>".trimlink($data['thread_subject'], 30)."</a></span></td>\n";
}
echo "<td align='center' width='1%' class='$row_color' style='white-space:nowrap'><span class='small'>".($data['count_posts']-1)."</span></td>
<td align='center' width='1%' class='$row_color' style='white-space:nowrap'><span class='small'><a href='".BASEDIR."profile.php?lookup=".$data['thread_lastuser']."'>".$data['user_name']."</a></span></td>
<td align='center' width='1%' class='$row_color' style='white-space:nowrap'><span class='small'>".showdate("forumdate", $data['thread_lastpost'])."</span></td>
</tr>\n";
$i++;
}
if (iMEMBER) {
echo "<tr>\n<td align='center' colspan='5' class='tbl1'><span class='small'><a href='".INFUSIONS."forum_threads_list_panel/my_threads.php'>".$locale['026']."</a> |
<a href='".INFUSIONS."forum_threads_list_panel/my_posts.php'>".$locale['027']."</a> |
<a href='".INFUSIONS."forum_threads_list_panel/new_posts.php'>".$locale['028']."</a></span></td>\n</tr>\n";
}
echo "</table>\n";
closetable();
}
?>
my_posts.php
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "../../maincore.php";
require_once BASEDIR."subheader.php";
require_once BASEDIR."side_left.php";
if (!iMEMBER) fallback("../../index.php");
[b]if(iSUPERADMIN){
$result = dbquery(
"SELECT tp.*, tf.* FROM ".$db_prefix."posts tp
INNER JOIN ".$db_prefix."forums tf USING(forum_id)
WHERE post_author='".$userdata['user_id']."' LIMIT 100"
);
} else {
$result = dbquery(
"SELECT tp.*, tf.* FROM ".$db_prefix."posts tp
INNER JOIN ".$db_prefix."forums tf USING(forum_id)
WHERE ".groupaccess('forum_access')." AND post_author='".$userdata['user_id']."' LIMIT 100"
);
}[/b]
$rows = dbrows($result);
if ($rows != 0) {
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
[b]if(iSUPERADMIN){
$result = dbquery(
"SELECT tp.*, tf.* FROM ".$db_prefix."posts tp
INNER JOIN ".$db_prefix."forums tf USING(forum_id)
WHERE post_author='".$userdata['user_id']."'
ORDER BY post_datestamp DESC LIMIT $rowstart,20"
);
} else {
$result = dbquery(
"SELECT tp.*, tf.* FROM ".$db_prefix."posts tp
INNER JOIN ".$db_prefix."forums tf USING(forum_id)
WHERE ".groupaccess('forum_access')." AND post_author='".$userdata['user_id']."'
ORDER BY post_datestamp DESC LIMIT $rowstart,20"
);
}[/b]
$i=0;
opentable($locale['027']);
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n<tr>\n";
echo "<td class='tbl2'><span class='small'><b>".$locale['030']."</b></span></td>
<td class='tbl2'><span class='small'><b>".$locale['035']."</b></span></td>
<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><span class='small'><b>".$locale['036']."</b></span></td>
</tr>\n";
while ($data = dbarray($result)) {
if ($i % 2 == 0) { $row_color = "tbl1"; } else { $row_color = "tbl2"; }
echo "<tr>
<td class='$row_color'><span class='small'>".trimlink($data['forum_name'], 30)."</span></td>
<td class='$row_color'><span class='small'><a href='".FORUM."viewthread.php?".$rstart."forum_id=".$data['forum_id']."&thread_id=".$data['thread_id']."&pid=".$data['post_id']."#post_".$data['post_id']."' title='".$data['post_subject']."'>".trimlink($data['post_subject'], 40)."</a></span></td>
<td align='center' width='1%' class='$row_color' style='white-space:nowrap'><span class='small'>".showdate("forumdate", $data['post_datestamp'])."</span></td>
</tr>\n";
$i++;
}
echo "</table>\n";
closetable();
if ($rows > 20) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,20,$rows,3)."\n</div>\n";
} else {
opentable($locale['027']);
echo "<center><br>\n".$locale['038']."<br><br>\n</center>\n";
closetable();
}
require_once BASEDIR."side_right.php";
require_once BASEDIR."footer.php";
?>
my_threads.php
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "../../maincore.php";
require_once BASEDIR."subheader.php";
require_once BASEDIR."side_left.php";
if (!iMEMBER) fallback("../../index.php");
[b]if(iSUPERADMIN){
$result = dbquery(
"SELECT tt.*, tf.*, tu.user_id,user_name FROM ".$db_prefix."threads tt
INNER JOIN ".$db_prefix."forums tf USING(forum_id)
INNER JOIN ".$db_prefix."users tu ON tt.thread_lastuser=tu.user_id
WHERE thread_author='".$userdata['user_id']."' LIMIT 100"
);
} else {
$result = dbquery(
"SELECT tt.*, tf.*, tu.user_id,user_name FROM ".$db_prefix."threads tt
INNER JOIN ".$db_prefix."forums tf USING(forum_id)
INNER JOIN ".$db_prefix."users tu ON tt.thread_lastuser=tu.user_id
WHERE ".groupaccess('forum_access')." AND thread_author='".$userdata['user_id']."' LIMIT 100"
);
}[/b]
$rows = dbrows($result);
if ($rows != 0) {
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
[b]if(iSUPERADMIN){
$result = dbquery(
"SELECT tt.*, tf.*, tu.user_id,user_name FROM ".$db_prefix."threads tt
INNER JOIN ".$db_prefix."forums tf USING(forum_id)
INNER JOIN ".$db_prefix."users tu ON tt.thread_lastuser=tu.user_id
WHERE thread_author='".$userdata['user_id']."'
ORDER BY thread_lastpost DESC LIMIT $rowstart,20"
);
} else {
$result = dbquery(
"SELECT tt.*, tf.*, tu.user_id,user_name FROM ".$db_prefix."threads tt
INNER JOIN ".$db_prefix."forums tf USING(forum_id)
INNER JOIN ".$db_prefix."users tu ON tt.thread_lastuser=tu.user_id
WHERE ".groupaccess('forum_access')." AND thread_author='".$userdata['user_id']."'
ORDER BY thread_lastpost DESC LIMIT $rowstart,20"
);
}[/b]
$i=0;
opentable($locale['026']);
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n<tr>\n";
if ($theme_width == "100%") echo "<td class='tbl2'><span class='small'><b>".$locale['030']."</b></span></td>\n";
echo "<td class='tbl2'><span class='small'><b>".$locale['031']."</b></span></td>
<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><span class='small'><b>".$locale['033']."</b></span></td>
<td align='center' colspan='2' width='1%' class='tbl2' style='white-space:nowrap'><span class='small'><b>".$locale['034']."</b></span></td>
</tr>\n";
while ($data = dbarray($result)) {
if ($i % 2 == 0) { $row_color = "tbl1"; } else { $row_color = "tbl2"; }
$result2 = dbquery("SELECT post_id FROM ".$db_prefix."posts WHERE thread_id='".$data['thread_id']."' ORDER BY post_id DESC");
echo "<tr>\n";
if ($theme_width == "100%") {
echo "<td width='45%' class='$row_color'><span class='small'>".$data['forum_name']."</span></td>
<td width='55%' class='$row_color'><span class='small'><a href='".FORUM."viewthread.php?forum_id=".$data['forum_id']."&thread_id=".$data['thread_id']."' title='".$data['thread_subject']."'>".trimlink($data['thread_subject'], 30)."</a></span></td>\n";
} else {
echo "<td width='100%' class='$row_color'><span class='small'><a href='".FORUM."viewthread.php?forum_id=".$data['forum_id']."&thread_id=".$data['thread_id']."' title='".$data['thread_subject']." (".$data['forum_name'].")'>".trimlink($data['thread_subject'], 30)."</a></span></td>\n";
}
echo "<td align='center' width='1%' class='$row_color' style='white-space:nowrap'><span class='small'>".(dbrows($result2)-1)."</span></td>
<td align='center' width='1%' class='$row_color' style='white-space:nowrap'><span class='small'><a href='".BASEDIR."profile.php?lookup=".$data['thread_lastuser']."'>".$data['user_name']."</a></span></td>
<td align='center' width='1%' class='$row_color' style='white-space:nowrap'><span class='small'>".showdate("forumdate", $data['thread_lastpost'])."</span></td>
</tr>\n";
$i++;
}
echo "</table>\n";
closetable();
if ($rows > 20) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,20,$rows,3)."\n</div>\n";
} else {
opentable($locale['026']);
echo "<center><br>\n".$locale['037']."<br><br>\n</center>\n";
closetable();
}
require_once BASEDIR."side_right.php";
require_once BASEDIR."footer.php";
?>
ponizej dalsza czesc :D
Edytowane przez slawekneo dnia 17.09.2006 03:41:17
|