Print Thread
Blacklist Page
skpacman
Want to show a page of blacklisted IP addresses or email addresses or domains to your administration staff, moderators, users, or even to the public?

Just make a new custom page, enter the code below, set the appropriate options (view restrictions, link locations, comments, ratings, etc.) and save it! The page does the rest.

IP addresses link to their report on ProjectHoneypot with a title tooltip showing the blacklist reason, and email addresses only show the tooltip, I may link that to something else later. Please leave the copyright in the bottom!

Edit the $num_cols variable to change how many columns the table has to fit your theme.

Download source  Code
<?php
$query = "SELECT * FROM " . DB_BLACKLIST . " ORDER BY blacklist_id";
   $result = dbquery($query);
   if (!$result) {
      die('Could not get table data: ' . mysql_error());
   }
echo "<center>The below table shows all IP addresses, email addresses, or email domains that have been banned from this website.<BR>
<table border='1' cellspacing='0' cellpadding='2'>";
$col_count = 0;
$num_cols = 6;
while($row = dbarray( $result )) {
   if ($col_count==0) { echo "<tr>";}
   if ($row['blacklist_ip']){
   echo "<TD><a href='http://projecthoneypot.org/ip_" . $row['blacklist_ip'] . "' title='".$row['blacklist_reason']."'>" . $row['blacklist_ip'] . "</a></td>";
   } elseif ($row['blacklist_email']){
   echo "<TD><span title='".$row['blacklist_reason']."'>" . $row['blacklist_email'] . "</span></td>";
   }
   $col_count++;
   if ($col_count >= $num_cols){
   echo "</tr>";
   $col_count=0;
   }
}
   echo "</TR></table><br /><br /><br />Blacklist Custom Page v1.54 &copy; skpacman 2013</center>";
?>



Edited by skpacman on 02-22-2013 08:33


There are 10 kinds of people in this world.
Those who understand binary,
and those who don't...
 
KasteR
Awesome, thank you! I'm going to use this. Clap
 
madison

>KasteR wrote:


Awesome, thank you! I'm going to use this. Clap


me too Good One
 
Lenoox
Very good Thank you Smile
 
Craig
just Some constructive input.

<TD> <TR> <BR> UPPERCASE IS NOT XHTML VALID.

<center></center> Is Deprecated. Use style='text-align: center;' or style='margin-left: auto; margin-right: auto;'. Even better put them in the style and use it as a class for span, p, div or whatever. just use add_to_head to add the styles.

<BR> or <br> is Depreciated, again UPPERCASE is also Not XHTML Compatible. Use <br /> instead.

And don't use this just do an else if no data.

Download source  Code
if (!$result) {
      die('Could not get table data: ' . mysql_error());
   }




Download source  Code
if ($result) {
// GO GO GO
}else{
echo"no blacklisted things";
}




Actually probably better to use...

Download source  Code
if (dbrows($result) > 0) {


 
skpacman

>Craig wrote:


just Some constructive input.

<TD> <TR> <BR> UPPERCASE IS NOT XHTML VALID.

<center></center> Is Deprecated. Use style='text-align: center;' or style='margin-left: auto; margin-right: auto;'. Even better put them in the style and use it as a class for span, p, div or whatever. just use add_to_head to add the styles.

<BR> or <br> is Depreciated, again UPPERCASE is also Not XHTML Compatible. Use <br /> instead.


Thanks for your input Good One

Keep in mind, I wrote this custom page several years ago, back when I knew little-to-nothing about xhtml and best php practices.

I'll rewrite it when I get some time, for now you can make the corrections (as you've stated) in your own use.

There are 10 kinds of people in this world.
Those who understand binary,
and those who don't...
 
PolarFox
Tip: maybe it's better to see the emails separated from IPs?
Hadoken!It Happens...JawDrop
 
KasteR
I've started to assemble an improved version of this. Few more things to add/improve on, and plan on making it available here. Thumb Up
http://fusion.kas..._panel.php
 
Jump to Forum: