$privacylevel = T_($CURUSER["privacy"]);or something close to it and after add $motm_current_query = @mysql_fetch_row(@SQL_Query_exec("SELECT motm.points FROM motm WHERE month = " . date("m") . " && year = " . date("y") . " && id = ".$CURUSER["id"]));
$motm_current = number_format(0+$motm_current_query[0],1);
now find something like
<br />" . T_("RATIO") .": $userratio
after add
<br />Current Member of the Month Points: ".$motm_current."
in account-details.php
find something like
$numcomments = get_row_count("comments", "WHERE user = $id");
and after add
$motm_current_query = @mysql_fetch_row(@SQL_Query_exec("SELECT motm.points FROM motm WHERE month = " . date("m") . " && year = " . date("y") . " && id = ".$user["id"]));
$motm_current = number_format(0+$motm_current_query[0],1);
now farther down find something like
<?php echo T_("RATIO"); ?>: <?php echo $ratio?><br />
or where ever you want to display it and add
Current Member of the Month Points: <?php echo $motm_current?><br />
while at it in account-details i would change
<?php echo T_("RATIO"); ?>: <?php echo $ratio?><br />
to
<?php echo T_("RATIO"); ?>: <?php echo number_format($ratio,2)?><br />
$shoutbox_query = SQL_Query_exec("INSERT INTO shoutbox (msgid, user, message, date, userid, room) VALUES (NULL, 'System', " . sqlesc($sbmessage) . ", '" . get_date_time() . "', '0', '0')");"ErvD, post: 88812":LOL you welcome to try my shoutbox.php its from the 1st post and I checked it with 3 different php editors and my dev site.. seems to pass rightREAD READ READ
I checked all the code and still have not found the f**king unexpected '}'
<tr>
<td>TimeZone:</td>
<td>
<select name='tzoffset'>
<?php
ksort($tzs);
reset($tzs);
while (list($key, $val) = each($tzs)) {
if ($site_config["tzoffset"] == $key)
$tz .= "<option value="$key" selected>$val</option>n";
else
$tz .= "<option value="$key">$val</option>n";
}
?>
<?=$tz?>
</select></td>
</tr>
with
<?php
ksort($tzs);
reset($tzs);
while (list($key, $val) = each($tzs)) {
if ($site_config["tzoffset"] == $key)
$tz .= "<option value="$key" selected>$val[0]</option>n";
else
$tz .= "<option value="$key">$val[0]</option>n";
}
print("<tr><td align=left><b>TimeZone:</b> <font class='small' color='#FF0000'>*</font></td><td align=left><select name='tzoffset'>$tz</select></td></tr>");
?>
ALTER TABLE `subs` CHANGE `size` `size` INT( 12 ) UNSIGNED NOT NULL DEFAULT '0';$updateset[] = 'key = ' . sqlesc($var);
//===| Start Auto Promote/Demote Users |===//
//===| config
$minratio = 0.95; # ratio for demotion to user
$gigs2 = 50 * 1073741824; # 50 GB / uploaded amount for promote as power user
$delay2 = sqlesc(get_date_time(gmtime() - 86400 * 30)); # Joined > 1 month
$class2 = 2; // Power User Class
$gigs3 = 150 * 1073741824; # 150 GB / uploaded amount for promote as power user+
$delay3 = sqlesc(get_date_time(gmtime() - 86400 * 45)); # Joined > 1 month
$class3 = 3; // Power User Class+
//===| auto promote to power user
$res = SQL_Query_exec("SELECT id, username, modcomment FROM users WHERE class = 1 AND warned = 'no' AND (added < $delay2 AND uploaded >= $gigs2 AND uploaded >= downloaded");
$time = get_date_time();
while ($arr = mysql_fetch_assoc($res)) {
$res_classname = SQL_Query_exec("SELECT level FROM groups WHERE group_id=$class2 LIMIT 1");
if (mysql_num_rows($res_classname) == 1) {
$arr_classname = mysql_fetch_assoc($res_classname);
$new_classname = "$arr_classname[level]";
}
$username = $arr[username];
$modcomment = $arr[modcomment];
$modcomment2 = gmdate("d-M-Y") . " - Has been promoted by System to " . $new_classname . " class n";
$modcomment = $modcomment2 . "" . $modcomment;
$modcom = sqlesc($modcomment);
SQL_Query_exec("UPDATE users SET class = $class2, modcomment = CONCAT($modcom,modcomment) WHERE id = $arr[id]");
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES(0, $arr[id], '$time', 'Congratulations, you were automatically promoted to Power User class. Please note that if your ratio drops below " . $minratio . " at any time, you will be demoted back to User', 'You have been promoted as " . $new_classname . "')");
write_log("<a href=account-details.php?id=$arr[id]><b>$username</b></a> has been promoted by System to <b>" . $new_classname . "</b> class");
unset($res, $arr, $res_classname, $arr_classname,$new_classname);
}
//===| auto promote to power user+
$res = SQL_Query_exec("SELECT id, username, modcomment FROM users WHERE class = $class2 AND warned = 'no' AND (added < $delay3 AND uploaded >= $gigs3 AND uploaded >= downloaded");
$time = get_date_time();
while ($arr = mysql_fetch_assoc($res)) {
$res_classname = SQL_Query_exec("SELECT level FROM groups WHERE group_id=$class3 LIMIT 1");
if (mysql_num_rows($res_classname) == 1) {
$arr_classname = mysql_fetch_assoc($res_classname);
$new_classname = "$arr_classname[level]";
}
$username = $arr[username];
$modcomment = $arr[modcomment];
$modcomment2 = gmdate("d-M-Y") . " - Has been promoted by System to Power User+ class n";
$modcomment = $modcomment2 . "" . $modcomment;
$modcom = sqlesc($modcomment);
SQL_Query_exec("UPDATE users SET class = $class3, modcomment = CONCAT($modcom,modcomment) WHERE id = $arr[id]");
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES(0, $arr[id], '$time', 'Congratulations, you were automatically promoted to Power User class. Please note that if your ratio drops below " . $minratio . " at any time, you will be demoted back to User', 'You have been promoted as " . $new_classname . "')");
write_log("<a href=account-details.php?id=$arr[id]><b>$username</b></a> has been promoted by System to <b>" . $new_classname . "</b> class");
}
//===| auto demote to user
$res = SQL_Query_exec("SELECT id, username, modcomment FROM users WHERE (class = $class2 || class = $class3) AND uploaded / downloaded < $minratio");
while ($arr = mysql_fetch_assoc($res)) {
$username = $arr[username];
$modcomment = $arr[modcomment];
$modcomment2 = gmdate("d-M-Y") . " - Has been demoted by System to User class n";
$modcomment = $modcomment2 . "" . $modcomment;
$modcom = sqlesc($modcomment);
SQL_Query_exec("UPDATE users SET class = 1, modcomment = CONCAT($modcom,modcomment) WHERE id = $arr[id]");
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES(0, $arr[id], '$time', 'You were automatically demoted as User. That happened because your ratio dropped below " . $minratio . "', 'You have been demoted as User')");
write_log("<a href=account-details.php?id=$arr[id]><b>$username</b></a> has been demoted by System to <b>User</b> class");
}
//===| End Auto Promote/Demote Users |===//
//== Start member of the month
$debug = 0;
$motmdateget = SQL_Query_exec("SELECT win_month,year,credit from motm WHERE last_winner ='1'");
$motmdategot = mysql_fetch_array($motmdateget);
$motmdate = (int) $motmdategot[0];
$motmyear = $motmdategot[1];
$mdate = date("m");
$myear = date("y");
if ($motmdate == 12 && $mdate > 1)
$motmdate = 1;
if ($motmdate == 0 || $motmdate == '')
$motmdate = (date("m") - 1);
$mdate1 = (date("m") - 1);
if ($motmdate < $mdate) {
$motmdateget1 = SQL_Query_exec("SELECT win_month,year,credit from motm WHERE win_month = '$mdate'");
$motmdategot1 = mysql_fetch_array($motmdateget1);
$motcredit = $motmdategot1[2];
$sql32 = "SELECT id, points FROM motm WHERE points > '0' && year =" . $myear . " && month =" . $motmdate . " ORDER BY points DESC LIMIT 1";
$mysql_result_motm = SQL_Query_exec($sql32);
while ($row_motm = mysql_fetch_array($mysql_result_motm)) {
$nextmonth = (date(m) + 1);
$id_motm = $row_motm['id'];
$pos = $row_motm["points"];
$motmdateget3 = SQL_Query_exec("SELECT win_month from motm WHERE last_winner ='1'");
$motmdategot3 = mysql_fetch_array($motmdateget3);
$motmdate3 = $motmdategot3[0];
if ($motmdate3 == 12 && $mdate > 1)
$motmdate3 = 1;
if ($motmdate3 == 0 || $motmdate3 == '')
$motmdate3 = (date("m") - 1);
if ($motcredit != 'yes') {
SQL_Query_exec("UPDATE motm SET last_winner = '0' WHERE last_winner = '1'");
SQL_Query_exec("UPDATE motm SET win_month = '$mdate', last_winner_points = '$pos', last_winner = '1', credit='yes' WHERE id = '$id_motm' && month = $motmdate && year = " . $myear . "");
SQL_Query_exec("UPDATE users SET seedbonus = seedbonus+300 WHERE id = '$id_motm'");
// SQL_Query_exec("UPDATE motm SET points = '0' where month!='$mdate'");
SQL_Query_exec("UPDATE motm SET last_winner_points = '0' WHERE last_winner != '1'");
} //$motcredit != 'yes'
} //$row_motm = mysql_fetch_array($mysql_result_motm)
} //$motmdate < $mdate
//== End member of the month
//== Start member of the month
$debug = 0;
$motmdateget = SQL_Query_exec("SELECT win_month,year,credit from motm WHERE last_winner ='1'");
$motmdategot = mysql_fetch_array($motmdateget);
$motmdate = $motmdategot[0];
$motmyear = $motmdategot[1];
$mdate = date("m");
$myear = date("y");
$mdate1 = (date("m") - 1);
if ($motmdate < $mdate) {
$motmdateget1 = SQL_Query_exec("SELECT win_month,year,credit from motm WHERE win_month = '$mdate'");
$motmdategot1 = mysql_fetch_array($motmdateget1);
$motcredit = $motmdategot1[2];
$sql32 = "SELECT id, points FROM motm WHERE points > '0' && year =" . $myear . " ORDER BY points DESC LIMIT 1";
$mysql_result_motm = SQL_Query_exec($sql32);
while ($row_motm = mysql_fetch_array($mysql_result_motm)) {
$nextmonth = (date(m) + 1);
$id_motm = $row_motm['id'];
$pos = $row_motm["points"];
$motmdateget = SQL_Query_exec("SELECT win_month from motm WHERE last_winner ='1'");
$motmdategot = mysql_fetch_array($motmdateget);
$motmdate = $motmdategot[0];
if ($motcredit != 'yes') {
SQL_Query_exec("UPDATE motm SET last_winner = '0' WHERE last_winner = '1'");
SQL_Query_exec("UPDATE motm SET win_month = '$mdate', last_winner_points = '$pos', last_winner = '1', credit='yes' WHERE id = '$id_motm'");
SQL_Query_exec("UPDATE users SET seedbonus = seedbonus+300 WHERE id = '$id_motm'");
SQL_Query_exec("UPDATE motm SET points = '0'");
SQL_Query_exec("UPDATE motm SET last_winner_points = '0' WHERE last_winner != '1'");
} //$motcredit != 'yes'
} //$row_motm = mysql_fetch_array($mysql_result_motm)
} //$motmdate < $mdate
//== End member of the month