This will add 1 GB to users who login daily credits to (ERvD and Arcticwolf for the sys comment code)
ok first off lets add the SQL
now the users SQL
Now open up index.php and find
Add under
save and close
open up account-details.php find
under add
find
under add
open up languages/english.php and add
ok first off lets add the SQL
CREATE TABLE IF NOT EXISTS `dailys` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`userid` int(10) NOT NULL DEFAULT '0',
`added` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`expiry` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ;
now the users SQL
ALTER TABLE `users` ADD `daily` enum('yes','no') NOT NULL DEFAULT 'no';
ALTER TABLE `users` ADD `syscomment` TEXT NOT NULL;
Now open up index.php and find
printf(T_("SHOUTBOX_REFRESH"), 5)."<br />";
end_frame();
}
Add under
//RESET EVERY 24H DAILY BONUS
if ($CURUSER["daily"] == "yes")
{
$today = get_date_time();
$userid = $CURUSER["id"];
$dres = SQL_Query_exec("SELECT userid, expiry FROM dailys WHERE userid='$userid'");
$daily = mysqli_fetch_assoc($dres);
if ($CURUSER["id"] == $daily["userid"] && $today >= $daily["expiry"])
{
$ddel = SQL_Query_exec("DELETE FROM dailys WHERE userid='$userid'");
$dup = SQL_Query_exec("UPDATE users SET daily='no' WHERE id='$userid'");
}
}
//ADD DAILY BONUS
if ($CURUSER['daily'] == "no")
{
$userid = $CURUSER["id"];
$expiry = (int)1;
//1 = 1 one day
$timenow = get_date_time();
$expiretime = get_date_time(gmtime() + (86400 * $expiry));
//86400 = 24H
$dadd = SQL_Query_exec("INSERT INTO dailys (userid, added, expiry) VALUES ('$userid','$timenow','$expiretime')");
$syscomment = $CURUSER["syscomment"];
$syscomment = gmdate("Y-m-d h:i:s A") . " - has been credited his/her daily 1Gb bonus by -System.n <br />". $syscomment;
$syscomment = sqlesc($syscomment);
$dadd = SQL_Query_exec("UPDATE users SET uploaded = uploaded+1073741824,syscomment=$syscomment WHERE id='$userid'");
//1073741824 = 1GB
$dadd = SQL_Query_exec("UPDATE users SET daily='yes' WHERE id='$userid'");
$msg = sqlesc("Your Next Daily Login Bonus Of 1 GB Will Be In: ".$expiretime."");
$added = sqlesc(get_date_time());
@SQL_Query_exec("INSERT INTO messages (sender, receiver, msg, added) VALUES(0, $userid, $msg, $added)");
} else
{ }
save and close
open up account-details.php find
$modcomment = htmlspecialchars($user["modcomment"]);
under add
$syscomment = htmlspecialchars($user["syscomment"]);
find
print("<tr><td>".T_("MOD_COMMENT").": </td><td align='left'><textarea cols='50' rows='10' name='modcomment'>$modcomment</textarea></td></tr>\n");
under add
print("<tr><td>".T_("SYS_COMMENT").": </td><td align='left'><textarea cols='50' rows='10' name='modcomment'>$syscomment</textarea></td></tr>\n");
open up languages/english.php and add
$LANG["SYS_COMMENT"] = "Sys Comment";
