Ich möchte nun für meine neue Clanseite ein Design zu Ilch anpassen. Zusätzlich habe ich vor, weitgehend auf Tabellen zu verzichten, um meinen Style (u.a. CSS-Sprites) besser anzupassen (zumindest in den Boxen).
Nun habe ich folgende Boxen verändert:
lastnews.php
lastforum.php
lastwars.php
login.php
picofx.php
shoutbox.php
vote.php
Ich habe jediglich die echo Werte so verändert, dass statt Tabellen Listen ausgegeben werden.
Nun habe ich das Addon "News Extended 1.4" von Mairu und TOPOLINO installiert und zudem die top.html umstrukturiert. Zudem habe ich auch vor, das komplette Newssystem von Tabellen zu befreien.
Leider hat sich bei der Aktualisierung ein Bug ergeben: in den modifizierten Boxen lastwars, shoutbox und picofx haben sich <b>-Tags erschlichen, die ich keineswegs eingebaut habe. Zudem ist diese Anzeige nur auf der Newsseite erkennbar, was auf das News Modul zurückschließt. Die Screenshots verdeutlichen meinen Problemfall:
Die Quelltexte zu den modifizierten & betroffenen Dateien:
lastforum.php
<?php # Copyright by Manuel # Support www.ilch.de defined ('main') or die ( 'no direct access' ); $farbe = ''; $farb2 = ''; echo '<ul>'; $erg = db_query('SELECT * FROM prefix_wars WHERE status = "3" ORDER BY datime DESC LIMIT 3'); while ($row = db_fetch_object($erg) ) { $row->tag = ( empty($row->tag) ? $row->gegner : $row->tag ); if ($row->wlp == 1) { $bild = 'win'; } elseif ($row->wlp == 2) { $bild = 'lose'; } elseif ($row->wlp == 3) { $bild = 'draw'; } echo '<li><span>'.get_wargameimg($row->game).'</span>'; echo '<a href="index.php?wars-more-'.$row->id.'">'; echo '<span class="clone2">'.$row->tag.' vs TWA</span><span class="wresult '.$bild.'">'.$row->owp.':'.$row->opp.'</span></a></li>'; } echo '</ul>'; ?>
picofx.php
<?php /* ilchClan Pic of the X modul -------------------------------------------------------------| Copyright : copy by Manuel | E-Mail : Webmaster@ilch.de | Internet : www.ilch.de | Version : v.1 | Lastupdate : 20.12.2005 | Modul Copyright : copy by David "scarfhogg" | ------------------------------------------------------------*/ defined ('main') or die ( 'no direct access' ); $svResult = db_query('SELECT * FROM prefix_allg WHERE k = \'picofx\''); while($saRow = db_fetch_assoc($svResult)) { $picofxOpts[$saRow['v1']] = $saRow['v2']; } //var_dump($picofxOpts); $picofxNow = date('Y-m-d'); // pruefen ob das bild gewechselt werden muss. if($picofxOpts['nextchange'] == $picofxNow || $picofxOpts['nextchange'] < $picofxNow) { if($picofxOpts['directory'] == 0) { $picofxOpts['pic'] = @db_result(db_query("SELECT id FROM prefix_gallery_imgs ORDER BY RAND() LIMIT 1"),0); } else { $picofxOpts['pic'] = @db_result(db_query("SELECT id FROM prefix_gallery_imgs WHERE cat = ".$picofxOpts['directory']." ORDER BY RAND() LIMIT 1"),0); } if (!empty($picofxOpts['pic'])) { $picofxOpts['pic'] .= '.'.@db_result(db_query("SELECT endung FROM prefix_gallery_imgs WHERE id = ".$picofxOpts['pic']),0); } $picofxNextChange = date('Y-m-d', time() + 3600 * 24 * $picofxOpts['interval']); // geaendertes pic in db speichern db_query('UPDATE prefix_allg SET v2 = \''. $picofxOpts['pic'] .'\' WHERE k = \'picofx\' AND v1 =\'pic\' LIMIT 1'); db_query('UPDATE prefix_allg SET v2 = \''. $picofxNextChange .'\' WHERE k = \'picofx\' AND v1 =\'nextchange\' LIMIT 1'); } $picofxThumb = 'img_thumb_'.$picofxOpts['pic']; if ($picofxOpts['pic'] != '' AND file_exists ('include/images/gallery/'.$picofxThumb)) { $picofxThumb = 'img_thumb_'.$picofxOpts['pic']; $picofxImg = getimagesize('include/images/gallery/'.$picofxThumb); if($picofxImg[0] < $picofxOpts['picwidth']) { $picofxImg[1] = @ceil(($picofxImg[1] / $picofxImg[0]) * $picofxOpts['picwidth']); $picofxImg[0] = $picofxOpts['picwidth']; } list ($id, $endung) = explode('.', $picofxOpts['pic']); if ($picofxOpts['directory'] == 0) { $cid = db_result(db_query("SELECT cat FROM prefix_gallery_imgs WHERE id = ".$id),0); } else { $cid = $picofxOpts['directory']; } $anz = db_result(db_query("SELECT COUNT(*) FROM prefix_gallery_imgs WHERE id < ".$id." AND cat = ".$cid),0); $weite = $allgAr['gallery_normal_width']+30; ?> <script language="JavaScript" type="text/javascript"> <!-- function picOfxOeffneFenster (bildr, cat) { var fenster = window.open ('index.php?gallery-show-'+cat+'-p'+bildr,'showBild','scrollbars=yes,height=600,width=<?php echo $weite; ?>,left=200,status=yes'); fenster.focus(); return (false); } //--> </script> <?php echo '<div>'; echo '<a target="_blank" href="index.php?gallery-show-'.$cid.'-p'.$anz.'" onClick="return picOfxOeffneFenster('.$anz.','.$cid.');"><img src="include/images/gallery/'.$picofxThumb.'" width="'.$picofxImg[0].'" height="'.$picofxImg[1].'" alt=""></a>'; echo '</div>'; } else { echo $lang['nothingavailable']; } ?>
shoutbox.php
<?php // Copyright by Manuel // Support www.ilch.de defined ('main') or die ('no direct access'); if (loggedin()) { $shoutbox_VALUE_name = $_SESSION['authname']; } else { $shoutbox_VALUE_name = 'Nickname'; } if (has_right($allgAr['sb_recht'])) { if (!empty($_POST['shoutbox_submit']) AND chk_antispam ('shoutbox')) { $shoutbox_nickname = escape($_POST['shoutbox_nickname'], 'string'); $shoutbox_nickname = substr($shoutbox_nickname, 0, 15); $shoutbox_textarea = escape($_POST['shoutbox_textarea'], 'textarea'); $shoutbox_textarea = preg_replace("/\[.?(url|b|i|u|img|code|quote)[^\]]*?\]/i", "", $shoutbox_textarea); $shoutbox_textarea = strip_tags($shoutbox_textarea); if (!empty($shoutbox_nickname) AND !empty($shoutbox_textarea)) { db_query('INSERT INTO `prefix_shoutbox` (`nickname`,`textarea`) VALUES ( "' . $shoutbox_nickname . '" , "' . $shoutbox_textarea . '" ) '); } } echo '<div class="shout-field"><form action="index.php?' . $menu->get_complete() . '" method="POST">'; echo '<input class="input-text" type="text" size="15" name="shoutbox_nickname" value="' . $shoutbox_VALUE_name . '" onFocus="if (value == \'' . $shoutbox_VALUE_name . '\') {value = \'\'}" onBlur="if (value == \'\') {value = \'' . $shoutbox_VALUE_name . '\'}" maxlength="15">'; echo '<br /><textarea class="input-text" style="width: 80%" cols="15" rows="2" name="shoutbox_textarea"></textarea><br />'; $antispam = get_antispam ('shoutbox', 0); echo $antispam; if (!empty($antispam)) { echo '<br />'; } echo '<input class="send" type="submit" value="' . $lang['formsub'] . '" name="shoutbox_submit">'; echo '</form></div>'; } echo '<ul>'; $erg = db_query('SELECT * FROM `prefix_shoutbox` ORDER BY id DESC LIMIT ' . (is_numeric($allgAr['sb_limit'])?$allgAr['sb_limit']:5)); $class = 'Cnorm'; while ($row = db_fetch_object($erg)) { $class = ($class == 'Cmite' ? 'Cnorm' : 'Cmite'); echo '<li class="' . $class . '"><strong>' . $row->nickname . ':</strong><span class="shout-text"> ' . preg_replace('/([^\s]{' . $allgAr['sb_maxwordlength'] . '})(?=[^\s])/', "$1\n", $row->textarea) . '</span></li>'; } echo '</ul><a class="box" href="index.php?shoutbox" title="'. $lang['archiv'] .'">' . $lang['archiv'] . '</a>'; ?>
hier die modifizierte top.html:
<div class="featured"> <div class="content-news"> <span class="headnews">Featured News</span> <div class="hr"></div> <h1>{title} {koms}</h1> {txt} </div> </div>
Verwendete Ilch Version: 1.1 O
Modul: News Extended 1.4a
betroffene Homepage: localhost