1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
|
<?php
$filename="artistdb.php";
require("./global.php");
if(!$wbbuserdata['userid']) access_error();
$lang->load("START,POSTINGS");
if(isset($_REQUEST['action'])) $action=$_REQUEST['action'];
else $action="start";
if(isset($_REQUEST['catid'])) $catid=$_REQUEST['catid'];
if(isset($_REQUEST['entryid'])) $entryid=$_REQUEST['entryid'];
if($action=="start") {
$getkats = $db->query("SELECT * FROM bb".$n."_adbkats WHERE type=0 ORDER BY title ASC");
while($krow = $db->fetch_array($getkats)) {
$title = $krow['title'];
eval ("\$bits .= \"".$tpl->get("artistdbcatbit")."\";");
$getskats = $db->query("SELECT * FROM bb".$n."_adbkats WHERE type=1 AND pcatid='$krow[catid]' ORDER BY title ASC");
while($skrow = $db->fetch_array($getskats)) {
$title = $skrow['title'];
$description = $skrow['description'];
$counter = $skrow['counter'];
eval ("\$bits .= \"".$tpl->get("artistdbscatbit")."\";");
}
}
eval("\$tpl->output(\"".$tpl->get("artistdb")."\");");
}
if($action=="entrys") {
$kat = $db->query_first("SELECT title FROM bb".$n."_adbkats WHERE catid='$catid'");
$getentrys = $db->query("SELECT u.username,adb.entryid,adb.title,adb.time,adb.userid FROM bb".$n."_adbentrys adb LEFT JOIN bb".$n."_users u ON (adb.userid=u.userid) WHERE adb.catid='$catid'");
while($row = $db->fetch_array($getentrys)) {
$title = $row['title'];
$date = formatdate($wbbuserdata['dateformat'],$row['time'],1);
$time = formatdate($wbbuserdata['timeformat'],$row['time']);
$userid = $row['userid'];
$username = $row['username'];
eval ("\$entrys .= \"".$tpl->get("artistdbentrybit")."\";");
}
eval("\$tpl->output(\"".$tpl->get("artistdbentry")."\");");
}
if($action=="showentry") {
require("./acp/lib/class_parse.php");
$parse = new parse($docensor,75,$wbbuserdata['showimages'],$hilight,$usecode);
$entry = $db->query("SELECT k.title AS kattitle,k.catid,adb.*,u.username FROM bb".$n."_adbentrys adb LEFT JOIN bb".$n."_users u ON (adb.userid=u.userid) LEFT JOIN bb".$n."_adbkats k ON (adb.catid=k.catid) WHERE adb.entryid='$entryid'");
while($row = $db->fetch_array($entry)) {
$title = $row['title'];
$message=$parse->doparse($row['message'],1,0,1,1);
$date = formatdate($wbbuserdata['dateformat'],$row['time'],1);
$time = formatdate($wbbuserdata['timeformat'],$row['time']);
$userid = $row['userid'];
$username = $row['username'];
$kattitle = $row['kattitle'];
$katid = $row['catid'];
}
eval("\$tpl->output(\"".$tpl->get("artistdbshowentry")."\");");
}
if($action=="newentry") {
if(isset($_POST['send'])) {
$error="";
if($_POST['title']=="") $error .="<li> Bitte gib einen Titel ein!<br />";
if($_POST['message']=="") $error .="<li> Bitte gib einen Text ein!";
if($error) eval ("\$newentry_error = \"".$tpl->get("newthread_error")."\";");
else {
$db->query("INSERT INTO bb".$n."_adbentrys (title,userid,message,time,catid) VALUES ('".addslashes($_POST['title'])."','$wbbuserdata[userid]','".addslashes($_POST['message'])."','".time()."','$catid')");
$db->query("UPDATE bb".$n."_adbkats SET counter=counter+1 WHERE catid='$catid'");
header("Location: artistdb.php?action=entrys&catid=$catid&sid=$session[hash]");
}
}
$kat = $db->query_first("SELECT title FROM bb".$n."_adbkats WHERE catid='$catid'");
$bbcode_buttons = getcodebuttons();
$bbcode_smilies = getclickysmilies($smilie_table_cols,$smilie_table_rows);
eval ("\$headinclude .= \"".$tpl->get("bbcode_script")."\";");
eval("\$tpl->output(\"".$tpl->get("artistdbnewentry")."\");");
}
?>
|