|
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 26.10.2025 21:59:33
|
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
|
| |
|