Eine Frage zum Modul Barock News
Ich würde gerne den Zwischenraum zwischen den Nachrichten verringern. wie funktinoiert das. Der code vom block ist unten.
anschauen könnt ihr das hier http://www.agiredila.de/lol/index.php
<?php
/**
* pragmaMx Content Management System
* Copyright (c) 2006 pragmaMx Dev Team - http://pragmaMx.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* $Source: /home/www/dps3311/home/cvsroot/pragmamx/pragmamx_01/blocks/block-News.php,v $
* $Revision: 1.4 $
* $Author: tora60 $
* $Date: 2007/04/12 20:18:29 $
*/
if (!defined("mxMainFileLoaded")) die ("You can't access this file directly...");
/**
* -----------------------------------------------------------------------------
* Einstellungen fuer den Block
*/
// die ersten Teile des Artikeltextes anzeigen,
// - 0 fuer nein, oder
// - eine beliebige Zahl, die die Menge der angezeigten Zeichen definiert
// HTML-Tags, ausser <br> werden entfernt und nicht mitgerechnet
$showintro = 200;
// Bilder im Text anzeigen, wenn $showintro angeschaltet ist
$showpics = false;
// Buttonleiste anzeigen
$showbuttons = 1;
// Veroeffentlichungsdatum anzeigen
$showdate = 1;
// Kategorie zusammen mit der Artikelueberschrift anzeigen
$showcattitle = 1; # 0 Nein, 1 Ja,
// Anzahl der Spalten
$showcolumns = 2;
// Anzahl der angezeigten Artikel
// - eine beliebige Zahl, oder
// - die globale Variable $GLOBALS['storyhome']
#$storynum = $GLOBALS['storyhome'];
$storynum = 4;
// Links zu Suche etc. anzeigen
$showextendedlinks = 1;
// Blockcache erlauben
$mxblockcache = true;
// Einstellungen für fieldset
// Siehe Muster www.soneros.eu
$fieldsetbackground = '#F8EEEB';
$legendfontcolor = '#0058A5';
$datetimefontcolor = '#9f0011';
/**
* ENDE Einstellungen fuer den Block
* -----------------------------------------------------------------------------
*/
global $prefix, $bgcolor1, $bgcolor2, $bgcolor3;
if ($GLOBALS["multilingual"] == 1) {
if (ereg("german", $GLOBALS["currentlang"])) $thislang = "german";
else $thislang = $GLOBALS["currentlang"];
$querylang = "AND (alanguage LIKE '" . $thislang . "%' OR alanguage='')";
} else {
$querylang = "";
}
$qry = "SELECT s.sid, cat.catid, aid, s.title, time, DATE_ADD(time, INTERVAL 2 DAY) AS expire, now() AS jetzt, hometext, bodytext, comments, s.counter, topic, informant, notes, acomm, cat.title AS title1
FROM ${prefix}_stories AS s LEFT JOIN ${prefix}_stories_cat AS cat ON s.catid = cat.catid
WHERE (ihome='0' OR s.catid='0') AND time <= now() $querylang
ORDER BY s.time DESC, s.sid DESC
limit 0,$storynum";
$result = sql_query($qry);
if (!$result) {
return;
}
// $empty = "<img src=\"images/menu/empty.gif\" border=0 >";
$count = 0;
$out = '';
$width = ceil(100 / $showcolumns);
while ($story = sql_fetch_assoc($result)) {
// Textlaengen
// $introcount = strlen(strip_tags($story['hometext']));
// $fullcount = strlen(strip_tags($story['bodytext']));
$totalcount = strlen(strip_tags($story['hometext'])) + strlen(strip_tags($story['bodytext']));
$introtext = '';
if ($showintro) {
if ($showpics) {
// Alle Tags ausser <br> & <img> entfernen
$introtext = trim(strip_tags($story['hometext'], '<br><img>'));
// <br> am Textbeginn entfernen
$introtext = preg_replace('#^(?:<br\s*/*>\s*)*#is', '', $introtext);
// array zuruecksetzen
$replaces = array();
$textlentemp = $showintro;
// alle Imagetags suchen und zwischenspeichern
if (preg_match_all('#<img[^>]*>#si', $introtext, $images)) {
foreach($images[0] as $i => $img) {
// einen alternativen String zum Ersetzen erstellen
$alternate = md5($img);
// die gewuenschte Textlaenge um die Textlaenge des alternativen String erweitern
$textlentemp = $showintro + strlen($alternate);
// den gefundenen Imagetag in das array stellen
$replaces[$alternate] = $img;
// den gefundenen Imagetag aus dem Text entfernen und dafuer den alternativen String einsetzen
$introtext = trim(str_replace($img, $alternate, $introtext));
}
}
// Text auf die gewuenschte Laenge kuerzen
$introtext = mxCutString($introtext, $textlentemp, " ...", " ");
// wenn imagetags gefunden wurden, die alternativen Textteile wieder
// durch die im Array zwischengespeicherten Imagetags ersetzen
if (count($replaces)) {
$introtext = str_replace(array_keys($replaces), array_values($replaces), $introtext);
}
// Text auf die gewuenschte Laenge kuerzen
$introtext = trim(mxCutString($introtext, $showintro, " ...", " "));
} else {
// Alle Tags ausser <br> entfernen
$introtext = trim(strip_tags($story['hometext'], '<br>'));
// <br> am Textbeginn entfernen
$introtext = preg_replace('#^(?:<br\s*/*>\s*)*#is', '', $introtext);
// Text auf die gewuenschte Laenge kuerzen
$introtext = trim(mxCutString($introtext, $showintro, " ...", " "));
}
if ($introtext) {
$introtext = '<div class="content">' . $introtext . '</div>';
}
}
// das formatierte Datum
$datetime = '';
if ($showdate) {
$datetime = '<td width="96%" style="padding-top:10px;">
<span style="margin-left:5px; margin-right:5px;
font-family:Verdana, Arial, Helvetica, sans-serif; color:'.$datetimefontcolor.'; font-weight: bold; font-size: 12px;">
' . mx_strftime(_SHORTDATESTRING, mxSqlDate2UnixTime($story['time'])) . '
</span></td>';
}
// die Buttons
$buttons = array();
if ($showbuttons) {
$buttons[] = '<a href="modules.php?name=News&file=print&sid=' . $story['sid'] . '" rel="nofollow"><img src="images/menu/print.gif" width=12 height=13 border=0 alt="' . _BMXPRINTER . '" title="' . _BMXPRINTER . '" ></a>';
if (mxModuleAllowed('Recommend_Us')) {
$buttons[] = '<a href="modules.php?name=News&file=friend&sid=' . $story['sid'] . '" rel="nofollow"><img src="images/menu/friend.gif" width=12 height=13 border=0 alt="' . _BMXFRIEND . '" title="' . _BMXFRIEND . '" ></a>';
}
$buttons[] = '<a href="modules.php?name=News&file=article&sid=' . $story['sid'] . '"><img src="images/menu/bytesmore.gif" border=0 width=12 height=13 alt="' . _BMXBYTESMORE . ' ' . $totalcount . '" title="' . _BMXBYTESMORE . ' ' . $totalcount . '" ></a>';
$buttons[] = '<a href="modules.php?name=News&file=article&sid=' . $story['sid'] . '#comments"><img src="images/menu/comments2.gif" width=12 height=13 border=0 alt="' . _COMMENTS . ' ' . $story['comments'] . '" title="' . _COMMENTS . ' ' . $story['comments'] . '" ></a>';
if (mxModuleAllowed('Userinfo')) {
$buttons[] = '<a href="modules.php?name=Userinfo&uname=' . $story['informant'] . '"><img src="images/menu/informant.gif" width=12 height=13 border=0 alt="' . $story['informant'] . '" title="' . _UNICKNAME . ': ' . $story['informant'] . '" ></a>';
}
$buttons[] = '<img src="images/menu/counter.gif" width=12 height=13 border=0 alt="' . $story['counter'] . ' ' . _READS . '" title="' . $story['counter'] . ' ' . _READS . '" >';
}
$colspan = count($buttons) + 1;
// $buttons = '<table border="0" cellspacing="1" cellpadding="1" align="right"><tr><td>'.implode('</td><td>', $button).'</td></tr></table>';
$buttons = '<td>' . implode('</td><td>', $buttons) . '</td>';
// der Titel des Artikels
$story['title'] = '<a href="modules.php?name=News&file=article&sid=' . $story['sid'] . '">
' . $story['title'] . '</a>';
// den Kategoriename mit anzeigen
if ($showcattitle && $story['catid']) {
#$story['title'] = $story['title'] . ' [<a href="modules.php?name=News&file=categories&op=newindex&catid=' . $story['catid'] . '">' . $story['title1'] . '</a>]';
$story['title'] = ''.$story['title'].'';
#<b>'.$story['title'].'</b>'
}
// $image = ($story['jetzt'] > $story['expire']) ? 'sign' : 'new';
// $out .= '<td colspan="'.$colspan.'"><img src="images/menu/' . $image . '.gif" align="middle" alt=""> '.$story['title'].'</td>';
if ($count == 0) {
$out .= '<tr valign="top">';
}
$out .= '
<td width="' . $width . '%" valign="top" style="padding-top:60px;
padding-left:5px; padding-right:5px; padding-bottom:0px; border: 0px solid ' . $bgcolor2 . ';">
<fieldset>
<legend>
<a href="modules.php?name=News&file=categories&op=newindex&catid=' . $story['catid'] . '"
style="font-family:Verdana, Arial, Helvetica, sans-serif; color:'.$legendfontcolor.'; font-weight: bold; font-size: 12px; margin-bottom:10px; margin-top:15px;">
' . $story['title1'] . '
</a> </legend>';
$out .= ' <table border="0" cellspacing="0" cellpadding="2" width="100%" bgcolor='.$fieldsetbackground.'>';
if ($datetime || $buttons) {
$out .= '
<tr valign="top" style="height: 10px;">
' . $datetime . '
</tr>
'; # ' . $datetime . $buttons . '
}
$out .= '
<tr valign="top" style="height: 35px;">
<td colspan="' . $colspan . '">
<div style="margin-left:5px; margin-right:5px; margin-top:10px; margin-bottom:20px;">
<b>' . $story['title'] . '</b>' . $introtext . '
</div></td>
</tr>
</table>
</td>
';
$count++;
if ($count * $width == 100) {
$out .= '</tr>';
$count = 0;
}
}
// falls nicht alle Tabellenspalten am Ende gefuellt sind, eine zus. anfuegen
if ($count && $out) {
$out .= '<td colspan="' . ($showcolumns - $count) . '"> </td>';
}
// die Links zu anderen Modulen
if ($showextendedlinks) {
if (mxModuleAllowed('Stories_Archive')) {
$links[] = '<a href="modules.php?name=Stories_Archive">' . _STORIEARCHIVE . '</a>';
}
if (mxModuleAllowed('Submit_News')) {
$links[] = '<a href="modules.php?name=Submit_News">' . _SUBMITNEWS . '</a>';
}
if (mxModuleAllowed('Search')) {
$links[] = '<a href="modules.php?name=Search">' . _SEARCH . '</a>';
}
if (isset($links)) {
$out .= '<tr><td style="padding:40px" align="center" colspan="' . $showcolumns . '" style="border: 0px solid ' . $bgcolor2 . ';">';
$out .= '[ ' . implode(' | ', $links) . ' ]';
$out .= '</td></tr>';
$out .= '<tr><td style="padding-bottom:40px" align="center" colspan="' . $showcolumns . '" style="border: 0px solid ' . $bgcolor2 . ';">';
$out .= '</td></tr>';
}
}
// content-tabelle, nur wenn ueberhaupt was zum anzeigen da ist...
if ($out) {
$content = '<table width="100%" border="0" cellspacing="2" cellpadding="5" align="center">' . $out . '</table>';
}
?>
irgendwie komme ich da nicht weiter was muss ich denn da ändern
Zitat$out .= '<tr><td style="padding:40px" align="center" colspan="' . $showcolumns . '" style="border: 0px solid ' . $bgcolor2 . ';">';
$out .= '[ ' . implode(' | ', $links) . ' ]';
$out .= '</td></tr>';
$out .= '<tr><td style="padding-bottom:40px" align="center" colspan="' . $showcolumns . '" style="border: 0px solid ' . $bgcolor2 . ';">';
Ändere mal da die Werte und schauen...
passiert nichts heval
Ich habe nun alle werte auf 5 gesetzt passiert nicht viel, ich möchte dass der abstand nicht groß ist
aber klappt ned