%
if($amode=="ja"):
include ("../../scripts/kb/anmelden.html");
$thisadmin = mysql_fetch_array($result);
endif;
%>
KNOWLEDGE BASE
<%
########################################################
# Knowledgebase 1000 (c) Thomas.Tausend@2000-onLine.de #
########################################################
require("../../scripts/dbdetails.php");
$dbcode = mysql_connect($host,$user,$pw);
if(!$sort){$sort="cID";}
if(!$dbcode):
echo "Kein Kontakt zur Datenbank";
endif;
%>
<%
### include("header.htm");
# Als erstes listen wir 'mal die vorhandenen Topics mit Level X
if(!$level){$level=0;}
$query = "SELECT * FROM topics WHERE ID = $level";
$result = mysql_db_query($db,$query,$dbcode);
$headrow = mysql_fetch_array($result);
$query = "select ID, title, admin, subof, name, totopic, count(content.cID) as anzahl, date_format(max(content.updated), '%d.%m.%Y %H:%i:%s') as letzter from (topics LEFT JOIN content ON topics.ID = content.totopic) LEFT JOIN admins ON topics.admin=aID WHERE topics.subof=$level AND topics.free=0 GROUP BY topics.ID ORDER BY topics.ID";
$result = mysql_db_query($db,$query,$dbcode);
if(!$result):
echo "Konnte Abfrage nicht ausführen!";
else:
$num = mysql_num_rows($result);
endif;
if($suchtext):
$query = "select *, date_format(updated, '%d.%m.%Y') as datum from content WHERE (text like '%$suchtext%' OR headline like '%$suchtext%') ORDER BY $sort $direction";
elseif($alter):
$query = "select *, (to_days(now())-to_days(updated)) as tanz, date_format(updated, '%d.%m.%Y') as datum from content where (to_days(now())-to_days(updated)) <$alter order by tanz";
else:
$query = "select *, date_format(updated, '%d.%m.%Y') as datum from content WHERE totopic = $level ORDER BY $sort $direction";
endif;
$result = mysql_db_query($db,$query,$dbcode);
$canzahl= mysql_numrows($result);
if ($thisadmin["aID"]!=$headrow["admin"] AND $thisadmin["master"]!=1):
$amode="nein";
endif;
if($canzahl>0 OR $amode=="ja"):
%>
<% if($alter): %>
Hier die <% echo $canzahl; %> neuen Einträge der letzten <% echo $alter; %> Tage: