Thema: Die letzten X Postings anzeigen

Forum: MLF 1.7

Autor: wolf


wolf - 22/9/2007 um 17:32

<?php

// MLF 1.7 Mod
// Die letzten X Einträge im Forum anzeigen
// Diese Modifikation zeigt die Beiträge in der Threadansicht
// Die Erweiterung der farbigen Nicknamen muß installiert sein

include("inc.php");

include ("db_settings.php");

$host = $db_settings['host'];
$user = $db_settings['user'];
$pw = $db_settings['pw'];
$db = $db_settings['db'];

$link = mysql_connect("$host", "$user", "$pw")
or die ("could nor connect : " . mysql_error());
mysql_select_db("$db") or die("could not select database");

// Anzahl der Einträge
$limit = 100;

$result=mysql_query("SELECT id, pid, tid, last_answer, user_id, name, UNIX_TIMESTAMP(time + INTERVAL ".$time_difference." HOUR) AS xtime, UNIX_TIMESTAMP(time + INTERVAL ".$time_difference." HOUR) AS rss_time, name, subject, text FROM ".$db_settings['forum_table']." WHERE category IN (".$category_ids_query.") **** BY time DESC LIMIT $limit", $connid);

$subnav_1='<a class="textlink" href="posting.php?category='.urlencode($category).'" title="'.$lang['new_entry_linktitle'].'">'.$lang['new_entry_linkname'].' </a>';
$subnav_2 = '';
$subnav_2 .= ' <span class="small"><a href="mod_last_postings.php"><img src="img/update.gif" alt="" title="'.$lang['update_time_linktitle'].'" width="9" height="9" onmouseover="this.src=\'img/update_mo.gif\';" onmouseout="this.src=\'img/update.gif\';"</a></span>';

parse_template();
echo $header;

echo "<h2>Die letzten $limit Einträge</h2>";

echo "<ul class=\"thread\">";

while ($zeile = mysql_fetch_array($result)) {

$topic = $zeile["subject"];
$tag = $zeile["last_answer"];

$ftext = $zeile["text"];
$ftext = htmlspecialchars(stripslashes($ftext));
$ftext = make_link($ftext);
$ftext = preg_replace("#\[msg\](.+?)\[/msg\]#is", "\\1", $ftext);
$ftext = preg_replace("#\[msg=(.+?)\](.+?)\[/msg\]#is", "\\2 --> \\1", $ftext);
$ftext = bbcode($ftext);
$ftext = nl2br($ftext);
$ftext = str_replace("»", ">", $ftext);
$ftext = str_replace("«", "<", $ftext);
$ftext = rss_quote($ftext);
$ftext = str_replace("&", "&", $ftext);
$ftext = str_replace("<", "<", $ftext);
$ftext = str_replace(">", ">", $ftext);
$title = $zeile['subject'];
$title = htmlspecialchars(stripslashes($title));
$title = str_replace("»", ">", $title);
$title = str_replace("«", "<", $title);
$title = str_replace("&", "&", $title);
$name = $zeile['name'];


echo '<li><a class="';

if ((($zeile==0) && isset($_SESSION[$settings['session_prefix'].'newtime']) && $_SESSION[$settings['session_prefix'].'newtime'] < $zeile["last_answer"]) || (($zeile["pid"]==0) && empty($_SESSION[$settings['session_prefix'].'newtime']) && $zeile["last_answer"] > $last_visit))
{
echo "threadnew";
}
elseif ($zeile["pid"]==0)
{
echo "thread";
}
elseif ((($zeile["pid"]!=0) && isset($_SESSION[$settings['session_prefix'].'newtime']) && $_SESSION[$settings['session_prefix'].'newtime'] < $zeile["time"]) || (($zeile["pid"]!=0) && empty($_SESSION[$settings['session_prefix'].'newtime']) && $zeile["time"] > $last_visit))
{
echo "replynew";
}
else
{
echo "reply";
}

echo '" href="forum_entry.php?id='.$zeile["id"].'">'.htmlspecialchars(stripslash es($zeile["subject"])).'</a>';

setlocale(LC_TIME, "de_DE");
$zeit = strftime($lang['rss_time'],$zeile['rss_time']); setlocale(LC_TIME, $lang['locale']);

$sresult = mysql_query("SELECT user_type, user_color FROM forum_userdata WHERE user_id = ".$zeile['user_id']);

$szeile = mysql_fetch_array($sresult);

if ($szeile['user_type'] == 'admin') $name = "<span class=\"admin-highlight\">".htmlspecialchars(stripslashes($zeile['name'] ))."</span> <font color=\"#cccc99\">®</font>";
elseif ($szeile['user_type'] == 'mod') $name = "<span class=\"mod-highlight\">".htmlspecialchars(stripslashes($zeile['name'])) ."</span> <font color=\"#cccc99\">®</font>";
else $name = '<font color="'.$szeile['user_color'].'">'.htmlspecialchars(stripslashes($zeile ['name'])).'</font>';

echo " - <b>$name</b>, ";

echo "$zeit";

echo "</li>";

}

echo "</ul>";

mysql_free_result($result);
mysql_close($link);

echo $footer;

?>

Dieses Thema kommt von : eD2K-Serverboard
http://ed2k-serverboard.de

URL dieser Webseite:
http://ed2k-serverboard.de/modules.php?name=eBoard2&file=viewthread&fid=34&tid=117