Kategorie forum w oddzielnych panelach środkowych
|
Szapko |
Dodany dnia 27.12.2009 20:58:55
|
Bywalec
Postów: 888 Pomógł: 66
Data rejestracji: 19.08.2007 19:49
|
Witam!
Chciałem sobie zrobić stronę główną mojego forum żeby wyglądało jak na PHPBB, ale gdzieś jest niedomknięty jakiś znacznik, bo panel wjeżdża na inne i sięga aż do końca strony.
Przykład: http://forum.stre.../index.php
Wydaje mi się, że błąd leży gdzieś w tych liniach, ale sam już nic z tym nie dam rady zrobić:
if (dbrows($result) != 0) {
while ($data = dbarray($result)) {
if ($data['forum_cat_name'] != $current_cat) {
$current_cat = $data['forum_cat_name'];
openforum($data['forum_cat_name']);
echo "\n<!--pre_forum_idx--><table cellpadding='0' cellspacing='0' width='100%'>\n<tr height='20'>\n";
echo "<td colspan='3'>Forum dyskusyjne</td>\n";
echo "<td align='center' >Tematy</td>\n";
echo "<td align='center'>Posty</td>\n";
echo "<td>Ostatni post</td>\n";
echo "</tr>\n";
}
$moderators = "";
if ($data['forum_moderators']) {
$mod_groups = explode(".", $data['forum_moderators']);
foreach ($mod_groups as $mod_group) {
if ($moderators) $moderators .= ", ";
$moderators .= $mod_group<101 ? "<a href='".BASEDIR."profile.php?group_id=".$mod_group."'>".getgroupname($mod_group)."</a>" : getgroupname($mod_group);
}
}
$forum_match = "\|".$data['forum_lastpost']."\|".$data['forum_id'];
if ($data['forum_lastpost'] > $lastvisited) {
if (iMEMBER && preg_match("({$forum_match}\.|{$forum_match}$)", $userdata['user_threads'])) {
$fim = "<img src='".get_image("folder")."' alt='".$locale['561']."' />";
} else {
$fim = "<img src='".get_image("foldernew")."' alt='".$locale['560']."' />";
}
} else {
$fim = "<img src='".get_image("folder")."' alt='".$locale['561']."' />";
}
echo "<tr>\n";
echo "<td class='kt'></td>\n";
echo "<td class='kt2'>$fim</td>\n";
echo "<td class='kt3'><!--forum_name--><a href='viewforum.php?forum_id=".$data['forum_id']."'>".$data['forum_name']."</a><br />\n";
if ($data['forum_description']) {
echo "<span class='small'>".$data['forum_description']."</span>\n";
}
echo "</td>\n";
echo "<td class='kt4'>".$data['forum_threadcount']."</td>\n";
echo "<td class='kt5'>".$data['forum_postcount']."</td>\n";
echo "<td class='kt6'>";
if ($data['forum_lastpost'] == 0) {
echo $locale['405'];
} else {
echo showdate("forumdate", $data['forum_lastpost'])."<br />\n";
echo "<span class='small'>".$locale['406']."<a href='".BASEDIR."profile.php?lookup=".$data['forum_lastuser']."'>".$data['user_name']."</a></span>";
}
echo "</td>\n</tr>\n";
}
echo "</table>\n";
} else {
echo "".$locale['407']."";
}
closeforum();
Jak wstawiam za tą częścią zamknięcie TD,TR,TABLE to panele pod kategoriami forum działają tak jak trzeba, ale nadal nie mogę dojść co zrobić z resztą.
Cały kod:
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fu...
+--------------------------------------------------------+
| Filename: index.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 THEMES."templates/header.php";
include LOCALE.LOCALESET."forum/main.php";
if (!isset($lastvisited) || !isnum($lastvisited)) { $lastvisited = time(); }
add_to_title($locale['global_200'].$locale['400']);
$forum_list = ""; $current_cat = "";
$result = dbquery(
"SELECT f.*, f2.forum_name AS forum_cat_name, u.user_id, u.user_name
FROM ".DB_FORUMS." f
LEFT JOIN ".DB_FORUMS." f2 ON f.forum_cat = f2.forum_id
LEFT JOIN ".DB_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"
);
if (dbrows($result) != 0) {
while ($data = dbarray($result)) {
if ($data['forum_cat_name'] != $current_cat) {
$current_cat = $data['forum_cat_name'];
openforum($data['forum_cat_name']);
echo "\n<!--pre_forum_idx--><table cellpadding='0' cellspacing='0' width='100%'>\n<tr height='20'>\n";
echo "<td colspan='3'>Forum dyskusyjne</td>\n";
echo "<td align='center' >Tematy</td>\n";
echo "<td align='center'>Posty</td>\n";
echo "<td>Ostatni post</td>\n";
echo "</tr>\n";
}
$moderators = "";
if ($data['forum_moderators']) {
$mod_groups = explode(".", $data['forum_moderators']);
foreach ($mod_groups as $mod_group) {
if ($moderators) $moderators .= ", ";
$moderators .= $mod_group<101 ? "<a href='".BASEDIR."profile.php?group_id=".$mod_group."'>".getgroupname($mod_group)."</a>" : getgroupname($mod_group);
}
}
$forum_match = "\|".$data['forum_lastpost']."\|".$data['forum_id'];
if ($data['forum_lastpost'] > $lastvisited) {
if (iMEMBER && preg_match("({$forum_match}\.|{$forum_match}$)", $userdata['user_threads'])) {
$fim = "<img src='".get_image("folder")."' alt='".$locale['561']."' />";
} else {
$fim = "<img src='".get_image("foldernew")."' alt='".$locale['560']."' />";
}
} else {
$fim = "<img src='".get_image("folder")."' alt='".$locale['561']."' />";
}
echo "<tr>\n";
echo "<td class='kt'></td>\n";
echo "<td class='kt2'>$fim</td>\n";
echo "<td class='kt3'><!--forum_name--><a href='viewforum.php?forum_id=".$data['forum_id']."'>".$data['forum_name']."</a><br />\n";
if ($data['forum_description']) {
echo "<span class='small'>".$data['forum_description']."</span>\n";
}
echo "</td>\n";
echo "<td class='kt4'>".$data['forum_threadcount']."</td>\n";
echo "<td class='kt5'>".$data['forum_postcount']."</td>\n";
echo "<td class='kt6'>";
if ($data['forum_lastpost'] == 0) {
echo $locale['405'];
} else {
echo showdate("forumdate", $data['forum_lastpost'])."<br />\n";
echo "<span class='small'>".$locale['406']."<a href='".BASEDIR."profile.php?lookup=".$data['forum_lastuser']."'>".$data['user_name']."</a></span>";
}
echo "</td>\n</tr>\n";
}
echo "</table>\n";
} else {
echo "".$locale['407']."";
}
closeforum();
openforum("Informacje");
echo "<br /><table cellpadding='0' cellspacing='0' width='50%' align='left'>\n<tr>\n";
echo "<td>\n";
$result = dbquery("SELECT * FROM ".DB_ONLINE." WHERE online_user=".($userdata['user_level'] != 0 ? "'".$userdata['user_id']."'" : "'0' AND online_ip='".USER_IP."'"));
if (dbrows($result)) {
$result = dbquery("UPDATE ".DB_ONLINE." SET online_lastactive='".time()."' WHERE online_user=".($userdata['user_level'] != 0 ? "'".$userdata['user_id']."'" : "'0' AND online_ip='".USER_IP."'")."");
} else {
$result = dbquery("INSERT INTO ".DB_ONLINE." (online_user, online_ip, online_lastactive) VALUES ('".($userdata['user_level'] != 0 ? $userdata['user_id'] : "0")."', '".USER_IP."', '".time()."')");
}
$result = dbquery("DELETE FROM ".DB_ONLINE." WHERE online_lastactive<".(time()-60)."");
$result = dbquery("SELECT ton.*, tu.user_id,user_name FROM ".DB_ONLINE." ton LEFT JOIN ".DB_USERS." tu ON ton.online_user=tu.user_id");
$guests = 0;
$members = array();
while ($data = dbarray($result)) {
if ($data['online_user'] == "0") {
$guests++;
} else {
array_push($members, array($data['user_id'], $data['user_name']));
}
}
$razem_online = count($members) + $guests;
$userow = count($members);
echo "Obecnie na forum przebywa <strong>".$razem_online."</strong>\n";
if ($razem_online = 0) { echo "uĹĽytkownikĂłw\n"; } elseif ($razem_online = 1) { echo "uĹĽytkownik\n"; } elseif ($razem_online > 1) { echo "uĹĽytkownikĂłw\n"; }
echo ":: ".count($members)."\n";
if ($userow = 0) { echo "zalogowanych userĂłw\n"; } elseif ($userow = 1) { echo "zalogowany user\n"; } elseif ($userow > 1) { echo "zalogowanych userĂłw\n"; }
echo "i ".$guests."\n";
if ($guests < 1) { echo "gości<br />"; } elseif ($guests = 1) { echo "gość<br />"; } elseif ($guests > 1) { echo "gości<br />"; }
echo "Zalogowani userzy:\n";
if (count($members)) {
$i = 1;
while (list($key, $member) = each($members)) {
echo "<a href='".BASEDIR."profile.php?lookup=".$member[0]."'>".$member[1]."</a>";
if ($i != count($members)) { echo ",\n"; } else { echo "<p>\n"; }
$i++;
}
}
$all = dbcount("(online_user)", DB_ONLINE, "online_user!=''");
if($all > $settings['nu']) $result = dbquery("UPDATE ".DB_SETTINGS." SET nu='".$all."', nub='".time()."'");
$settings2 = dbarray(dbquery("SELECT nu, nub FROM ".DB_SETTINGS.""));
echo "Najwięcej osób - <strong>".$settings2['nu']."</strong> - było dnia ".showdate('%d.%m.%Y',$settings2['nub'])."<p />";
$czas = time()- 60*60*24;
$ile = dbresult(dbquery("SELECT COUNT(user_id) FROM ".DB_USERS." WHERE user_lastvisit > '".$czas."' AND user_lastvisit != '0'"),0);
echo "Przez ostatnie 24h odwiedzili nas (<b>$ile</b>):\n";
$wynik = dbquery("SELECT * FROM ".DB_USERS." WHERE user_lastvisit > '".$czas."' AND user_lastvisit != '0'");
if(dbrows($wynik) > 0) {
while($r = dbarray($wynik)) {
echo "<a href='".BASEDIR."profile.php?lookup=".$r['user_id']."'>".$r['user_name']."</a>, ";
}
}
echo "<p />";
echo "Nasi uĹĽytkownicy napisali <b>".dbcount("(post_id)", DB_POSTS)."</b> postĂłw w <b>".dbcount("(thread_id)", DB_THREADS)."</b> tematach.<br />";
echo "Mamy <b>".number_format(dbcount("(user_id)", DB_USERS, "user_status<='1'"))."</b> zarejestrowanych uĹĽytkownikĂłw.<br />";
$data = dbarray(dbquery("SELECT user_id,user_name FROM ".DB_USERS." WHERE user_status='0' ORDER BY user_joined DESC LIMIT 0,1"));
echo "Najnowszy user: <a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a>.<br />";
echo "</td>\n</tr>\n</table>\n";
echo "<table cellpadding='0' cellspacing='0' width='50%' align='right'>\n<tr>\n";
echo "<td height='20'>\n";
echo "<img src='".get_image("foldernew")."' alt='".$locale['560']."' width='20' height='13' style='vertical-align:middle;' /> - nowe posty<br />\n";
echo "<img src='".get_image("folder")."' alt='".$locale['561']."' width='20' height='13' style='vertical-align:middle;' /> - brak nowych postów\n";
echo "</td><td height='20'>\n";
echo "<img src='".get_image("folderhot")."' alt='".$locale['561']."' width='20' height='13' style='vertical-align:middle;' /> - gorÄ…cy wÄ…tek<br />\n";
echo "<img src='".get_image("folderlock")."' alt='".$locale['561']."' width='20' height='13' style='vertical-align:middle;' /> - temat/dział zablokowany\n";
echo "</td>\n</tr>\n</table>\n";
closeforum();
openforum("Kalnedarz urodzin");
echo "<br />\n";
include('infusions/birthday_panel/birthday_panel.php');
closeforum();
require_once THEMES."templates/footer.php";
?> Kliknij i zaczekaj na załadowanie kodu ...
PW od moderatora:
- Odświeżenie Tematu - Pieka 27.12 - 20:58
|
|
|
|
Wścibski Gość |
Dodany dnia 25.11.2024 20:30:31
|
Pan Kontekstualny
Postów: n^x
Data rejestracji: Zawsze
|
|
IP: localhost |
|
|
diablo9983 |
Dodany dnia 27.12.2009 22:46:48
|
Przedszkolak
Postów: 39 Pomógł: 14
v7.02.07 Data rejestracji: 10.03.2007 17:22
|
W tej części:
} else {
echo showdate("forumdate", $data['forum_lastpost'])."<br />\n";
echo "<span class='small'>".$locale['406']."<a href='".BASEDIR."profile.php?lookup=".$data['forum_lastuser']."'>".$data['user_name']."</a></span>";
}
echo "</td>\n</tr>\n";
}
echo "</table>\n";
} else {
echo "".$locale['407']."";
}
closeforum();
Po </table> spróbuj wpisać drugie </table>.
Jak wkleiłem kod na swoja stronę, cała się rozsypała, dopisałem znacznik i wygląd powrócił do normy.
Pozdrawiam Diablo9983
Edytowane przez diablo9983 dnia 27.12.2009 22:47:48
|
|
|
|
Szapko |
Dodany dnia 27.12.2009 23:25:35
|
Bywalec
Postów: 888 Pomógł: 66
Data rejestracji: 19.08.2007 19:49
|
Niestety to nie pomogło do końca.
Wstawiłem po tym table to:
echo "</td>\n</tr>\n</table>\n";
echo "</td>\n</tr>\n</table>\n";
i teraz poprawnie wyglądają jedynie panele, które są pod kategoriami forum.
Wiadomość doklejona:
Problem leży w 99% po stronie:
closeforum();
Uważam tak, bo pod funkcją, która wywołuje trzy rozpoczęcia paneli do utworzonych trzech kategorii forum zakończa się tylko jedno. Problemu nie rozwiąże także wstawienie trzech closeforum(); pod tą funkcją, ponieważ kategorie nadal się pokrywają, jedynie panele pod forum wracają do normy. Problem leży w tym, że nie mam zielonego pojęcia jak wywołać funkcję, która zamknie otwarte panele w odpowiednim miejscu.
Wiadomość doklejona:
Wymyśliłem jedynie coś takiego, że w pliku index.php:
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: index.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 http://www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../maincore.php";
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."forum/main.php";
if (!isset($lastvisited) || !isnum($lastvisited)) { $lastvisited = time(); }
add_to_title($locale['global_200'].$locale['400']);
$forum_list = ""; $current_cat = "";
$result = dbquery(
"SELECT f.*, f2.forum_name AS forum_cat_name, u.user_id, u.user_name
FROM ".DB_FORUMS." f
LEFT JOIN ".DB_FORUMS." f2 ON f.forum_cat = f2.forum_id
LEFT JOIN ".DB_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"
);
if (dbrows($result) != 0) {
while ($data = dbarray($result)) {
if ($data['forum_cat_name'] != $current_cat) {
$current_cat = $data['forum_cat_name'];
openforum($data['forum_cat_name']);
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr height='20'>\n";
echo "<td colspan='3'>Forum dyskusyjne</td>\n";
echo "<td align='center' >Tematy</td>\n";
echo "<td align='center'>Posty</td>\n";
echo "<td>Ostatni post</td>\n";
echo "</tr>\n</table>\n";
include BASEDIR."category.php";
closeforum();
}
}
} else {
echo "".$locale['407']."";
}
openforum("Informacje");
echo "<br /><table cellpadding='0' cellspacing='0' width='50%' align='left'>\n<tr>\n";
echo "<td>\n";
$result = dbquery("SELECT * FROM ".DB_ONLINE." WHERE online_user=".($userdata['user_level'] != 0 ? "'".$userdata['user_id']."'" : "'0' AND online_ip='".USER_IP."'"));
if (dbrows($result)) {
$result = dbquery("UPDATE ".DB_ONLINE." SET online_lastactive='".time()."' WHERE online_user=".($userdata['user_level'] != 0 ? "'".$userdata['user_id']."'" : "'0' AND online_ip='".USER_IP."'")."");
} else {
$result = dbquery("INSERT INTO ".DB_ONLINE." (online_user, online_ip, online_lastactive) VALUES ('".($userdata['user_level'] != 0 ? $userdata['user_id'] : "0")."', '".USER_IP."', '".time()."')");
}
$result = dbquery("DELETE FROM ".DB_ONLINE." WHERE online_lastactive<".(time()-60)."");
$result = dbquery("SELECT ton.*, tu.user_id,user_name FROM ".DB_ONLINE." ton LEFT JOIN ".DB_USERS." tu ON ton.online_user=tu.user_id");
$guests = 0;
$members = array();
while ($data = dbarray($result)) {
if ($data['online_user'] == "0") {
$guests++;
} else {
array_push($members, array($data['user_id'], $data['user_name']));
}
}
$razem_online = count($members) + $guests;
$userow = count($members);
echo "Obecnie na forum przebywa <strong>".$razem_online."</strong>\n";
if ($razem_online = 0) { echo "uĹĽytkownikĂłw\n"; } elseif ($razem_online = 1) { echo "uĹĽytkownik\n"; } elseif ($razem_online > 1) { echo "uĹĽytkownikĂłw\n"; }
echo ":: ".count($members)."\n";
if ($userow = 0) { echo "zalogowanych userĂłw\n"; } elseif ($userow = 1) { echo "zalogowany user\n"; } elseif ($userow > 1) { echo "zalogowanych userĂłw\n"; }
echo "i ".$guests."\n";
if ($guests < 1) { echo "gości<br />"; } elseif ($guests = 1) { echo "gość<br />"; } elseif ($guests > 1) { echo "gości<br />"; }
echo "Zalogowani userzy:\n";
if (count($members)) {
$i = 1;
while (list($key, $member) = each($members)) {
echo "<a href='".BASEDIR."profile.php?lookup=".$member[0]."'>".$member[1]."</a>";
if ($i != count($members)) { echo ",\n"; } else { echo "<p>\n"; }
$i++;
}
}
$all = dbcount("(online_user)", DB_ONLINE, "online_user!=''");
if($all > $settings['nu']) $result = dbquery("UPDATE ".DB_SETTINGS." SET nu='".$all."', nub='".time()."'");
$settings2 = dbarray(dbquery("SELECT nu, nub FROM ".DB_SETTINGS.""));
echo "Najwięcej osób - <strong>".$settings2['nu']."</strong> - było dnia ".showdate('%d.%m.%Y',$settings2['nub'])."<p />";
$czas = time()- 60*60*24;
$ile = dbresult(dbquery("SELECT COUNT(user_id) FROM ".DB_USERS." WHERE user_lastvisit > '".$czas."' AND user_lastvisit != '0'"),0);
echo "Przez ostatnie 24h odwiedzili nas (<b>$ile</b>):\n";
$wynik = dbquery("SELECT * FROM ".DB_USERS." WHERE user_lastvisit > '".$czas."' AND user_lastvisit != '0'");
if(dbrows($wynik) > 0) {
while($r = dbarray($wynik)) {
echo "<a href='".BASEDIR."profile.php?lookup=".$r['user_id']."'>".$r['user_name']."</a>, ";
}
}
echo "<p />";
echo "Nasi uĹĽytkownicy napisali <b>".dbcount("(post_id)", DB_POSTS)."</b> postĂłw w <b>".dbcount("(thread_id)", DB_THREADS)."</b> tematach.<br />";
echo "Mamy <b>".number_format(dbcount("(user_id)", DB_USERS, "user_status<='1'"))."</b> zarejestrowanych uĹĽytkownikĂłw.<br />";
$data = dbarray(dbquery("SELECT user_id,user_name FROM ".DB_USERS." WHERE user_status='0' ORDER BY user_joined DESC LIMIT 0,1"));
echo "Najnowszy user: <a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a>.<br />";
echo "</td>\n</tr>\n</table>\n";
echo "<table cellpadding='0' cellspacing='0' width='50%' align='right'>\n<tr>\n";
echo "<td height='20'>\n";
echo "<img src='".get_image("foldernew")."' alt='".$locale['560']."' width='20' height='13' style='vertical-align:middle;' /> - nowe posty<br />\n";
echo "<img src='".get_image("folder")."' alt='".$locale['561']."' width='20' height='13' style='vertical-align:middle;' /> - brak nowych postów\n";
echo "</td><td height='20'>\n";
echo "<img src='".get_image("folderhot")."' alt='".$locale['561']."' width='20' height='13' style='vertical-align:middle;' /> - gorÄ…cy wÄ…tek<br />\n";
echo "<img src='".get_image("folderlock")."' alt='".$locale['561']."' width='20' height='13' style='vertical-align:middle;' /> - temat/dział zablokowany\n";
echo "</td>\n</tr>\n</table>\n";
closeforum();
openforum("Kalnedarz urodzin");
echo "<br />\n";
include('infusions/birthday_panel/birthday_panel.php');
closeforum();
require_once THEMES."templates/footer.php";
?>
includuje plik category.php:
<?php
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n";
$moderators = "";
if ($data['forum_moderators']) {
$mod_groups = explode(".", $data['forum_moderators']);
foreach ($mod_groups as $mod_group) {
if ($moderators) $moderators .= ", ";
$moderators .= $mod_group<101 ? "<a href='".BASEDIR."profile.php?group_id=".$mod_group."'>".getgroupname($mod_group)."</a>" : getgroupname($mod_group);
}
}
$forum_match = "\|".$data['forum_lastpost']."\|".$data['forum_id'];
if ($data['forum_lastpost'] > $lastvisited) {
if (iMEMBER && preg_match("({$forum_match}\.|{$forum_match}$)", $userdata['user_threads'])) {
$fim = "<img src='".get_image("folder")."' alt='".$locale['561']."' />";
} else {
$fim = "<img src='".get_image("foldernew")."' alt='".$locale['560']."' />";
}
} else {
$fim = "<img src='".get_image("folder")."' alt='".$locale['561']."' />";
}
echo "<tr>\n";
echo "<td class='kt'></td>\n";
echo "<td class='kt2'>$fim</td>\n";
echo "<td class='kt3'><!--forum_name--><a href='viewforum.php?forum_id=".$data['forum_id']."'>".$data['forum_name']."</a><br />\n";
if ($data['forum_description']) {
echo "<span class='small'>".$data['forum_description']."</span>\n";
}
echo "</td>\n";
echo "<td class='kt4'>".$data['forum_threadcount']."</td>\n";
echo "<td class='kt5'>".$data['forum_postcount']."</td>\n";
echo "<td class='kt6'>";
if ($data['forum_lastpost'] == 0) {
echo $locale['405'];
} else {
echo showdate("forumdate", $data['forum_lastpost'])."<br />\n";
echo "<span class='small'>".$locale['406']."<a href='".BASEDIR."profile.php?lookup=".$data['forum_lastuser']."'>".$data['user_name']."</a></span>";
}
echo "</td>\n</tr>\n";
echo "</table>\n";
?>
Lecz to stwarza nowy problem, który można zobaczyć na mojej stronie: http://forum.stre... Mianowicie nie wyświetla wszystkich działów, które są w danych kategoriach.
Edytowane przez Szapko dnia 27.12.2009 23:48:53
|
|
|
|
poki289 |
Dodany dnia 27.12.2009 23:56:56
|
Początkujący
Postów: 240 Pomógł: 33 Ostrzeżeń: 1
v7.02.07 Data rejestracji: 26.12.2009 05:49
|
Może temat Bartka coś pomoże. http://www.php-fu...d_id=19814
|
|
|
|
Szapko |
Dodany dnia 27.12.2009 23:59:44
|
Bywalec
Postów: 888 Pomógł: 66
Data rejestracji: 19.08.2007 19:49
|
Niestety efekt, który chcę osiągnąć wygląda tak: http://cs.strefa2.../index.php
A to nadal to samo, nadal w jednym panelu.
Wiadomość doklejona:
Udało się! :D
Jakby ktoś chciał skorzystać to potrzebny index.php:
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: index.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 http://www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../maincore.php";
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."forum/main.php";
if (!isset($lastvisited) || !isnum($lastvisited)) { $lastvisited = time(); }
add_to_title($locale['global_200'].$locale['400']);
$forum_list = ""; $current_cat = "";
$result = dbquery(
"SELECT f.*, f2.forum_name AS forum_cat_name
FROM ".DB_FORUMS." f
LEFT JOIN ".DB_FORUMS." f2 ON f.forum_cat = f2.forum_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"
);
if (dbrows($result) != 0) {
while ($data = dbarray($result)) {
if ($data['forum_cat_name'] != $current_cat) {
$current_cat = $data['forum_cat_name'];
openforum($data['forum_cat_name']);
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr height='20'>\n";
echo "<td colspan='3'>Forum dyskusyjne</td>\n";
echo "<td align='center' >Tematy</td>\n";
echo "<td align='center'>Posty</td>\n";
echo "<td>Ostatni post</td>\n";
echo "</tr>\n</table>\n";
include BASEDIR."category.php";
closeforum();
}
}
} else {
echo "".$locale['407']."";
}
openforum("Informacje");
echo "<br /><table cellpadding='0' cellspacing='0' width='50%' align='left'>\n<tr>\n";
echo "<td>\n";
$result = dbquery("SELECT * FROM ".DB_ONLINE." WHERE online_user=".($userdata['user_level'] != 0 ? "'".$userdata['user_id']."'" : "'0' AND online_ip='".USER_IP."'"));
if (dbrows($result)) {
$result = dbquery("UPDATE ".DB_ONLINE." SET online_lastactive='".time()."' WHERE online_user=".($userdata['user_level'] != 0 ? "'".$userdata['user_id']."'" : "'0' AND online_ip='".USER_IP."'")."");
} else {
$result = dbquery("INSERT INTO ".DB_ONLINE." (online_user, online_ip, online_lastactive) VALUES ('".($userdata['user_level'] != 0 ? $userdata['user_id'] : "0")."', '".USER_IP."', '".time()."')");
}
$result = dbquery("DELETE FROM ".DB_ONLINE." WHERE online_lastactive<".(time()-60)."");
$result = dbquery("SELECT ton.*, tu.user_id,user_name FROM ".DB_ONLINE." ton LEFT JOIN ".DB_USERS." tu ON ton.online_user=tu.user_id");
$guests = 0;
$members = array();
while ($data = dbarray($result)) {
if ($data['online_user'] == "0") {
$guests++;
} else {
array_push($members, array($data['user_id'], $data['user_name']));
}
}
$razem_online = count($members) + $guests;
$userow = count($members);
echo "Obecnie na forum przebywa <strong>".$razem_online."</strong>\n";
if ($razem_online = 0) { echo "uĹĽytkownikĂłw\n"; } elseif ($razem_online = 1) { echo "uĹĽytkownik\n"; } elseif ($razem_online > 1) { echo "uĹĽytkownikĂłw\n"; }
echo ":: ".count($members)."\n";
if ($userow = 0) { echo "zalogowanych userĂłw\n"; } elseif ($userow = 1) { echo "zalogowany user\n"; } elseif ($userow > 1) { echo "zalogowanych userĂłw\n"; }
echo "i ".$guests."\n";
if ($guests < 1) { echo "gości<br />"; } elseif ($guests = 1) { echo "gość<br />"; } elseif ($guests > 1) { echo "gości<br />"; }
echo "Zalogowani userzy:\n";
if (count($members)) {
$i = 1;
while (list($key, $member) = each($members)) {
echo "<a href='".BASEDIR."profile.php?lookup=".$member[0]."'>".$member[1]."</a>";
if ($i != count($members)) { echo ",\n"; } else { echo "<p>\n"; }
$i++;
}
}
$all = dbcount("(online_user)", DB_ONLINE, "online_user!=''");
if($all > $settings['nu']) $result = dbquery("UPDATE ".DB_SETTINGS." SET nu='".$all."', nub='".time()."'");
$settings2 = dbarray(dbquery("SELECT nu, nub FROM ".DB_SETTINGS.""));
echo "Najwięcej osób - <strong>".$settings2['nu']."</strong> - było dnia ".showdate('%d.%m.%Y',$settings2['nub'])."<p />";
$czas = time()- 60*60*24;
$ile = dbresult(dbquery("SELECT COUNT(user_id) FROM ".DB_USERS." WHERE user_lastvisit > '".$czas."' AND user_lastvisit != '0'"),0);
echo "Przez ostatnie 24h odwiedzili nas (<b>$ile</b>):\n";
$wynik = dbquery("SELECT * FROM ".DB_USERS." WHERE user_lastvisit > '".$czas."' AND user_lastvisit != '0'");
if(dbrows($wynik) > 0) {
while($r = dbarray($wynik)) {
echo "<a href='".BASEDIR."profile.php?lookup=".$r['user_id']."'>".$r['user_name']."</a>, ";
}
}
echo "<p />";
echo "Nasi uĹĽytkownicy napisali <b>".dbcount("(post_id)", DB_POSTS)."</b> postĂłw w <b>".dbcount("(thread_id)", DB_THREADS)."</b> tematach.<br />";
echo "Mamy <b>".number_format(dbcount("(user_id)", DB_USERS, "user_status<='1'"))."</b> zarejestrowanych uĹĽytkownikĂłw.<br />";
$data = dbarray(dbquery("SELECT user_id,user_name FROM ".DB_USERS." WHERE user_status='0' ORDER BY user_joined DESC LIMIT 0,1"));
echo "Najnowszy user: <a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a>.<br />";
echo "</td>\n</tr>\n</table>\n";
echo "<table cellpadding='0' cellspacing='0' width='50%' align='right'>\n<tr>\n";
echo "<td height='20'>\n";
echo "<img src='".get_image("foldernew")."' alt='".$locale['560']."' width='20' height='13' style='vertical-align:middle;' /> - nowe posty<br />\n";
echo "<img src='".get_image("folder")."' alt='".$locale['561']."' width='20' height='13' style='vertical-align:middle;' /> - brak nowych postów\n";
echo "</td><td height='20'>\n";
echo "<img src='".get_image("folderhot")."' alt='".$locale['561']."' width='20' height='13' style='vertical-align:middle;' /> - gorÄ…cy wÄ…tek<br />\n";
echo "<img src='".get_image("folderlock")."' alt='".$locale['561']."' width='20' height='13' style='vertical-align:middle;' /> - temat/dział zablokowany\n";
echo "</td>\n</tr>\n</table>\n";
closeforum();
openforum("Kalnedarz urodzin");
echo "<br />\n";
include('infusions/birthday_panel/birthday_panel.php');
closeforum();
require_once THEMES."templates/footer.php";
?>
Oraz plik category.php:
<?php
$result2 = dbquery(
"SELECT f.*, f2.forum_name AS forum_cat_name, u.user_id, u.user_name
FROM ".DB_FORUMS." f
LEFT JOIN ".DB_FORUMS." f2 ON f.forum_cat = f2.forum_id
LEFT JOIN ".DB_USERS." u ON f.forum_lastuser = u.user_id
WHERE f.forum_cat=".$data['forum_cat']." GROUP BY forum_id ORDER BY f2.forum_order ASC, f.forum_order ASC"
);
if (dbrows($result2) != 0) {
while ($data2 = dbarray($result2)) {
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n";
$moderators = "";
if ($data2['forum_moderators']) {
$mod_groups = explode(".", $data2['forum_moderators']);
foreach ($mod_groups as $mod_group) {
if ($moderators) $moderators .= ", ";
$moderators .= $mod_group<101 ? "<a href='".BASEDIR."profile.php?group_id=".$mod_group."'>".getgroupname($mod_group)."</a>" : getgroupname($mod_group);
}
}
$forum_match = "\|".$data2['forum_lastpost']."\|".$data2['forum_id'];
if ($data2['forum_lastpost'] > $lastvisited) {
if (iMEMBER && preg_match("({$forum_match}\.|{$forum_match}$)", $userdata['user_threads'])) {
$fim = "<img src='".get_image("folder")."' alt='".$locale['561']."' />";
} else {
$fim = "<img src='".get_image("foldernew")."' alt='".$locale['560']."' />";
}
} else {
$fim = "<img src='".get_image("folder")."' alt='".$locale['561']."' />";
}
echo "<tr>\n";
echo "<td class='kt'></td>\n";
echo "<td class='kt2'>$fim</td>\n";
echo "<td class='kt3'><!--forum_name--><a href='viewforum.php?forum_id=".$data2['forum_id']."'>".$data2['forum_name']."</a><br />\n";
if ($data2['forum_description']) {
echo "<span class='small'>".$data2['forum_description']."</span>\n";
}
echo "</td>\n";
echo "<td class='kt4'>".$data2['forum_threadcount']."</td>\n";
echo "<td class='kt5'>".$data2['forum_postcount']."</td>\n";
echo "<td class='kt6'>";
if ($data2['forum_lastpost'] == 0) {
echo $locale['405'];
} else {
echo showdate("forumdate", $data2['forum_lastpost'])."<br />\n";
echo "<span class='small'>".$locale['406']."<a href='".BASEDIR."profile.php?lookup=".$data2['forum_lastuser']."'>".$data2['user_name']."</a></span>";
}
echo "</td>\n</tr>\n";
echo "</table>\n";
}
}
?>
Trzeba pamiętać o zmianie openforum i closeforum na opentable i closetable i powinno śmigać.
Edytowane przez Szapko dnia 28.12.2009 00:19:08
|
|
|