Parašė kLx· 2008 Rugp. 25 18:08:02
#6
Messages.php failas :
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
// if (!defined("IN_FUSION")) { header("Location:../../index.php"); exit; }
require_once "../../maincore.php";
header('Refresh: 10; URL=messages.php');
echo "
<style type='text/css'>
body {
color: #5B5B5B;
padding: 0px 0px 0px 0px;
font-family: verdana, arial, sans-serif;
font-size: 10px;
}
.shoutboxname {
color:#113355;
}
.shoutbox {
color:#555;
}
.shoutboxdate {
font-size:9px; color:#333; text-align:right;
}
a {
color:#0066CC; text-decoration:none;
}
a:hover {
color:#333333; text-decoration:none;
}
a.side {
color:#0066CC; text-decoration:none;
}
</style>
<div style='position:absolute;left:0px;top:0px;width:100%;'>
";
function replace_url($text)
{
$res = ' ' . $text;
$res = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">[LIEN]</a>", $res);
$res = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r<]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">[LIEN]</a>", $res);
$res = substr($res, 1);
return($res);
}
function replace_mail($text)
{
$text = eregi_replace( "(([a-z0-9_]|\-|\.)+@([^[:space:]]*)([[:alnum:]-]))", "<a href=\"mailto:\\1\">[MAIL]</a>", $text);
return($text);
}
function me_message($text)
{
$command = "/me";
$affichage = "";
$text = str_replace($command, $affichage, $text);
return($text);
}
function news_message($text)
{
$command = "/news";
$affichage = "";
$text = str_replace($command, $affichage, $text);
return($text);
}
$result = dbquery("SELECT count(shout_id) FROM ".$db_prefix."shoutbox");
$numrows = dbresult($result, 0);
$result = dbquery(
"SELECT * FROM ".$db_prefix."shoutbox LEFT JOIN ".$db_prefix."users
ON ".$db_prefix."shoutbox.shout_name=".$db_prefix."users.user_id
ORDER BY shout_datestamp DESC LIMIT 0,".$settings['numofshouts']
);
if (dbrows($result) != 0) {
$i = 0;
$n = 0;
while ($data = dbarray($result)) {
if ($n == 0) {
echo "<div >";
$n++;
} else {
echo "<div style='background-color:#EEEEEE'>";
$n--;
}
if (iADMIN && checkrights("S")) {
echo "[<a href='".ADMIN."shoutbox.php".$aidlink."&action=delete&shout_id=".$data['shout_id']."' target='_blank' class='side'>X</a>][<a href='".ADMIN."shoutbox.php".$aidlink."&action=edit&shout_id=".$data['shout_id']."' target='_blank' class='side'>E</a>]";
}
$settings2 = dbarray(dbquery("SELECT * FROM ".$db_prefix."settings"));
$timestamp = $data['shout_datestamp']+($settings2['timeoffset']*3600);
echo " <span class='shoutboxdate'>".strftime("[%d/%m|%H:%M]", $timestamp)."</span><span class='shoutboxname'> ";
if ((substr($data['shout_message'], 0, 3) == "/me") && (($data[user_level] == "103") || ($data[user_level] == "101") || ($data[user_level] == "102"))) {
echo "<span class='shoutbox'><font color='#9966FF'>* ".$data['user_name']." ".me_message(replace_mail(replace_url(parsesmileys($data['shout_message']))))."</font></span><br>\n";
}
else if ((substr($data['shout_message'], 0, 5) == "/news") && (($data[user_level] == "103") || ($data['shout_ip'] == "new_member"))) {
echo "<span class='shoutbox'><font color='#FF0000'><b>#Flash Info#</b></font><br><center><b>".news_message(replace_mail(replace_url(parsesmileys($data['shout_message']))))."</b></center></span><br>\n";
}
else {
if ($data[user_level] == "103") {
echo "<a href='".BASEDIR."profile.php?lookup=".$data['shout_name']."' target='_blank' class='side'><font color='#FF0000'>@</font>".$data['user_name']."</a><b>></b>";
}
else if ($data[user_level] == "101") {
echo "<a href='".BASEDIR."profile.php?lookup=".$data['shout_name']."' target='_blank' class='side'>".$data['user_name']."</a><b>></b>";
}
else if ($data[user_level] == "102") {
echo "<a href='".BASEDIR."profile.php?lookup=".$data['shout_name']."' target='_blank' class='side'><font color='#FF0000'>%</font>".$data['user_name']."</a><b>></b>";
} else {
echo $data['shout_name']."> ";
}
echo "</span> ";
echo " <span class='shoutbox'>".parseubb(replace_mail(replace_url(parsesmileys($data['shout_message']))))."</span><br>\n";
if ($i != $numrows) echo "\n";
echo "</div>";
}
}
} else {
echo "<div align='left'>".$locale['127']."</div>\n";
}
echo "</div>";
?>