ok, fangen wir an :-).
Im folgenden gehe ich davon aus, dass du die Language Box hast.
ic1 ist durch den prefix zu ersetzen(sollte in phpmyadmin unter SQL eingefügt werden);
ALTER TABLE `ic1_news` ADD `lang` VARCHAR( 2 ) NOT NULL ;
include/contents/news.php
Search and replace
$abf = "SELECT
a.news_title as title,
a.news_id as id,
DATE_FORMAT(a.news_time,'%d. %m. %Y') as datum,
DATE_FORMAT(a.news_time,'%W') as dayofweek,
a.news_kat as kate,
a.news_text as text,
b.name as username
FROM prefix_news as a
LEFT JOIN prefix_user as b ON a.user_id = b.id
WHERE ".$_SESSION['authright']." <= a.news_recht
AND a.lang = '".$_SESSION['language']."'
OR a.news_recht = 0
AND a.lang = '".$_SESSION['language']."'
ORDER BY news_time DESC
LIMIT ".$anfang.",".$limit;
include/admin/templates/news.htm
</tr><tr>
<td class="Cnorm"><textarea name="txt" rows="15" cols="72" tabindex="2">{txt}</textarea></td>
</tr><tr> //Ab hier geändert
<td class="Cmite" align="right"><strong>Sprache: </strong></td>
<td class="Cnorm">{lang}</td>
</tr><tr> //bis hier
<td class="Cmite" align="right"><strong>Sichtbar ab : </strong></td>
<td class="Cnorm"><select name="grecht">{_list_grecht@<option%1 value="%2">%3</option>}</select></td>
</tr><tr>
include/admin/news.php
<?php
# Copyright by: Manuel
# Support: www.ilch.de
defined ('main') or die ( 'no direct access' );
defined ('admin') or die ( 'only admin access' );
$design = new design ( 'Admins Area', 'Admins Area', 2 );
$design->header();
//-----------------------------------------------------------|
##
###
####
##### F u n k t i o n e n
function getKats ( $akt ) {
$katAR = array();
$kats = '';
$erg = db_query("SELECT DISTINCT news_kat FROM `prefix_news`");
while ($row = db_fetch_object($erg)) {
$katAr[] = $row->news_kat;
}
$katAr[] = 'Allgemein';
$katAr = array_unique($katAr);
foreach($katAr as $a) {
if (trim($a) == trim($akt)) {
$sel = ' selected';
} else {
$sel = '';
}
$kats .= '<option'.$sel.'>'.$a.'</option>';
}
return ($kats);
}
function langfiles () { // neue Funktion (aus dem language Box mod)
$lang = '<select name="lang">';
$o = opendir ('include/includes/lang');
while ( $f = readdir($o) ) {
if ( $f != '.' AND $f != '..' AND is_file('include/includes/lang/'.$f) ) {
$f = basename ($f,".php");
$s = ( $f == $_SESSION['language'] ? ' selected' : '' );
$lang .= '<option'.$s.'>'.$f.'</option>';
}
}
$lang .= '</select>';
return ($lang);
}
##### F u n k t i o n
####
###
##
#
##
###
####
##### A k t i o n e n
if ( !empty($_REQUEST['um']) ) {
$um = $_REQUEST['um'];
if ( $um == 'insert' ) {
# insert
$text = escape($_POST['txt'], 'textarea');
if ( $_POST['katLis'] == 'neu' ) {
$_POST['katLis'] = $_POST['kat'];
} //language dazu
db_query("INSERT INTO `prefix_news` (news_title,user_id,news_time,news_recht,news_kat,news_text,lang)
VALUES ('".$_POST['titel']."',".$_SESSION['authid'].",NOW(),".$_POST['grecht'].",'".$_POST['katLis']."','".$text."','".$_POST['lang']."')");
# insert
} elseif ( $um == 'change' ) {
# edit
$text = addslashes($_POST['txt']);
if ( $_POST['katLis'] == 'neu' ) {
$_POST['katLis'] = $_POST['kat'];
}
db_query('UPDATE `prefix_news` SET
news_title = "'.$_POST['titel'].'",
user_id = "'.$_SESSION['authid'].'",
news_recht = "'.$_POST['grecht'].'",
news_kat = "'.$_POST['katLis'].'",
lang = "'.$_POST['lang'].'", //neu
news_text = "'.$text.'" WHERE news_id = "'.$_POST['newsID'].'" LIMIT 1');
$edit = $_POST['newsID'];
}
}
# edit
# del
if ( $menu->get(1) == 'del' ) {
db_query('DELETE FROM `prefix_news` WHERE news_id = "'.$menu->get(2).'" LIMIT 1');
}
#del
##### A k t i o n e n
####
###
##
#
##
###
####
##### h t m l E i n g a b e n
if ( empty ($doNoIn) ) {
$limit = 20; // Limit
$page = ($menu->getA(1) == 'p' ? $menu->getE(1) : 1 );
$MPL = db_make_sites ($page , '' , $limit , "?news" , 'news' );
$anfang = ($page - 1) * $limit;
if ( $menu->get(1) != 'edit' ) {
$FnewsID = '';
$Faktion = 'insert';
$Fueber = '';
$Fstext = '';
$Ftxt = '';
$Fgrecht = '';
$FkatLis = '';
$Flang = langfiles (); // die Funktion wird aufgerufen
$Fsub = 'Eintragen';
} else {
$row = db_fetch_object(db_query("SELECT * FROM `prefix_news` WHERE news_id = ".$menu->get(2)));
$FnewsID = $row->news_id;
$Faktion = 'change';
$Fueber = $row->news_title;
$Ftxt = stripslashes($row->news_text);
$Fgrecht = $row->news_recht;
$FkatLis = $row->news_kat;
$Flang = langfiles (); // die Funktion wird aufgerufen
$Fsub = 'Ändern';
}
$tpl = new tpl ( 'news', 1);
$ar = array
(
'NEWSID' => $FnewsID,
'AKTION' => $Faktion,
'MPL' => $MPL,
'UEBER' => $Fueber,
'txt' => $Ftxt,
'SMILIS' => getsmilies(),
'grecht' => dbliste($Fgrecht,$tpl,'grecht',"SELECT id,name FROM prefix_grundrechte ORDER BY id DESC"),
'KATS' => getKats($FkatLis),
'FSUB' => $Fsub,
'lang' => $Flang //wird nun zum template geschickt
);
$tpl->set_ar_out($ar,0);
# e d i t , d e l e t e
$abf = 'SELECT news_id,news_title
FROM `prefix_news`
ORDER BY news_time DESC
LIMIT '.$anfang.','.$limit;
$erg = db_query($abf);
$class = '';
while ($row = db_fetch_object($erg) ) {
$class = ($class == 'Cmite' ? 'Cnorm' : 'Cmite' );
$tpl->set_ar_out( array ( 'ID' => $row->news_id, 'class' => $class, 'TITEL' => $row->news_title ) , 1 );
}
# e d i t , d e l e t e
$tpl->set_ar_out( array ('MPL' => $MPL ) , 2 );
}
$design->footer();
?>
Kann sein, dass man was ändern muss, da ich BBcode 2.0 hab. habe aber de änderungen angekreidet
Zuletzt modifiziert von Bummelmann am 22.11.2007 - 21:48:41