fix checkuser page + add harem addition to invite page

This commit is contained in:
xiaomlove
2022-08-05 16:13:19 +08:00
parent cfda6aec1d
commit 60013897ab
8 changed files with 42 additions and 24 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.7.20');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-08-04');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-08-05');
defined('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
+3 -1
View File
@@ -614,7 +614,9 @@ function begin_main_frame($caption = "", $center = false, $width = 100)
if ($center)
$tdextra .= " align=\"center\"";
$width = 1200 * $width /100;
if (!str_ends_with($width, '%')) {
$width = 1200 * $width / 100;
}
print("<table class=\"main\" width=\"".$width."\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">" .
"<tr><td class=\"embedded\" $tdextra>");
+2
View File
@@ -48,6 +48,8 @@ $lang_invite = array
'std_only' => "只有",
'std_or_above_can_invite' => "及以上的用户才能发送邀请。",
'text_email_restriction_note' => "你只能发送邀请给以下邮箱:",
'harem_addition' => '后宫加成',
);
?>
+1
View File
@@ -48,6 +48,7 @@ $lang_invite = array
'std_only' => "只有",
'std_or_above_can_invite' => "及以上的用戶才能發送邀請。",
'text_email_restriction_note' => "你只能發送邀請給以下郵箱:",
'harem_addition' => '後宮加成',
);
?>
+1
View File
@@ -51,6 +51,7 @@ Best Regards,
'std_only' => "Only ",
'std_or_above_can_invite' => " or above can send invitation.",
'text_email_restriction_note' => "You could only send invitation to email from those domains: ",
'harem_addition' => 'Harem addition',
);
?>
+11 -11
View File
@@ -19,24 +19,24 @@ $r = @sql_query("SELECT * FROM users WHERE status = 'pending' AND id = ".sqlesc(
$user = mysql_fetch_array($r) or bark($lang_checkuser['std_no_user_id']);
if (get_user_class() < UC_MODERATOR) {
if ($user[invited_by] != $CURUSER[id])
if ($user['invited_by'] != $CURUSER['id'])
bark($lang_checkuser['std_no_permission']);
}
if ($user["gender"] == "Male") $gender = "<img src=pic/male.png alt='Male' style='margin-left: 4pt'>";
elseif ($user["gender"] == "Female") $gender = "<img src=pic/female.png alt='Female' style='margin-left: 4pt'>";
elseif ($user["gender"] == "N/A") $gender = "<img src=pic/na.gif alt='N/A' style='margin-left: 4pt'>";
if ($user["gender"] == "Male") $gender = '<img class="male" src="pic/trans.gif" alt="Male" title="Male" style="margin-left: 4pt">';
elseif ($user["gender"] == "Female") $gender = '<img class="female" src="pic/trans.gif" alt="Female" title="Female" style="margin-left: 4pt">';
elseif ($user["gender"] == "N/A") $gender = '<img class="no_gender" src="pic/trans.gif" alt="N/A" title="No gender" style="margin-left: 4pt">';
if ($user[added] == "0000-00-00 00:00:00" || $user['added'] == null)
if ($user['added'] == "0000-00-00 00:00:00" || $user['added'] == null)
$joindate = 'N/A';
else
$joindate = "$user[added] (" . get_elapsed_time(strtotime($user["added"])) . " ago)";
$res = sql_query("SELECT name,flagpic FROM countries WHERE id=$user[country] LIMIT 1") or sqlerr();
if (mysql_num_rows($res) == 1)
{
$arr = mysql_fetch_assoc($res);
$country = "<td class=embedded><img src=pic/flag/$arr[flagpic] alt=\"$arr[name]\" style='margin-left: 8pt'></td>";
$country = "<td class=embedded><img src=pic/flag/{$arr['flagpic']} alt=\"$arr[name]\" style='margin-left: 8pt'></td>";
}
stdhead($lang_checkuser['head_detail_for'] . $user["username"]);
@@ -51,12 +51,12 @@ if (!$enabled)
<table width=737 border=1 cellspacing=0 cellpadding=5>
<tr><td class=rowhead width=1%><?php echo $lang_checkuser['row_join_date'] ?></td><td align=left width=99%><?php echo $joindate;?></td></tr>
<tr><td class=rowhead width=1%><?php echo $lang_checkuser['row_gender'] ?></td><td align=left width=99%><?php echo $gender;?></td></tr>
<tr><td class=rowhead width=1%><?php echo $lang_checkuser['row_email'] ?></td><td align=left width=99%><a href=mailto:<?php echo $user[email];?>><?php echo $user[email];?></a></td></tr>
<tr><td class=rowhead width=1%><?php echo $lang_checkuser['row_email'] ?></td><td align=left width=99%><a href=mailto:<?php echo $user['email'];?>><?php echo $user['email'];?></a></td></tr>
<?php
if (get_user_class() >= UC_MODERATOR AND $user[ip] != '')
print ("<tr><td class=rowhead width=1%>".$lang_checkuser['row_ip']."</td><td align=left width=99%>$user[ip]</td></tr>");
if (get_user_class() >= UC_MODERATOR AND $user['ip'] != '')
print ("<tr><td class=rowhead width=1%>".$lang_checkuser['row_ip']."</td><td align=left width=99%>{$user['ip']}</td></tr>");
print("<form method=post action=takeconfirm.php?id=".htmlspecialchars($id).">");
print("<input type=hidden name=email value=$user[email]>");
print("<input type=hidden name=email value={$user['email']}>");
print("<tr><td class=rowhead width=1%><input type=\"checkbox\" name=\"conusr[]\" value=\"" . $id . "\" checked/></td>");
print("<td align=left width=99%><input type=submit style='height: 20px' value=\"".$lang_checkuser['submit_confirm_this_user'] ."\"></form></tr></td></table>");
stdfoot();
+20 -9
View File
@@ -9,11 +9,9 @@ $type = unesc($_GET["type"] ?? '');
$menuSelected = $_REQUEST['menu'] ?? 'invitee';
$pageSize = 50;
registration_check('invitesystem',true,false);
function inviteMenu ($selected = "invitee") {
global $lang_invite, $id, $CURUSER;
begin_main_frame();
begin_main_frame("", false, "100%");
print ("<div id=\"invitenav\" style='position: relative'><ul id=\"invitemenu\" class=\"menu\">");
print ("<li" . ($selected == "invitee" ? " class=selected" : "") . "><a href=\"?id=".$id."&menu=invitee\">".$lang_invite['text_invite_status']."</a></li>");
print ("<li" . ($selected == "sent" ? " class=selected" : "") . "><a href=\"?id=".$id."&menu=sent\">".$lang_invite['text_sent_invites_status']."</a></li>");
@@ -48,6 +46,7 @@ if ($inv["invites"] != 1){
}
if ($type == 'new'){
registration_check('invitesystem',true,false);
if ($CURUSER['invites'] <= 0) {
stdmsg($lang_invite['std_sorry'],$lang_invite['std_no_invites_left'].
"<a class=altlink href=invite.php?id={$CURUSER['id']}>".$lang_invite['here_to_go_back'],false);
@@ -80,13 +79,18 @@ if ($type == 'new'){
print("<tr><td colspan=7 align=center>".$lang_invite['text_no_invites']."</tr>");
} else {
list($pagertop, $pagerbottom, $limit) = pager($pageSize, $number, "?id=$id&menu=$menuSelected&");
$haremAdditionFactor = get_setting('bonus.harem_addition');
$ret = sql_query("SELECT id, username, email, uploaded, downloaded, status, warned, enabled, donor, email FROM users WHERE invited_by = ".mysql_real_escape_string($id) . " $limit") or sqlerr();
$num = mysql_num_rows($ret);
print("<tr><td class=colhead><b>".$lang_invite['text_username']."</b></td><td class=colhead><b>".$lang_invite['text_email']."</b></td><td class=colhead><b>".$lang_invite['text_uploaded']."</b></td><td class=colhead><b>".$lang_invite['text_downloaded']."</b></td><td class=colhead><b>".$lang_invite['text_ratio']."</b></td><td class=colhead><b>".$lang_invite['text_status']."</b></td>");
if ($CURUSER['id'] == $id || get_user_class() >= UC_SYSOP)
print("<tr><td class=colhead><b>".$lang_invite['text_username']."</b></td><td class=colhead><b>".$lang_invite['text_email']."</b></td><td class=colhead><b>".$lang_invite['text_uploaded']."</b></td><td class=colhead><b>".$lang_invite['text_downloaded']."</b></td><td class=colhead><b>".$lang_invite['text_ratio']."</b></td>");
if ($haremAdditionFactor > 0) {
print('<td class="colhead">'.$lang_invite['harem_addition'].'</td>');
}
print("<td class=colhead><b>".$lang_invite['text_status']."</b></td>");
if ($CURUSER['id'] == $id || get_user_class() >= UC_SYSOP) {
print("<td class=colhead><b>".$lang_invite['text_confirm']."</b></td>");
}
print("</tr>");
for ($i = 0; $i < $num; ++$i)
@@ -110,7 +114,11 @@ if ($type == 'new'){
else
$status = "<a href=checkuser.php?id={$arr['id']}><font color=#ca0226>".$lang_invite['text_pending']."</font></a>";
print("<tr class=rowfollow>$user<td>{$arr['email']}</td><td class=rowfollow>" . mksize($arr['uploaded']) . "</td><td class=rowfollow>" . mksize($arr['downloaded']) . "</td><td class=rowfollow>$ratio</td><td class=rowfollow>$status</td>");
print("<tr class=rowfollow>$user<td>{$arr['email']}</td><td class=rowfollow>" . mksize($arr['uploaded']) . "</td><td class=rowfollow>" . mksize($arr['downloaded']) . "</td><td class=rowfollow>$ratio</td>");
if ($haremAdditionFactor > 0) {
print ("<td class=rowfollow>".number_format(calculate_seed_bonus($arr['id'])['all_bonus'] * $haremAdditionFactor, 3)."</td>");
}
print("<td class=rowfollow>$status</td>");
if ($CURUSER['id'] == $id || get_user_class() >= UC_SYSOP){
print("<td>");
if ($arr['status'] == 'pending')
@@ -124,11 +132,14 @@ if ($type == 'new'){
if ($CURUSER['id'] == $id || get_user_class() >= UC_SYSOP)
{
$pendingcount = number_format(get_row_count("users", "WHERE status='pending' AND invited_by={$CURUSER['id']}"));
$colSpan = 7;
if (isset($haremAdditionFactor) && $haremAdditionFactor > 0) {
$colSpan += 1;
}
if ($pendingcount){
print("<input type=hidden name=email value={$arr['email']}>");
print("<tr><td colspan=7 align=right><input type=submit style='height: 20px' value=".$lang_invite['submit_confirm_users']."></td></tr>");
print("<tr><td colspan=$colSpan align=right><input type=submit style='height: 20px' value=".$lang_invite['submit_confirm_users']."></td></tr>");
}
print("</form>");
}
+3 -2
View File
@@ -12,10 +12,11 @@ else
"<a class=altlink href=invite.php?id={$CURUSER['id']}>".$lang_takeconfirm['std_here_to_go_back'],false);
$title = $SITENAME.$lang_takeconfirm['mail_title'];
$baseUrl = getSchemeAndHttpHost();
$body = <<<EOD
{$lang_takeconfirm['mail_content_1']}
<b><a href="javascript:void(null)" onclick="window.open('http://$BASEURL/login.php')">{$lang_takeconfirm['mail_here']}</a></b><br />
http://$BASEURL/login.php
<b><a href="javascript:void(null)" onclick="window.open('{$baseUrl}/login.php')">{$lang_takeconfirm['mail_here']}</a></b><br />
{$baseUrl}/login.php
{$lang_takeconfirm['mail_content_2']}
EOD;