not really sure LOL!! my server has not switched over to an new month yet..
ALTER TABLE `motm` ADD `credit` enum('yes','no') NOT NULL default 'no',
//== Start member of the month
$motmdateget = SQL_Query_exec("SELECT win_month,year from motm WHERE last_winner ='1'");
$motmdategot = mysql_fetch_array($motmdateget);
$motmdate = $motmdategot[0];
$motmyear = $motmdategot[1];
$mdate = date("m");
$myear = date("y");
if ($motmdate < $mdate) {
$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];
SQL_Query_exec("UPDATE motm SET last_winner = '0' WHERE last_winner = '1'");
SQL_Query_exec("UPDATE motm SET last_winner = '1' WHERE id = '$id_motm'");
//to give seeder bonus
SQL_Query_exec("UPDATE users SET seedbonus = seedbonus+300 WHERE id = '$id_motm'");
SQL_Query_exec("UPDATE motm SET win_month = '$mdate', last_winner_points = '$pos' 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 = '0'");
} //$row_motm = mysql_fetch_array($mysql_result_motm)
} //$motmdate < $mdate && $motmyear == $myear
//== End member of the month
with
//== Start member of the month
$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");
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
//== Start member of the month
$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");
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
Fatal error: Call to undefined function SQL_Query_exec() in /home/divxhunt/public_html/backend/cleanup.php on line 305
$motmdateget = SQL_Query_exec("SELECT win_month,year,credit from motm WHERE last_winner ='1'");
//== 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
"ArcticWolf, post: 88585":not sure what to tell you... i guess I will play around with it on dev site.. my only guess you dont have anything in motm for last month or something LOL!!!
Table structure for table motm
|------
|Column|Type|Null|Default
|------
|//**id**//|varchar(10)|No|
|points|decimal(10,1)|No|0.0
|//**month**//|tinyint(2)|No|
|//**year**//|tinyint(4)|No|
|last_winner|varchar(10)|No|
|last_winner_points|varchar(10)|No|
|win_month|tinyint(2)|No|
|credit|enum('yes', 'no')|No|no
== Dumping data for table motm
|139|70.0|12|12|1|1.0|12|no
|322|3.0|12|12| | |0|no
|24|1.0|12|12| | |0|no
|317|1.0|12|12| | |0|no
|329|9.0|12|12| | |0|no
|38|6.0|12|12| | |0|no
|292|2.0|12|12| | |0|no
|347|1.0|12|12| | |0|no
|147|3.0|12|12| | |0|no
|178|1.0|12|12| | |0|no
|129|4.0|12|12| | |0|no
|2|28.0|12|12| | |0|no
|4|4.0|12|12| | |0|no
|275|3.0|1|13| | |0|no
|139|266.0|1|13| | |0|no
|147|76.0|1|13| | |0|no
|292|43.0|1|13| | |0|no
|24|3.0|1|13| | |0|no
|10|10.0|1|13| | |0|no
|408|1.0|1|13| | |0|no
|410|15.0|1|13| | |0|no
|57|43.0|1|13| | |0|no
|280|1.0|1|13| | |0|no
|355|11.0|1|13| | |0|no
|422|2.0|1|13| | |0|no
|489|3.0|1|13| | |0|no
|493|1.0|1|13| | |0|no
|524|1.0|1|13| | |0|no
|336|3.0|1|13| | |0|no
|544|3.0|1|13| | |0|no
|553|53.0|1|13| | |0|no
|546|6.0|1|13| | |0|no
|2|3.0|1|13| | |0|no
|38|6.0|1|13| | |0|no
|641|6.0|1|13| | |0|no
|292|10.0|2|13| | |0|no
|355|22.0|2|13| | |0|no
|139|50.0|2|13| | |0|no
|553|22.0|2|13| | |0|no
== Table structure for table motm
|------
|Column|Type|Null|Default
|------
|//**id**//|varchar(10)|No|
|points|decimal(10,1)|No|0.0
|//**month**//|tinyint(2)|No|
|//**year**//|tinyint(4)|No|
|last_winner|varchar(10)|No|
|last_winner_points|varchar(10)|No|
|win_month|tinyint(2)|No|
|credit|enum('yes', 'no')|No|no
//== 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
$query = "SELECT * FROM motm WHERE id='$CURUSER[id]' && month = ".date("m")." && year = ".date("y")."";
$result = SQL_Query_exec($query);
$motm = mysql_fetch_array($result);
$points = $motm['points'];
echo "Activity Bonus: <b>$points</b>";$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 />No users online
Torrents
Members
Online