Mekrwürdig. Ohne Addon geht es.
Das ist der Code des Addons.
PHP-Code:
<?php
date_default_timezone_set('Europe/Paris');
function buildLastBlogAddon() {
global $explode;
global $settings;
global $optionen;
$thisAddonLastBlogModulHeadline = true; # Soll eine Überschrift angezeigt werden? (true = Ja, false = Nein)
$thisAddonLastBlogModulShow = false; # Sollen die letzten Blogs nur auf der Startseite angezeigt werden? (true = nur Startseite, false = alle Seiten) (Standard: false)
$thisAddonLastBlogModulLimit = 3; # Wieviele letzte Blogs sollen angezeigt werden? (Standard: 3)
$thisAddonLastBlogModulString = 180; # Soll der Blog auf eine bestimmte Anzahl an Zeichen gekürzt werden? (Leer lassen wenn nicht gewünscht!) (Standard: 180)
$thisAddonLastBlogModulPrev = 2; # Welcher Blogteil soll angezeigt werden? (0 = Vorschau, 1 = Blog, 2 = Wenn Vorschau vorhanden dann Vorschau) (Standard: 2)
$thisAddonLastBlogModulError = 'Bisher noch keinen Eintrag.'; # Welcher Text soll angezeigt werden, wenn der Blog leer ist? (Standard: leer)
$thisAddonLastBlogModulErrorShow = false; # Soll eine Meldung erscheinen, wenn der Blog leer ist? (true = Ja, false = Nein)
$thisAddonLastBlogModulLinkTitle = '(mehr lesen)'; # Text von Link, um mehr von dem angezeigten Blog zu lesen
$thisAddonLastBlogModul = @mysql_fetch_assoc(mysql_query("SELECT * FROM module WHERE ordner = 'blog' LIMIT 1"));
$thisAddonLastBlog = @mysql_query("SELECT * FROM modul_blog WHERE status='0' ORDER BY id DESC LIMIT 0,".$thisAddonLastBlogModulLimit."");
$checkStartseite = @mysql_fetch_assoc(mysql_query("SELECT * FROM pages WHERE id = '".(int)$explode['0']."' LIMIT 1"));
$checkBlogSite = @mysql_fetch_assoc(mysql_query("SELECT * FROM pages WHERE inhalt = '%BLOG%' LIMIT 1"));
if ($thisAddonLastBlogModul['code'] != "") {
if (($thisAddonLastBlogModulShow == true && $checkStartseite['startseite'] == "1") || ($thisAddonLastBlogModulShow == false)) {
print "<div class=\"addon\" style=\"margin: 0px; padding: 0px;\">";
print "<div id=\"addon_lastblog\">";
$thisAddonLastBlogModulCheck = mysql_num_rows(mysql_query("SELECT * FROM modul_blog WHERE status = '0'"));
if ($thisAddonLastBlogModulCheck > 0) {
while ($data = mysql_fetch_assoc($thisAddonLastBlog)) {
$thisAddonLastBlogModulLink = rBuildLink($checkBlogSite['page'],$data['id'].".".makeMyURL($data['titel']),"");
print "<div class=\"lastblog\">";
print "<p class=\"titel\"><a href=\"".$thisAddonLastBlogModulLink."\">".$data['titel']."</a></p>";
print "<p class=\"date\">".thisAddonLastBlogDate($data['datum'])."</p>";
print "<div class=\"text\">";
if ($thisAddonLastBlogModulPrev == 0) {
if ($thisAddonLastBlogModulString == "") {
print strip_tags($data['vorschau']);
} else {
print strip_tags(word_wrap($data['vorschau'], $thisAddonLastBlogModulString, ''))." [<a href=\"".$thisAddonLastBlogModulLink."\">".$thisAddonLastBlogModulLinkTitle."</a>]";
}
} else if ($thisAddonLastBlogModulPrev == 1) {
if ($thisAddonLastBlogModulString == "") {
print strip_tags($data['vorschau']);
} else {
print strip_tags(word_wrap($data['vorschau'], $thisAddonLastBlogModulString, ''))." <a href=\"".$thisAddonLastBlogModulLink."\">".$thisAddonLastBlogModulLinkTitle."</a>";
}
} else {
if ($data['vorschau'] != "") {
if ($thisAddonLastBlogModulString == "") {
print strip_tags($data['vorschau']);
} else {
print strip_tags(word_wrap($data['vorschau'], $thisAddonLastBlogModulString, ''))." <a href=\"".$thisAddonLastBlogModulLink."\">".$thisAddonLastBlogModulLinkTitle."</a>";
}
} else {
if ($thisAddonLastBlogModulString == "") {
print strip_tags($data['text']);
} else {
print strip_tags(word_wrap($data['text'], $thisAddonLastBlogModulString, ''))." <a href=\"".$thisAddonLastBlogModulLink."\">".$thisAddonLastBlogModulLinkTitle."</a>";
}
}
}
print "</div>";
print "</div>";
}
} else {
if ($thisAddonLastBlogModulErrorShow == true) {
print $thisAddonLastBlogModulError;
}
}
print "</div>";
print "</div>";
}
}
}
buildLastBlogAddon();
function thisAddonLastBlogDate($timestamp) {
$tag = date("d", $timestamp);
$monat = date("m", $timestamp);
$jahr = date("Y", $timestamp);
$uhrzeit = date("H:i", $timestamp);
return $tag.'.'.$monat.'.'.$jahr.', '.$uhrzeit.' Uhr';
}
?>