Tag,
ist es möglich in den Artikel bzw. in dem Block "Last 5 Articels" eine Info einzufügen ala
eingestellt vor xx Minuten
oder
eingestellt am xx.xx.xxxx xx.xx Uhr
Danke für eine Info
LG B!
Datum habe ich jetzt schon. Wie bekomme ich jetzt die Uhrzeit hinter das Datum ??
<?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/html/blocks/Attic/block-News_short.php,v $
* $Revision: 1.1.2.2 $
* $Author: tora60 $
* $Date: 2006/11/20 14:26:42 $
*/
if (!defined("mxMainFileLoaded")) die ("You can't access this file directly...");
/**
* -----------------------------------------------------------------------------
* Einstellungen fuer den Block
*/
// News-Modulname
$module_name = "News";
// BlockCache ermöglichen?
$mxblockcache = true;
// Anzahl der Artikel die angezeigt werden,
// es kann anstatt $GLOBALS['storyhome'] auch eine normale Zahl angegeben werden
$storynum = 10;
// Anzahl der Zeichen die angezeigt werden
$textlen = 180;
// Bilder im Text anzeigen
$showpics = true;
/**
* ##################################################################################################
*/
global $prefix;
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 sid, aid, s.title, time, DATE_ADD(time, INTERVAL 2 DAY) AS expire, now() AS nowi, hometext, bodytext, comments, s.counter, topic, informant, notes, acomm
FROM ${prefix}_stories AS s
WHERE (ihome='0' OR s.catid='0') AND time <= now() $querylang
ORDER BY s.time DESC
limit 0,$storynum";
$result = sql_query($qry);
if (!$result) {
return;
}
$list = '';
while ($story = sql_fetch_assoc($result)) {
$story['title'] = "<a href=\"modules.php?name=$module_name&file=article&sid=" . $story['sid'] . "\">" . strip_tags($story['title']) . "</a>";
$story['hometext'] = preg_replace('#<br\s*/*>#i', ' ', $story['hometext']);
if ($showpics) {
$story['hometext'] = strip_tags($story['hometext'], '<img>');
$replaces = array();
if (preg_match_all('#<img[^>]*>#si', $story['hometext'], $images)) {
foreach($images[0] as $i => $img) {
$alternate = md5($img);
$textlen = $textlen + strlen($alternate);
$replaces[$alternate] = $img;
$story['hometext'] = str_replace($img, $alternate, $story['hometext']);
}
}
$story['hometext'] = mxCutString(trim($story['hometext']), $textlen, "...", " ");
if (count($replaces)) {
$story['hometext'] = str_replace(array_keys($replaces), array_values($replaces), $story['hometext']);
}
} else {
$story['hometext'] = strip_tags($story['hometext']);
$story['hometext'] = mxCutString(trim($story['hometext']), $textlen, "...", " ");
}
$image = '';
if ($story['nowi'] < $story['expire']) {
$datetime = mx_strftime(_SHORTDATESTRING, mxSqlDate2UnixTime($story['time']));
$image = mxCreateImage("images/menu/new.gif", 'new: ' . $datetime) . " ";
}
$list .= "<p>" .$datetime . " - <strong>" . $story['title'] . "</strong><br> " . $story['hometext'] . "</p>";
}
if ($list) {
$content = $list;
}
?>