Announcements

The New PHP-Fusion USA
by NetriX - 4 weeks ago
Free Hosting
by NetriX - 2 months ago

Latest Posts

MySql?
by daimonbok - 15 hours ago
Video Infusion 3.2.0
by NetriX - 20 hours ago
Version 9 with php 7
by daimonbok - 7 days ago
Facebook Connect 3.0.0
by daimonbok - 1 week ago
URL shortening in PHP
by jim09 - 1 week ago
PHP-Fusion 9 Extensive Demo
by NetriX - 1 week ago
[FORUM RANKS] Flat
by Homdax - 4 weeks ago
The New PHP-Fusion USA
by NetriX - 4 weeks ago
[GUIDE] Optimize PHP-Fusion Website
by NetriX - 4 weeks ago
[FORUM RANKS] ForumCore
by NetriX - 4 weeks ago

View Thread

Who is here? 1 guest(s)
 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.kaster.us/infusions/bla..._panel.php
 
Jump to Forum:

Similar Threads

Thread Forum Replies Last Post
Blank Page When Opening Site Errors and Bugs 2 10-17-2017 18:15
External Page Wrapper General Chat 5 08-15-2017 23:07
PHPF 9 - Page into page w/o iframe [7.02.XX] Code Snippets 1 07-28-2017 11:16
Page keeps breaking Themes Support 3 09-11-2015 23:04
Front Page Scroller Help Infusions Support 26 07-07-2015 06:15


WE RECOMMEND THIS HOST - PHP-Fusion Hosting