
"darknova, post: 89391":+1It is much better to us the block but how can I adjust for classfield_block.php to appear at the top of the site not to be the first middle block at the bottom of the site?
THANKS!
<?php
// Start Announcement for Private Messages
if ($unreadmail){
$res_messages = SQL_Query_exec("SELECT COUNT(*) FROM messages WHERE receiver=" . $CURUSER["id"] . " and unread='yes' AND location IN ('in','both')") or print(mysql_error());
$arr_messages = mysql_fetch_row($res_messages);
$num_messages = $arr_messages[0];
if ($num_messages > 0)
echo"<div style='margin-bottom:5px'><table align=center width=100% border=0 cellspacing=0 cellpadding=10 bgcolor=red><tr><td style='padding: 10px; background: #204066' align=center><div style='font: bold 14px Times New Roman; color:#FFBF00'>
Hey $CURUSER[username], $num_messages message" . ($num_messages > 1 ? "s" : "") . " is waiting for you to read. Click <a href=mailbox.php?inbox><font size=3 color=#CBCBCB>HERE</font></a> to see!
</div></td></tr></table></div>n";
}
// End Announcement for Private Messages
?>
<?php
// Start Announcement for Reports
if ($CURUSER["control_panel"]=="yes") {
$res_reports = SQL_Query_exec("SELECT COUNT(*) FROM reports WHERE dealtwith = '0'");
$arr_reports = mysql_fetch_row($res_reports);
$num_reports = $arr_reports[0];
if ($num_reports > 0)
echo"<div style='margin-bottom:5px'><table align=center width=100% border=0 cellspacing=0 cellpadding=10><tr><td style='padding: 10px; background: #204066' align=center><div style='font: bold 14px Times New Roman; color:#FFBF00'>
Hey $CURUSER[username], $num_reports Report" . ($num_reports > 1 ? "s" : "") . " must be solved. Click <a href=admincp.php?action=reports&do=view><font size=3 color=#CBCBCB>HERE</font></a> to view reports!
</div></td></tr></table></div>n";
}
// End Announcement for Reports
?>
<?php
// Start Announcement for Staff Messages
if ($CURUSER["control_panel"] == "yes") {
$res_staffmessages = SQL_Query_exec("SELECT COUNT(*) FROM reports WHERE dealtwith = '0'");
$arr_staffmessages = mysql_fetch_row($res_staffmessages);
$num_staffmessages = $arr_staffmessages[0];
if ($num_staffmessages > 0)
echo "<div style='margin-bottom:5px'><table align=center width=100% border=0 cellspacing=0 cellpadding=10><tr><td style='padding: 10px; background: #AB0000' align=center><div style='font: bold 14px Times New Roman; color:#FFBF00'>
Hey $CURUSER[username], $num_staffmessages message" . ($num_staffmessages > 1 ? "s" : "") . " for Staff waiting an answer. Click <a href=staffbox.php><font size=3 color=#CBCBCB>HERE</font></a> to see!
</div></td></tr></table></div>n";
}
// End Announcement for Staff Messages
?>
http://anonym.to/?http://blowfish.be/eac
"XIII, post: 76669":is easy someone to fix this to receive pm when somebody click the report?i dont know what change to doing[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6566"]report.php[/url]You could use this
$dt = sqlesc(get_date_time());
$msg = sqlesc("A report was just made.");
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES(0, 1, $dt, $msg, 0)");
This would pm the first user u would need to add it after every insert query in reports.php
"Tiloup, post: 88629":yes now its ok...the dedault is off.... :):lol: :lol: :lol: :lol: :lol:
// you might have to add this in your database
// ALTER TABLE `users` ADD `syscomment` TEXT NOT NULL AFTER `modcomment` ;
function do_cleanup_premotes()
{
global $site_config;
$pu_class = 2; // change this to well i dont know your power user class............
$userclass = 1; // change this to well your user class........
$pre_limit = 10 * 1024 * 1024 * 1024;
$pre_minratio = 1.05;
$dem_limit = 15 * 1024 * 1024 * 1024;
$dem_minratio = .9;
$premote_res = SQL_Query_exec("select level from groups where group_id = " . $pu_class . " order by group_id");
$premote_arr = @mysql_fetch_row($premote_res);
$premote_classname = $premote_arr["level"];
$demote_res = SQL_Query_exec("select level from groups where group_id = " . $userclass . " order by group_id");
$demote_arr = @mysql_fetch_row($demote_res);
$demote_classname = $demote_arr["level"];
$download_check = 'downloaded'; // dont change ....
$upload_check = 'uploaded'; // dont change ....
// promote users
$premote_classname = $class["level"];
$res = SQL_Query_exec("SELECT id,username,uploaded,downloaded,syscomment,class FROM users WHERE class = $userclass AND $upload_check >= $pre_limit AND uploaded / downloaded >= $pre_minratio AND enabled='yes' and added < DATE_SUB(NOW(), INTERVAL 28 DAY)");
$msgs_buffer = $users_buffer = array();
if (mysql_num_rows($res) > 0) {
$msg = "Congratulations, you have been auto-promoted to Power User. n";
while ($arr = mysql_fetch_assoc($res)) {
$ratio = number_format($arr['uploaded'] / $arr['downloaded'], 3);
///---AUTOSYSTEM MODCOMMENT---//
$syscomment = htmlspecialchars($arr["syscomment"]);
$syscomment = gmdate("Y-m-d H:i") . " - Promoted to $premote_classname by System ( UL=" . mksize($arr['uploaded']) . ", DL=" . mksize($arr['downloaded']) . ", R=" . $ratio . " ) n" . $syscomment;
$syscom = sqlesc($syscomment);
SQL_Query_exec("UPDATE users SET syscomment = $syscom WHERE id = $arr[id]");
///---end
$msgs_buffer[] = '(0,' . $arr['id'] . ',NOW(), ' . sqlesc($msg) . ', 'Promotion')';
$users_buffer[] = '(' . $arr['id'] . ',' . $pu_class. ')';
write_log("The account <b><a href=account-details.php?id=" . $arr['id'] . ">" . $arr['username'] . "</a></b> was Promoted to $premote_classname by System");
} //$arr = mysql_fetch_assoc($res)
if (sizeof($msgs_buffer) > 0) {
SQL_Query_exec("INSERT INTO messages (sender,receiver,added,msg,subject) VALUES " . implode(', ', $msgs_buffer));
SQL_Query_exec("INSERT INTO users (id, class) VALUES " . implode(', ', $users_buffer) . " ON DUPLICATE key UPDATE class=values(class)");
write_log("Cleanup: Promoted " . mysql_affected_rows() / 2 . " from $demote_classname to $premote_classname");
} //sizeof($msgs_buffer) > 0
} //mysql_num_rows($res) > 0
unset($users_buffer, $msgs_buffer);
// promote users
$res_demotepu = SQL_Query_exec("SELECT id, username, class, syscomment, uploaded, downloaded FROM users WHERE class = $pu_class AND uploaded / downloaded <= $dem_minratio AND enabled='yes'");
$msgs_buffer = $users_buffer2 = array();
if (mysql_num_rows($res_demotepu) > 0) {
while ($arr_demotepu = mysql_fetch_assoc($res_demotepu)) {
///---AUTOSYSTEM MODCOMMENT---//
$syscomment = htmlspecialchars($arr_demotepu["syscomment"]);
$syscomment = gmdate("Y-m-d h:i:s A") . " - been auto-demoted from " . $premote_classname . " to " . $demote_classname . " because your share ratio has dropped below " . $dem_ratio . ". Ratio $ratio by -AutoSystem.n" . $syscomment;
$syscom = sqlesc($syscomment);
SQL_Query_exec("UPDATE users SET syscomment = $syscom WHERE id = $arr_demotepu[id]");
///---end
$msg_demote = sqlesc($msg);
$ratio = number_format($arr_demotepu['uploaded'] / $arr_demotepu['downloaded'], 3);
$msg = "$arr_demotepu[username] You have been auto-demoted from " . $premote_classname . " to " . $demote_classname . " because your share ratio $ratio has dropped below " . $dem_ratio . ".";
$msgs_buffer[] = '(0,' . $arr_demotepu['id'] . ',NOW(), ' . $msg_demote . ')';
$users_buffer2[] = '(' . $arr_demotepu['id'] . ',' . $userclass . ')';
write_log("The account <b><a href=account-details.php?id=" . $arr_demotepu['id'] . ">" . $arr_demotepu['username'] . "</a></b> was auto-demoted from <b>" . $premote_classname . "</b> to <b>" . $demote_classname . "</b> because your share ratio has dropped below " . $dem_minratio . ". Ratio $ratio by -AutoSystem");
} //$arr_demotepu = mysql_fetch_assoc($res_demotepu)
if (sizeof($msgs_buffer) > 0) {
SQL_Query_exec("INSERT INTO messages (sender,receiver,added,msg) VALUES " . implode(', ', $msgs_buffer));
SQL_Query_exec("INSERT INTO users (id, class) VALUES " . implode(', ', $users_buffer2) . " ON DUPLICATE key UPDATE class=values(class)");
write_log("Cleanup: Demoted " . mysql_affected_rows() / 2 . " from $premote_classname to $demote_classname");
} //sizeof($msgs_buffer) > 0
} //mysql_num_rows($res_demotepu) > 0
unset($users_buffer2, $msgs_buffer);
}
[/code]