<?php
/*-----------------------------------------------------
Vip News
-----------------------------------------------------*/
session_start();
require "global_func.php";
if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }
$userid=$_SESSION['userid'];
require "header.php";
$h = new headers;
$h->startheaders();
include "mysql.php";
global $c;
$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error());
$ir=mysql_fetch_array($is);
check_level();
$fm=money_formatter($ir['money']);
$cm=money_formatter($ir['crystals'],'');
$lv=date('F j, Y, g:i a',$ir['laston']);
$h->userdata($ir,$lv,$fm,$cm);
$h->menuarea();
$post=strip_tags($_POST['post']);
if ($post)
{
mysql_query("INSERT INTO vipnews VALUES ('$post', unix_timestamp())",$c) or die (mysql_error());
print "News Added";
mysql_query("UPDATE users SET newvip=newvip+1 WHERE userid>0",$c);
exit;
}
$vip=mysql_query("SELECT * FROM vipnews ORDER BY time DESC LIMIT 10",$c);
print "<center><table width='75%' cellpadding='2' border=0 class='forumline'>
<tr>
<table width=75% border=1><tr><th width=75%>News</th><th>Time</th></tr><tr><td>";
while ($a=@mysql_fetch_array($vip))
{
$time=date(' G:i:s, F d, Y', $a['time']);
if ($a['time']>$ir['ant'])
{
print "<tr><td>[b]New:[/b]</font>";}
print "
{$a['msg']}
<td>$time</br />
</tr>
";
}
print "</table></center>
";
if ($ir['user_level']==2)
{
print "<form action='vipnews.php' method='post'><textarea name='post' rows='7' cols='100'></textarea>
<center><input type='submit' value='Post News'></center></form>";
}
$ti=time();
mysql_query("UPDATE users SET ant=$ti WHERE userid=$userid",$c);
mysql_query("UPDATE users SET newvip=0 WHERE userid=$userid",$c);
?>
Save As vipnews.php
Add This To Mainmenu.php
if ($ir[newvip]==0)
print"
[url='vipnews.php']<LI></font>VIP News</font>[/url]
";
if ($ir[newvip]>0)
print"
[url="vipnews.php><LI>VIP"][/url]
";
Not fully sure if it works please post iff it dont work :) +1 If it does May Need sql i dont really no anyone finds it post it please