Quote:
Originally Posted by rara
Where i can find a checkuser.php and takeconfirm.php ?
I need it for confirm the invited users....
|
I also need those two files, anybody can post them here?
Thanks in advance.
Maybe this for takeconfirm.php?
Code:
<?php
require_once("include/bittorrent.php");
dbconn();
loggedinorreturn();
$id = intval($_GET["id"]);
if (!is_valid_id($id))
stderr("Error", "...");
if (isset($_POST["conusr"]))
sql_query("UPDATE users SET status = 'confirmed' WHERE id IN (" . implode(", ", array_map("sqlesc", $_POST["conusr"])) . ") AND status = 'pending'".( get_user_class() < UC_SYSOP ? " AND invitedby = $CURUSER[id]" : "")) or sqlerr(__FILE__,__LINE__);
else
header("Location: invite.php?id=$id");
header("Refresh: 0; url=invite.php?id=$id");
?>
Bump: and perhaps this to checkuser.php?
PHP Code:
<?
require "include/bittorrent.php";
dbconn(false);
loggedinorreturn();
function bark($msg)
{
stdhead();
stdmsg("Error", $msg);
stdfoot();
exit;
}
function how_many_days_left($iy,$im,$id,$dy,$dm,$dd) {
$init_date = mktime(12,0,0,$im,$id,$iy);
$dst_date = mktime(12,0,0,$dm,$dd,$dy);
$offset = $dst_date-$init_date;
$days = floor($offset/60/60/24);
return $days;
}
function mkage($birthdate) {
$curyear = date("Y");
$curmonth = date("m");
$curday = date("d");
$bdexpl = explode("-",$birthdate);
$byear = $bdexpl[0];
$bmonth = $bdexpl[1];
$bday = $bdexpl[2];
$udate = date("U");
$inforeturn = array();
if (($curmonth == $bmonth) and ($curday == $bday)) {
$dudesage = $curyear - $byear;
$inforeturn["age"] = $dudesage;
$inforeturn["birthday"] = "now";
}
else {
if ($bmonth < $curmonth) {
$agetype = 1; // birthday is already gone for this year
}
if (($bmonth == $curmonth) and ($bday < $curday)) {
$agetype = 1;
}
if (($bmonth == $curmonth) and ($bday > $curday)) {
$agetype = 2; // birthday is yet to come
}
if ($bmonth > $curmonth) {
$agetype = 2;
}
if ($agetype == 1) {
$dudesage = $curyear - $byear;
$days = how_many_days_left($curyear,$curmonth,$curday,$curyear+1,$bmonth,$bday);
}
elseif ($agetype == 2) {
$dudesage = $curyear - $byear - 1;
$days = how_many_days_left($curyear,$curmonth,$curday,$curyear,$bmonth,$bday);
}
$inforeturn["birthday"] = $days;
$inforeturn["currentage"] = $dudesage;
$inforeturn["become"]= $dudesage+1;
}
return $inforeturn;
}
$id = 0 + $_GET["id"];
if (!is_valid_id($id))
bark("Bad ID $id.");
$r = @mysql_query("SELECT * FROM users WHERE id=$id") or sqlerr();
$user = mysql_fetch_array($r) or bark("No user with ID $id.");
if ($user["ip"] && (get_user_class() >= UC_MODERATOR || $user["id"] == $CURUSER["id"]))
{
$ip = $user["ip"];
/* if (get_user_class() == UC_SYSOP)
$dom = @gethostbyaddr($user["ip"]); */
if ($dom == $user["ip"] || @gethostbyname($dom) != $user["ip"])
$addr = $ip;
else
{
$domparts = explode(".", $dom);
$domain = $domparts[count($domparts) - 2];
if ($domain == "COM" || $domain == "CO" || $domain == "NET" || $domain == "NE" || $domain == "ORG" || $domain == "OR" )
$l = 2;
else
$l = 1;
$addr = "$ip ($dom)";
}
}
if ($user[added] == "0000-00-00 00:00:00")
$joindate = 'N/A';
else
$joindate = "$user[added] (" . get_elapsed_time(sql_timestamp_to_unix_timestamp($user["added"])) . " ago)";
$res = mysql_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 = "<img src=/pic/flag/$arr[flagpic] alt=\"$arr[name]\" style='margin-left: 8pt'>";
}
/*$res = mysql_query("SELECT name FROM clients WHERE id=$user[client] LIMIT 1") or sqlerr();
if (mysql_num_rows($res) == 1)
{
$arr = mysql_fetch_assoc($res);
$client = "<td align=left>" . ($arr["name"]) . "</td>";
}*/
$client = "<td align=left>" . $user["client"] . "</td>";
stdhead("Details for " . $user["username"]);
/*$res = mysql_query("SELECT image FROM contacts WHERE id=$user[contacttype] LIMIT 1") or sqlerr();
if (mysql_num_rows($res) == 1)
{
$arr = mysql_fetch_assoc($res);
$contacttype = "<img src=pic/$arr[image]>";
}*/
$contacttype = "<img src=pic/apps.jpg>";
if ($user["invited_by"] > 0){
$blah = mysql_query("SELECT id, username FROM users WHERE id = $user[invited_by]") or sqlerr();
$invite = mysql_fetch_assoc($blah);
}
if ($user["status"] == 'confirmed')
$status = "<a href=userdetails.php?id=$user[id]><font color=#1f7309>Confirmed</font></a>";
else
$status = "<font color=#ca0226>Pending</font>";
begin_main_frame();
print("<table width=100% class=main border=1 cellspacing=0 cellpadding=2>".
"<tr class=tabletitle><td class=embedded><p align=center>$user[username]" . get_user_icons($user, true) . " $country</p></tr></table>\n"); ?>
<table width=100% border=1 cellspacing=0 cellpadding=5>
<?
if ($user[invited_by] > 0)
print("<tr class=tableb><td width=15%>Invited By</td><td align=left><a href=userdetails.php?id=$invite[id]>$invite[username]</a></td></tr>\n");
print("<tr class=tableb><td width=15%>Status</td><td align=left width=99%>$status</td></tr>\n");
print("<tr class=tableb><td width=15%>" . JOINDATE . "</td><td align=left width=99%>$joindate</td></tr>\n");
if (get_user_class() >= UC_MODERATOR)
print("<tr class=tableb><td>" . EMAIL . "</td><td align=left><a href=mailto:$user[email]>$user[email]</a></td></tr>\n");
if ($addr)
print("<tr class=tableb><td>" . IPADDRESS . "</td><td align=left>$addr</td></tr>\n");
//////// admins and curuser only ///////
if (get_user_class() >= UC_ADMINISTRATOR || $user["id"] == $CURUSER["id"]){
print("<tr class=tableb><td>Max. Torrents</td><td align=left>$user[maxtorrents]</td></tr>\n");
}
if ($user['donated'] > 0 && (get_user_class() >= UC_MODERATOR || $CURUSER["id"] == $user["id"]))
print("<tr class=tableb><td>" . DONATED . "</td><td align=left>€ $user[donated]</td></tr>\n");
if ($user[avatar] == '')
$avatar = "<img src=pic/default_avatar.gif width=150>";
elseif ($user[avatar] == $user[id].".jpg")
$avatar = "<img src=Avatars/Gallery/users/$user[avatar] width=150>";
elseif ($user[gallery] == '1')
$avatar = "<img src=Avatars/Gallery/$user[avatar] width=150>";
else
$avatar = "<img src=$user[avatar] width=150>";
print("<tr class=tableb><td>" . AVATAR . "</td><td align=left>$avatar</td></tr>\n");
print("<tr class=tableb><td>" . GENDER . "</td><td align=left>$user[gender]</td></tr>\n");
/// BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY
if ($user["birthdate"]) {
$bdoutput = mkage($user[birthdate]);
if ($bdoutput["birthday"] == "now") {
print("<tr class=tableb><td>Birthday</td><td align=left>$user[username] celebrates ");
if ($user[gender] == "Female") echo "her "; else echo "his ";
$lastdigit = strrev($bdoutput["age"]);
if ($lastdigit{0} == 1) { $bdayending = "st"; }
elseif ($lastdigit{0} == 2) { $bdayending = "nd"; }
elseif ($lastdigit{0} == 3) { $bdayending = "rd"; }
else { $bdayending = "th"; }
print $bdoutput["age"];
print "$bdayending ";
print ("birthday today! Congratulations!</td></tr>\n");
}
else {
print("<tr class=tableb><td>Birthday</td><td align=left>$user[username] is currently $bdoutput[currentage]. But ");
if ($user[gender] == "Female") echo "she "; else echo "he ";
print ("will become $bdoutput[become] in $bdoutput[birthday] days!</td></tr>\n");
}
}
else {
print ("<tr class=tableb><td>Birthday</td><td align=left>No birthdate is set for this user. Too bad...</td></tr>\n");
}
/// BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY
if ($user["client"] > 0)
print("<tr class=tableb><td>" . BTCLIENT . "</td>$client</tr>\n");
if ($user["website"])
print("<tr class=tableb><td>" . WEBSITE . "</td><td align=left><a href=$user[website] target=_blank>$user[website]</a></td></tr>\n");
print("<tr class=tableb><td>Class</td><td align=left>" . get_user_class_name($user["class"]) . "</td></tr>\n");
if ($CURUSER[id] == $user[id] || get_user_class() >= UC_ADMINISTRATOR)
print("<tr class=tableb><td>Invitations</td><td align=left><a href=invite.php?id=$user[id]>$user[invites]</a></td></tr>\n");
else
print("<tr class=tableb><td>Invitations</td><td align=left>$user[invites]</td></tr>\n");
if ($user["contacts"])
print("<tr class=tableb><td>Contact</td><td align=left>$contacttype $user[contacts]</td></tr>\n");
if ($user["title"])
print("<tr class=tableb><td>" . TITLE . "</td><td align=left>" . format_comment($user[title]) . "</td></tr>\n");
if ($user["info"])
print("<tr valign=top class=tableb><td align=left colspan=2 class=text>" . format_comment($user["info"]) . "</td></tr>\n");
print("</table>\n");
end_main_frame();
stdfoot();
?>