thank you all for help 🙂
One more important question i have for you guy. I put on my site VIPMEMBERS activated by time ( 1 day, 2 days etc... ) . Everything is good, but if a member activated for example the option color text, this option will remain after the vip period expires and i don't want that. I try something like this:
$membruvip = mysql_result(mysql_query("SELECT COUNT(*) FROM `vipuri` WHERE `id_utilizator` = '$user[id]' AND `time` > '$time'"), 0);
if ($membruvip==0)
{
echo " ".output_text($statuse['msg'])." ";
}else{
echo "<span style=\"color:$profil[culoaretext]\">";
echo " ".output_text($statuse['msg'])." ";
echo "</span>\n";
}
but not work very well. If you are not a vip member you can't see any color and if you are a vip member you can see all the color ( even if the user cu vip expires post a message).
this is the page where you can activate vip member. Maybe you may know how after the vip expires the color text , and color nick set to mod default.
<?
include_once '../../sys/inc/start.php';
include_once '../../sys/inc/compress.php';
include_once '../../sys/inc/sess.php';
include_once '../../sys/inc/home.php';
include_once '../../sys/inc/settings.php';
include_once '../../sys/inc/db_connect.php';
include_once '../../sys/inc/ipua.php';
include_once '../../sys/inc/fnc.php';
include_once '../../sys/inc/adm_check.php';
include_once '../../sys/inc/user.php';
$set['title'] = 'Membri vip';
include_once '../../sys/inc/thead.php';
title();
if (!isset($user))
header("location: /index.php?");
err();
aut();
if (isset($user))
{
if (isset($_POST['stav']) && isset($_POST['msg']))
{
if ($_POST['stav']==1)
{
$st=1;
$tm=$time+86400;
$vipstatut=1;
}
else if ($_POST['stav']==2)
{
$st=2;
$tm=$time+172800;
$vipstatut=1;
}
else if ($_POST['stav']==3)
{
$st=3;
$tm=$time+259200;
$vipstatut=1;
}
else if ($_POST['stav']==4)
{
$st=4;
$tm=$time+345600;
$vipstatut=1;
}
else if ($_POST['stav']==5)
{
$st=5;
$tm=$time+432000;
$vipstatut=1;
}
else if ($_POST['stav']==6)
{
$st=6;
$tm=$time+518400;
$vipstatut=1;
}
else if ($_POST['stav']==7)
{
$st=7;
$tm=$time+604800;
$vipstatut=1;
}
else if ($_POST['stav']==8)
{
$st=30;
$tm=$time+2592000;
$vipstatut=1;
}
else if ($_POST['stav']==9)
{
$st=365;
$tm=$time+31536000;
$vipstatut=1;
}
$msg=my_esc($_POST['msg']);
if ($user['money']>=$st)
{
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `liders` WHERE `id_user` = '$user[id]'"), 0)==0)
{
//mysql_query("INSERT INTO `liders` (`id_user`, `stav`, `msg`, `time`, `time_p`) values('$user[id]', '$st', '".$msg."', '$tm', '$time')");
mysql_query("INSERT INTO `liders` (`id_user`, `stav`, `msg`, `time`, `time_p`, `vipstatut`) values('$user[id]', '$st', '".$msg."', '$tm', '$time', '$vipstatut')");
}
else
{
//mysql_query("UPDATE `liders` SET `time` = '$tm', `time_p` = '$time', `msg` = '$msg', `stav` = '$st' WHERE `id_user` = '$user[id]'");
mysql_query("UPDATE `liders` SET `time` = '$tm', `time_p` = '$time', `msg` = '$msg', `stav` = '$st', `vipstatut` = '$vipstatut' WHERE `id_user` = '$user[id]'");
}
mysql_query("UPDATE `user` SET `money` = '".($user['money']-$st)."' WHERE `id` = '$user[id]' LIMIT 1");
$_SESSION['message'] = 'Ai devenit cu succes membru vip!!';
header("Location: /user/liders/index.php?ok");
exit;
}else{
$err='Nu ai suficiente monede pentru a deveni membru vip';
}
}else{
$err='Statusul nu poate fi gol';
}
err();
echo '<div class="foot">';
echo '<img src="/style/icons/str2.gif" alt="S"/> <a href="/user/money/">Servicii extra</a> | <b>Membru vip</b>';
echo '</div>';
echo '<div class="mess">';
echo 'Pentru a ajunge membru vip trebuie sa ai in cont cel putin <b style="color:red;">1</b> <b style="color:green;"> diamant </b>. Acest serviciu este
calculat pe zi, zi in care ne vom asigura ca vei in TOP. Pozitia ta in TOP depinde de numarul de diamante (timpul total de inchiriere)!
In plus, profilul tau va putea fi vizibil prin rotatie in sectiunea Dating si Conectati!';
echo '</div>';
echo '<form class="main" method="post" action="?">';
echo '<span style="color: red">Vreau sa fiu vip timp de:</span> <select name="stav">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">30</option>
<option value="9">365</option>
</select> zile<br />';
echo 'Status membru vip (100 caractere)<textarea name="msg"></textarea><br />';
echo '<input value="Fa-ma vip" type="submit" />';
echo '</form>';
}
echo '<div class="foot">';
echo '<img src="/style/icons/str2.gif" alt="S"/> <a href="/user/money/">Servicii extra</a> | <b>Membru vip</b>';
echo '</div>';
include_once '../../sys/inc/tfoot.php';
?>
Added after 6 minutes:
I think with something like this can be done:
mysql_query("UPDATE `user` SET `color` = '"default"' WHERE `id` = '$user[id]' LIMIT 1");
but i don' know where to put it in this file 🙁
Added after 42 minutes:
problem solved with:
$membruvip = mysql_result(mysql_query("SELECT COUNT(*) FROM `liders` WHERE `id_user` = '$user[id]' AND `time` > '$time'"), 0);
if ($membruvip==0)
{
mysql_query("UPDATE `user` SET `mcolor` = '#000000' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `ncolor` = '#3251FF' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `ncolor2` = '#3251FF' WHERE `id` = '$user[id]' LIMIT 1");
}
in a file that is included in all the site. Somethimes i am so stupid 🙁 sorry for all my stupid posts.