// Limit warned users
$res = SQL_Query_exec("SELECT users.id, users.username, UNIX_TIMESTAMP(warnings.expiry) AS expiry FROM users INNER JOIN warnings ON users.id=warnings.userid WHERE type='Poor Ratio' AND active = 'yes' AND account_limited = 'no' AND class = 1 AND enabled='yes' AND warned = 'yes' AND uploaded / downloaded < $minratio AND downloaded >= $downloaded");
if (mysql_num_rows($res) > 0) {
$timenow = get_date_time();
$expires = (86400 * $length);
while ($arr = mysql_fetch_assoc($res)) {
if (gmtime() - $arr["expiry"] >= 0) {
// Send to Shoutbox - Low Ratio user limited
$limiteduser = $arr["username"];
$event = $arr["username"] . " has been limited (Auto Leech warning).";
SQL_Query_exec("INSERT INTO shoutbox (msgid, user, message, date, userid) VALUES (NULL, '$limiteduser', '$event', NOW(), 0)");
SQL_Query_exec("UPDATE users SET account_limited = 'yes', warned = 'no' WHERE id='" . $arr["id"] . "'");
write_log("User <a href='/user/?id=" . $arr["id"] . "'>" . $arr["username"] . "</a> has been <b>limited</b> (Auto Leech warning).");
}
}
}
"Propaganda, post: 68931, member: 60":
Implemented and working without error.
Did clean up the fonts a bit and it now looks like this on my site >>
//////connectable yes or know////////
if ($CURUSER["view_torrents"]=="yes") {
$activeseed = get_row_count("peers", "WHERE userid = '$CURUSER[id]' AND seeder = 'yes'");
$activeleech = get_row_count("peers", "WHERE userid = '$CURUSER[id]' AND seeder = 'no'");
$stmt = DB::run("SELECT connectable FROM peers WHERE userid=" . $CURUSER["id"] . " LIMIT 1");
$connect = $stmt->fetchColumn();
if($connect == 'yes') {
$connectable = "<b><font color=\"#00FF00\">YES</font></b>";
} elseif($connect == 'no') {
$connectable = "<b><font color=\"FFCCFF\">NO</font></b>";
} else {
$connectable ="<b><font color=\"99CCFF\">Check Settings</font></b>";
}
}
print(" ( Seeding: <a href=\"javascript:popout(0)\"onclick=\"window.open('" .$site_config["SITEURL"]. "/peers/seeding1?id=" . $CURUSER["id"] . "','Seeding','width=350,height=350,scrollbars=yes')\" title='You are Seeding'><font color='#EB7F27'><b>".$activeseed."</b></font></a> ");
print("Leeching: <a href=\"javascript:popout(0)\"onclick=\"window.open('" .$site_config["SITEURL"]. "/peers/leeching?id=" . $CURUSER["id"] . "','Seeding','width=350,height=350,scrollbars=yes')\" title='You are Leeching'><font color='#EB7F27'><b>".$activeleech."</b></font></a> ");
print("Connected: ".$connectable." )");
//////connectable yes or know end of mod////////
Will look at the correct bootstrap classes to use at later moment.
require_once ("backend/functions.php");require_once ("backend/ipqualityscore.php");
// Check if username is already in use
$a = (@mysql_fetch_row(@SQL_Query_exec("select count(*) from users where username='$wantusername'")));
if ($a[0] != 0) $message = sprintf(T_("USERNAME_INUSE_S") , $wantusername);
// Check if IP is already in use - August 4, 2020
$checkip = getip();
$a = (@mysql_fetch_row(@SQL_Query_exec("select count(*) from users where ip='$checkip'")));
$ipdenied = "This IP address is already registered.<br><br>We only allow 1 account per device/computer to prevent tracker abuse.";
if ($a[0] != 0) $message = sprintf($ipdenied, $checkip);
write_log("New user $wantusername with IP <b>$checkip</b> was denied due to IP abuse."); // Log the event
<?
$key = 'YOUR_API_KEY';
$ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : $_SERVER['HTTP_CLIENT_IP'];
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$user_language = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
$strictness = 1;
$allow_public_access_points = 'true';
$lighter_penalties = 'false';
$parameters = array(
'user_agent' => $user_agent,
'user_language' => $user_language,
'strictness' => $strictness,
'allow_public_access_points' => $allow_public_access_points,
'lighter_penalties' => $lighter_penalties
);
$formatted_parameters = http_build_query($parameters);
$url = sprintf('https://www.ipqualityscore.com/api/json/ip/%s/%s?%s', $key, $ip, $formatted_parameters);
$timeout = 5;
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $timeout);
$json = curl_exec($curl);
curl_close($curl);
$result = json_decode($json, true);
if (isset($result['success']) && $result['success'] === true) {
if ($result['proxy'] === true && $result['is_crawler'] === false) {
exit(header("Location: https://WEBSITE.com"));
}
}
?>
exit(header("Location: https://WEBSITE.com"));
"m-jay, post: 68923, member: 20288":
what do you have for xampp setup .htaccess seems to be playing up for me
is it htdocs/foldername/.htaccess - tried removing https rewrite
ill try live server as well (y)
RewriteEngine On
# Force HTTPS - Do you have SSL? If not, hashtag next 3 lines
RewriteCond %{HTTP_HOST} WEBSITE\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://WEBSITE.com/$1 [R,L]
# Custom Error Page
ErrorDocument 404 /notfound.php
# Rewritten URls
RewriteRule ^details/([^/]*)/$ /torrents-details.php?id=$1 [L]
RewriteRule ^signup/$ /account-signup.php [L]
RewriteRule ^signin/$ /account-login.php [L]
RewriteRule ^signout/$ /account-logout.php [L]
RewriteRule ^spotlight/latest/$ /spotlight.php [L]
RewriteRule ^updates/$ /news_updates.php [L]
RewriteRule ^search/ajax/$ /ajax/ajax_autocomplete.php [L]
RewriteRule ^check/ajax/$ /ajax/ajax_checkusername.php [L]
RewriteRule ^results/page\:([^/]*)$ /?page=$1 [L]
RewriteRule ^cat/([^/]*)/$ /torrents.php?cat=$1 [L]
RewriteRule ^download/([^/]*)/([^/]*)$ /download.php?id=$1&name=$2 [L]
RewriteRule ^edit/([^/]*)/$ /torrents-edit.php?id=$1 [L]
RewriteRule ^report/([^/]*)/$ /report.php?torrent=$1 [L]
RewriteRule ^bookmark/([^/]*)/$ /bookmarks.php?torrent=$1 [L]
RewriteRule ^bookmarks/$ /bookmark.php [L]
RewriteRule ^tags/([^/]*)/$ /torrents-search.php?search=$1 [L]
RewriteRule ^signup/([^/]*)/$ /account-signup.php?takesignup=$1 [L]
RewriteRule ^signup/([^/]*)/$ /account-confirm-ok.php?type=$1 [L]
RewriteRule ^signup/([^/]*)/([^/]*)/([^/]*)$ /account-confirm-ok.php?type=$1&username=$2&avatar=$3 [L]
RewriteRule ^community/$ /forums.php [L]
RewriteRule ^user/$ /account-details.php [L]
RewriteRule ^account/$ /account.php [L]
RewriteRule ^report/$ /report.php [L]
RewriteRule ^message/$ /mailbox.php [L]
RewriteRule ^faq/$ /faq.php [L]
RewriteRule ^upload/$ /torrents-upload.php [L]
#RewriteRule ^details/$ /torrents-details.php [L]
RewriteRule ^teams/$ /teams-view.php [L]
RewriteRule ^browse/$ /torrents.php [L]
RewriteRule ^latest/$ /torrents-today.php [L]
RewriteRule ^search/$ /torrents-search.php [L]
RewriteRule ^lounge/$ /lounge.php [L]
RewriteRule ^announce/$ /announce.php [L]
RewriteRule ^members/$ /memberlist.php [L]
RewriteRule ^snatched/$ /snatched.php [L]
RewriteRule ^watch/$ /watchedusers.php [L]
CREATE TABLE `users_trophies` (
`userid` INT(10) unsigned NOT NULL,
`trophie` TEXT NOT NULL,
`reason` TEXT NOT NULL,
`trophiepic` TEXT NOT NULL,
PRIMARY KEY (`userid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
"m-jay, post: 68916, member: 20288":
Pdo db classes can be extended too
class DB extends \PDO
This way you can use custom functions and the original functions just added this got sick of editing scripts from github to test lol
In my mvc skeleton I just have two db functions
Run() for chaining and get_row_count was moved there
$var = $sth->Obj(" Query ")->fetch();
foreach ($var as $var2) {
$balls = $var2['column'];
}
print_r($var); // or var_dump()
print($balls); // Read column
$type = isset($_GET['type']) ? intval($_GET['type']) : 0;