Reply to comment

Fix scripts

Downloaded the blocked_hosts.zip file. First the php files need the ^M removed. Use the dos2unix command.
In order for me to get the index.php working with the BlockHosts-2.4.0, I did the following:
change line 4 from $file = "/etc/hosts.deny" to $file = "/etc/hosts.allow"
change line 6 from $blockline = "ALL" to $blockline = "deny"
Most importantly, the command on line 33 is not very good with splitting a string using only 1 whitespace character. Instead, change line 33 from $out[$i] = explode(" ",$output[$i]) to $out[$i] = preg_split('/\s+/',$output[$i])
This will split the array on any whitespace between characters and will file the table with ip addresses instead of blanks.
Finally in the file ip.class.php: be sure to make sure line 10 has the same file name for the iptocountry.csv as your file. I had to change it from ip2country.csv. Otherwise, the little flags will not show up.

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <b> <span> <pre> <hr>
  • Lines and paragraphs break automatically.
  • You may use [acidfree:xx] tags to display acidfree videos or images inline.
  • [l:URL text] input tags replaced with HTML links. URL may be Drupal internal path. [ Link Filter Tips ]

More information about formatting options