<?
function color_show1($text) {
$text=str_replace('<br />','',$text);
$arr=array('990000','990000','990000','990000','990000','990000','990000','990000','990000','990000','990000','990000'
);
$str='';
$text=iconv('utf-8','windows-1251',$text);
for ($i=0; $i<strlen($text); $i++) {
$str.='<font color="#'.$arr[$i].'">'.$text[$i].'</font>';
}
$str=iconv('windows-1251','utf-8',$str);
return $str;
}


function aut()
{
global $set;
if ($set['web']==false)
{

echo "<div class='menu_razd'>";
global $user;
if (isset($user))
{
echo "<a href='/info.php'>Dinding</a> | <a href='/status'>status</a> | <a href='/umenu.php'>PaneL</a> | <a href='/exit.php'>Exit</a><br />\n";
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `frends_new` WHERE `to` = '$user[id]' LIMIT 1"), 0) > 0)
{
echo '<div class="status"><span style=\"color:red\"><b>anda memiliki permintaan pertemanan</b><a href="/frend_new.php"><img src="/sys/img/friendship.gif"/></a></span></div>'."\n";
}
$knm=mysql_result(mysql_query("SELECT COUNT(*) FROM `jurnal` WHERE `id_kont` = '$user[id]' AND `read` = '0'"), 0);
if ($knm>0)
echo "Anda memiliki<b> <a href='/jurnal.php'>$knm Pemberitahuan baru</a></b><br />\n";
$knm=mysql_result(mysql_query("SELECT COUNT(*) FROM `mail` WHERE `id_kont` = '$user[id]' AND `read` = '0'"), 0);
if ($knm>0)
echo "<b>($knm) privat pesan <br/><a href=\"/new_mess.php\" title=\"Privat Pesan\">buka</a></b><br />\n";
$k_n_s_zak=0;
$q23=mysql_query("SELECT `id_them`, `time` FROM `forum_zakl` WHERE `id_user` = '$user[id]'");
while ($zakl = mysql_fetch_array($q23))
{
$k_n_s_zak+=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_them` = '$zakl[id_them]' AND `time` > '$zakl[time]'"),0);
}

if ($k_n_s_zak>0)
echo "<a href=\"/zakl.php\" title=\"Posting baru di bookmark\">($k_n_s_zak) Pos baru di forum favorite</a><br />\n";
}
else
{
echo "<a href='/reg.php'>Register</a> | <a href='/aut.php'>Login</a><br />\n";

}
echo "</div>\n";
}
$php_self=$_SERVER['PHP_SELF'];
if(!ereg('/shout/', $php_self) && !ereg('/gue/', $php_self) && !ereg('/forum/', $php_self) && !ereg('/mail.php', $php_self) && !ereg('/anketa.php', $php_self) && !ereg('/setting.php', $php_self)){
$shout_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `shout`"),0);
echo "<div class='p_m'>\n";
if (isset($user))
{
echo "<tr><div class='msg'></div></tr>\n";
echo "<form method=\"post\" name='message' action=\"/shout/aksi.php\">\n";
echo "<tr><td><input name=\"shout_msg\" type=\"text\" size=\"22\"/><br />\n";
echo "<input value=\"Shout\" type=\"submit\" /><a href='index.php/".rand(1000,9999)."/'>reload</a>&bull;<a href='/smiles.php'>smiley</a>&bull;<a href='/shout'>smode </a><br />\n";
echo "</form></tr></td>\n";
if ($shout_post==0)
{
echo "   <tr>\n";
echo "  <td class='p_m'>\n";
echo "Shout kosong\n";
echo "  </td>\n";
echo "   </tr><br />\n";
}
// $shoute=mysql_query("SELECT * FROM `shout` ORDER BY id DESC LIMIT $mulai, 3");
$shoute=mysql_query("SELECT * FROM `shout` ORDER BY id DESC LIMIT 5");
while ($shot = mysql_fetch_array($shoute))
{
$jeneng=get_user($shot['id_user']);
echo "   <tr>\n";
echo "</td><a href='/info.php?id=$jeneng[id]'><span style='color:$jeneng[ncolor]'>$jeneng[nick]</span></a>".online($jeneng['id']).":\n";

echo output_text($shot['shout_msg'])."\n";
if ($shot['shout_admin']!=NULL && $shot['id_shout']!=NULL){
$adm=get_user($shot['id_shout']);
echo "<div style='background-color: #eee'><a href='/info.php?id=$shot[id_shout]'><b>$adm[nick]</b></a>: <font color='#6600BB'>".output_text($shot['shout_admin'])."</font></div>";
}
echo "   </tr><br />\n";

}

}

echo "</div>\n";
}
}
?>
