könnte mir wohl wer helfen beim umschreiben vom Artikel modul?
Ich würde gerne das die Kommentar Funktion und die Kommentare selbst unter den Artikel kommen und nicht durch den Wechsel wenn man auf Kommentar klickt.
Bei den sys hab ich noch nicht ganz durchgeblickt. schon sicher muss ich die tpl out irgendwie ändern? aber meine versuche scheiterten und ja :/
Vllt mag mal wer der mehr Ahnung hat bissl schauen und mir weiterhelfen
Ps. send pm bei erstellten oder edetierten Artikel geht auch nicht auch wenn es in der Admin config richtig eingestellt ist.
articles.htm
<table width="100%" border="0" cellspacing="1" cellpadding="4"><tr><td><b>»<u>Tutorials & Anleitungen</u></b></td><td align="right"><b><a href="index.php?articles-write">Tutorial - Anleitung eintragen.</a></b></td></tr></table> {EXPLODE} <br /> <table width="95%" border="0" cellspacing="2" cellpadding="2" align="center" bgcolor="#f7e7d6" class="forumumrand"> <tr> <td valign="top"> <table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr> <td width="80%" align="center"><b>{_lang_category}</b></td> <td width="20%" align="center"><b>Artikel</b></td> </tr> <tr bgcolor="#FFFFFF"> <td colspan="2"> <table width="100%" border="0" cellspacing="1" cellpadding="4" class="freeshardtable"> {EXPLODE} <tr bgcolor="#FFFFFF" onmouseover="this.className='Cmite';" onmouseout="this.className='Cnorm';" onclick="window.location.href = 'index.php?downloads-{id}'"> <td width="80%" align="left"><a href="index.php?articles-{id}">{name}</a></td> <td width="20%" align="center">{anzArt}</td> </tr> {EXPLODE} </table> </td> </tr> </table> </td> </tr> </table> {EXPLODE} <table width="100%" border="0" cellspacing="1" cellpadding="4"> {EXPLODE} <tr> <td width="100%"> {vorschau} <div style="padding:0.2em;text-indent:0.2em;font-weight:bold;" class="head"><a href="index.php?articles-show-A{art_id}">{art_title}</a> <div style="float:right;">{art_kate} {art_grp}</div></div> <span class="smalfont">» {_lang_from} <b>{username}</b> geschrieben am {datum}</span><br /> <div style="margin-top:.2em;padding:0.2em;border-top:1px dashed #000;clear:both;">{art_preview}</div> </td> </tr> {EXPLODE} {EXPLODE} </table> {EXPLODE} <table width="100%" border="0" cellspacing="1" cellpadding="4"><tr><th colspan="2"><div align="left"><b>»<u>Tutorials & Anleitungen</u></b></div></th></tr></table> <table width="100%" border="0" cellspacing="5" cellpadding="3" bgcolor="#f7e7d6" class="forumumrand"> <tr class="freeshardslist"> <td align="center"><b>{art_title}</b></td> </tr> <tr bgcolor="#FFFFFF"> <td> <table width="100%" border="0" cellspacing="5" cellpadding="3"> <tr bgcolor="#FFFFFF"> <td width="12" align="center"><img src="include/images/icons/download/icon_author.gif" alt="" border="0"></td> <td width="275" align="left">{creater}</td> <td width="12" align="right"><img src="include/images/icons/download/icon_eye.gif" alt="" border="0"></td> <td colspan="2">{hits} Gesehen</td> </tr> <tr bgcolor="#FFFFFF"> <td width="12" align="center"><img src="include/images/icons/download/icon_date.gif" alt="" border="0"></td> <td width="275" align="left">Eingetragen {datum}</td> <td width="12" align="center"><img src="include/images/icons/download/icon_grp.gif" alt="" border="0"></td> <td width="46">{art_kate}</td> <td>{art_kate2}</td> </tr> <tr bgcolor="#FFFFFF"> <td width="12" align="center"><img src="include/images/icons/download/icon_komms.gif" alt="" border="0"></td> <td width="275" align="left"><a href='index.php?articles-show-A{art_id}#komm'>Kommentare</a></td> <td width="12" align="center"><img src="include/images/icons/download/icon_art.gif" alt="" border="0"></td> <td width="46">{art_grp}</td> <td>{art_grp2}</td> </tr> </table> </td> </tr> </table> <br /> <table width="100%" border="0" cellspacing="3" cellpadding="0" bgcolor="#f7e7d6" class="forumumrand"> <tr class="freeshardslist"> <td align="center"><b>{_lang_desc}</b></td> </tr> <tr> {EXPLODE} <td> <table width="100%" border="0" cellspacing="2" cellpadding="3"> <tr bgcolor="#FFFFFF"> <td class="newstxt">{content}</td> </tr> </table> </td> </tr> </table> <br /><br /> <a name=komm></a></a><b>Kommentare ({ANZAHL})</b> <br /><br /> {_if_{SESSION_AUTHRIGHT}<='-1'} <form action="index.php?articles-show-C{art_id}" method="POST"> <table width="95%" border="0" cellspacing="5" cellpadding="3" align="center" bgcolor="#f7e7d6" class="forumumrand"> <tr bgcolor="#FFFFFF"> <td><table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr> <td valign="top"><input type="text" name="name" value="{uname}" readonly /> {ANTISPAM}</td> </tr> <tr> <td align="left"><!-- BB Code START -->{__BBCodeButtons__}<!-- BB Code ENDE --></td> </tr> <tr> <td valign="top"><textarea style="width: 98%" cols="50" rows="4" name="text"></textarea></td> </tr> <tr> <td colspan="2" valign="top" align="right" style="padding-right:12px;"><input type="submit" value="Kommentieren"></td> </tr> </table></td> </tr> </table> </form> {_else_} <table width="95%" border="0" cellspacing="5" cellpadding="3" align="center" bgcolor="#f7e7d6" class="forumumrand"> <tr bgcolor="#FFFFFF"> <td valign="top"> <table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr> <td align="center">Um einen Kommentar zu posten, bitte <a href="index.php?user-login"><b>einloggen</b></a> oder <a href="index.php?user-1"><b>registrieren</b></a> Sie einen neuen Account.</td> </tr> </table> </td> </tr> </table>{/_endif} <br /> {EXPLODE} <div align="center"> <table width="95%" border="0" cellspacing="5" cellpadding="3" class="forumumrand"> <tr class="freeshardslist"> <td width="84" rowspan="2" align="center" valign="top">{BILD}</td> <td align="left">{GOKOMM} <a href="index.php?user-details-{ID}"><b>{NAME}</b></a> - <font class="smalfont">{TIME}</font> {DELETE}</td> </tr> <tr bgcolor="#FFFFFF"> <td align="left" valign="top">{TEXT}</td> </tr> </table> </div> <br /> {EXPLODE} <br /> <a href="javascript:history.back(1)"><b>«</b> zurück</a>
articles.php
<?php # Copyright by: Manuel Staechele # Edit by: Nero # Support: www.ilch.de defined ('main') or die ( 'no direct access' ); //PHP datei mit den funktionen laden require_once('include/includes/func/articles.php'); switch(escape($menu->get(1),'string')){ default: #-> Kategorien-Pfad erstellen $cid = ( $menu->get(1) ? escape($menu->get(1), 'integer') : 0 ); $erg = db_query("SELECT cat,name,schreibr FROM `prefix_artsys_cats` WHERE id = ".$cid." AND recht >= ".$_SESSION['authright']." ORDER BY pos"); if (db_num_rows($erg) > 0) { $row = db_fetch_assoc($erg); $array = get_cats_array($row['cat'],''); if (!empty($array) ) { $titelzw = get_cats_title($array); $namezw = get_cats_urls($array); } else { $titelzw = ''; $namezw = ''; } $cattitle = ':: '.$titelzw.$row['name']; $catname = '<b> » </b>'.$namezw.$row['name']; } else { if ($cid <> 0) { $title = $allgAr['title'].''; $hmenu = '<a href="?articles"><font color="#FFFFFF">Tutorials - Anleitungen</font></a>'; $design = new design ( $title , $hmenu ); $design->header(); echo 'Die Kategorie wurde nicht gefunden'; $design->footer(1); } $cattitle = ''; $catname = ''; } $schreibrecht = $row['schreibr']; #-> Ausgabe $title = $allgAr['title'].''; $hmenu = '<a href="?articles"><font color="#FFFFFF">Tutorials - Anleitungen</font></a>'.$catname; $design = new design ( $title , $hmenu ); $design->header(); $tpl = new tpl ('articles' ); $tpl->out(0); $tpl->set('cid', $cid); $erg = db_query("SELECT id,name,`desc` FROM `prefix_artsys_cats` WHERE cat = ".$cid." AND recht >= ".$_SESSION['authright']." ORDER BY pos"); if ( db_num_rows($erg) > 0 ) { $tpl->out(1); $class = 'Cnorm'; while ($row = db_fetch_assoc($erg) ) { $row['anzArt'] = count_art($row['id']); $class = ($class == 'Cdark' ? 'Cnorm' : 'dark'); $row['class'] = $class; $tpl->set_ar_out($row,2); } $tpl->out(3); } #->sortieren $felder = array('art_time','art_viewed','art_time'); $row = artsys_sort_func($menu->get(2),escape($menu->get(3),'string'),$felder,'list_articles'); $sort = $row['sort']; unset($row['sort']); #->sortieren ende //Seiten $limit = $ArtsysArray['anzArt_perSite']; // Limit $page = ($menu->getA(2) == 'p' ? $menu->getE(2) : 1 ); $MPL = db_make_sites($page, " WHERE art_cat = ".$cid." AND art_status = 1 ", $limit, '?articles-'.$cid, 'artsys_articles'); $anfang = ($page - 1) * $limit; //Aussgabe $erg = db_query("SELECT art_id,art_title,art_preview,art_rating,art_image,art_difficult,art_grp,art_kate,art_uid,art_viewed,DATE_FORMAT(art_time,'%d.%m.%Y') as datum from `prefix_artsys_articles` WHERE art_cat = ".$cid." AND art_status = 1 ORDER BY art_time DESC LIMIT $anfang, $limit"); $anz_art = db_num_rows($erg); (($anz_art > 0 OR $cid<>0) ? $tpl->set_ar_out($row,4):''); if ( $anz_art > 0 ) { $class = 'Cnorm'; while($row = db_fetch_assoc($erg) ) { $class = ( $class == 'Cnorm' ? 'Cnorm' : 'Cnorm' ); $row['class'] = $class; $row['art_preview'] = bbcode($row['art_preview']); $row['vorschau'] = ''; $row['float'] = ''; if ($row['art_image'] <> "" AND file_exists($row['art_image'])){ $row['vorschau'] = '<a href="index.php?articles-show-A'.$row['art_id'].'"><img src="'.$row['art_image'].'" alt="'.$row['art_title'].'" title="'.$row['art_title'].'" style="border: medium none ; float: left; padding-right: 5px;"></a>'; } artsys_hexToRgb(array($ArtsysArray['diff_bgcolor'],$ArtsysArray['diff_color'],$ArtsysArray['diff_nonecolor']),'diff'); $row['art_difficult'] = ($row['art_difficult'] > 0?'Schwierigkeit : <img src="include/images/articles/art_diff_image.php?d='.$row['art_difficult'].'" alt="'.$ArtsysArray['diff'][$row['art_difficult']].'" title="'.$ArtsysArray['diff'][$row['art_difficult']].'" ><br />':''); $row['art_rating'] = show_vote_stats($row['art_rating']); $row['username'] = get_n($row['art_uid']); if ($row['art_kate']==1) { $kate = '<img src="include/images/articles/entwickler.gif" alt="" border="0">'; }elseif($row['art_kate']==2) { $kate = '<img src="include/images/articles/spieler.gif" alt="" border="0">'; }elseif($row['art_kate']==3) { $kate = '<img src="include/images/articles/entwickler.gif" alt="" border="0"> <img src="include/images/articles/spieler.gif" alt="" border="0">'; }else{ $kate = ''; } if ($row['art_grp']==1) { $grp = '<img src="include/images/articles/gumps_art.gif" alt="" border="0">'; }elseif($row['art_grp']==2) { $grp = '<img src="include/images/articles/anim.gif" alt="" border="0">'; }elseif($row['art_grp']==3) { $grp = '<img src="include/images/articles/weltenbau.gif" alt="" border="0">'; }elseif($row['art_grp']==4) { $grp = '<img src="include/images/articles/technik.gif" alt="" border="0">'; }else{ $grp = ''; } $row['art_kate'] = $kate; $row['art_grp'] = $grp; if ( loggedin() ) { $entry = '<div align="right"><b><a href="index.php?articles-write">Tutorial - Anleitung eintragen.</a></b></div>'; }else{ $entry = ''; } $row['art_entry'] = $entry; $tpl->set_ar_out($row,5); } }else{ echo ($cid<>0?'<tr><td colspan="3" class="Cnorm">Kein Tutorials - Anleitungen vorhanden</td></tr>':''); } (((($anz_art > 0 AND $ArtsysArray['allow_defKat'] <> 0)OR $cid<>0) AND $schreibrecht == 1 )?$tpl->set_out('new_art_cat',($cid<>0?"-C$cid":""),6):''); (($anz_art > 0 OR $cid<>0)?$tpl->out(7):""); echo $MPL; echo '<br /><br /> <table width="100%" border="0" cellspacing="1" cellpadding="1"> <tr> <td width="23"> </td> <td width="23"><img src="include/images/articles/entwickler.gif" alt="" border="0"></td> <td>Entwickler</td> <td width="23"><img src="include/images/articles/spieler.gif" alt="" border="0"></td> <td>Spieler</td> <td width="23"><img src="include/images/articles/technik.gif" alt="" border="0" /></td> <td>Technik</td> <td width="23"><img src="include/images/articles/weltenbau.gif" alt="" border="0"></td> <td>Weltenbau</td> <td width="23"><img src="include/images/articles/anim.gif" alt="" border="0"></td> <td>Animation</td> <td width="23"><img src="include/images/articles/gumps_art.gif" alt="" border="0"></td> <td>Gumps/Art</td> </tr> </table>'; $design->footer(); break; case 'show': $fid =$menu->getE(2); $erg = db_query("SELECT art_cat,art_viewed,art_votes,art_rating,art_title,art_kate,art_grp,art_uid,art_content,art_id,DATE_FORMAT(art_time,'%d.%m.%Y') as datum FROM `prefix_artsys_articles` artsys LEFT JOIN `prefix_artsys_cats` ON id = art_cat WHERE art_id = ".$fid." AND art_status = 1 AND (".$_SESSION['authright']." <= recht OR (art_cat = 0 AND recht IS NULL))"); if (@db_num_rows($erg) !== 1) { $title = $allgAr['title'].''; $hmenu = '<a href="?articles"><font color="#FFFFFF">Tutorials - Anleitungen</font></a>'; $design = new design ( $title , $hmenu ); $design->header(); echo 'Das Tutorial - Anleitung wurde nicht gefunden'; $design->footer(1); } $row = db_fetch_assoc($erg); #-> umfrage einen hoch zaehlen ... if ($menu->getA(3) === 'z' AND is_numeric($menu->getE(3)) AND !isset($_SESSION['artDoVote'][$row['art_id']]) AND loggedin() ) { $_SESSION['artDoVote'][$row['art_id']] = 'o'; $row['art_rating'] = round( ( ($row['art_rating'] * $row['art_votes'] ) + $menu->getE(3) ) / ( $row['art_votes'] + 1 ), 3); $row['art_votes']++; db_query("UPDATE prefix_artsys_articles SET art_rating = ".$row['art_rating'].", art_votes = ".$row['art_votes']." WHERE art_id = ".$fid); } #-> visits einen hoch zaehlen ... if (!isset ($_SESSION['artDoKlick'][$row['art_id']]) ) { $_SESSION['artDoKlick'][$row['art_id']] = 'o'; db_query("UPDATE prefix_artsys_articles SET art_viewed = art_viewed +1 WHERE art_id = ".$fid); } #-> Kategorien-Pfad erstellen $cid = $row['art_cat']; $erg1 = db_query("SELECT id,cat,name FROM `prefix_artsys_cats` WHERE id = ".$cid); if (db_num_rows($erg1)>0){ $row1 = db_fetch_assoc($erg1); $array = get_cats_array($row1['cat'],''); if (!empty($array)){ $titelzw = get_cats_title($array); $namezw = get_cats_urls($array); }else{ $titelzw = ''; $namezw = ''; } $cattitle = ':: '.$titelzw.$row1['name'].' :: '.$row['art_title']; $catname = '<b> » </b>'.$namezw.'<a href="?articles-'.$row1['id'].'">'.$row1['name'].'</a>'; //<b> » </b>'.$row['name'].' '.$row['version']; } else { $cattitle = ''; $catname = ''; } if ($menu->getA(2) === 'A'){ #-> Artikel-Page setzen $art_page = ($menu->getA(3) === 'P'?$menu->getE(3):1); #-> Anz kommentare holen $comAnz= db_result(db_query("SELECT COUNT(ID) FROM `prefix_koms` WHERE uid = ".$row['art_id']." AND cat = 'ARTICLES'"),0); #-> Ausgabe $page = make_art_pages($row['art_content'],$art_page,$fid); $title = $allgAr['title'].''; $hmenu = '<a href="?articles"><font color="#FFFFFF">Tutorials - Anleitungen</font></a>'.$catname; $design = new design ( $title , $hmenu ); $design->header(); $tpl = new tpl ('articles' ); $row['creater'] = get_n($row['art_uid']); if ($row['art_kate']==1) { $kate = '<img src="include/images/articles/entwickler.gif" alt="" border="0">'; }elseif($row['art_kate']==2) { $kate = '<img src="include/images/articles/spieler.gif" alt="" border="0">'; }elseif($row['art_kate']==3) { $kate = '<img src="include/images/articles/entwickler.gif" alt="" border="0"> <img src="include/images/articles/spieler.gif" alt="" border="0">'; }else{ $kate = ''; } if ($row['art_grp']==1) { $grp = '<img src="include/images/articles/gumps_art.gif" alt="" border="0">'; }elseif($row['art_grp']==2) { $grp = '<img src="include/images/articles/anim.gif" alt="" border="0">'; }elseif($row['art_grp']==3) { $grp = '<img src="include/images/articles/weltenbau.gif" alt="" border="0">'; }elseif($row['art_grp']==4) { $grp = '<img src="include/images/articles/technik.gif" alt="" border="0">'; }else{ $grp = ''; } if ($row['art_kate']==1) { $kate2 = 'Entwickler'; }elseif($row['art_kate']==2) { $kate2 = 'Spieler'; }elseif($row['art_kate']==3) { $kate2 = 'Entwickler/Spieler'; }else{ $kate2 = ''; } if ($row['art_grp']==1) { $grp2 = 'Gumps/Art'; }elseif($row['art_grp']==2) { $grp2 = 'Animation'; }elseif($row['art_grp']==3) { $grp2 = 'Weltenbau'; }elseif($row['art_grp']==4) { $grp2 = 'Technik'; }else{ $grp2 = ''; } $row['art_kate'] = $kate; $row['art_kate2'] = $kate2; $row['art_grp'] = $grp; $row['art_grp2'] = $grp2; $row['hits'] = $row['art_viewed']; $row['comOderShow'] = ' <a href="index.php?articles-show-C'.$row['art_id'].'">'.$comAnz.' '.$lang['comments'].'</a>'; $row['art_title'] .= (($row['art_uid'] == $_SESSION['authid'] OR has_right(-9, 'articles'))? ' <a href="?articles-write-E'.$row['art_id'].'"><img border="0" src="include/images/icons/edit.gif" title="editieren" alt="editieren"></a>':''); $row['art_rating'] = show_vote_stats($row['art_rating']); show_vote($row['art_id']);//Vote ausgeben $tpl->set_ar_out($row,8); $tpl->set_ar_out($page,9); $tpl->out(13); }elseif($menu->getA(2) === 'C'){ # kommentar add if (!empty($_POST['name']) AND !empty($_POST['text']) AND ($ArtsysArray['user_comment_right'] === 2 OR loggedin())) { $_POST['text'] = escape($_POST['text'],'textarea'); $_POST['name'] = escape($_POST['name'],'string'); db_query("INSERT INTO `prefix_koms` VALUES ('',".$fid.",'ARTICLES','".$_POST['name']."','".$_POST['text']."')"); } # kommentar loeschen if ($menu->getA(3) == 'd' AND is_numeric($menu->getE(3)) AND is_admin()) { $kommentar_id = escape($menu->getE(3),'integer'); db_query("DELETE FROM `prefix_koms` WHERE uid = ".$fid." AND cat = 'ARTICLES' AND id = ".$kommentar_id); } #-> Ausgabe $title = $allgAr['title'].''; $hmenu = '<a href="?articles"><font color="#FFFFFF">Tutorials - Anleitungen</font></a>'.$catname; $design = new design ( $title , $hmenu ); $design->header(); $tpl = new tpl ('articles' ); $row['creater'] = get_n($row['art_uid']); $row['comOderShow'] = ' <a href="?articles-show-A'.$row['art_id'].'">Tutorials - Anleitungen lesen</a>'; $row['art_title'] .= (($row['art_uid'] == $_SESSION['authid'] OR has_right(-9, 'articles'))?' <a href="?articles-write-E'.$row['art_id'].'"><img border="0" src="include/images/icons/edit.gif" title="editieren" alt="editieren"></a>':''); $row['art_rating'] = show_vote_stats($row['art_rating']); show_vote($row['art_id'],'C');//Vote ausgeben $tpl->set_ar_out($row,8); #-> Kommentar insertfields if ($ArtsysArray['user_comment_right'] == 2 OR loggedin()){ $row_ins = array('uname'=>get_n($_SESSION['authid']),'art_id'=>$row['art_id']); $tpl->set_ar_out($row_ins,10); }elseif($ArtsysArray['user_comment_right'] != 0){ $tpl->set_out('writeout','du musst eingelogt sein um einen Kommentare zu schreiben',11); } #-> kommentar show #->sortieren $felder = array('id'); $row2 = artsys_sort_func($menu->get(3),escape($menu->get(4),'string'),$felder,'com_articles'); $sort = $row2['sort']; unset($row2['sort']); #->sortieren ende //Seiten $erg2 = db_query("SELECT text, name, id FROM `prefix_koms` WHERE uid = ".$row['art_id']." AND cat = 'ARTICLES' ORDER BY $sort"); $ergAnz1 = db_num_rows($erg2); $limit = $ArtsysArray['anzCom_perSite']; // Limit $page = ($menu->getA(3) == 'p' ? $menu->getE(3) : 1 ); $MPL = db_make_sites($page, "", $limit, '?articles-show-C'.$row['art_id'],"",$ergAnz1); $anfang = ($page - 1) * $limit; //Aussgabe $erg2 = db_query("SELECT text, name, id FROM `prefix_koms` WHERE uid = ".$row['art_id']." AND cat = 'ARTICLES' ORDER BY $sort LIMIT $anfang,$limit"); if ( $ergAnz1 == 0 ) { $tpl->set_out('writeout',$lang['nocomments'],11); $tpl->out(13); }elseif($ArtsysArray['user_comment_right'] == 0 AND !loggedin()){ $tpl->set_out('writeout','du musst eingelogt sein um die Kommentare zu sehen, bzw. einen zu schreiben',11); $tpl->out(13); }else{ echo '<tr><td class="Cnorm"><a href="index.php?articles-show-C'.$row['art_id'].'-sort-'.$row2['s0'].'">'.ucfirst(substr($row2['s0'],1)).' sortieren</a> <img src="include/images/icons/pfeil'.$row2['p0'].'.gif" border="0"></td></tr>'; $rtung = $row2['s0']; $zahl = ($rtung == '0auf'?($ergAnz1-$anfang):($anfang + 1)); while ($row2 = db_fetch_assoc($erg2)) { $row2['text'] = bbcode(trim($row2['text'])); if (is_admin()) { $row2['text'] .= '<a href="index.php?articles-show-C'.$row['art_id'].'-d'.$row2['id'].'"><img src="include/images/icons/del.gif" alt="löschen" border="0" title="löschen" /></a>'; } $tpl->set_ar_out(array('name' => $row2['name'], 'text' => $row2['text'], 'zahl' => $zahl ),12); ($rtung == '0auf'?$zahl--:$zahl++); } $tpl->out(13); echo $MPL; } # kommentar show ende }else{ $title = $allgAr['title'].''; $hmenu = '<a href="?articles"><font color="#FFFFFF">Tutorials - Anleitungen</font></a>'; $design = new design ( $title , $hmenu ); $design->header(); echo 'Unbekannter Befehl'; } $design->footer(); break; case 'write': if (has_right(-9, 'articles') AND $ArtsysArray['hasright_thenAdmin'] == 1){ $host = $_SERVER['HTTP_HOST']; $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); if($menu->getA(2) === 'E') header("Location: http://$host$uri/admin.php?articles-editArt-E".$menu->getE(2)); else header("Location: http://$host$uri/admin.php?articles-newArt-C".$menu->getE(2)); exit; } $title = $allgAr['title'].''; $hmenu = '<a href="?articles"><font color="#FFFFFF">Tutorials - Anleitungen</font></a><b> » </b>erstellen/überarbeiten'; $design = new design ( $title , $hmenu ); $design->header(); if($_SESSION['authright'] <= $ArtsysArray['write_right']){ if ($menu->getA(2) === 'E'){ if (!$row = @db_fetch_assoc(db_query('SELECT art_pos, art_id, art_cat, art_kate, art_grp, art_title, art_content, art_preview, art_uid, art_image, art_difficult FROM `prefix_artsys_articles` WHERE art_id = '.$menu->getE(2)))){ wd('?articles','Artikel ist nicht vorhanden',3); $design->footer(1); } $row['mod_title'] = ''; }else{ $row = array('art_title'=>'', 'art_cat'=>$menu->getE(2), 'art_content'=>'', 'art_preview'=>'','art_id'=>'','art_image'=>'a897s','mod_title'=>'Neuer Artikel schreiben','art_uid'=>'','art_difficult'=>''); } if (isset($_POST['submit'])){#-> Artikel speichern oder updaten if (isset($_POST['artID']) AND $_POST['artID'] == $menu->getE(2)){#-> Artikel ändern $insArr = array('txt'=>'txt','titel'=>'str','art_preview'=>'str','cat'=>'','kate'=>'','grp'=>'','artID'=>'','difficult'=>''); $insert = escape_arrays($_POST,$insArr); cat_exist_and_has_right($insert['cat'],$ArtsysArray['allow_defKat'],'front',$row['art_uid'],$row['art_cat']);#-> auf Recht prüfen 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 = 0, art_cat = '.$insert['cat'].', art_pos = '.$pos.', art_title = "'.$insert['titel'].'", art_kate = "'.$insert['kate'].'", art_grp = "'.$insert['grp'].'", art_content = "'.$insert['txt'].'", art_preview = "'.$insert['art_preview'].'", art_difficult = '.$insert['difficult'].' WHERE art_id = '.$insert['artID'].' LIMIT 1'); $imageMsg = $ArtsysArray['vballow'] == 1?config_art_image($insert['artID']):''; #-> Angaben für PM und Weiterleitung $wd = array('pfad'=>'?articles'.($insert['cat'] == 0?'':'-'.$insert['cat']),'msg'=>'Tutorials - Anleitungen erfolgreich geändert'); $msg = "Tutorials - Anleitungen ".$row['art_title']." wurde geändert in: \n Titel: ".$insert['titel']." \n Kategorie: "; $msg_titel = 'Tutorials - Anleitungen wurde editiert'; }else{#-> Neuer Artikel einfügen $insArr = array('txt'=>'txt','titel'=>'str','art_preview'=>'str','cat'=>'','kate'=>'','grp'=>'','difficult'=>''); $insert = escape_arrays($_POST,$insArr); cat_exist_and_has_right($insert['cat'],$ArtsysArray['allow_defKat'],'front');#-> auf Recht prüfen $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_cat,art_pos,art_time,art_kate,art_grp,art_title,art_content,art_preview,art_difficult) VALUES ('.$_SESSION['authid'].','.$insert['cat'].','.$pos.',NOW(),"'.$insert['kate'].'","'.$insert['grp'].'","'.$insert['titel'].'","'.$insert['txt'].'","'.$insert['art_preview'].'",'.$insert['difficult'].')'); $imageMsg = $ArtsysArray['vballow'] == 1?config_art_image(db_last_id()):''; #-> Angaben für PM und Weiterleitung $wd = array('pfad'=>'?articles'.($insert['cat'] == 0?'':'-'.$insert['cat']),'msg'=>'Artikel erfolgreich eingefügt'); $msg = "Es wurde ein Tutorial - Anleitung eingetragen: \n \n Titel: ".$insert['titel']." \n Kategorie: "; $msg_titel = 'Neues Tutorial - Anleitung'; } if (!has_right(-9, 'articles')){ $row_art = db_fetch_assoc(db_query("SELECT pm,name FROM `prefix_artsys_cats` WHERE id = ".$insert['cat'])); if ($row_art['pm']<>0 OR ($ArtsysArray['allow_defKat']<>0 AND $ArtsysArray['defKat_uid']<>0)){ sendpm($_SESSION['authid'],$row_art['pm'],$msg_titel,$msg .= $row_art['name']." \n \n und wartet darauf freigeschaltet zu werden! \n\n Das Artikelmodul ;)"); } } wd($wd['pfad'],$wd['msg'].' <br> <br> '.$imageMsg,3); }else{ if (isset($_POST['preview'])){#-> alles für die Vorschau aufbereiten $art = array('txt'=>trim(escape($_POST['txt'],'textarea')),'pref'=>trim(escape($_POST['art_preview'],'textarea')),'titel'=>trim($_POST['titel']),'display'=>''); $art['preview'] = MAT_for_priview(bbcode(unescape($art['txt'])),unescape($art['pref'])); $row['art_cat'] = escape($_POST['cat'],'integer'); $row['art_kate'] = escape($_POST['kate'],'integer'); $row['art_grp'] = escape($_POST['grp'],'integer'); $row['art_difficult'] = escape($_POST['difficult'],'integer'); }else{ $art = array('txt'=>$row['art_content'],'pref'=>$row['art_preview'],'titel'=>$row['art_title'],'display'=>'style="display:none;"','preview'=>''); } cat_exist_and_has_right($row['art_cat'],$ArtsysArray['allow_defKat'],'front',$row['art_uid']); $tpl = new tpl ('articles_write' ); $out = array('modul_titel' =>$row['mod_title'], 'show_preview'=>$art['preview'], 'art_txt' =>escape_for_fields(unescape($art['txt'])), 'preview' => escape_for_fields(unescape($art['pref'])), 'art_titel' =>$art['titel'], 'display' =>$art['display'], 'smilies' =>getsmilies(), 'kat' =>($menu->getA(2) <> 'E'?($row['art_cat'] <> 0?'-'.$row['art_cat']:''):'-show-A'.$menu->getE(2)), 'cat_list' =>($ArtsysArray['allow_defKat']<>0?'<option value="0">Bitte auswählen</option>':'').dblistee($row['art_cat'],"SELECT id,name FROM `prefix_artsys_cats` WHERE (recht >= ".$_SESSION['authright']." AND schreibr = 1) OR id = ".$row['art_cat']." ORDER BY name ASC"), 'kate_list' =>($ArtsysArray['allow_defKat']<>0?'<option value="0">Bitte auswählen</option>':'').dblistee($row['art_kate'],"SELECT id,name FROM `prefix_artsys_kate` WHERE (recht >= ".$_SESSION['authright']." AND schreibr = 1) OR id = ".$row['art_cat']." ORDER BY name DESC"), 'grp_list' =>($ArtsysArray['allow_defKat']<>0?'<option value="0">Bitte auswählen</option>':'').dblistee($row['art_grp'],"SELECT id,name FROM `prefix_artsys_grp` WHERE (recht >= ".$_SESSION['authright']." AND schreibr = 1) OR id = ".$row['art_cat']." ORDER BY name ASC"), 'artID' =>($row['art_id']<>''?'<input type="hidden" name="artID" value="'.$row['art_id'].'" />':''), 'text_cols' =>$ArtsysArray['frontend_textarea_cols'], 'text_rows' =>$ArtsysArray['frontend_textarea_rows'], 'TXTL' =>$ArtsysArray['frontend_textarea_min_lenge'], 'art_image_upload' => ($ArtsysArray['vballow'] == 1?html_art_image($row['art_image']):""), 'art_difficult'=>html_art_diff($row['art_difficult'],"'front'"), ); $tpl->set_ar_out($out,0); } }else{wd('?articles','Keine Berechtigung',3);} $design->footer(); break; case 'search': $suche = ''; if (isset($_POST['search'])){ $suche = $_POST['search_after'].$_POST['search']; }elseif (!empty($_GET['articles-search'])){ $suche = $_GET['articles-search']; } $sucheNach = substr($suche,0,1); $suche = stripslashes(escape(substr($suche,1), 'string')); $title = $allgAr['title'].''; $hmenu = '<a href="?articles"><font color="#FFFFFF">Tutorials - Anleitungen</font></a><b> » </b><a href="index.php?articles-search"><font color="#FFFFFF">Suchen</font></a>'.(!empty($suche)?'<b> » </b> nach: '.htmlentities($suche):""); $design = new design ( $title , $hmenu ); $design->header(); echo '<table width="100%" border="0" cellspacing="1" cellpadding="4"><tr><th colspan="2"><div align="left"><b>»<u>Tutorials - Anleitungen</u></b></div></th></tr></table>'; $tpl = new tpl ('articles_write'); $out = array( 'search'=>$suche, 'a_title'=> (isset($_REQUEST['after_title'])?'checked="checked"':""), 'a_preview'=> (isset($_REQUEST['after_preview'])?'checked="checked"':""), 'a_txt'=> (isset($_REQUEST['after_txt'])?'checked="checked"':""), ); $tpl->set_ar_out($out,1); if (!empty($suche)){ #-> Seiten einteilung $page = 1; $limit = 25; // Limit if (isset($_GET['page'])) { $page = trim(str_replace('-p','',$_GET['page'])); } $anfang = ($page - 1) * $limit; #-> Seiten einteilung Ende $x = time() - (3600 * 24 * 360); if ($sucheNach == '1' AND $uid = @db_result(db_query("SELECT id FROM prefix_user WHERE name = BINARY '".$suche."'"),0)){// Nach Autor suchen $sucheSql = "art_uid = $uid AND "; $sucheSucc = true; }else{ //Text suche echo $sucheNach == '1'?"<span style='color:#FF0000; background:#000000;'>User '$suche' wurde nicht gefunden </span>":""; $suche = str_replace('-','',$suche); $suche = str_replace('=','',$suche); $suche = str_replace('&','',$suche); $searar = explode(' ', $suche); $sucheSql = ''; foreach($searar as $elem) { $str = str_replace('\'','',$elem); $str = str_replace('"','',$str); $str = addslashes($str); if (!empty($str)) { $sucheSqlTeil = ''; $sucheSqlTeil .= (isset($_REQUEST['after_title'])?" art_title LIKE '%$str%' OR ":""); $sucheSqlTeil .= (isset($_REQUEST['after_preview'])?" art_preview LIKE '%$str%' OR ":""); $sucheSqlTeil .= (isset($_REQUEST['after_txt'])?" art_content LIKE '%$str%' OR ":""); $sucheSql .= ($sucheSqlTeil <> ''?" ( $sucheSqlTeil 1 = 2 ) AND ":" "); } } } $sql = "SELECT DISTINCT art_id, art_title as titel FROM `prefix_artsys_articles` artsys LEFT JOIN `prefix_artsys_cats` ON id = art_cat WHERE ($sucheSql 1 = 1) AND (art_time >= $x) AND art_status = 1 AND (".$_SESSION['authright']." <= recht OR (art_cat = 0 AND recht IS NULL)) ORDER BY art_time DESC"; $sAnz = db_num_rows(db_query($sql)); if ((($sucheNach == '1' AND isset($sucheSucc)) OR $sucheNach == '0') AND $sAnz > 0){ $tpl->set('sAnz',$sAnz); $url = ''; $url .= (isset($_REQUEST['after_title'])?"&after_title=1":""); $url .= (isset($_REQUEST['after_preview'])?"&after_preview=1":""); $url .= (isset($_REQUEST['after_txt'])?"&after_txt=1":""); $tpl->set_out('MPL',$MPL = db_make_sites ($page , "" , $limit , 'index.php?articles-search='.urlencode($suche).$url.'&page=' , "", $sAnz),2); echo $sucheNach == 1 ? ($sAnz > 1?'Folgende Tutorials - Anleitungen':'Folgendes Tutorial - Anleitung')." wurden von $suche geschrieben:":"'$suche' wurde in ".($sAnz > 1?'folgenden Tutorials - Anleitungen':'folgendem Tutorials - Anleitungen')." gefunden:"; echo "\n <br><br> \n"; $sql .= " LIMIT ".$anfang.",".$limit; $erg = db_query($sql) or die(mysql_error()); $class = ''; WHILE($row = db_fetch_assoc($erg)){ $class = ($class == 'Cmite' ? 'Cnorm' : 'Cmite' ); $row['class'] = $class; if ($sucheNach == '1'){ $row['titel'] = $suche.' || '.$row['titel']; } $tpl->set_ar_out($row,3); } $tpl->out(4); }elseif($sucheNach == '0'){ echo "es wurden keine Tutorials - Anleitungen gefunden"; } } $design->footer(); break; } ?>
Zuletzt modifiziert von Siggi am 30.01.2013 - 11:28:34