Zaawansowany
Postów: 1191 Pomógł: 418 Ostrzeżeń: 1
v6.00.xxx Data rejestracji: 06.04.2008 21:59
|
Zrobiłem tak jak chciałeś informacje tylko może dodawać przy zakładaniu admin i jest ona nie obowiązkowa jak nie dasz to nic nie wyświetla jak wypełnisz pole to nad tematem będziesz miał informacje którą wpiszesz
Najpierw wchodzisz w dodatkowe strony i wklejasz ten kod i dajesz podgląd
<?php
dbquery("ALTER TABLE `".DB_PREFIX."threads` ADD `info` TEXT NOT NULL;");
?>
Teraz edytujesz plik postnewthread.php
Odnajdujesz w nim
if (isset($_POST['postnewthread'])) {
$flood = false; $error = 0;
$sticky = isset($_POST['sticky']) ? "1" : "0";
$sig = isset($_POST['show_sig']) ? "1" : "0";
$smileys = isset($_POST['disable_smileys']) ? "0" : "1";
$subject = trim(stripinput(censorwords($_POST['subject'])));
$message = trim(stripinput(censorwords($_POST['message'])));
I pod tym dodajesz
$info = $_POST['info'];
Teraz odnajdujesz w tym pliku
$result = dbquery("INSERT INTO ".$db_prefix."threads (forum_id, thread_subject, thread_author, thread_views, thread_lastpost, thread_lastuser, thread_sticky, thread_locked[b], info[/b]) VALUES('$forum_id', '$subject', '".$userdata['user_id']."', '0', '".time()."', '".$userdata['user_id']."', '$sticky', '0', [b]'$info'[/b])");
I dodajesz to co pogrubione
Teraz odnajdujesz
echo "<form name='inputform' method='post' action='".FUSION_SELF."?action=newthread&forum_id=$forum_id' enctype='multipart/form-data'>
<table cellpadding='0' cellspacing='0' width='100%' class='tbl-border'>
<tr>
<td>
<table width='100%' border='0' cellspacing='1' cellpadding='0'>
I dodajesz pod tym
";
if (iSUPERADMIN) {
echo "<tr>
<td width='145' class='tbl2'>Informacja:</td>
<td class='tbl2'><input type='text' name='info' value='$info' class='textbox' maxlength='255' style='width: 250px'></td>
</tr>";
}
echo "
I teraz edytujesz plik viewforum.php
Odnajdujesz
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)) {
I dodajesz pod tym
if ($data['info'] != "") {
echo "<tr><td align='center' width='25' class='tbl2'>Informacja</td><td class='tbl2' colspan='5'>".$data['info']."</td></tr>";
}
No i to wszystko sprawdzałem i działa tak jak trzeba
|
Zaawansowany
Postów: 1191 Pomógł: 418 Ostrzeżeń: 1
v6.00.xxx Data rejestracji: 06.04.2008 21:59
|
Hmmmmmm teraz powinno być dokładnie tak jak chciałeś
Robisz tak wchodzisz w dodatkowe strony i wklejasz
<?php
dbquery("ALTER TABLE `".DB_PREFIX."forums` ADD `info` TEXT NOT NULL;");
?>
i dajesz podgląd
I przystępujesz do edycji plików
Najpierw edytujesz plik administration/forum.php dzięki temu przy dodawanie kategorii będziesz mógł dać informacją a jak chcesz zmienić to po prostuj edytujesz kategorie i zmieniasz informacje
W plik tym odnajdujesz
} elseif (isset($_POST['save_forum'])) {
$forum_name = stripinput($_POST['forum_name']);
$forum_description = stripinput($_POST['forum_description']);
$forum_cat = isNum($_POST['forum_cat']) ? $_POST['forum_cat'] : "";
$forum_access = $_POST['forum_access'];
$forum_posting = $_POST['forum_posting'];
I pod wklejasz
$info = $_POST['info'];
Teraz odnajdujesz i dodajesz to co pogrubione
$result = dbquery("UPDATE ".$db_prefix."forums SET forum_name='$forum_name', forum_cat='$forum_cat', forum_description='$forum_description', forum_access='$forum_access', forum_posting='$forum_posting'[b], info='$info' [/b]WHERE forum_id='$forum_id'");
Teraz odnajdujesz i dodajesz to co pogrubione
$result = dbquery("INSERT INTO ".$db_prefix."forums (forum_cat, forum_name, forum_order, forum_description, forum_moderators, forum_access, forum_posting, forum_lastpost, forum_lastuser[b], info[/b]) VALUES ('$forum_cat', '$forum_name', '$forum_order', '$forum_description', '$forum_mods', '$forum_access', '$forum_posting', '0', '0'[b], '$info'[/b])");
Odnajdujesz i dodajesz to co pogrubione
if ($action == "edit") {
if ($t == "cat") {
$result = dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_id='$forum_id'");
$data = dbarray($result);
$cat_name = $data['forum_name'];
$cat_title = $locale['420'];
$cat_action = FUSION_SELF.$aidlink."&action=edit&forum_id=".$data['forum_id']."&t=cat";
$forum_title = $locale['421'];
$forum_action = FUSION_SELF.$aidlink;
} elseif ($t == "forum") {
$result = dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_id='$forum_id'");
$data = dbarray($result);
$forum_name = $data['forum_name'];
$forum_description = $data['forum_description'];
$forum_cat = $data['forum_cat'];
$forum_access = $data['forum_access'];
$forum_posting = $data['forum_posting'];
$forum_title = $locale['422'];
[b]$info = $data['info'];[/b]
$forum_action = FUSION_SELF.$aidlink."&action=edit&forum_id=".$data['forum_id']."&t=forum";
$cat_title = $locale['423'];
$cat_action = FUSION_SELF.$aidlink;
}
} else {
$cat_name = "";
$cat_order = "";
$cat_title = $locale['423'];
$cat_action = FUSION_SELF.$aidlink;
$forum_name = "";
[b]$info ="";[/b]
$forum_description = "";
$forum_cat = "";
$forum_order = "";
$forum_access = "";
$forum_posting = "";
$forum_title = $locale['421'];
Na koniec odnajdujesz
opentable($forum_title);
echo "<form name='addforum' method='post' action='$forum_action'>
<table align='center' cellpadding='0' cellspacing='0' width='300'>
<tr>
<td colspan='2' class='tbl'>".$locale['460']."<br>
<input type='text' name='forum_name' value='$forum_name' class='textbox' style='width:285px;'></td>
</tr>
i dodajesz pod tym
<tr>
<td colspan='2' class='tbl'>Informacja:<br>
<textarea name='info' rows='2' class='textbox' style='width:285px;'>$info</textarea></td>
</tr>
I teraz tylko edytujesz plik forum/viewforum.php odnajujedsz w nim
echo "<table cellpadding='0' cellspacing='0' width='100%' class='tbl-border'>
<tr>
<td>
<table cellspacing='1' cellpadding='0' width='100%'>
I niżej dodajesz
";
if ($data['info'] != "") {
echo "<tr>
<td width='20' class='tbl2'>Info</td><td class='tbl2' colspan='5'>".$data['info']."</td>
</tr>";
}
echo "
I TO wszystko działa sprawdzałem i wyświetla tylko dla tych kategorii co wpiszesz w panelu admina i tym miejscu co pokazałeś na screnie
Edytowane przez kefirek dnia 26.06.2008 17:33:31
|
Przedszkolak
Postów: 81 Ostrzeżeń: 4
Data rejestracji: 20.10.2007 13:25
|
O jejku Kefirek dzięki Ci serdeczne.
:beer: :)
Pozdrawiam!
Mam małe problemy z wklejeniem tego:
$result = dbquery("INSERT INTO ".$db_prefix."forums (forum_cat, forum_name, forum_order, forum_description, forum_moderators, forum_access, forum_posting, forum_lastpost, forum_lastuser, [b]info[/b]) VALUES ('$forum_cat', '$forum_name', '$forum_order', '$forum_description', '$forum_mods', '$forum_access', '$forum_posting', '0', '0', '[b]$info[/b]')");
w forums.php mam tylko
$result = dbquery("INSERT INTO ".$db_prefix."forums (forum_cat, forum_name, forum_order, forum_description, forum_moderators, forum_access, forum_posting, forum_reply, forum_edit, forum_delete, forum_lastpost, forum_lastuser, forum_icon) VALUES ('0', '$cat_name', '$cat_order', '', '', '0', '0', '0', '0', '0', '0', '0', '')");
Jak widać, po forum_lastuser mam jeszcze forum_icon, i nie wiem gdzie to dać. Szukałem w całym pliku i tej linijki nie mam..
Dla pewności dam plik forums.php już po części zmodyfikowany:
http://wklej.org/...
Pozdrawiam.
Edytowane przez Maserman dnia 26.06.2008 18:38:56
|
Zaawansowany
Postów: 1191 Pomógł: 418 Ostrzeżeń: 1
v6.00.xxx Data rejestracji: 06.04.2008 21:59
|
Dododaj tutaj
$result = dbquery("INSERT INTO ".$db_prefix."forums (forum_cat, forum_name, forum_order, forum_description, forum_moderators, forum_access, forum_posting, forum_reply, forum_edit, forum_delete, forum_lastpost, forum_lastuser, forum_sub, forum_icon, info) VALUES ('$forum_cat', '$forum_name', '$forum_order', '$forum_description', '$forum_mods', '$forum_access', '$forum_posting', '$forum_reply', '$forum_edit', '$forum_delete', '0', '0', '$forum_sub', '$forum_icon', '$info')");
Edytowane przez kefirek dnia 26.06.2008 18:53:56
|
Przedszkolak
Postów: 81 Ostrzeżeń: 4
Data rejestracji: 20.10.2007 13:25
|
Hmm zrobiłem, w edycji jest pole Informacja, jednak gdy wejdę do danego działu informacji nie ma.
Zauważyłem także parę niezgodności w moim plikach, więc dla pewności dam je tutaj:
forums.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 ADMIN."navigation.php";
include LOCALE.LOCALESET."admin/forums.php";
if (file_exists(BASEDIR."forum/locale/".$settings['locale'].".php")) {
include BASEDIR."forum/locale/".$settings['locale'].".php";
} else {
include BASEDIR."forum/locale/locale/German.php";
}
if (!checkrights("F") || !defined("iAUTH") || $aid != iAUTH) fallback("../index.php");
if (isset($forum_id) && !isNum($forum_id)) fallback(FUSION_SELF);
if (!isset($action)) $action = "";
if (!isset($t)) $t = "";
if ($action == "refresh") {
$i = 1; $k = 1;
$result = dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_cat='0' ORDER BY forum_order");
while ($data = dbarray($result)) {
$result2 = dbquery("UPDATE ".$db_prefix."forums SET forum_order='$i' WHERE forum_id='".$data['forum_id']."'");
$result2 = dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_cat='".$data['forum_id']."' ORDER BY forum_order");
while ($data2 = dbarray($result2)) {
$result3 = dbquery("UPDATE ".$db_prefix."forums SET forum_order='$k' WHERE forum_id='".$data2['forum_id']."'");
$k++;
}
$i++; $k = 1;
}
redirect(FUSION_SELF.$aidlink);
}
if (isset($status)) {
if ($status == "savece") {
$title = $locale['400'];
$message = "<b>".$locale['401']."</b>";
} elseif ($status == "savecu") {
$title = $locale['402'];
$message = "<b>".$locale['403']."</b>";
} elseif ($status == "savefe") {
$title = $locale['404'];
$message = "<b>".$locale['405']."</b>";
} elseif ($status == "savefu") {
$title = $locale['406'];
$message = "<b>".$locale['407']."</b>";
} elseif ($status == "savefm") {
$title = $locale['408'];
$message = "<b>".$locale['409']."</b>";
} elseif ($status == "delc1") {
$title = $locale['410'];
$message = "<b>".$locale['411']."</b>";
} elseif ($status == "delc2") {
$title = $locale['410'];
$message = "<b>".$locale['412']."</b><br>\n".$locale['413'];
} elseif ($status == "delf1") {
$title = $locale['414'];
$message = "<b>".$locale['415']."</b>";
} elseif ($status == "delf2") {
$title = $locale['414'];
$message = "<b>".$locale['416']."</b><br>\n".$locale['417'];
}
opentable($title);
echo "<div align='center'>".$message."</div>\n";
closetable();
tablebreak();
}
if (isset($_POST['save_cat'])) {
$cat_name = stripinput($_POST['cat_name']);
if ($action == "edit" && $t == "cat") {
$result = dbquery("UPDATE ".$db_prefix."forums SET forum_name='$forum_name', forum_cat='$forum_cat', forum_description='$forum_description', forum_access='$forum_access', forum_posting='$forum_posting', info='$info' WHERE forum_id='$forum_id'");
redirect(FUSION_SELF.$aidlink."&status=savece");
} else {
if ($cat_name != "") {
$cat_order = isNum($_POST['cat_order']) ? $_POST['cat_order'] : "";
if(!$cat_order) $cat_order=dbresult(dbquery("SELECT MAX(forum_order) FROM ".$db_prefix."forums WHERE forum_cat='0'"),0)+1;
$result = dbquery("UPDATE ".$db_prefix."forums SET forum_order=forum_order+1 WHERE forum_cat='0' AND forum_order>='$cat_order'");
$result = dbquery("INSERT INTO ".$db_prefix."forums (forum_cat, forum_name, forum_order, forum_description, forum_moderators, forum_access, forum_posting, forum_reply, forum_edit, forum_delete, forum_lastpost, forum_lastuser, forum_sub, forum_icon, info) VALUES ('$forum_cat', '$forum_name', '$forum_order', '$forum_description', '$forum_mods', '$forum_access', '$forum_posting', '$forum_reply', '$forum_edit', '$forum_delete', '0', '0', '$forum_sub', '$forum_icon', '$info')");
}
redirect(FUSION_SELF.$aidlink."&status=savecu");
}
} elseif (isset($_POST['save_forum'])) {
$forum_name = stripinput($_POST['forum_name']);
$forum_description = stripinput($_POST['forum_description']);
$forum_cat = isNum($_POST['forum_cat']) ? $_POST['forum_cat'] : "";
$forum_access = $_POST['forum_access'];
$forum_posting = $_POST['forum_posting'];
$info = $_POST['info'];
$forum_reply = $_POST['forum_reply'];
$forum_edit = (isNum($_POST['forum_edit']) ? $_POST['forum_edit'] : "1");
$forum_delete = (isNum($_POST['forum_delete']) ? $_POST['forum_delete'] : "1");
$forum_icon = $_POST['forum_icon'];
$forum_sub = $_POST['forum_sub'];
if ($action == "edit" && $t == "forum") {
$result = dbquery("UPDATE ".$db_prefix."forums SET forum_name='$forum_name', forum_cat='$forum_cat', forum_description='$forum_description', forum_access='$forum_access', forum_posting='$forum_posting', forum_reply='$forum_reply', forum_edit='$forum_edit', forum_delete='$forum_delete', forum_icon='$forum_icon', forum_sub='$forum_sub' WHERE forum_id='$forum_id'");
redirect(FUSION_SELF.$aidlink."&status=savefe");
} else {
if ($forum_name != "") {
$forum_mods = "";
$result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_level='102'");
while ($data = dbarray($result)) {
$forum_mods .= $data['user_id'];
if ($i < dbrows($result)) $forum_mods .= ".";
$i++;
}
$forum_order = isNum($_POST['forum_order']) ? $_POST['forum_order'] : "";
if(!$forum_order) $forum_order=dbresult(dbquery("SELECT MAX(forum_order) FROM ".$db_prefix."forums WHERE forum_cat='$forum_cat'"),0)+1;
$result = dbquery("UPDATE ".$db_prefix."forums SET forum_order=forum_order+1 WHERE forum_cat='$forum_cat' AND forum_order>='$forum_order'");
$result = dbquery("INSERT INTO ".$db_prefix."forums (forum_cat, forum_name, forum_order, forum_description, forum_moderators, forum_access, forum_posting, forum_reply, forum_edit, forum_delete, forum_lastpost, forum_lastuser, forum_sub, forum_icon) VALUES ('$forum_cat', '$forum_name', '$forum_order', '$forum_description', '$forum_mods', '$forum_access', '$forum_posting', '$forum_reply', '$forum_edit', '$forum_delete', '0', '0', '$forum_sub', '$forum_icon')");
}
redirect(FUSION_SELF.$aidlink."&status=savefu");
}
} elseif (isset($_POST['save_forum_mods'])) {
$forum_mods = $_POST['forum_mods'];
$result = dbquery("UPDATE ".$db_prefix."forums SET forum_moderators='$forum_mods' WHERE forum_id='".$_POST['forum_id']."'");
redirect(FUSION_SELF.$aidlink."&status=savefm");
} elseif ($action == "moveup") {
if ($t == "cat") {
$data = dbarray(dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_cat='0' AND forum_order='$order'"));
$result = dbquery("UPDATE ".$db_prefix."forums SET forum_order=forum_order+1 WHERE forum_id='".$data['forum_id']."'");
$result = dbquery("UPDATE ".$db_prefix."forums SET forum_order=forum_order-1 WHERE forum_id='$forum_id'");
} elseif ($t == "forum") {
$data = dbarray(dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_cat='$cat' AND forum_order='$order'"));
$result = dbquery("UPDATE ".$db_prefix."forums SET forum_order=forum_order+1 WHERE forum_id='".$data['forum_id']."'");
$result = dbquery("UPDATE ".$db_prefix."forums SET forum_order=forum_order-1 WHERE forum_id='$forum_id'");
}
redirect(FUSION_SELF.$aidlink);
} elseif ($action == "movedown") {
if ($t == "cat") {
$data = dbarray(dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_cat='0' AND forum_order='$order'"));
$result = dbquery("UPDATE ".$db_prefix."forums SET forum_order=forum_order-1 WHERE forum_id='".$data['forum_id']."'");
$result = dbquery("UPDATE ".$db_prefix."forums SET forum_order=forum_order+1 WHERE forum_id='$forum_id'");
} elseif ($t == "forum") {
$data = dbarray(dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_cat='$cat' AND forum_order='$order'"));
$result = dbquery("UPDATE ".$db_prefix."forums SET forum_order=forum_order-1 WHERE forum_id='".$data['forum_id']."'");
$result = dbquery("UPDATE ".$db_prefix."forums SET forum_order=forum_order+1 WHERE forum_id='$forum_id'");
}
redirect(FUSION_SELF.$aidlink);
} elseif ($action == "delete" && $t == "cat") {
if (dbcount("(*)", "forums", "forum_cat='$forum_id'") == 0) {
$data = dbarray(dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_id='$forum_id'"));
$result = dbquery("UPDATE ".$db_prefix."forums SET forum_order=forum_order-1 WHERE forum_cat='0' AND forum_order>'".$data['forum_order']."'");
$result = dbquery("DELETE FROM ".$db_prefix."forums WHERE forum_id='$forum_id'");
redirect(FUSION_SELF.$aidlink."&status=delc1");
} else {
redirect(FUSION_SELF.$aidlink."&status=delc2");
}
} elseif ($action == "delete" && $t == "forum") {
if (dbcount("(*)", "posts", "forum_id='$forum_id'") == 0) {
$data = dbarray(dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_id='$forum_id'"));
$result = dbquery("UPDATE ".$db_prefix."forums SET forum_order=forum_order-1 WHERE forum_cat='".$data['forum_cat']."' AND forum_order>'".$data['forum_order']."'");
$result = dbquery("DELETE FROM ".$db_prefix."forums WHERE forum_id='$forum_id'");
redirect(FUSION_SELF.$aidlink."&status=delf1");
} else {
redirect(FUSION_SELF.$aidlink."&status=delf2");
}
} else {
if ($action == "edit") {
if ($t == "cat") {
$result = dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_id='$forum_id'");
$data = dbarray($result);
$cat_name = $data['forum_name'];
$cat_title = $locale['420'];
$cat_action = FUSION_SELF.$aidlink."&action=edit&forum_id=".$data['forum_id']."&t=cat";
$forum_title = $locale['421'];
$forum_action = FUSION_SELF.$aidlink;
} elseif ($t == "forum") {
$result = dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_id='$forum_id'");
$data = dbarray($result);
$forum_name = $data['forum_name'];
$forum_description = $data['forum_description'];
$forum_cat = $data['forum_cat'];
$forum_access = $data['forum_access'];
$forum_posting = $data['forum_posting'];
$forum_reply = $data['forum_reply'];
$forum_edit = $data['forum_edit'];
$forum_delete = $data['forum_delete'];
$forum_title = $locale['422'];
$info = $data['info'];
$forum_icon = $data['forum_icon'];
$forum_sub = $data['forum_sub'];
$forum_action = FUSION_SELF.$aidlink."&action=edit&forum_id=".$data['forum_id']."&t=forum";
$cat_title = $locale['423'];
$cat_action = FUSION_SELF.$aidlink;
}
} else {
$cat_name = "";
$cat_order = "";
$cat_title = $locale['423'];
$cat_action = FUSION_SELF.$aidlink;
$forum_name = "";
$forum_name = "";
$info ="";
$forum_description = "";
$forum_cat = "";
$forum_order = "";
$forum_access = "";
$forum_posting = "";
$forum_reply = "";
$forum_edit = "";
$forum_delete = "";
$forum_sub = "";
$forum_title = $locale['421'];
$forum_icon = "";
$forum_action = FUSION_SELF.$aidlink;
}
if ($t != "forum") {
opentable($cat_title);
echo "<form name='addcat' method='post' action='$cat_action'>
<table align='center' cellpadding='0' cellspacing='0' width='300'>
<tr>
<td class='tbl'>".$locale['440']."<br>
<input type='text' name='cat_name' value='$cat_name' class='textbox' style='width:230px;'></td>
<td width='50' class='tbl'>";
if ($action != "edit") {
echo $locale['441']."<br>
<input type='text' name='cat_order' value='$cat_order' class='textbox' style='width:45px;'></td>\n";
}
echo "</tr>
<tr>
<td align='center' colspan='2' class='tbl'>
<input type='submit' name='save_cat' value='".$locale['442']."' class='button'></td>
</tr>
</table>
</form>\n";
closetable();
}
if ($t == "") tablebreak();
if ($t != "cat") {
$cat_opts = ""; $sel = "";
$result2 = dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_cat='0' ORDER BY forum_order");
if (dbrows($result2) != 0) {
while ($data2 = dbarray($result2)) {
if ($action == "edit" && $t == "forum") $sel = ($data2['forum_id'] == $forum_cat ? " selected" : "");
$cat_opts .= "<option value='".$data2['forum_id']."'$sel>".$data2['forum_name']."</option>\n";
}
}
$user_groups = getusergroups(); $access_opts = "";
while(list($key, $user_group) = each($user_groups)){
$sel = ($forum_access == $user_group['0'] ? " selected" : "");
$access_opts .= "<option value='".$user_group['0']."'$sel>".$user_group['1']."</option>\n";
}
$post_groups = getusergroups(); $posting_opts = "";
while(list($key, $user_group) = each($post_groups)){
if ($user_group['0'] != "0") {
$sel = ($forum_posting == $user_group['0'] ? " selected" : "");
$posting_opts .= "<option value='".$user_group['0']."'$sel>".$user_group['1']."</option>\n";
}
}
$reply_groups = getusergroups(); $reply_opts="";
while(list($key, $user_group) = each($reply_groups)){
if ($user_group['0'] != "0") {
$sel = ($forum_reply == $user_group['0'] ? " selected" : "");
$reply_opts .= "<option value='".$user_group['0']."'$sel>".$user_group['1']."</option>\n";
}
}
opentable($forum_title);
echo "<form name='addforum' method='post' action='$forum_action'>
<table align='center' cellpadding='0' cellspacing='0' width='300'>
<tr>
<td colspan='2' class='tbl'>".$locale['460']."<br>
<input type='text' name='forum_name' value='$forum_name' class='textbox' style='width:285px;'></td>
</tr>
<tr>
<td colspan='2' class='tbl'>Informacja:<br>
<textarea name='info' rows='2' class='textbox' style='width:285px;'>$info</textarea></td>
</tr>
<tr>
<td colspan='2' class='tbl'>".$locale['461']."<br>
<textarea name='forum_description' rows='2' class='textbox' style='width:285px;'>$forum_description</textarea></td>
</tr>
<tr>
<td class='tbl'>".$locale['462']."<br>
<select name='forum_cat' class='textbox' style='width:225px;'>
$cat_opts</select></td>
<td width='55' class='tbl'>";
if ($action != "edit") {
echo $locale['463']."<br>
<input type='text' name='forum_order' value='$forum_order' class='textbox' style='width:45px;'></td>\n";
}
echo "</tr>
<tr>
<td colspan='2' class='tbl'>".$locale['464']."<br>
<select name='forum_access' class='textbox' style='width:225px;'>
$access_opts</select></td>
</tr>
<tr>
<td colspan='2' class='tbl'>".$locale['465']."<br>
<select name='forum_posting' class='textbox' style='width:225px;'>
$posting_opts</select></td>
</tr>
<tr>
<td colspan='2' class='tbl'>".$locale['468']."<br>
<select name='forum_reply' class='textbox' style='width:225px;'>
$reply_opts</select></td>
</tr>
<tr>
<td colspan='2' class='tbl'>".$locale['469']."<br>
<select name='forum_edit' class='textbox'>
<option value='1'".($forum_edit == "1" ? " selected" : "").">".$locale['471']."</option>
<option value='0'".($forum_edit == "0" ? " selected" : "").">".$locale['472']."</option>
</select></td>
</tr>
<tr>
<td colspan='2' class='tbl'>".$locale['470']."<br>
<select name='forum_delete' class='textbox'>
<option value='1'".($forum_delete == "1" ? " selected" : "").">".$locale['471']."</option>
<option value='0'".($forum_delete == "0" ? " selected" : "").">".$locale['472']."</option>
</select></td>
</tr>
<tr>
<td colspan='2' class='tbl'>".$locale['fba_101']."<br>
<select name='forum_icon' class='textbox' style='width:225px;'>";
echo "<option value=''".($forum_icon == "" ? " SELECTED" : "").">---</option>";
echo makefileopts(makefilelist(IMAGES."icons/", ".|..|index.php|Thumbs.db"), ($forum_icon ? $forum_icon : ""));
echo "</select></td>
</tr>
<tr>
<td colspan='2' class='tbl'>".$locale['fba_102']."<br>
<select name='forum_sub' class='textbox' style='width:225px;'>
<option value='0'".($forum_sub == "0" ? " SELECTED" : "").">---</option>";
$forums = dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_sub = '0' AND forum_cat != '0'");
while($forumData = dbarray($forums)){
echo "<option value='".$forumData['forum_id']."'".($forumData['forum_id'] == $forum_sub ? " SELECTED" : "").">".$forumData['forum_name']."</option>";
}
echo "</select></td>
</tr>
<tr>
<td align='center' colspan='2' class='tbl'>
<input type='submit' name='save_forum' value='".$locale['466']."' class='button'></td>
</tr>
</table>
</form>\n";
closetable();
if ($action == "edit" && $t == "forum") {
tablebreak();
opentable($locale['408']);
$result = dbquery("SELECT user_id,user_name FROM ".$db_prefix."users ORDER BY user_level DESC, user_name");
while ($data2 = dbarray($result)) {
$user_id = $data2['user_id'];
if (!preg_match("(^{$user_id}$|^{$user_id}\.|\.{$user_id}\.|\.{$user_id}$)", $data['forum_moderators'])) {
$mods1_user_id[] = $data2['user_id'];
$mods1_user_name[] = $data2['user_name'];
} else {
$mods2_user_id[] = $data2['user_id'];
$mods2_user_name[] = $data2['user_name'];
}
unset($user_id);
}
echo "<form name='modsform' method='post' action='".FUSION_SELF.$aidlink."'>
<table align='center' cellpadding='0' cellspacing='0' class='tbl'>
<tr>
<td>
<select multiple size='15' name='modlist1' id='modlist1' class='textbox' style='width:150' onChange=\"addUser('modlist2','modlist1');\">\n";
for ($i=0;$i < count($mods1_user_id);$i++) echo "<option value='".$mods1_user_id[$i]."'>".$mods1_user_name[$i]."</option>\n";
echo "</select>
</td>
<td align='center' valign='middle'>
</td>
<td>
<select multiple size='15' name='modlist2' id='modlist2' class='textbox' style='width:150' onChange=\"addUser('modlist1','modlist2');\">\n";
for ($i=0;$i < count($mods2_user_id);$i++) echo "<option value='".$mods2_user_id[$i]."'>".$mods2_user_name[$i]."</option>\n";
echo "</select>
</td>
</tr>
<tr>
<td align='center' colspan='3'><br>
<input type='hidden' name='forum_mods'>
<input type='hidden' name='forum_id' value='".$data['forum_id']."'>
<input type='hidden' name='save_forum_mods'>
<input type='button' name='update' value='".$locale['467']."' class='button' onclick='saveMods();'></td>
</tr>
</table>
</form>\n";
closetable();
echo "<script type='text/javascript'>
function addUser(toGroup,fromGroup) {
var listLength = document.getElementById(toGroup).length;
var selItem = document.getElementById(fromGroup).selectedIndex;
var selText = document.getElementById(fromGroup).options[selItem].text;
var selValue = document.getElementById(fromGroup).options[selItem].value;
var i; var newItem = true;
for (i = 0; i < listLength; i++) {
if (document.getElementById(toGroup).options[i].text == selText) {
newItem = false; break;
}
}
if (newItem) {
document.getElementById(toGroup).options[listLength] = new Option(selText, selValue);
document.getElementById(fromGroup).options[selItem] = null;
}
}
function saveMods() {
var strValues = \"\";
var boxLength = document.getElementById('modlist2').length;
var count = 0;
if (boxLength != 0) {
for (i = 0; i < boxLength; i++) {
if (count == 0) {
strValues = document.getElementById('modlist2').options[i].value;
} else {
strValues = strValues + \".\" + document.getElementById('modlist2').options[i].value;
}
count++;
}
}
if (strValues.length == 0) {
document.forms['modsform'].submit();
} else {
document.forms['modsform'].forum_mods.value = strValues;
document.forms['modsform'].submit();
}
}
</script>\n";
}
}
tablebreak();
opentable($locale['480']);
$forums_defined = false;
$forum = "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n";
$result = dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_cat='0' ORDER BY forum_order");
if (dbrows($result) != 0) {
$forums_defined = true;
$forum .= "<tr>\n<td class='tbl2'><b>".$locale['485']."</b></td>
<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><b>".$locale['486']."</b></td>
<td align='center' colspan='2' width='1%' class='tbl2' style='white-space:nowrap'><b>".$locale['487']."</b></td>
<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><b>".$locale['488']."</b></td>
</tr>\n";
$i = 1;
while ($data = dbarray($result)) {
$forum .= "<tr>
<td class='tbl2' colspan='2'>".$data['forum_name']."</td>
<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>".$data['forum_order']."</td>
<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>\n";
if (dbrows($result) != 1) {
$up = $data['forum_order'] - 1;
$down = $data['forum_order'] + 1;
if ($i == 1) {
$forum .= "<a href='".FUSION_SELF.$aidlink."&action=movedown&order=$down&forum_id=".$data['forum_id']."&t=cat'><img src='".THEME."images/down.gif' alt='".$locale['490']."' title='".$locale['492']."' style='border:0px;'></a>\n";
} elseif ($i < dbrows($result)) {
$forum .= "<a href='".FUSION_SELF.$aidlink."&action=moveup&order=$up&forum_id=".$data['forum_id']."&t=cat'><img src='".THEME."images/up.gif' alt='".$locale['489']."' title='".$locale['491']."' style='border:0px;'></a>\n";
$forum .= "<a href='".FUSION_SELF.$aidlink."&action=movedown&order=$down&forum_id=".$data['forum_id']."&t=cat'><img src='".THEME."images/down.gif' alt='".$locale['490']."' title='".$locale['492']."' style='border:0px;'></a>\n";
} else {
$forum .= "<a href='".FUSION_SELF.$aidlink."&action=moveup&order=$up&forum_id=".$data['forum_id']."&t=cat'><img src='".THEME."images/up.gif' alt='".$locale['489']."' title='".$locale['491']."' style='border:0px;'></a>\n";
}
}
$i++;
$forum .= "</td>
<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><a href='".FUSION_SELF.$aidlink."&action=edit&forum_id=".$data['forum_id']."&t=cat'>".$locale['481']."</a> -
<a href='".FUSION_SELF.$aidlink."&action=delete&forum_id=".$data['forum_id']."&t=cat'>".$locale['482']."</a></td>
</tr>\n";
$result2 = dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_cat='".$data['forum_id']."' ORDER BY forum_order");
if (dbrows($result2) != 0) {
$k = 1;
while ($data2 = dbarray($result2)) {
$forum .= "<tr>
<td class='tbl1'><span class='alt'>".$data2['forum_name']."</span><br>
<span class='small'>".$data2['forum_description']."</span></td>
<td align='center' width='1%' class='tbl1' style='white-space:nowrap'>".getgroupname($data2['forum_access'])."<br>
<span class='small2'>".getgroupname($data2['forum_posting'])."</span><br>
<span class='small2'>".getgroupname($data2['forum_reply'])."</span></td>
<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>".$data2['forum_order']."</td>
<td align='center' width='1%' class='tbl1' style='white-space:nowrap'>\n";
if (dbrows($result2) != 1) {
$up = $data2['forum_order'] - 1;
$down = $data2['forum_order'] + 1;
if ($k == 1) {
$forum .= "<a href='".FUSION_SELF.$aidlink."&action=movedown&order=$down&forum_id=".$data2['forum_id']."&t=forum&cat=".$data2['forum_cat']."'><img src='".THEME."images/down.gif' alt='".$locale['490']."' title='".$locale['492']."' style='border:0px;'></a>\n";
} elseif ($k < dbrows($result2)) {
$forum .= "<a href='".FUSION_SELF.$aidlink."&action=moveup&order=$up&forum_id=".$data2['forum_id']."&t=forum&cat=".$data2['forum_cat']."'><img src='".THEME."images/up.gif' alt='".$locale['489']."' title='".$locale['491']."' style='border:0px;'></a>\n";
$forum .= "<a href='".FUSION_SELF.$aidlink."&action=movedown&order=$down&forum_id=".$data2['forum_id']."&t=forum&cat=".$data2['forum_cat']."'><img src='".THEME."images/down.gif' alt='".$locale['490']."' title='".$locale['492']."' style='border:0px;'></a>\n";
} else {
$forum .= "<a href='".FUSION_SELF.$aidlink."&action=moveup&order=$up&forum_id=".$data2['forum_id']."&t=forum&cat=".$data2['forum_cat']."'><img src='".THEME."images/up.gif' alt='".$locale['489']."' title='".$locale['491']."' style='border:0px;'></a>\n";
}
}
$k++;
$forum .= "</td>
<td align='center' width='1%' class='tbl1' style='white-space:nowrap'><a href='".FUSION_SELF.$aidlink."&action=edit&forum_id=".$data2['forum_id']."&t=forum'>".$locale['481']."</a> -
<a href='".FUSION_SELF.$aidlink."&action=delete&forum_id=".$data2['forum_id']."&t=forum'>".$locale['482']."</a></td>
</tr>\n";
}
} else {
$forum .= "<tr>\n<td align='center' colspan='5' class='tbl1'>".$locale['483']."</td>\n</tr>\n";
}
}
} else {
$forum .= "<tr>\n<td align='center' class='tbl1'>".$locale['484']."</td>\n</tr>\n";
}
echo $forum;
if ($forums_defined) echo "<tr>\n<td align='center' colspan='5' class='tbl1'>[ <a href='".FUSION_SELF.$aidlink."&action=refresh'>".$locale['493']."</a> ]</td>\n</tr>\n";
echo "</table>\n";
closetable();
}
echo "</td>\n";
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";
include LOCALE.LOCALESET."fusionboard.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);
if (!checkgroup($data['forum_access']) || !$data['forum_cat']) fallback("index.php");
} else {
fallback("index.php");
}
$can_post = checkgroup($data['forum_posting']);
$caption = $data['forum_cat_name']." | ".$data['forum_name'];
$subForums = dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_sub='$forum_id'");
if(dbrows($subForums)){
opentable($locale['fb_j104']);
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='3' 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 = "";
$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' AND f.forum_sub='$forum_id' GROUP BY forum_id ORDER BY f2.forum_order ASC, f.forum_order ASC"
);
while ($data = dbarray($result)) {
$moderators = "";
if ($data['forum_moderators']) {
$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'>
".($data['forum_icon'] == "" ? "<img src='".IMAGES."icons/folder.png' alt=''>" : "<img src='".IMAGES."icons/".$data['forum_icon']."' alt=''>")."
</td><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";
}
}
echo "</table>
</td>
</tr>
</table>";
closetable();
tablebreak();
}
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) {
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%'>
";
if ($data['info'] != "") {
echo "<tr>
<td width='20' class='tbl2'>Info</td><td class='tbl2' colspan='5'>".$data['info']."</td>
</tr>";
}
echo "
<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 = "";
$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"
);
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) {
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";
?>
Dzieki serdeczne za pomoc. |