so,
ich habe nun {__BBCodeButtons__} an stelle des orginalen bbcode in der article.php geändert. In der template article.htm gibt es nichts mit bbcode.
naja nun funktioniert es noch nicht so ganz, {__BBCodeButtons__} wird als text angezeigt und nicht als funktion :'(
muss ich
<script type='text/javascript' src='include/includes/js/BBCodeGlobal.js'></script>
<script type='text/javascript' src='include/includes/js/Interface.js'></script>
noch irgendwie dort einbringen, denke schon, weiß aber nicht wo ?!?!
ihr mal der code der article.php , vllt kann mir ja wer helfen wo es dort hinneinkommt
<?php
# Copyright by: Manuel
# Edit by: Nero
# Support: www.ilch.de
defined ('main') or die ( 'no direct access' );
// Einstellung der Rechte von den Gästen:
// 0 = sie dürfen weder die kommentare sehen noch schreiben
// 1 = sie dürfen die kommentare sehen aber nicht schreiben
// 2 = sie dürfen die kommentare sehen aund welche schreiben
$gast_allow = 2;
//Einstellung Ende
#-> functions
function show_vote($id){
global $tpl;
if(loggedin()){
$return = '
<script language="JavaScript" type="text/javascript">
<!--
function doVote(n1,did) {
document.location.href="index.php?articles-show-" + did + "-z"+n1;
}
//-->
</script>
<td class="Cdark" onClick="doVote(1,'.$id.')" style="cursor:pointer"> 1 </td>
<td class="Cmite" onClick="doVote(2,'.$id.')" style="cursor:pointer"> 2 </td>
<td class="Cdark" onClick="doVote(3,'.$id.')" style="cursor:pointer"> 3 </td>
<td class="Cmite" onClick="doVote(4,'.$id.')" style="cursor:pointer"> 4 </td>
<td class="Cdark" onClick="doVote(5,'.$id.')" style="cursor:pointer"> 5 </td>
<td class="Cmite" onClick="doVote(6,'.$id.')" style="cursor:pointer"> 6 </td>
<td class="Cdark" onClick="doVote(7,'.$id.')" style="cursor:pointer"> 7 </td>
<td class="Cmite" onClick="doVote(8,'.$id.')" style="cursor:pointer"> 8 </td>
<td class="Cdark" onClick="doVote(9,'.$id.')" style="cursor:pointer"> 9 </td>
<td class="Cmite" onClick="doVote(10,'.$id.')" style="cursor:pointer"> 10 </td>'."\n";
}else{
$return='
<td class="Cdark">Du muss eingeloggt sein um zu voten</td>
';
}
$tpl->set('write_vote',$return);
}
function make_art_pages($s,$page,$art_id) {
$return = array('links'=>'[ ','content'=>'');
$s_arr = preg_split('/\[NEWARTPAGE\]/', $s);
foreach($s_arr as $key=>$value){
if ($page == $key){
$return['content'] = $value;
$return['links'] .= $key === 0?($key+1):' | '.($key+1);
}else{
$return['links'] .= ($key === 0?'<a href="?articles-show-'.$art_id.'-P'.$key.'">'.($key+1).'</a>':
' | <a href="?articles-show-'.$art_id.'-P'.$key.'">'.($key+1).'</a>');
}
}
$return['links'] .= ' ]';
if($return['links'] === '[ 1 ]'){$return['links'] = '';}
if(empty($return['content'])){$return['content'] = $s_arr[0];}
return ($return);
}
function get_cats_title ( $catsar ){
$l = '';
foreach($catsar as $k => $v){
if ( $k != '' AND $v != '' ) {
$l = $v.' :: '.$l;
}
}
return ($l);
}
function get_cats_urls($catsar){
$l = '';
foreach($catsar as $k => $v) {
if ( $k != '' AND $v != '' ) {
$l = '<a class="smalfont" href="?articles-'.$k.'">'.$v.'</a><b> » </b>'.$l;
}
}
return ($l);
}
function get_cats_array($cid, $ar){
if ( empty($cid) ) {
return ($ar);
}else{
$erg = db_query("SELECT cat,id,name FROM `prefix_artsys_cats` WHERE id = ".$cid);
$row = db_fetch_assoc($erg);
$ar[$row['id']] = $row['name'];
return (get_cats_array($row['cat'],$ar));
}
if ($r){
return ($l);
}
}
function count_art($cid){
$zges = 0;
$e = db_query("SELECT id FROM `prefix_artsys_cats` WHERE cat = ".$cid);
if ( db_num_rows($e) > 0 ) {
while ($r = db_fetch_assoc($e) ) {
$zges = $zges + count_art ($r['id']);
}
}
$zges = $zges + db_count_query("SELECT COUNT(art_id) FROM `prefix_artsys_articles` WHERE art_cat = ".$cid." AND art_status = 1");
return ($zges);
}
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 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'].' :: Artikeln ';
$hmenu = '<a class="smalfont" href="?articles">Artikeln</a>';
$design = new design ( $title , $hmenu );
$design->header();
echo 'Die Kategorie wurde nicht gefunden';
$design->footer(1);
}
$cattitle = '';
$catname = '';
}
#-> Ausgabe
$title = $allgAr['title'].' :: Artikeln '.$cattitle;
$hmenu = '<a class="smalfont" href="?articles">Artikeln</a>'.$catname;
$design = new design ( $title , $hmenu );
$design->header();
$tpl = new tpl ('articles' );
$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 == 'Cmite' ? 'Cnorm' : 'Cmite');
$row['class'] = $class;
$tpl->set_ar_out($row,2);
}
$tpl->out(3);
}
# sortierung festlegen
$sortierung = 'art_id ASC';
$DOM = 'ASC';
$POM = 'ASC';
$DAM = 'ASC';
switch ($menu->get(2)) {
case 'positionDESC' : $sortierung = 'art_id DESC'; break;
case 'positionASC' : $sortierung = 'art_id ASC'; $POM = 'DESC'; break;
case 'seeDESC' : $sortierung = 'art_viewed DESC'; break;
case 'seeASC' : $sortierung = 'art_viewed ASC'; $DOM = 'DESC'; break;
case 'dateDESC' : $sortierung = 'art_time DESC'; break;
case 'dateASC' : $sortierung = 'art_time ASC'; $DAM = 'DESC'; break;
}
$tpl->set ('POM', $POM);
$tpl->set ('DOM', $DOM);
$tpl->set ('DAM', $DAM);
$erg = db_query("SELECT art_id,art_title,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 ".$sortierung);
if ( db_num_rows($erg) > 0 ) {
$tpl->out(4); $class = 'Cnorm';
while($row = db_fetch_assoc($erg) ) {
$class = ( $class == 'Cmite' ? 'Cnorm' : 'Cmite' );
$row['class'] = $class;
$row['username'] = get_n($row['art_uid']);
$tpl->set_ar_out($row,5);
}
$tpl->out(6);
}
$design->footer();
break;
case 'show':
$fid = escape($menu->get(2), 'integer');
$erg = db_query("SELECT art_cat,art_viewed,art_votes,art_rating,art_title,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))")OR die(mysql_error());
if (@db_num_rows($erg) !== 1) {
$title = $allgAr['title'].' :: Artikeln ';
$hmenu = '<a class="smalfont" href="?articles">Artikeln</a>';
$design = new design ( $title , $hmenu );
$design->header();
echo 'Der Artikel 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);
}
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)OR die(mysql_error());
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['name'].' '.$row['version'];
$catname = '<b> » </b>'.$namezw.'<a class="smalfont" href="?articles-'.$row1['id'].'">'.$row1['name'].'</a><b> » </b>'.$row['name'].' '.$row['version'];
} else {
$cattitle = '';
$catname = '';
}
#-> Artikel-Page setzen
if ($menu->getA(3) === 'P'){
$art_page = $menu->getE(3);
}else{$art_page = 0;}
#-> Anz kommentare holen
$comAnz= db_result(db_query("SELECT COUNT(ID) FROM `prefix_koms` WHERE uid = ".$row['art_id']." AND cat = 'ARTICLES'"),0);
#-> Ausgabe
$tpl = new tpl ('articles' );
$row['comOderShow'] = ' <a href="index.php?articles-com-'.$row['art_id'].'">'.$comAnz.' '.$lang['comments'].'</a>';
if ($row['art_uid'] == $_SESSION['authid'] OR $_SESSION['authright'] <= -7) $row['comOderShow'] .= ' <a href="index.php?articles-edit-'.$row['art_id'].'">Edit </a>';
$page = make_art_pages(bbcode($row['art_content']),$art_page,$fid);
$title = $allgAr['title'].' :: Artikeln '.$cattitle;
$hmenu = '<a class="smalfont" href="?articles">Artikeln</a>'.$catname;
$design = new design ( $title , $hmenu );
$row['creater'] = get_n($row['art_uid']);
$design->header();
show_vote($row['art_id']);//Vote ausgeben
$tpl->set_ar_out($row,7);
$tpl->set_ar_out($page,8);
$tpl->out(12);
$design->footer();
break;
case 'com':
$fid = escape($menu->get(2), 'integer');
$erg = db_query("SELECT art_cat,art_viewed,art_votes,art_rating,art_title,art_uid,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))")OR die(mysql_error().'111');
if (@db_num_rows($erg) !== 1) {
$title = $allgAr['title'].' :: Artikeln ';
$hmenu = '<a class="smalfont" href="?articles">Artikeln</a>';
$design = new design ( $title , $hmenu );
$design->header();
echo 'Der Artikel wurde nicht gefunden';
$design->footer(1);
}
$row = db_fetch_assoc($erg);
#-> Kategorien-Pfad erstellen
$cid = $row['art_cat'];
$erg1 = db_query("SELECT id,cat,name FROM `prefix_artsys_cats` WHERE id = ".$cid)OR die(mysql_error().'112');
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['name'].' '.$row['version'];
$catname = '<b> » </b>'.$namezw.'<a class="smalfont" href="?articles-'.$row1['id'].'">'.$row1['name'].'</a><b> » </b>'.$row['name'].' '.$row['version'];
} else {
$cattitle = '';
$catname = '';
}
# kommentar add
if (!empty($_POST['name']) AND !empty($_POST['text']) AND ($gast_allow === 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)OR die('dl22');
}
#-> Ausgabe
$tpl = new tpl ('articles' );
$row['comOderShow'] = ' <a href="?articles-show-'.$row['art_id'].'">Artikel lesen</a>';
$title = $allgAr['title'].' :: Artikeln '.$cattitle;
$hmenu = '<a class="smalfont" href="?articles">Artikeln</a>'.$catname;
$design = new design ( $title , $hmenu );
$row['creater'] = get_n($row['art_uid']);
$design->header();
show_vote($row['art_id']);//Vote ausgeben
$tpl->set_ar_out($row,7);
#-> Kommentar insertfields
if ($gast_allow === 2 OR loggedin()){
$row_ins = array('uname'=>get_n($_SESSION['authid']),'art_id'=>$row['art_id']);
$tpl->set_ar_out($row_ins,9);
}elseif($gast_allow !== 0){
$tpl->set_out('writeout','du musst eingelogt sein um einen Kommentare zu schreiben',10);
}
#-> kommentar show
$erg2 = db_query("SELECT text, name, id FROM `prefix_koms` WHERE uid = ".$row['art_id']." AND cat = 'ARTICLES' ORDER BY id DESC")OR die(mysql_error());
$ergAnz1 = db_num_rows($erg2);
if ( $ergAnz1 == 0 ) {
$tpl->set_out('writeout',$lang['nocomments'],10);
$tpl->out(12);
}elseif($gast_allow === 0 AND !loggedin()){
$tpl->set_out('writeout','du musst eingelogt sein um die Kommentare zu sehen, bzw. einen zu schreiben',10);
$tpl->out(12);
}else{
$zahl = $ergAnz1;
while ($row2 = db_fetch_assoc($erg2)) {
$row2['text'] = bbcode(trim($row2['text']));
if (is_admin()) {
$row2['text'] .= '<a href="index.php?articles-com-'.$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 ),11);
$zahl--;
}
$tpl->out(12);
}
# kommentar show ende
$design->footer();
break;
case 'edit':
#Config - Begin
$artadmin = 1; //ID des Users, der die PMs über neue Artikel bekommen soll
$editright = -1; //Recht ab dem Artikel verfasst werden dürfen
#Config - End
$title = $allgAr['title'].' :: Artikeln :: Editor';
$hmenu = 'Artikel <b>»</b> Editor';
$design = new design ( $title , $hmenu );
$design->header();
$art_id = 'nix';
$perm = TRUE;
if (!empty($_POST['preview'])) {
//Vorschau
$art_id = $_POST['id'];
$art_title = escape($_POST['title'],'string');
$txt = unescape($_POST['txt']);
$cat_nmbr = $_POST['cat'];
if ($art_id <> 'nix') $readonly = ' readonly="readonly"';
?>
<table class="border" border="0" cellspacing="1" cellpadding="3" width="95%">
<tr class="Chead"><th>Vorschau</th></tr>
<tr style="background-color:white"><td><?= bbcode($txt)?></td></tr>
</table><br />
<?
}
elseif (!empty($_POST['submit']) AND $_SESSION['authright'] <= $editright) {
//Absenden
$art_stat = ($_SESSION['authright'] <= -7 ? 1 : 0);
if ($_POST['id'] == 'nix') $query = 'INSERT INTO `prefix_artsys_articles` (art_uid,art_cat,art_time,art_title,art_content,art_status) VALUES
('.$_SESSION['authid'].','.$_POST['cat'].',NOW(),"'.escape($_POST['title'],'string').'","'.escape($_POST['txt'],'textarea').'",'.$art_stat.')';
elseif ($_SESSION['authright'] <= -7 OR db_result(db_query("SELECT art_uid FROM `prefix_artsys_articles` WHERE art_id = ".$_POST['id']),0) == $_SESSION['authid']) $query = 'UPDATE `prefix_artsys_articles` SET art_status = '.$art_stat.', art_content = "'.escape($_POST['txt'],'textarea').'" WHERE art_id = '.$_POST['id'].' LIMIT 1';
db_query($query) OR die($erg.mysql_error());
if ($_SESSION['authright'] > -7) {
sendpm(0, $artadmin, 'Neuer Artikel', 'Es wurde ein neuer Artikel in der Kategorie [b]'.db_result(db_query("SELECT name FROM `prefix_artsys_cats` WHERE id = ".$_POST['cat']),0).'[/b] geschrieben/verändert und wartet darauf freigeschaltet zu werden!\n\nDas Artikelmodul ;)', -1);
echo 'Der Artikel wurde abgeschickt und dem Administrator eine Nachricht geschickt, damit er den Artikel freischalten kann.<br />';
}
else echo 'Der Artikel wurde eingetragen<br />';
echo '<a href="index.php?articles">Zurück zu den Artikeln</a><br />';
}
elseif (is_numeric($menu->get(2))) {
$art_id = $menu->get(2);
$sql = db_query('SELECT * FROM `prefix_artsys_articles` WHERE art_id = '.$art_id);
if (db_num_rows($sql) == 1) {
$article = db_fetch_assoc($sql);
if ($article['art_uid'] == $_SESSION['authid'] OR $_SESSION['authright'] <= -7) $perm = TRUE; else $perm = FALSE;
$art_title = $article['art_title'];
$txt = $article['art_content'];
$cat_nmbr = $article['art_cat'];
$readonly = ' readonly="readonly"';
}
else {
echo "Den Artikel mit der ID $art_id gibt es nicht!<br />";
$art_id = 'nix';
}
}
if (empty($_POST['submit']) AND $perm AND $_SESSION['authright'] <= $editright) {
?>
<form name="form" method="POST" action="index.php?articles-edit">
<input type="hidden" name="id" value="<?=$art_id?>">
<table class="border" border="0" cellspacing="1" cellpadding="3">
<tr><th class="Chead" colspan="2">Artikel Editor</th></tr>
<tr><td class="Cmite">Titel:</td><td class="Cnorm"><input type="text" size="40" maxlength="80" name="title" value="<?= $art_title?>"<?=$readonly?>></td></tr>
<tr><td class="Cmite">Kategorie:</td><td class="Cnorm">
<?
if (!empty($readonly)) echo '<input type="text" size="40" readonly="readonly" value="'.($cat_nmbr == 0 ? 'keine' : db_result(db_query("SELECT name FROM `prefix_artsys_cats` WHERE id = $cat_nmbr"),0)).'"><input type="hidden" name="cat" value="'.$cat_nmbr.'">';
else {
echo '<select name="cat">';
echo '<option value="0"'.($cat_nmbr == '0' ? ' selected="selected"' : '').'>keine</option>';
$sql = db_query('SELECT * FROM `prefix_artsys_cats` WHERE recht >= '.$_SESSION['authright'].' ORDER BY pos');
while ($cat = db_fetch_assoc($sql)){
echo '<option value="'.$cat[id].'"'.($cat_nmbr == $cat[id] ? ' selected="selected"' : '').'>'.$cat['name'].'</option>';
}
echo '</select>';
}
?>
</td></tr>
<tr><td colspan="2" class="Cnorm">
<!-- BB Code START -->
{__BBCodeButtons__}
<!-- BB Code START -->
</td>
</tr>
<tr class="Cmite"><td colspan="2"><textarea name="txt" cols="60" rows="15"><?= $txt?></textarea></td></tr>
<tr class="Cmite"><td colspan="2"><input type="submit" name="preview" value="Vorschau"> <input type="submit" name="submit" value="Absenden"></td></tr>
</table>
</form>
<? }
elseif (empty($_POST['submit']))
{echo 'Du hast nicht die nötigen Rechte';}
$design->footer();
break;
}
?>
im moment sieht es so aus