hätte da mal eine kleine frage zu dein Artikelsys. Und zwar habe ich es noch ein bissel angepasst nach meinen bedarf *neu funtion aka Feld^^klappt auch super (: Mein prop ist das in den feld was ich hinzugefügt habe im Admin Menu von Artikelsys kein HTML Code mit postet
könntet ihr evt mal schauen was das falsch ist ?
Vielen dank im voraus
aus der
include\admin\articles.php
<?php
# Copyright by: Manuel
# Edit by: Nero
# Support: www.ilch.de
defined ('main') or die ( 'no direct access' );
defined ('admin') or die ( 'only admin access' );
#-> functions
//PHP datei mit den funktionen laden
require_once('include/includes/func/articles.php');
function get_cat_recht($recht,$cat,$count=1){#-> Prüfen ob die Rechte stimmen
if ($cat <> 0){
$erg = db_query("SELECT recht FROM `prefix_artsys_cats` WHERE id = ".$cat);
$Crecht = db_result($erg,0);
if($Crecht<$recht){$recht = $Crecht;}
}
if ($count === 1 AND $recht<$_SESSION['authright']){
get_cat_recht($_SESSION['authright'], $cat, 2);
echo '<span style="color:#FF0000;">Das Recht der Kategorie wurde auf Euer Recht zurückgestellt!</span><br><br>';
}elseif($count === 2 AND $recht<$_SESSION['authright']){
global $design;
wd('admin.php?articles','Kategorie Anlegen verweigert',3);
$design->footer(1);
}
return $recht;
}
function uptate_cat_right($cat, $right){
if ($right<>0){
$erg = db_query('SELECT id, recht FROM `prefix_artsys_cats` WHERE cat = '.$cat);
WHILE ($row = db_fetch_assoc($erg)){
if ($row['recht']>$right){
db_query('UPDATE `prefix_artsys_cats` SET recht = '.$right.' WHERE id = '.$row['id'].' LIMIT 1');
}
uptate_cat_right($row['id'], $row['recht']);
}
}
}
function articles_show_cats($id, $stufe) {#-> Ausgabe der Kategoorien
$erg = db_query("SELECT id,name,pos,cat FROM `prefix_artsys_cats` WHERE cat = ".$id." AND recht >= ".$_SESSION['authright']." ORDER BY pos") OR die($erg.mysql_error());
if ( db_num_rows($erg) > 0 ) {
while ($row = db_fetch_object($erg) ) {
echo '<tr class="Cmite"><td>'.$stufe.'- <a href="admin.php?articles-C'.$row->id.'">'.$row->name.'</a></td>';
echo '<td align="center"><a href="admin.php?articles-E'.$row->id.'#edit"><img src="include/images/icons/edit.gif" border="0"></a></td>';
echo '<td align="center"><a href="javascript:Kdel('.$row->id.')"><img src="include/images/icons/del.gif" border="0"></a></td>';
echo '<td align="center"><a href="admin.php?articles-C'.$row->id.'-O'.$row->pos.'"><img src="include/images/icons/pfeilo.gif" border="0"></a></td>';
echo '<td align="center"><a href="admin.php?articles-C'.$row->id.'-U'.$row->pos.'"><img src="include/images/icons/pfeilu.gif" border="0"></a></td></tr>'."\n";
articles_show_cats($row->id, $stufe.' ' );
}
}
}
#-> Artikel-Admin funktionen
function admin_user_comment_right($value){
$return = '';
$arr = array('weder sehen noch schreiben','sehen aber nicht schreiben','sehen und welche schreiben');
for ($i=0;$i!=3;$i++){
$return .= '<option value="'.$i.'" '.($i == $value?'selected="selected"':'').'>'.$arr[$i].'</option>';
}
return $return;
}
#-> Define same vars
$switchmenu = escape($menu->get(1),'string');
#-> menu
$design = new design ( 'Admins Area', 'Admins Area', 2);
$design->header();
switch($switchmenu){
case 'admin':
if (isset($_POST['submit'])){
$erg = db_query('SELECT * FROM `prefix_artsys_config` ORDER by kat');
while($row = db_fetch_assoc($erg) ) {
db_query('UPDATE `prefix_artsys_config` SET wert = "'.escape($_POST[$row['schl']],'string').'" WHERE schl = "'.$row['schl'].'"');
}
wd ('admin.php?articles-admin', 'Erfolgreich geändert' , 2);
}else{
$defKat_uid = '<option value="0">Keiner</option>'.dblistee($ArtsysArray['defKat_uid'], 'SELECT DISTINCT u.id,u.name FROM `prefix_user` u
INNER JOIN `prefix_modulerights` mr ON u.id = mr.uid
INNER JOIN `prefix_modules` m ON mr.mid = m.id WHERE (m.url = "articles" OR u.recht = "-9") ORDER BY u.name');
$write_right = dblistee($ArtsysArray['write_right'],'SELECT id,name FROM `prefix_grundrechte` WHERE id <> 0 ORDER BY id DESC');
$user_comment_right = admin_user_comment_right($ArtsysArray['user_comment_right']);
$tpl = new tpl('artsys/admin', 1 );
$erg = db_query('SELECT * FROM prefix_artsys_config ORDER by kat');
$tpl->out(0);
$cat = '';
WHILE($row = db_fetch_assoc($erg)){
if ($cat != $row['kat']){
echo '<tr><td colspan="2" class="Cdark"><b>'.$row['kat'].'</b></td></tr>';
}
SWITCH($row['typ']){
CASE 'input':
$row['wert'] = '<input type="text" name="'.$row['schl'].'" value="'.$row['wert'].'">';
break;
CASE 'select':
$vname = $row['schl'];
$row['wert'] = '<select name="'.$row['schl'].'">'.$$vname.'</select>';
break;
CASE 'checkbox':
$row['wert'] = '<input type="checkbox" name="'.$row['schl'].'" '.( $row['wert'] == 1?'checked':'').'>';
break;
}
$tpl->set_ar_out($row,1);
$cat = $row['kat'];
}
$tpl->out(2);
}
break;
case 'newArt':
if (isset($_POST['submit'])){
$insArr = array('txt'=>'txt','titel'=>'str','textow'=>'str','art_preview'=>'str','cat'=>'','difficult'=>'');
$insert = escape_arrays($_POST,$insArr);
cat_exist_and_has_right($insert['cat']);
$stat = isset($_POST['art_stat'])?'1':'0';
$pos = db_result(db_query("SELECT COUNT(*) FROM `prefix_artsys_articles` WHERE art_cat = ".$insert['cat']),0);
db_query('INSERT INTO `prefix_artsys_articles` (art_uid,art_status,art_cat,art_pos,art_time,art_title,art_content,art_preview,art_difficult) VALUES
('.$_SESSION['authid'].',"'.$stat.'",'.$insert['cat'].','.$pos.',NOW(),"'.$insert['titel'].'","'.$insert['textow'].'","'.$insert['txt'].'","'.$insert['art_preview'].'",'.$insert['difficult'].')');
$imageMsg = config_art_image(db_last_id());
#$lang['ArtSuccessfInsert'];
wd('?articles'.($insert['cat'] == 0?'':'-C'.$insert['cat']),'Artikel erfolgreich eingefügt <br> <br> '.$imageMsg,3);
}else{
if(isset($_POST['priview'])){
$art = array('txt'=>trim(escape($_POST['txt'],'textarea')),'pref'=>trim(escape($_POST['art_preview'],'textarea')),'titel'=>trim($_POST['titel']),'textow'=>trim(escape($_POST['textow'],'textarea')),'display'=>'','cat'=>escape($_POST['cat'],'integer'),'cat_link'=>($_POST['cat'] === '0'?'':'-C'.escape($_POST['cat'],'integer')),'difficult'=>$_POST['difficult']);
$art['priview'] = MAT_for_priview(bbcode(unescape($art['txt'])),unescape($art['preview']));
}else{
$art = array('txt'=>'','pref'=>'','titel'=>'','textow'=>'','display'=>'style="display:none;"','cat_link'=>($menu->getA(2) === 'C'?'-C'.$menu->getE(2):''),'cat'=>($menu->getA(2) === 'C'?$menu->getE(2):0),'difficult'=>'');
}
$tpl = new tpl('artsys/writeart', 1 );
$out = array('modul_titel' =>'Neuer Artikel schreiben',
'show_priview' =>$art['priview'],
'art_txt' =>escape_for_fields(unescape($art['txt'])),
'preview' => escape_for_fields(unescape($art['pref'])),
'art_titel' =>$art['titel'],
'art_textow' =>$art['textow'],
'art_difficult'=>html_art_diff($art['difficult']),
'display' =>$art['display'],
'smilies' =>getsmilies(),
'kat' =>$art['cat_link'],
'cat_list' =>'<option value="0">Keine</option>'.dblistee($art['cat'],"SELECT id,name FROM `prefix_artsys_cats` WHERE recht >= ".$_SESSION['authright']." ORDER BY name ASC"),
'artID' =>'',
'art_image_upload' => html_art_image(),
'art_image' => '',
);
$tpl->set_ar_out($out,0);
}
break;
case 'editArt':
if ($menu->getA(2) === 'E'){
if ($row = @db_fetch_assoc(db_query('SELECT * FROM `prefix_artsys_articles` WHERE art_id = '.$menu->getE(2)))){
cat_exist_and_has_right($row['art_cat']);
if (isset($_POST['submit']) AND $_POST['artID'] == $menu->getE(2)){
$insArr = array('txt'=>'txt','titel'=>'str','textow'=>'str','art_preview'=>'str','cat'=>'','artID'=>'','difficult'=>'');
$insert = escape_arrays($_POST,$insArr);
cat_exist_and_has_right($insert['cat']);
$stat = isset($_POST['art_stat'])?'1':'0';
$imageMsg = config_art_image($insert['artID']);
//$insert['txt'] = $insert['txt']."\n\n Editiert von ".get_n($_SESSION['authid'])." am "; #-> Datum hin!!!
if ($row['art_cat'] <> $insert['cat']){#-> Schauen ob neue Kategorie
$pos = db_result(db_query("SELECT COUNT(*) FROM `prefix_artsys_articles` WHERE art_cat = ".$insert['cat']),0);
db_query("UPDATE `prefix_artsys_articles` SET art_pos = art_pos - 1 WHERE art_pos > ".$row['art_pos']." AND art_cat = ".$row['art_cat']);
}else{
$pos = $row['art_pos'];
}
db_query('UPDATE `prefix_artsys_articles` SET
art_status = "'.$stat.'",
art_cat = '.$insert['cat'].',
art_pos = '.$pos.',
art_title = "'.$insert['titel'].'",
art_textow = "'.$insert['textow'].'",
art_content = "'.$insert['txt'].'",
art_preview = "'.$insert['art_preview'].'",
art_difficult = '.$insert['difficult'].'
WHERE art_id = '.$insert['artID'].' LIMIT 1');
#$lang['ArtSuccessUpdatet'];
wd('?articles'.($insert['cat'] == 0?'':'-C'.$insert['cat']),'Artikel erfolgreich geändert <br> <br> '.$imageMsg,3);
}else{
if (isset($_POST['priview'])){
$art = array('txt'=>trim(escape($_POST['txt'],'textarea')),'pref'=>trim(escape($_POST['art_preview'],'textarea')),'titel'=>trim($_POST['titel']),'textow'=>trim(escape($_POST['textow'],'textarea')),'display'=>'');
$art['priview'] = MAT_for_priview(bbcode(unescape($art['txt'])),unescape($art['pref']));
$row['art_cat'] = escape($_POST['cat'],'integer');
$row['art_difficult'] = escape($_POST['difficult'],'integer');
}else{
$art = array('txt'=>$row['art_content'],'pref'=>$row['art_preview'],'titel'=>$row['art_title'],'textow'=>$row['art_textow'],'display'=>'style="display:none;"');
}
$tpl = new tpl('artsys/writeart', 1 );
$out = array('modul_titel' =>'Artikel editieren',
'show_priview'=>$art['priview'],
'art_txt' =>escape_for_fields(unescape($art['txt'])),
'preview' => escape_for_fields(unescape($art['pref'])),
'art_titel' =>$art['titel'],
'art_textow' =>$art['textow'],
'art_difficult'=>html_art_diff($row['art_difficult']),
'display' =>$art['display'],
'smilies' =>getsmilies(),
'kat' =>($row['art_cat'] <> 0?'-C'.$row['art_cat']:''),
'cat_list' =>'<option value="0">Keine</option>'.dblistee($row['art_cat'],"SELECT id,name FROM `prefix_artsys_cats` WHERE recht >= ".$_SESSION['authright']." ORDER BY name ASC"),
'artID' =>$menu->getE(2),
'art_image_upload' => html_art_image($row['art_image']),
);
$tpl->set_ar_out($out,0);
}
}else{
wd('?articles','Artikel mit der ID "'.$menu->getE(2).'" ist leider nicht vorhanden',3);
}
}else{
wd('?articles','Unbekanntes vorhaben',3);
}
break;
default;
#-> Template
$tpl = new tpl('artsys/articles', 1);
$tpl->out(0);
#-> Kategorie ID erfassen und prüfen
$artArr = array('cat'=>0);
if ($menu->getA(1) === 'C' OR $menu->getA(1) === 'E'){
$artArr['cat'] = $menu->getE(1);
cat_exist_and_has_right($artArr['cat']);
}
if ($menu->getA(2) === 'U' OR $menu->getA(2) === 'O' AND $artArr['cat'] <> 0){#-> kategorien verschieben
$pos = $menu->getE(2);
$id = $artArr['cat'];
$cat = db_result(db_query("SELECT cat FROM `prefix_artsys_cats` WHERE id = ".$id),0);
$nps = ( $menu->getA(2) == 'U' ? $pos + 1 : $pos - 1 );
$anz = db_result(db_query("SELECT COUNT(*) FROM `prefix_artsys_cats` WHERE cat = ".$cat),0);
if ($nps < 0) {
db_query("UPDATE `prefix_artsys_cats` SET pos = ".$anz." WHERE id = ".$id);
db_query("UPDATE `prefix_artsys_cats` SET pos = pos -1 WHERE cat = ".$cat);
}
if ($nps >= $anz) {
db_query("UPDATE `prefix_artsys_cats` SET pos = -1 WHERE id = ".$id);
db_query("UPDATE `prefix_artsys_cats` SET pos = pos +1 WHERE cat = ".$cat);
}
if ( $nps < $anz AND $nps >= 0 ) {
db_query("UPDATE `prefix_artsys_cats` SET pos = ".$pos." WHERE pos = ".$nps." AND cat = ".$cat);
db_query("UPDATE `prefix_artsys_cats` SET pos = ".$nps." WHERE id = ".$id);
}
}elseif($menu->getA(2) === 'u' OR $menu->getA(2) === 'o'){
$pos = $menu->getE(2);
$id = escape($menu->get(3),'integer');
$nps = ( $menu->getA(2) == 'u' ? $pos + 1 : $pos - 1 );
$anz = db_result(db_query("SELECT COUNT(*) FROM `prefix_artsys_articles` WHERE art_cat = ".$artArr['cat']),0);
if ($nps < 0){
db_query("UPDATE `prefix_artsys_articles` SET art_pos = ".$anz." WHERE art_id = ".$id);
db_query("UPDATE `prefix_artsys_articles` SET art_pos = art_pos -1 WHERE art_cat = ".$artArr['cat']);
}
if ($nps >= $anz) {
db_query("UPDATE `prefix_artsys_articles` SET art_pos = -1 WHERE art_id = ".$id);
db_query("UPDATE `prefix_artsys_articles` SET art_pos = art_pos +1 WHERE art_cat = ".$artArr['cat']);
}
if ( $nps < $anz AND $nps >= 0 ) {
db_query("UPDATE `prefix_artsys_articles` SET art_pos = ".$pos." WHERE art_pos = ".$nps." AND art_cat = ".$artArr['cat']);
db_query("UPDATE `prefix_artsys_articles` SET art_pos = ".$nps." WHERE art_id = ".$id);
}
}elseif (isset($_POST['Csub'])){#-> kategorie eintraege speichern oder aendern.
if (empty($_POST['Ccat'])){$_POST['Ccat'] = 0;}
$insArr = array('Cname'=>'str','Cdesc'=>'txt','Ccat'=>'','Crecht'=>'','Cschreibr'=>'','Cdiff'=>'','Cpm'=>'','Cid'=>'');
$insert = escape_arrays($_POST,$insArr);
if (empty($_POST['Cid'])){#-> Kategorie speicher
cat_exist_and_has_right($insert['Ccat']);
$insert['Crecht'] = get_cat_recht($insert['Crecht'],$insert['Ccat']);
$pos = db_result(db_query("SELECT COUNT(*) FROM `prefix_artsys_cats` WHERE cat = ".$insert['Ccat']),0);
db_query("INSERT INTO `prefix_artsys_cats` (`cat`,`pos`,`recht`,`schreibr`,`diff`,`pm`,`name`,`desc`) VALUES (".$insert['Ccat'].",".$pos.",".$insert['Crecht'].",".$insert['Cschreibr'].",".$insert['Cdiff'].",".$insert['Cpm'].",'".$insert['Cname']."','".$insert['Cdesc']."')");
$artArr['cat'] = db_last_id();
}elseif($artArr['cat'] == $_POST['Cid']){#-> Kategorie ändern
$insert['Crecht'] = get_cat_recht($insert['Crecht'],$insert['Ccat']);
$alt_row = db_fetch_assoc(db_query("SELECT cat,pos FROM `prefix_artsys_cats` WHERE id = ".$insert['Cid']));
if ($alt_row['cat'] <> $insert['Ccat']){#-> Schauen ob neue Kategorie
$pos = db_result(db_query("SELECT COUNT(*) FROM `prefix_artsys_cats` WHERE cat = ".$insert['Ccat']),0);
db_query("UPDATE `prefix_artsys_cats` SET pos = pos - 1 WHERE pos > ".$alt_row['pos']." AND cat = ".$alt_row['cat']);
}else{
$pos = $alt_row['pos'];
}
db_query("UPDATE `prefix_artsys_cats` SET `cat` = ".$insert['Ccat'].", `pos` = ".$pos.", `recht` = ".$insert['Crecht'].", `schreibr` = ".$insert['Cschreibr'].", `diff` = ".$insert['Cdiff'].", `pm` = ".$insert['Cpm'].",`name` = '".$insert['Cname']."',pos = '".$pos."',`desc` = '".$insert['Cdesc']."' WHERE `id` = '".$insert['Cid']."'");
uptate_cat_right($insert['Cid'],$insert['Crecht']);
}
}elseif($menu->getA(2) === 'S' AND $menu->getA(3) === 'A'){#-> Status eines Artikels ändern
db_query("UPDATE `prefix_artsys_articles` SET art_status = ".$menu->getE(2)." WHERE art_id = ".$menu->getE(3));
echo '<span style="color:#00FF00;">Status des Artikels erfoglreich geändert!</span><br><br>';
}elseif($menu->get(2) === 'DelKat'){#-> Kategorien löschen
if ('0' === db_result(db_query("SELECT COUNT(art_id) FROM `prefix_artsys_articles` WHERE art_cat = '".$artArr['cat']."'"),0)){
$row = db_fetch_assoc(db_query("SELECT cat, pos FROM `prefix_artsys_cats` WHERE id = '".$artArr['cat']."'"));
db_query("DELETE FROM `prefix_artsys_cats` WHERE id = '".$artArr['cat']."'");
db_query("UPDATE `prefix_artsys_cats` SET pos = pos - 1 WHERE pos > ".$row['pos']." AND cat = ".$row['cat']);
$artArr['cat'] = 0;
}else{
echo '<span style="color:#FF0000">Bitte zuerst alle Artikel zu dieser Kategorie löschen!</span><br><br>';
}
}elseif($menu->getA(2) === 'd'){#-> Artikel löschen
if (1 <> db_result(db_query("SELECT COUNT(art_id) FROM `prefix_artsys_articles` WHERE art_id = ".$menu->getE(2)." AND art_cat = ".$artArr['cat']),0)){
echo '<span style="color:#FF0000">Artikel nicht vorhanden!</span><br><br>';
}else{
$pos = db_result(db_query("SELECT art_pos FROM `prefix_artsys_articles` WHERE art_id = '".$menu->getE(2)."'"),0);
db_query("DELETE FROM `prefix_artsys_articles` WHERE art_id = '".$menu->getE(2)."' LIMIT 1");
db_query("UPDATE `prefix_artsys_articles` SET art_pos = art_pos - 1 WHERE art_pos > '".$pos."' AND art_cat = ".$artArr['cat']);
db_query("DELETE FROM `prefix_koms` WHERE uid = ".$menu->getE(2)." AND cat = 'ARTICLES'");
echo '<span style="color:#00FF00;">Artikel erfolgreich gelöscht!</span><br><br>';
}
}
$erg_art = db_query('SELECT * FROM `prefix_artsys_articles` WHERE art_cat = '.$artArr['cat'].' ORDER BY art_pos ASC')OR die(mysql_error());
if (db_num_rows($erg_art) <> 0){#-> Ausgabe der Artikeln der gewählten Kategorie
$class = 0;
WHILE($row_art = db_fetch_assoc($erg_art)){
$class = ($class == 'Cmite' ? 'Cnorm' : 'Cmite');
$row_art['class'] = $class;
$row_art['art_status'] = ($row_art['art_status'] === '0'?
'<a title="Artikel freischalten" href="admin.php?articles-C'.$artArr['cat'].'-S1-A'.$row_art['art_id'].'"><img src="include/images/icons/nop.gif"></a>':
'<a title="Artikel zurückziehen" href="admin.php?articles-C'.$artArr['cat'].'-S0-A'.$row_art['art_id'].'"><img src="include/images/icons/jep.gif"></a>');
$row_art['cat'] = $artArr['cat'];
$row_art['art_uname'] = get_n($row_art['art_uid']);//Name des Erstellers holen
$tpl->set_ar_out($row_art,1);
}
}
$tpl->set_out('kat',($artArr['cat']<>0?'-C'.$artArr['cat']:''),2);
articles_show_cats(0, '');
if ($menu->getA(1) === 'E'){
$edit_cat = db_fetch_assoc(db_query('SELECT id as Cid,cat as Ccat, recht as Crecht, pm as Cpm, name as Cname,pos as Cpos,`desc` as Cdesc, schreibr as Cschreibr, diff as Cdiff
FROM `prefix_artsys_cats` WHERE id ='.$artArr['cat']));
$edit_cat['checkCid'] = '-C'.$edit_cat['Cid'];
}else{
$edit_cat = array('Cdesc'=>'','Cname'=>'','Cid' => 0,'Crecht' => '','Ccat'=>$artArr['cat'],'checkCid'=>'','Cpm'=>0,'Cschreibr'=>1);
}
$edit_cat['Cpm'] = '<option value="0">Keiner</option>'.dblistee($edit_cat['Cpm'], 'SELECT DISTINCT u.id,u.name FROM `prefix_user` u
INNER JOIN `prefix_modulerights` mr ON u.id = mr.uid
INNER JOIN `prefix_modules` m ON mr.mid = m.id WHERE (m.url = "articles" OR u.recht = "-9") ORDER BY u.name');
$edit_cat['Crecht'] = dblistee($edit_cat['Crecht'],"SELECT id,name FROM `prefix_grundrechte` WHERE id >= ".$_SESSION['authright']." ORDER BY id DESC");
$edit_cat['cat_list'] = '<option value="0">Keine</option>';
$edit_cat['cat_list'] .= dblistee($edit_cat['Ccat'], "SELECT id,name FROM `prefix_artsys_cats` WHERE id != ".$edit_cat['Cid']." AND recht >= ".$_SESSION['authright']." ORDER BY name ASC");
$edit_cat['Cschreibr'] = arlistee($edit_cat['Cschreibr'],array(1=>'ja',0=>'nein'));
$edit_cat['Cdiff'] = arlistee($edit_cat['Cdiff'],array(0=>'nein',1=>'ja'));
$tpl->set_ar_out($edit_cat,3);
}
$design->footer();
?>
Zuletzt modifiziert von OloX am 02.08.2007 - 21:55:03