Will be converting to v3. Will also add Email & PM notification and config to turn on.
<td align="center"><a href="admincp.php?action=viewlogsunconnectable"><img src="images/admin/connectable.png" border="0" width="118" height="80" alt="" /><br /><?php echo T_("NOT_CONNECT"); ?><br /></a></td>////////////////////////////////////UNCONNECTABLE////////////////
if ($_GET['action'] == "listunconnectable") {
$res2 = SQL_Query_exec("SELECT userid, seeder, torrent, client FROM peers WHERE connectable='no' ORDER BY userid DESC") or sqlerr();
stdhead("Peers that are unconnectable");
begin_frame("Unconnectable");
print("<br/><a href=admincp.php?action=sendpmunconnectable>Send all not connectable users a PM</a>");
print("<br/><a href=admincp.php?action=viewlogsunconnectable>View the Log (Check this before PMing users)</a>");
print("<br/>Peers that are Not Connectable");
print("<br/>This is only users that are active on the torrents right now.");
print("<br/><font color=red>*</font> means the user is seeding.<p>");
$result = SQL_Query_exec("SELECT DISTINCT userid FROM peers WHERE connectable = 'no'");
$count = mysqli_num_rows($result);
print ("$count unique users that are not connectable ");
$result2 = SQL_Query_exec("SELECT DISTINCT torrent FROM peers WHERE connectable = 'no'");
$count2 = mysqli_num_rows($result2);
print ("on $count2 torrents.");
@mysqli_free_result($result);
if (mysqli_num_rows($res2) == 0)
print("<p align=center><b>All Peers Are Connectable! </b></p>\n");
else {
print("<table border=1 cellspacing=0 cellpadding=5>\n");
print("<tr><td class=colhead>UserName</td><td class=colhead>Torrent</td><td class=colhead>Client</td></tr>\n");
while($arr2 = mysqli_fetch_assoc($res2)){
$r2 = SQL_Query_exec("SELECT username FROM users WHERE id=$arr2[userid]") or sqlerr();
$a2 = mysqli_fetch_assoc($r2);
print("<tr><td><a href=account-details.php?id=$arr2[userid]>$a2[username]</a></td><td align=left><a href=torrents-details.php?id=$arr2[torrent]&dllist=1#seeders>$arr2[torrent]");
if ($arr2['seeder'] == 'yes')
print("<font color=red>*</font>");
print("</a></td><td align=left>$arr2[client]</td></tr>\n");
}
print("</table>\n");
}
end_frame();
navmenu();
stdfoot();
}
if ($_GET['action'] == "sendpmunconnectable") {
stdhead("Peers that are unconnectable");
begin_frame("Send PM");
?>
<table class="main" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="embedded"><div align="center"><h1>Mass Message to All Non Connectable Users</a></h1>
<form method="post" action="admincp.php?action=viewlogsunconnectable">
<?php
if (isset($_GET["returnto"]) || isset($_SERVER["HTTP_REFERER"])) {
?>
<input type="hidden" name="returnto" value=<?php echo $_GET["returnto"] ? $_GET["returnto"] : $_SERVER["HTTP_REFERER"] ?> />
<?php
}
//default message
$body = "The tracker has determined that you are firewalled or NATed and cannot accept incoming connections. This means that other peers in the swarm will be unable to connect to you, only you to them. Even worse, if two peers are both in this state they will not be able to connect at all. This has obviously a detrimental effect on the overall speed. The way to solve the problem involves opening the ports used for incoming connections (the same range you defined in your client) on the firewall and/or configuring your NAT server to use a basic form of NAT for that range instead of NAPT (the actual process differs widely between different router models. Check your router documentation and/or support forum. You will also find lots of information on the subject at PortForward). Also if you need help please post in the forums or shoutbox your problems and we will try and figure it out. Thank You";
?>
<table cellspacing="0" cellpadding="5">
<tr>
<td>Send Mass Message To All Non Connectable Users<br>
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td border="0"> </td>
<td border="0"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td><textarea name="msg" cols="120" rows="15"><?php echo $body?></textarea></td>
</tr>
<tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Send the PM!" class="btn"></td>
</tr>
</table>
<input type="hidden" name="receiver" value=<?php echo $receiver?> />
</form>
</div>
</td>
</tr>
</table>
<br>NOTE: Have fun
<?php
// if ($HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST") {
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$dt = sqlesc(get_date_time());
$msg = $_POST['msg'];
if (!$msg)
show_error_msg("Error", "Please Type In Some Text.", 1);
$query = SQL_Query_exec("SELECT distinct userid FROM peers WHERE connectable='no'");
while($dat=mysqli_fetch_assoc($query)){
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES (0,$dat[userid] , '" . get_date_time() . "', " . sqlesc($msg) .", '0')") or sqlerr(__FILE__,__LINE__); }
SQL_Query_exec("INSERT INTO notconnectablepmlog ( user , date ) VALUES ( $CURUSER[id], $dt)") or sqlerr(__FILE__,__LINE__);
write_log("A PM was sent to unconnectable users by ($CURUSER[username])");
die();
}
end_frame();
navmenu();
stdfoot();
}
if ($_GET['action'] == "viewlogsunconnectable") {
stdhead("Unconnectable Peers Mass PM Log");
begin_frame("Unconnectable PM Logs");
$getlog = SQL_Query_exec("SELECT * FROM notconnectablepmlog LIMIT 10");
print("Unconnectable Peers Mass PM Log");
print("<br/><br/><a href=admincp.php?action=sendpmunconnectable> <b>* Send all not connectable users a PM</b></a>");
print("<br/><a href=admincp.php?action=listunconnectable> <b>* List Unconnectable Users</b></a>");
print("<br/><br/>Please dont use the mass PM too often. We dont want to spam the users, just let them know they are unconnectable.<br/>");
print("Every week would be ok.<br/><br/>");
print("<table border=1 cellspacing=0 cellpadding=5>\n");
print("<br/><tr><td class=colhead>By User</td><td class=colhead>Date</td><td class=colhead>elapsed</td></tr>");
while($arr2 = mysqli_fetch_assoc($getlog)){
$r2 = SQL_Query_exec("SELECT username FROM users WHERE id=$arr2[user]") or sqlerr();
$a2 = mysqli_fetch_assoc($r2);
$elapsed = get_elapsed_time(sql_timestamp_to_unix_timestamp($arr2[date]));
print("<tr><td class=colhead><a href=account-details.php?id=$arr2[user]>$a2[username]</a></td><td class=colhead>$arr2[date]</td><td>$elapsed ago</td></tr>");
print("</table>");
}
end_frame();
navmenu();
stdfoot();
}
"MicroMonkey, post: 68845, member: 311":
Mine for v3 looks like this. Run the same sql query as above.
Add admin cp link
<td align="center"><a href="admincp.php?action=viewlogsunconnectable"><img src="images/admin/connectable.png" border="0" width="118" height="80" alt="" /><br /><?php echo T_("NOT_CONNECT"); ?><br /></a></td>
place inside admincp.php
////////////////////////////////////UNCONNECTABLE////////////////
if ($_GET['action'] == "listunconnectable") {
$res2 = SQL_Query_exec("SELECT userid, seeder, torrent, client FROM peers WHERE connectable='no' ORDER BY userid DESC") or sqlerr();
stdhead("Peers that are unconnectable");
begin_frame("Unconnectable");
print("<br/><a href=admincp.php?action=sendpmunconnectable>Send all not connectable users a PM</a>");
print("<br/><a href=admincp.php?action=viewlogsunconnectable>View the Log (Check this before PMing users)</a>");
print("<br/>Peers that are Not Connectable");
print("<br/>This is only users that are active on the torrents right now.");
print("<br/><font color=red>*</font> means the user is seeding.<p>");
$result = SQL_Query_exec("SELECT DISTINCT userid FROM peers WHERE connectable = 'no'");
$count = mysqli_num_rows($result);
print ("$count unique users that are not connectable ");
$result2 = SQL_Query_exec("SELECT DISTINCT torrent FROM peers WHERE connectable = 'no'");
$count2 = mysqli_num_rows($result2);
print ("on $count2 torrents.");
@mysqli_free_result($result);
if (mysqli_num_rows($res2) == 0)
print("<p align=center><b>All Peers Are Connectable! </b></p>\n");
else {
print("<table border=1 cellspacing=0 cellpadding=5>\n");
print("<tr><td class=colhead>UserName</td><td class=colhead>Torrent</td><td class=colhead>Client</td></tr>\n");
while($arr2 = mysqli_fetch_assoc($res2)){
$r2 = SQL_Query_exec("SELECT username FROM users WHERE id=$arr2[userid]") or sqlerr();
$a2 = mysqli_fetch_assoc($r2);
print("<tr><td><a href=account-details.php?id=$arr2[userid]>$a2[username]</a></td><td align=left><a href=torrents-details.php?id=$arr2[torrent]&dllist=1#seeders>$arr2[torrent]");
if ($arr2['seeder'] == 'yes')
print("<font color=red>*</font>");
print("</a></td><td align=left>$arr2[client]</td></tr>\n");
}
print("</table>\n");
}
end_frame();
navmenu();
stdfoot();
}
if ($_GET['action'] == "sendpmunconnectable") {
stdhead("Peers that are unconnectable");
begin_frame("Send PM");
?>
<table class="main" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="embedded"><div align="center"><h1>Mass Message to All Non Connectable Users</a></h1>
<form method="post" action="admincp.php?action=viewlogsunconnectable">
<?php
if (isset($_GET["returnto"]) || isset($_SERVER["HTTP_REFERER"])) {
?>
<input type="hidden" name="returnto" value=<?php echo $_GET["returnto"] ? $_GET["returnto"] : $_SERVER["HTTP_REFERER"] ?> />
<?php
}
//default message
$body = "The tracker has determined that you are firewalled or NATed and cannot accept incoming connections. This means that other peers in the swarm will be unable to connect to you, only you to them. Even worse, if two peers are both in this state they will not be able to connect at all. This has obviously a detrimental effect on the overall speed. The way to solve the problem involves opening the ports used for incoming connections (the same range you defined in your client) on the firewall and/or configuring your NAT server to use a basic form of NAT for that range instead of NAPT (the actual process differs widely between different router models. Check your router documentation and/or support forum. You will also find lots of information on the subject at PortForward). Also if you need help please post in the forums or shoutbox your problems and we will try and figure it out. Thank You";
?>
<table cellspacing="0" cellpadding="5">
<tr>
<td>Send Mass Message To All Non Connectable Users<br>
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td border="0"> </td>
<td border="0"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td><textarea name="msg" cols="120" rows="15"><?php echo $body?></textarea></td>
</tr>
<tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Send the PM!" class="btn"></td>
</tr>
</table>
<input type="hidden" name="receiver" value=<?php echo $receiver?> />
</form>
</div>
</td>
</tr>
</table>
<br>NOTE: Have fun
<?php
if ($HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST") {
$dt = sqlesc(get_date_time());
$msg = $_POST['msg'];
if (!$msg)
show_error_msg("Error", "Please Type In Some Text.", 1);
$query = SQL_Query_exec("SELECT distinct userid FROM peers WHERE connectable='no'");
while($dat=mysqli_fetch_assoc($query)){
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES (0,$dat[userid] , '" . get_date_time() . "', " . sqlesc($msg) .", '0')") or sqlerr(__FILE__,__LINE__); }
SQL_Query_exec("INSERT INTO notconnectablepmlog ( user , date ) VALUES ( $CURUSER[id], $dt)") or sqlerr(__FILE__,__LINE__);
write_log("A PM was sent to unconnectable users by ($CURUSER[username])");
die();
}
end_frame();
navmenu();
stdfoot();
}
if ($_GET['action'] == "viewlogsunconnectable") {
stdhead("Unconnectable Peers Mass PM Log");
begin_frame("Unconnectable PM Logs");
$getlog = SQL_Query_exec("SELECT * FROM notconnectablepmlog LIMIT 10");
print("Unconnectable Peers Mass PM Log");
print("<br/><br/><a href=admincp.php?action=sendpmunconnectable> <b>* Send all not connectable users a PM</b></a>");
print("<br/><a href=admincp.php?action=listunconnectable> <b>* List Unconnectable Users</b></a>");
print("<br/><br/>Please dont use the mass PM too often. We dont want to spam the users, just let them know they are unconnectable.<br/>");
print("Every week would be ok.<br/><br/>");
print("<table border=1 cellspacing=0 cellpadding=5>\n");
print("<br/><tr><td class=colhead>By User</td><td class=colhead>Date</td><td class=colhead>elapsed</td></tr>");
while($arr2 = mysqli_fetch_assoc($getlog)){
$r2 = SQL_Query_exec("SELECT username FROM users WHERE id=$arr2[user]") or sqlerr();
$a2 = mysqli_fetch_assoc($r2);
$elapsed = get_elapsed_time(sql_timestamp_to_unix_timestamp($arr2[date]));
print("<tr><td class=colhead><a href=account-details.php?id=$arr2[user]>$a2[username]</a></td><td class=colhead>$arr2[date]</td><td>$elapsed ago</td></tr>");
print("</table>");
}
end_frame();
navmenu();
stdfoot();
}
"spiritblue, post: 68848, member: 401":
a big thank you for the update, question, possible to put page ?¿, the list is very long scrolled
at home it does not work and I had to change this party [color=rgb(251, 160, 38)]if ($ _GET ['action'] ==[/color] For [color=rgb(250, 197, 28)]if ($ action ==[/color]
Thanks ! ;)
if ($_GET['action'] == "viewlogsunconnectable") {
#if ($action == "viewlogsunconnectable") {
stdhead("Unconnectable Peers Mass PM Log");
begin_frame("Unconnectable PM Logs");
$getlog = SQL_Query_exec("SELECT * FROM notconnectablepmlog LIMIT 10");
print("Unconnectable Peers Mass PM Log");
print("<br/><br/><a href=admincp.php?action=sendpmunconnectable> <b>* Send all not connectable users a PM</b></a>");
print("<br/><a href=admincp.php?action=listunconnectable> <b>* List Unconnectable Users</b></a>");
print("<br/><br/>Please dont use the mass PM too often. We dont want to spam the users, just let them know they are unconnectable.<br/>");
print("Every week would be ok.<br/><br/>");
print("<table border=1 cellspacing=0 cellpadding=5>\n");
print("<br/><tr><td class=colhead>By User</td><td class=colhead>Date</td><td class=colhead>elapsed</td></tr>");
while($arr2 = mysqli_fetch_assoc($getlog)){
$r2 = SQL_Query_exec("SELECT username FROM users WHERE id=$arr2[user]") or sqlerr();
$a2 = mysqli_fetch_assoc($r2);
$elapsed = get_elapsed_time(sql_timestamp_to_unix_timestamp($arr2[date]));
print("<tr><td class=colhead><a href=account-details.php?id=$arr2[user]>$a2[username]</a></td><td class=colhead>$arr2[date]</td><td>$elapsed ago</td></tr>");
print("</table>");
}
end_frame();
navmenu();
stdfoot();
}
#======================================================================#
# UNCONNECTABLE
#======================================================================#
if ($action == "listunconnectable") {
#if ($_GET['action'] == "listunconnectable") {
$res2 = SQL_Query_exec("SELECT userid, seeder, torrent, client FROM peers WHERE connectable='no' ORDER BY userid DESC") or sqlerr();
stdhead("Peers that are unconnectable");
begin_frame("Non Connecter");
print("<br/><center><a class=stylebouton href=admincp.php?action=sendpmunconnectable>Envoyer un MP à tous les utilisateurs non connectables</a>");
print("<br/>(Vérifiez ceci avant de faire à l'utilisateurs un MP)<br/><a class=stylebouton href=admincp.php?action=viewlogsunconnectable>Afficher le journal de connexion</a><br/>");
print("<br/><u>Pairs Connectables</u> ↴");
print("<br/>Ce ne sont que les utilisateurs actifs sur les torrents pour le moment.");
print("<br/><font color=red>*</font> signifie que l'utilisateur est en train de seedé.<hr/>");
$result = SQL_Query_exec("SELECT DISTINCT userid FROM peers WHERE connectable = 'no'");
$count = mysqli_num_rows($result);
print ("$count utilisateurs uniquements qui ne sont pas connectables ");
$result2 = SQL_Query_exec("SELECT DISTINCT torrent FROM peers WHERE connectable = 'no'");
$count2 = mysqli_num_rows($result2);
print ("sur $count2 torrents.");
@mysqli_free_result($result);
if (mysqli_num_rows($res2) == 0)
print("</center><div align=center><b>Tous les pairs sont connectables! </b></div><br/><br/>\n");
else {
print("<br/><table width=50% class=table_table cellspacing=0 cellpadding=5 border=0 align=center>\n");
print("<tr><td class=table_col1>Pseudonyme</td><td class=table_col1>Torrent</td><td class=table_col1>Client</td></tr>\n");
while($arr2 = mysqli_fetch_assoc($res2)){
$r2 = SQL_Query_exec("SELECT username FROM users WHERE id=$arr2[userid]") or sqlerr();
$a2 = mysqli_fetch_assoc($r2);
print("<tr><td><a href=account-details.php?id=$arr2[userid]>".class_user($a2["username"])."</a></td><td align=left><a href=torrents-details.php?id=$arr2[torrent]&dllist=1#seeders>$arr2[torrent]");
if ($arr2['seeder'] == 'yes')
print("<font color=red>*</font>");
print("</a></td><td align=left>$arr2[client]</td></tr>\n");
}
print("</table><br/>\n");
}
end_frame();
navmenu();
stdfoot();
}
if ($action == "sendpmunconnectable") {
#if ($_GET['action'] == "sendpmunconnectable") {
stdhead("Peers that are unconnectable");
begin_frame("Envoyer MP");
?>
<table class="main" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="embedded"><div align="center"><h1>Message de masse à tous les utilisateurs non connecter</a></h1>
<form method="post" action="admincp.php?action=viewlogsunconnectable">
<?php
if (isset($_GET["returnto"]) || isset($_SERVER["HTTP_REFERER"])) {
?>
<input type="hidden" name="returnto" value=<?php echo $_GET["returnto"] ? $_GET["returnto"] : $_SERVER["HTTP_REFERER"] ?> />
<?php
}
//default message
$body = "Le tracker a déterminé que vous êtes protégé par un pare-feu ou NAT et ne pouvez pas accepter les connexions entrantes. Cela signifie que les autres pairs de l'essaim ne pourront pas se connecter à vous, seulement vous à eux. Pire encore, si deux pairs sont tous les deux dans cet état, ils ne pourront pas du tout se connecter. Ceci a évidemment un effet néfaste sur la vitesse globale. La façon de résoudre le problème consiste à ouvrir les ports utilisés pour les connexions entrantes (la même plage que vous avez définie dans votre client) sur le pare-feu et / ou à configurer votre serveur NAT pour utiliser une forme de base de NAT pour cette plage au lieu de NAPT (le Le processus diffère considérablement selon les modèles de routeur. Consultez la documentation de votre routeur et / ou le forum d'assistance. Vous trouverez également de nombreuses informations sur le sujet sur Redirection de port). Aussi, si vous avez besoin d'aide, veuillez poster vos problèmes sur les forums ou shoutbox et nous essaierons de les résoudre. Merci";
?>
<table cellspacing="0" cellpadding="5">
<tr>
<td>Envoyer un message de masse à tous les utilisateurs non connectables<br>
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td border="0"> </td>
<td border="0"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td><textarea name="msg" cols="120" rows="15"><?php echo $body?></textarea></td>
</tr>
<tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Envoyez le MP!" class="btn"></td>
</tr>
</table>
<input type="hidden" name="receiver" value=<?php echo $receiver?> />
</form>
</div>
</td>
</tr>
</table>
<br>REMARQUE: amusez-vous
<?php
#if ($HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST")
if ($_SERVER["REQUEST_METHOD"] == "POST"){
$dt = sqlesc(get_date_time());
$msg = $_POST['msg'];
if (!$msg)
show_error_msg("Erreur", "Veuillez taper un texte.", 1);
$query = SQL_Query_exec("SELECT distinct userid FROM peers WHERE connectable='no'");
while($dat=mysqli_fetch_assoc($query)){
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES (0,$dat[userid] , '" . get_date_time() . "', " . sqlesc($msg) .", '0')") or sqlerr(__FILE__,__LINE__); }
SQL_Query_exec("INSERT INTO notconnectablepmlog ( user , date ) VALUES ( $CURUSER[id], $dt)") or sqlerr(__FILE__,__LINE__);
write_log("Un MP a été envoyé aux utilisateurs non connectables par ($CURUSER[username])");
die();
}
end_frame();
navmenu();
stdfoot();
}
if ($_GET['action'] == "viewlogsunconnectable") {
#if ($action == "viewlogsunconnectable") {
stdhead("Unconnectable Peers Mass PM Log");
begin_frame("Unconnectable PM Logs");
$getlog = SQL_Query_exec("SELECT * FROM notconnectablepmlog LIMIT 10");
print("Unconnectable Peers Mass PM Log");
print("<br/><br/><a href=admincp.php?action=sendpmunconnectable> <b>* Send all not connectable users a PM</b></a>");
print("<br/><a href=admincp.php?action=listunconnectable> <b>* List Unconnectable Users</b></a>");
print("<br/><br/>Please dont use the mass PM too often. We dont want to spam the users, just let them know they are unconnectable.<br/>");
print("Every week would be ok.<br/><br/>");
print("<table border=1 cellspacing=0 cellpadding=5>\n");
print("<br/><tr><td class=colhead>By User</td><td class=colhead>Date</td><td class=colhead>elapsed</td></tr>");
while($arr2 = mysqli_fetch_assoc($getlog)){
$r2 = SQL_Query_exec("SELECT username FROM users WHERE id=$arr2[user]") or sqlerr();
$a2 = mysqli_fetch_assoc($r2);
$elapsed = get_elapsed_time(sql_timestamp_to_unix_timestamp($arr2[date]));
print("<tr><td class=colhead><a href=account-details.php?id=$arr2[user]>$a2[username]</a></td><td class=colhead>$arr2[date]</td><td>$elapsed ago</td></tr>");
print("</table>");
}
end_frame();
navmenu();
stdfoot();
}
#======================================================================#
# END UNCONNECTABLE
#======================================================================#
"MicroMonkey, post: 68853, member: 311":
Just realized that HTTP_SERVER_VARS is removed from php, I guess it is now just $_SERVER
"spiritblue, post: 68857, member: 401":
?¿
No users online
Torrents
Members
Online