4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: V@no on March 28, 2005, 05:32:31 AM

Title: [MOD] Ban v1.7
Post by: V@no on March 28, 2005, 05:32:31 AM
Working with v1.7 and v1.7.1 (possible with v1.7.2 too)

With this mod administrators can control who should not visit their 4images site and for how long.

here are a few screenshots of the control panel:

The list of bans:
(http://img58.exs.cx/img58/161/banlist3cv.png)


The list of current visitors with ability ban them from there:
(http://img58.exs.cx/img58/8261/banwhos2ou.png)


A clean form for a new ban:
(http://img58.exs.cx/img58/9516/bannew2yc.png)


Logs of banned visitors:
(http://img58.exs.cx/img58/2484/banlogs0vr.png)



--------- [ Features ] -----------




---------- [ Changed/new files ] -----------

New files:
admin/plugins/ban.php
templates/<your template>/ban.html


Changed files:
admin/settings.php
includes/constants.php
includes/functions.php
includes/sessions.php
lang/<your language>/admin.php
lang/<your language>/main.php
member.php




---------- [ Installation ] ----------

Step 1
Open admin/settings.php
Find:
Code: [Select]
  show_form_footer($lang['save_changes'], "", 2);Add above:
Code: [Select]
/*
  MOD BAN
  START INSERT
*/
  show_table_separator($setting_group[XX], 2, "#setting_group_XX");
  show_setting_row("look_hostname", "radio");
/*
  MOD BAN
  END INSERT
*/
Now is the tricky part. Scroll little bit up and find the last
show_table_separator($setting_group[XX], 2, "#setting_group_XX");
where XX is a number of the last section. Now add 1 to that number and memorize that number, u'll need it in Step 5
Also, replace XX in the code u've just added to admin/settings.php with that number.
For example if the last section looks like show_table_separator($setting_group[7], 2, "#setting_group_7");
Then the number u should "memorize" is 8 (7+1=8)



Step 2
Open includes/constants.php
At the very end, above closing ?> insert:
Code: [Select]
/*
  MOD BAN
  START INSERT
*/
define("BAN_TABLE", $table_prefix."ban");
define("BAN_LOGS_TABLE", $table_prefix."ban_logs");
define("BAN_IP", 1);
define("BAN_HOSTNAME", 2);
define("BAN_USERID", 3);
define("BAN_NAME", 4);
define("BAN_EMAIL", 5);
/*
  MOD BAN
  END INSERT
*/



Step 3
Open includes/functions.php
At the very end, above closing ?> insert:
Code: [Select]
/*
  MOD BAN
  START INSERT
*/

function check_ban()
{
  global $user_info, $site_sess, $config, $lang, $site_db, $HTTP_GET_VARS;
  $types = array("ip", "hostname", "name", "user_id", "email");
  if (!$config['ban_update'])
  {
    return false;
  }
  if ($user_info['user_level'] == ADMIN)
  {
    if (!isset($HTTP_GET_VARS['bantest'])) return false;
    $return = true;
    foreach ($types as $key)
    {
      if (isset($HTTP_GET_VARS[$key]) && $$key = $HTTP_GET_VARS[$key]) $return = false;
      else $$key = "";
    }
    if ($return) return false;
    $force = true;
  }
  else
  {
    $ip = $site_sess->session_info['session_ip'];
    $email = $user_info['user_email'];
    $user_id = $user_info['user_id'];
    $name = $user_info['user_name'];
    $hostname = "";
    $force = false;
  }
 
  $ban = false;
  $ban_checked = $site_sess->get_session_var("ban_checked");
  $ban_userid = $site_sess->get_session_var("ban_userid");
  $ban_banned = $site_sess->get_session_var("ban_banned");
  if (get_magic_quotes_gpc() != 0)
  {
    $ban_banned = stripslashes($ban_banned);
  }
//  $ban_banned = stripslashes($ban_banned); //uncomment this line if magic_quotes_gpc is turned on on your server
  $ban_banned = ($ban_banned) ? unserialize($ban_banned) : "";
 
  if ($force || (!$ban_checked || !$ban_userid || ($ban_userid && $ban_userid != $user_info['user_id']) || ($ban_checked && $ban_checked < $config['ban_update']) || ($ban_banned && $ban_banned['expire'] < time())))
  {
    $query = array();

    if (preg_match('/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/', $ip, $ip_chop) == 1)
    {
      $query[] = "(type = ".BAN_IP." AND ($ip_chop[1] BETWEEN ip1_start AND ip1_end) AND ($ip_chop[2] BETWEEN ip2_start AND ip2_end) AND ($ip_chop[3] BETWEEN ip3_start AND ip3_end) AND ($ip_chop[4] BETWEEN ip4_start AND ip4_end))";

      if ($config['look_hostname'] && !$hostname)
      {
        $hostname = @gethostbyaddr($ip);
      }
    }
    if ($hostname)
    {
      $query[] = "(type = ".BAN_HOSTNAME." AND ('$hostname' LIKE hostname))";
    }
    if ($email)
    {
      $query[] = "(type = ".BAN_EMAIL." AND ('".addslashes($email)."' LIKE email))";
    }

    if ($user_id && $user_id > GUEST)
    {
      $query[] = "(type = ".BAN_USERID." AND user_id = ".$user_id.")";
    }

    if ($name)
    {
      $query[] = "(type = ".BAN_NAME." AND ('".addslashes($name)."' LIKE name))";
    }

    if (!empty($query))
    {
      $sql = "SELECT id, type, message, date, expire
              FROM ".BAN_TABLE."
              WHERE (".implode(' OR ', $query).")";
      if ($result = $site_db->query($sql))
      {
        while ($row = $site_db->fetch_array($result))
        {
          $site_sess->set_session_var("ban_banned", addslashes(serialize($row)));
 
          if ($row['date'] <= time() && (!$row['expire'] || $row['expire'] > time()))
          {
            $ban = $row;
            break;
          }
        }
      }
      else
      {
        $site_sess->set_session_var("ban_banned", "");
      }
     
    }
    $site_sess->set_session_var("ban_checked", time());
    $site_sess->set_session_var("ban_userid", $user_info['user_id']);
  }
  elseif ($ban_banned && $ban_banned['date'] <= time() && (!$ban_banned['expire'] ||  $ban_banned['expire'] > time()))
  {
    $ban = $ban_banned;
  }

  return $ban;
}
/*
  MOD BAN
  END INSERT
*/



Step 4
Open includes/sessions.php
Find:
Code: [Select]
$user_info = $site_sess->return_user_info();
Insert below:
Code: [Select]
/*
  MOD BAN
  START INSERT
*/
if ($ban = check_ban())
{
  $sql = "INSERT INTO ".BAN_LOGS_TABLE."
          (date, ip, uri, ban_id, user_id)
          VALUES
          (".time().", '".$site_sess->session_info['session_ip']."', 'http".(($_SERVER['SERVER_PORT'] != 80) ? "s" : "")."//".$_SERVER['SERVER_NAME'].addslashes($_SERVER['REQUEST_URI'])."', ".$ban['id'].", '".$user_info['user_id']."')";
  $site_db->query($sql);
  $main_template = "ban";
  $config['badword_list'] = "";
  include(ROOT_PATH.'includes/page_header.php');
  $site_template->register_vars(array(
    "lang_ban" => $lang['ban_banned'],
    "message" => format_text($ban['message'], 1, 0, 1, 1, 1, 1)
  ));
  $site_template->print_template($site_template->parse_template($main_template));
  include(ROOT_PATH.'includes/page_footer.php');
  exit;
}
/*
  MOD BAN
  END INSERT
*/



Step 5
Open lang/<your language>/admin.php
At the very end, above closing ?> insert:
Code: [Select]
/*
  MOD BAN
  START INSERT
*/
/*-- Setting-Group XX --*/
$setting_group[XX]="Ban";
$setting['look_hostname'] = "Lookup hostnames<span class=\"smalltext\"><br />might affect the perfomance";

$lang['ban'] = "Ban";
$lang['ban_ip'] = "IP";
$lang['ban_ip_expl'] = "<span class=\"smalltext\">ex: 123.123.123.123 or 123.123.123.* or 123.123.123.0-255</span>";
$lang['ban_user_id'] = "User id";
$lang['ban_email'] = "Email";
$lang['ban_email_expl'] = "<span class=\"smalltext\">ex: example*@example.com</span>";
$lang['ban_name'] = "Name";
$lang['ban_name_expl'] = "<span class=\"smalltext\">ex: example*</span>";
$lang['ban_hostname'] = "Hostname";
$lang['ban_hostname_expl'] = "<span class=\"smalltext\">ex: *.aol.com</span>";
$lang['ban_add'] = "Add new ban";
$lang['ban_edit'] = "Edit ban";
$lang['ban_date'] = "Start date";
$lang['ban_date_expl'] = "<span class=\"smalltext\">yyyy-mm-dd hh:mm:ss</span>";
$lang['ban_expire'] = "End date";
$lang['ban_expire_expl'] = "(leave blank for permanent ban)<br /><span class=\"smalltext\">yyyy-mm-dd hh:mm:ss</span>";
$lang['ban_message'] = "Message";
$lang['ban_message_expl'] = "<span class=\"smalltext\">Will be displayed to the banned visitor</span>";
$lang['ban_reason'] = "Reason";
$lang['ban_reason_expl'] = "<span class=\"smalltext\">Remind yourself</span>";
$lang['ban_required'] = array(
    BAN_IP => "Please enter IP",
    BAN_HOSTNAME => "Please enter a hostname",
    BAN_USERID => "Please enter a user ID",
    BAN_NAME => "Please enter a username",
    BAN_EMAIL => "Please enter an email"
);
$lang['ban_bad_entry'] = array(
    BAN_IP => "IP is incorrect",
    BAN_HOSTNAME => "Hostname is incorrect",
    BAN_USERID => "User ID is incorrect",
    BAN_NAME => "Username is incorrect",
    BAN_EMAIL => "Email is incorrect"
);
$lang['ban_dublicate'] = array(
    BAN_IP => "This IP is already present in the database",
    BAN_HOSTNAME => "This hostname is already present in the database",
    BAN_USERID => "This user ID is already present in the database",
    BAN_NAME => "This username is already present in the database",
    BAN_EMAIL => "This email is already present in the database"
);
$lang['ban_type_array'] = array(
    BAN_IP => "IP",
    BAN_HOSTNAME => "Hostname",
    BAN_USERID => "User ID",
    BAN_NAME => "Username",
    BAN_EMAIL => "Email"
);
$lang['ban_list'] = "List";
$lang['ban_type'] = "Type";
$lang['ban_value'] = "Value";
$lang['ban_add_success'] = "Entry added successfuly";
$lang['ban_add_error'] = "Error adding new entry";
$lang['ban_update_success'] = "Entry updated successfuly";
$lang['ban_update'] = "Update";
$lang['ban_update_error'] = "Error updating entry";
$lang['ban_edit_error'] = "Error edit entry";
$lang['ban_edit_success'] = "Entry edited successfuly";
$lang['ban_delete_error'] = "Error delete entry";
$lang['ban_delete_success'] = "Entry deleted successfuly";
$lang['ban_filter'] = "Filter";
$lang['ban_menu'] = "Content menu";
$lang['ban_whois'] = "Whos online";
$lang['ban_action'] = "Action";
$lang['ban_perm'] = "Never";
$lang['ban_perpage'] = "Show per page";
$lang['ban_logs'] = "Logs";
$lang['ban_uri'] = "Accessed URL";
$lang['ban_user_name'] = "User name";
$lang['ban_date_access'] = "Access date";
$lang['ban_logs_del_success'] = "Log(s) deleted successfuly";
$lang['ban_logs_del_error'] = "Error deleting log(s)";
$lang['ban_active'] = "Active";
$lang['ban_expired'] = "Expired";
$lang['ban_notactive'] = "Not active";
$lang['bad_invalid_date'] = "End date must be bigger then start date";
$lang['ban_copy'] = "Copy";
$lang['ban_test'] = "Test";
/*
  MOD BAN
  END INSERT
*/
Replace XX with the number u were supposed to memorize from Step 1
Quote
/*-- Setting-Group XX --*/
$setting_group[XX]="Ban";



Step 6
Open lang/<your language>/main.php
At the very end, above closing ?> insert:
Code: [Select]
/*
  MOD BAN
  START INSERT
*/
$lang['ban_banned'] = "You've been banned";

/*
  MOD BAN
  END INSERT
*/



Step 7
Download this (http://www.4homepages.de/forum/index.php?action=dlattach;topic=7066.0;attach=975) package.
Unzip it and upload acording the following directory tree:
ban_install.php
admin/plugins/ban.php
templates/<your template>/ban.html

(If u dont have admin/plugins/ folder, then simply create it)

Step 7.1
Login with your administrator account and run the installer (ban_install.php)
by typing in your browser: http://<yoursiteaddress>/<path_to_4images>/ban_install.php
Once the database update is finished, delete ban_install.php



Step 8 (added 2006-05-20)
Open member.php
Find:
Code: [Select]
  if ($user_row = get_user_info($user_id)) {
Replace with:
Code: [Select]
  if (($user_info['user_level'] == ADMIN || !$site_db->query_firstrow("SELECT id FROM ".BAN_TABLE." WHERE type = ".BAN_USERID." AND user_id = ".$user_id." AND (NOT expire OR expire > ".time().") LIMIT 1")) && $user_row = get_user_info($user_id)) {



In the settings u should see now a new section "Ban" were u can turn on/off hostname lookup. If u turn it off, u wont be able ban by hostname, but it might increase server perfomance. U should only turn it off if your site loose its perfomance.



---------- [ F.A.Q. ] --------------

Q: Why when I ban someone, they see the ban message only first time they open the page, after refresh the ban doesnt work anymore?
A: This is a recent discover and its probably because your server has magic_quotes_gpc is turned on (check in phpinfo()).
To fix that, uncomment this line from includes/functions.php:
//  $ban_banned = stripslashes($ban_banned); //uncomment this line if magic_quotes_gpc is turned on on your server
Since v1.6.1 added auto check if magic_quotes_gpc is enabled

Q: Why when I enter an user id, name or an email address for a new ban it says id/name/email is not valid?
A: The plugin checks if a member exists with such id/name/email, you can not ban non-existing members.

Q: How can I ban entire subnet?
A: If you want ban a subnet 192.168.0.X u have two ways to do so either use wildcard (*): 192.168.0.* or use IP range: 192.168.0.0-255
You can specify range of each of 4 IP parts. 0-255.0-255.0-255.0-255
In green is start number of the range and red is the end of the range. (be carefull, dont ban your own IP, otherwise ones you logout, the only way to get back is manualy edit database)

Q: I just tryed ban myself, but I still was able access my site. Why?
A: For security reason ban does not apply for administrators. Ones you log out, the only way unban yourself is edit manualy MySQL database.

Q: When click on "whos online" link, it takes a while before it opens the page. Why?
A: Most probably the "Hostname lookup" is turned on in the settings. You can disable it there, or edit ban.php and read comments for $look_hostname variable on top of the file.

Q: How can I properly test the mod working?
A: Well, the best sollution is add ban for your own IP/hostname and logout. BUT before you do that, make sure that you set expiration date for just a few minutes, you will have enough time to test the ban before it get expired and you'll be able login. To test ban by username/userid/email - set a ban for your test account and then try to login with that account.
Also, since v1.5 you can test the ban by clicking "test" link next to it from the bans list page.



---------- [ Version history ] -------------

1.7  (2006-05-20)
  - added an optional Step 8 which will allow view profiles of banned by user id members only to admins, other visitors will get "user not found" message.

1.6.3  (2006-05-20)
  - fixed issue with not able see member's profile by admin when member banned by user id. (replace ban.php and redo step 3)

1.6.2  (2005-07-09)
  - fixed issue when ban wouldnt work for name, user id or email, when visitor visited the site as a guest and then login.

1.6.1  (2005-06-03)
  - added auto check if  magic_quotes_gpc is enabled on the server. it should fix issue covered in FAQ about ban doesnt work after page referesh. (just 3 lines added into includes/functions.php above the line mentioned in the FAQ)

1.6 (2005-04-01) (more info here (http://www.4homepages.de/forum/index.php?topic=7066.msg31646#msg31646))
  - added support for [MOD] Country flags (based on IP) in whos online in ACP (http://www.4homepages.de/forum/index.php?topic=6709.0)
  - added "reason" field in the logs page
  - fixed test by hostname
  - improved test feature

1.5 (2005-03-29) (more info here (http://www.4homepages.de/forum/index.php?topic=7066.msg31176#msg31176))
  - added two new features: copy existing bans data into new ban form and test feature for admins

1.4.3 (2005-03-29)
  - not a bug, and not a new feature, it just didnt show correct page when editing an entry. (replace ban.php)

1.4.2 (2005-03-28)
  - very minor bug fixed where input form named "Add new ban" instead of "Update ban" after update failure (replace ban.php)

1.4.1 (2005-03-28) (more info here (http://www.4homepages.de/forum/index.php?topic=7066.msg31163#msg31163))
  - found a bug that would only check the first found entry in the database and if the first entry is expired or not active and second entry is valid, the visitor will not get banned..

1.4 (2005-03-28) (more info here (http://www.4homepages.de/forum/index.php?topic=7066.msg31153#msg31153))
  - added sorting by "value", its not perfect, but its close enough :)

1.3 (2005-03-28) (more info here (http://www.4homepages.de/forum/index.php?topic=7066.msg31153#msg31153))
  - added another filter "not active" which will show/hide bans that are not active yet (the start date is still in the future)
  - added check for end date, that must be bigger then the start date.

1.2 (2005-03-28) (more info here (http://www.4homepages.de/forum/index.php?topic=7066.msg31116#msg31116))
  - very minor change, now it coloring bans which are not active or expired
  - and now it parses bbcode, smiles (if installed) in the ban list

1.1.1 (2005-03-28) (more info here (http://www.4homepages.de/forum/index.php?topic=7066.msg31064#msg31064))
  - fixed a very minor warning message

1.1 (2005-03-28) (more info here (http://www.4homepages.de/forum/index.php?topic=7066.msg31040#msg31040))
  - added two new filters for the ban list

1.0 (2005-03-28)
  - first release
Title: Re: [MOD] Ban
Post by: Lucifix on March 28, 2005, 02:45:37 PM
Great job V@no, mod is working perfectly ;)
Title: Re: [MOD] Ban v1.0
Post by: V@no on March 28, 2005, 03:01:45 PM
Great job V@no, mod is working perfectly ;)
I just realised that the database installation should go as a last step (I've already fixed my post) otherwise the new tables will have wrong names...
Title: Re: [MOD] Ban v1.1
Post by: V@no on March 28, 2005, 03:51:56 PM
added two new filters "Active" and "Expired" to the bans list.
to update, redownload the package and replace ban.php with the new one
and in Step 5 added
Code: [Select]
$lang['ban_active'] = "Active";
$lang['ban_expired'] = "Expired";
Title: Re: [MOD] Ban v1.1
Post by: ascanio on March 28, 2005, 04:41:34 PM
Nice MOD!!! I was waiting for that!! I have not try it yet but I will tonight  :) Thanks V@no
Title: Re: [MOD] Ban v1.1
Post by: ascanio on March 28, 2005, 05:14:05 PM
hi V@no I have installed the MOD and I get this warning in the BanPlugIns
Title: Re: [MOD] Ban v1.1
Post by: syndrom on March 28, 2005, 06:13:24 PM
i get errors too...

in acp for every action in the plugin:
Code: [Select]
Warning: implode(): Bad arguments. in D:\apachefriends\xampp\htdocs\4images\admin\plugins\ban.php on line 457
the banned user get this (ban not working):
Code: [Select]
DB Error: Bad SQL Query: SELECT id, type, message, date, expire FROM 4images_ban WHERE ((type = 1AND (192 BETWEEN ip1_start AND ip1_end) AND (168
BETWEEN ip2_start AND ip2_end) AND (0 BETWEEN ip3_start AND ip3_end)AND (4 BETWEEN ip4_start AND ip4_end)) OR (type = 2 AND ('ZOMBIE' LIKE hostname))
OR (type = 5 AND ('xxx@xxxxxx.de' LIKE email)) OR (type = 3 AND user_id = 1972) OR (type = 4 AND ('blubb' LIKE name)))
You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the right syntax to use near '(192 BETWEEN ip1_start AND ip1_end)
AND (168 BETWEEN ip2_start AND ip2_end) AND ' at line 3
Title: Re: [MOD] Ban v1.1
Post by: V@no on March 28, 2005, 07:26:08 PM
hi V@no I have installed the MOD and I get this warning in the BanPlugIns
what warning?

i get errors too...
what MySQL version do u use?
For some reasons I got some "tabs" in the code and the code didnt display properly here on the forum...I've just updated Step 5
try replace the code in includes/functions.php with the updated code, see if it fixes the errors.
Title: Re: [MOD] Ban v1.1
Post by: syndrom on March 28, 2005, 07:49:25 PM
i use MySQL 1.4.8

i have replaced the code.
the errors on the page are gone and the ban is working now, thanks! :)
the warning in acp is still there.
Title: Re: [MOD] Ban v1.1
Post by: V@no on March 28, 2005, 08:02:07 PM
the warning in acp is still there.
ah, that happend after I updated to v1.1
either redownload the package and replace ban.php
or open ban.php and replace
Code: [Select]
  $list_sql = array("or" => array("type = 0"));with
Code: [Select]
  $list_sql = array("or" => array("type = 0"), "and" => array(""));
Then find:
Code: [Select]
  $list_sql_and = implode(" AND ", $list_sql["and"]); Replace it with:
Code: [Select]
  $list_sql_and = trim(implode(" AND ", $list_sql["and"]), " AND ");
Title: Re: [MOD] Ban v1.1.1
Post by: syndrom on March 28, 2005, 08:16:16 PM
u forgot the ");" at the end ;)
werks perfect now!
Title: Re: [MOD] Ban v1.1.1
Post by: V@no on March 28, 2005, 08:24:47 PM
u forgot the ");" at the end ;)
actualy I forgot more then that...
I've updated my post above.
Title: Re: [MOD] Ban v1.1.1
Post by: syndrom on March 28, 2005, 08:51:34 PM
okay :)

here are the german translation for the plugin...

admin.php
Code: [Select]
/*
  MOD BAN
  START INSERT
*/
/*-- Setting-Group XX --*/
$setting_group[XX]="Ban";
$setting['look_hostname'] = "Hostnamen auflösen<span class=\"smalltext\"><br />Könnte die Geschwindigkeit beeinflussen";

$lang['ban'] = "Ban";
$lang['ban_ip'] = "IP";
$lang['ban_ip_expl'] = "<span class=\"smalltext\">Beispiel: 123.123.123.123 oder 123.123.123.* oder 123.123.123.0-255</span>";
$lang['ban_user_id'] = "User id";
$lang['ban_email'] = "eMail";
$lang['ban_email_expl'] = "<span class=\"smalltext\">Beispiel: beispiel*@beispiel.de</span>";
$lang['ban_name'] = "Name";
$lang['ban_name_expl'] = "<span class=\"smalltext\">Beispiel: beispiel*</span>";
$lang['ban_hostname'] = "Hostname";
$lang['ban_hostname_expl'] = "<span class=\"smalltext\">Beispiel: *.aol.de</span>";
$lang['ban_add'] = "Neuen Ban hinzufügen";
$lang['ban_edit'] = "Ban editieren";
$lang['ban_date'] = "Startdatum";
$lang['ban_date_expl'] = "<span class=\"smalltext\">yyyy-mm-dd hh:mm:ss</span>";
$lang['ban_expire'] = "Enddatum";
$lang['ban_expire_expl'] = "(0 für permanenten Ban)<br /><span class=\"smalltext\">yyyy-mm-dd hh:mm:ss</span>";
$lang['ban_message'] = "Nachricht";
$lang['ban_message_expl'] = "<span class=\"smalltext\">Wird dem gebannten Besucher angezeigt</span>";
$lang['ban_reason'] = "Grund";
$lang['ban_reason_expl'] = "<span class=\"smalltext\">Lass dir was einfallen</span>";
$lang['ban_required'] = array(
    BAN_IP => "Bitte trage eine IP ein",
    BAN_HOSTNAME => "Bitte trage einen Hostnamen ein",
    BAN_USERID => "Bitte trage eine user ID ein",
    BAN_NAME => "Bitte trage einen Benutzernamen ein",
    BAN_EMAIL => "Bitte trage eine eMail ein"
);
$lang['ban_bad_entry'] = array(
    BAN_IP => "IP ist nicht korrekt",
    BAN_HOSTNAME => "Hostname ist nicht korrekt",
    BAN_USERID => "User ID ist nicht korrekt",
    BAN_NAME => "Benutzername ist nicht korrekt",
    BAN_EMAIL => "eMail ist nicht korrekt"
);
$lang['ban_dublicate'] = array(
    BAN_IP => "Diese IP ist bereits in der Datenbank",
    BAN_HOSTNAME => "Dieser Hostname ist bereits in der Datenbank",
    BAN_USERID => "Diese user ID ist bereits in der Datenbank",
    BAN_NAME => "Diesr Benutzername ist bereits in der Datenbank",
    BAN_EMAIL => "Diese eMail ist bereits in der Datenbank"
);
$lang['ban_type_array'] = array(
    BAN_IP => "IP",
    BAN_HOSTNAME => "Hostname",
    BAN_USERID => "User ID",
    BAN_NAME => "Benutzername",
    BAN_EMAIL => "eMail"
);
$lang['ban_list'] = "Liste";
$lang['ban_type'] = "Typ";
$lang['ban_value'] = "Wert";
$lang['ban_add_success'] = "Eintrag erfolgreich hinzugefügt";
$lang['ban_add_error'] = "Fehler beim eintragen";
$lang['ban_update_success'] = "Eintrag erfolgreich aktualisiert";
$lang['ban_update'] = "aktualisieren";
$lang['ban_update_error'] = "Fehler beim aktualisieren";
$lang['ban_edit_error'] = "Fehler beim editieren";
$lang['ban_edit_success'] = "Eintrag erfolgreich editiert";
$lang['ban_delete_error'] = "Fehler beim löschen";
$lang['ban_delete_success'] = "Eintrag erfolgreich gelöscht";
$lang['ban_filter'] = "Filter";
$lang['ban_menu'] = "Menü";
$lang['ban_whois'] = "Wer ist Online";
$lang['ban_action'] = "Aktion";
$lang['ban_perm'] = "Niemals";
$lang['ban_perpage'] = "Zeige per Seite";
$lang['ban_logs'] = "Logs";
$lang['ban_uri'] = "Besuchte URL";
$lang['ban_user_name'] = "Benutzername";
$lang['ban_date_access'] = "Zugriffsdatum";
$lang['ban_logs_del_success'] = "Log(s) erfolgreich gelöscht";
$lang['ban_logs_del_error'] = "Fehler beim löschen der log(s)";
$lang['ban_active'] = "Aktiv";
$lang['ban_expired'] = "Abgelaufen";
$lang['ban_notactive'] = "Nich aktiv";
$lang['bad_invalid_date'] = "Das Enddatum muss einen höheren Wert haben als das Startdatum";
$lang['ban_copy'] = "Kopieren";
$lang['ban_test'] = "Testen";
/*
  MOD BAN
  END INSERT
*/

main.php
Code: [Select]
/*
  MOD BAN
  START INSERT
*/
$lang['ban_banned'] = "Du wurdest gesperrt";

/*
  MOD BAN
  END INSERT
*/

Edit: v1.5
Title: Re: [MOD] Ban v1.1.1
Post by: ascanio on March 28, 2005, 09:59:57 PM
 :oops: :oops:I'm sorry I forgot toput the warning is this one: Warning: implode(): Bad arguments. in /home/ascanio/domains/girlsandgirls.net/public_html/admin/plugins/ban.php on line 457
Title: Re: [MOD] Ban v1.1.1
Post by: V@no on March 28, 2005, 11:44:14 PM
I just added red coloring to the ban entries that are not active or expired and now it parses bbcode/html/smiles (if installed)
either redownload the package and replace ban.php
or open ban.php find:
Code: [Select]
    echo "<td>".date("Y-m-d H:i:s", $row['date'])."</td>";
    echo "<td>".(($row['expire']) ? date("Y-m-d H:i:s", $row['expire']) : $lang['ban_perm'])."</td>";
    echo "<td>".stripslashes($row['reason'])."</td>";
    echo "<td>".stripslashes($row['message'])."</td>";
replace with:
Code: [Select]
    echo "<td".(($row['date'] > time()) ? " style=\"background-color: #FFCECE\"" : "").">".date("Y-m-d H:i:s", $row['date'])."</td>";
    echo "<td".(($row['expire'] && $row['expire'] < time()) ? " style=\"background-color: #FFCECE\"" : "").">".(($row['expire']) ? date("Y-m-d H:i:s", $row['expire']) : $lang['ban_perm'])."</td>";
    echo "<td>".format_text(stripslashes($row['reason']), 1, 0, 1, 1, 1, 1)."</td>";
    echo "<td>".format_text(stripslashes($row['message']), 1, 0, 1, 1, 1, 1)."</td>";


Also I just added a little FAQ to the original post.
Title: Re: [MOD] Ban v1.2
Post by: ascanio on March 29, 2005, 12:10:54 AM
hi V@no I just download the files again and it works. ;) but the whosonline is too slow
Title: Re: [MOD] Ban v1.2
Post by: V@no on March 29, 2005, 03:00:54 AM
but the whosonline is too slow
yes, I added little FAQ at the original post, it explained why ;)
Title: Re: [MOD] Ban v1.4
Post by: V@no on March 29, 2005, 03:49:37 AM
v1.3
Added new filter "not active" which will show/hide not active ban entries (date is still in the future)
and also now end date can not be lower then the start date.
v1.4
added sort by "value"

To upgrade redownload the package and replace ban.php
and redo Step 5

Title: Re: [MOD] Ban v1.4.1
Post by: V@no on March 29, 2005, 05:07:03 AM
fixed a bug that would not ban visitor if it matched multiple ban entries and first entry was expired or not active.

Redo Step 3
Title: Re: [MOD] Ban v1.4.1
Post by: om6acw on March 29, 2005, 05:50:13 AM
fixed a bug that would not ban visitor if it matched multiple ban entries and first entry was expired or not active.

Redo Step 3

stay that identical look like before 1.4.1
second entry is not baned
Title: Re: [MOD] Ban v1.4.1
Post by: V@no on March 29, 2005, 06:42:47 AM
stay that identical look like before 1.4.1
second entry is not baned
sorry I dont understand...
Title: Re: [MOD] Ban v1.4.1
Post by: om6acw on March 29, 2005, 06:53:25 AM
stay that identical look like before 1.4.1
second entry is not baned
sorry I dont understand...

I tried to change it the way you said for 1.4.1 (Redo Step 3). but nothing changed, when I reloaded, I was not ban.
Title: Re: [MOD] Ban v1.4.1
Post by: V@no on March 29, 2005, 06:54:40 AM
make sure u read the FAQ I added to the original post.
also, what steps did u do to test it?
Title: Re: [MOD] Ban v1.4.1
Post by: om6acw on March 29, 2005, 07:04:55 AM
make sure u read the FAQ I added to the original post.
also, what steps did u do to test it?

I did read FAQ, I tested it with friend of mine (I ban his IP and when he went to the site and refreshed he got in)
Title: Re: [MOD] Ban v1.4.2
Post by: V@no on March 29, 2005, 07:14:47 AM
it could happend if your friend is behind a proxy or some proxy-based ISP (such as AOL) which use different IP for each page requests...try ban him by partial IP or partial hostname.
Title: Re: [MOD] Ban v1.4.2
Post by: om6acw on March 29, 2005, 07:46:25 AM
it could happend if your friend is behind a proxy or some proxy-based ISP (such as AOL) which use different IP for each page requests...try ban him by partial IP or partial hostname.

I trieded it again with 2 diferen people (both have static IP shaw.ca, telecom.sk) and the same happend (banned at first and after refresh they get in)
Title: Re: [MOD] Ban v1.4.3
Post by: V@no on March 29, 2005, 08:21:55 AM
1) why didnt u mention that they get banned first time they visit!
2) what 4images version?
are u sure that sessions on your 4images are working fine?
this mod is using 4images sessions to "cache" the results (to avoid extra server load).

u can try disable "caching" feature by replacing $force = false; with $force = true; in includes/functions.php (require Ban v1.5 or above)
Title: Re: [MOD] Ban v1.5
Post by: V@no on March 29, 2005, 08:27:12 AM
Added two new features:
- Copy already existing ban's values into new ban form
- a test feature for admins.

To update redo Step 3 and Step 5 and replace ban.php
Title: Re: [MOD] Ban v1.5
Post by: blitzy on April 01, 2005, 01:43:19 AM
Wow, I love your mod! I just added it to my 1.7.1 gallery and it works like a charm. Great job!  :D
Title: Re: [MOD] Ban v1.6
Post by: V@no on April 01, 2005, 10:32:33 PM
- added support for [MOD] Country flags (based on IP) in whos online in ACP (http://www.4homepages.de/forum/index.php?topic=6709.0) it should automaticaly detect presence of needed files and uses them
- added "reason" of the ban field on the logs page
- fixed a bug on test page that would not "ban" by hostname
- improved test feature, now it generates random number between specifyed range (if range used) in the IP or random string if wildcard (*) used in any other types.

To upgrade redo Step 3 and replace ban.php with the new one.
Title: Re: [MOD] Ban v1.6
Post by: JensF on April 03, 2005, 04:20:38 PM
Hello,

i think i´m with stupid.

I have installed the Mod and i have banned a User. When i click in the ACP on Test i see the ban.html. OK!!!

But when the banned User want to log in all works. No Message, nothing. The User can log in in and can make all......

Can anyone say me what its wrong???
Title: Re: [MOD] Ban v1.6
Post by: V@no on April 03, 2005, 05:26:12 PM
please! if u reply with such problem, post at lease some more information one what kind of ban u are talking about! and how is that u know that the banned visitor didnt see the ban message?
I'm not phsycic, u know?
Title: Re: [MOD] Ban v1.6
Post by: JensF on April 03, 2005, 05:36:37 PM
Sorry,

i have found the Problem! But why it is???

I have banned for test my girlfriend (banned a User Name) and when i will log in as my Girlfriend from my Computer it doesn´t work. I can LogIn.

But when my Girlfriend will LogIn from her Computer she see the ban Message. It Works.

I have delete all my Cookies and my Cache but with my Computer it doesn´t work :(
Title: Re: [MOD] Ban v1.6
Post by: V@no on April 03, 2005, 05:51:34 PM
I have banned for test my girlfriend (banned a User Name) and when i will log in as my Girlfriend from my Computer it doesnґt work. I can LogIn.

But when my Girlfriend will LogIn from her Computer she see the ban Message. It Works.

I have delete all my Cookies and my Cache but with my Computer it doesnґt work :(
this is wierd...I wouldnt expect this to happend for ban by name/user id/email...are you sure her account is not administrator?
Title: Re: [MOD] Ban v1.6
Post by: JensF on April 03, 2005, 06:36:29 PM
Yes, i´m sure.

What i say. With my Computer it doesn´t work. And with her Computer it works. Her Computer is not in my Home ;)
Title: Re: [MOD] Ban v1.6
Post by: V@no on April 03, 2005, 07:03:03 PM
just to clarify this: u have logged in with her username/password on your computer - and nothing happend?
have u tryed different type of ban? (on your computer) (make sure u set expiration date, so u wont perm ban yourself ;))
Title: Re: [MOD] Ban v1.6
Post by: JensF on April 03, 2005, 07:09:46 PM
Quote
u have logged in with her username/password on your computer - and nothing happend?

YES!!!!

Quote
have u tryed different type of ban? (on your computer) (make sure u set expiration date, so u wont perm ban yourself

I don´t now what you mean, this is my first and own ban!!!

Title: Re: [MOD] Ban v1.6
Post by: V@no on April 03, 2005, 07:14:29 PM
Different type of bans are:
by IP
by hostname
by name (u've done that)
by email
by user id

If u set expiration date to, lets say, 5 minutes from now, then u can ban yourself without worrying, the ban will expired in 5 minutes and u can login as admin and delete that ban entrie.
Title: Re: [MOD] Ban v1.6
Post by: JensF on April 03, 2005, 11:09:21 PM
Hi,

i have ban myself for 10 minutes. in this time i can LogIn. No ban. It doesn´t work with my Computer.

 :?:
Title: Re: [MOD] Ban v1.6
Post by: V@no on April 03, 2005, 11:29:09 PM
are u testing this on your own, local server or on the actualy site? u mentioned u have more then one computer at home, does the ban works if u use second computer?
and again, u didnt mentioned what kind of ban u've tested and if possible what did u ban for...
Title: Re: [MOD] Ban v1.6
Post by: JensF on April 03, 2005, 11:54:30 PM
Hi,

i have One Computer at home and tested it at the actualy site.

I have testet ban for

name
ip
email

For Name it doesn´t work
For IP it works
For email it doesn´t work

More i don´t test......
Title: Re: [MOD] Ban v1.6
Post by: V@no on April 04, 2005, 12:03:58 AM
ok, if u do the following steps:
1) create a ban for 10 minutes (name or email)
2) logout
3) clear your cookies
4) close your webrowser
5) try to login with the banned user info.

Title: Re: [MOD] Ban v1.6
Post by: JensF on April 04, 2005, 11:01:50 AM
Hi,

i have test it.

I have ban my girlfriend by Name for 10 Minutes.

I have log out, clear all und start the Browser new.

No Effect.....I can LogIn with my Girlsfriends Name & Password.

It´s now on my Computer. I have banned another User and they say me he is banned but when i will LogIn from my Computer with his Datas i can....
Title: Re: [MOD] Ban v1.6
Post by: ascanio on April 09, 2005, 07:09:48 PM
The other day I was looking the admin settings and I saw this
Code: [Select]
Lookup hostnames
might affect the perfomance                             yes/no

I don't know what this does :S can anybody tell me? whichone is faster?
Title: Re: [MOD] Ban v1.6
Post by: sniper on April 20, 2005, 10:51:02 PM
wow! Vano, thx you very much for this mod!
it's work fine!
Title: Re: [MOD] Ban v1.6
Post by: martrix on April 21, 2005, 09:49:33 AM
LOOKUP (buscar)
Looking up an IP address from its name in DNS or looking up a name from its IP address.
HOSTNAME (denominación de computador)
The name given to an individual computer attached to the Internet.

if set to yes = more work for the server = slower
if set to no  = less work for the server = faster
Title: Re: [MOD] Ban v1.6
Post by: b.o.fan on May 12, 2005, 10:24:08 AM
Hello. I´ve got this Error, when i do the ban_install.php:

Code: [Select]
DB Error: Bad SQL Query: CREATE TABLE 4images_ban (id mediumint(12) NOT NULL auto_increment, `type` tinyint(1) NOT NULL default '0', active tinyint(1) NOT NULL default '0', ip1_start tinyint(3) unsigned NOT NULL default '0', ip1_end tinyint(3) unsigned NOT NULL default '0', ip2_start tinyint(3) unsigned NOT NULL default '0', ip2_end tinyint(3) unsigned NOT NULL default '0', ip3_start tinyint(3) unsigned NOT NULL default '0', ip3_end tinyint(3) unsigned NOT NULL default '0', ip4_start tinyint(3) unsigned NOT NULL default '0', ip4_end tinyint(3) unsigned NOT NULL default '0', user_id mediumint(10) NOT NULL default '0', name varchar(255) NOT NULL default '', hostname tinytext NOT NULL, email tinytext NOT NULL, `date` int(11) NOT NULL default '0', expire int(11) NOT NULL default '0', message text NOT NULL, reason text NOT NULL, PRIMARY KEY (id), KEY active (active)) ENGINE=MyISAM
You have an error in your SQL syntax near 'ENGINE=MyISAM' at line 1

DB Error: Bad SQL Query: CREATE TABLE 4images_ban_logs ( id mediumint(10) NOT NULL auto_increment, `date` int(11) NOT NULL default '0', ban_id mediumint(12) NOT NULL default '0', user_id mediumint(8) NOT NULL default '0', ip tinytext NOT NULL, uri varchar(255) NOT NULL default '', PRIMARY KEY (id)) ENGINE=MyISAM
You have an error in your SQL syntax near 'ENGINE=MyISAM' at line 1

   1. Error
        CREATE TABLE 4images_ban (id mediumint(12) NOT NULL auto_increment, `type` tinyint(1) NOT NULL default '0', active tinyint(1) NOT NULL default '0', ip1_start tinyint(3) unsigned NOT NULL default '0', ip1_end tinyint(3) unsigned NOT NULL default '0', ip2_start tinyint(3) unsigned NOT NULL default '0', ip2_end tinyint(3) unsigned NOT NULL default '0', ip3_start tinyint(3) unsigned NOT NULL default '0', ip3_end tinyint(3) unsigned NOT NULL default '0', ip4_start tinyint(3) unsigned NOT NULL default '0', ip4_end tinyint(3) unsigned NOT NULL default '0', user_id mediumint(10) NOT NULL default '0', name varchar(255) NOT NULL default '', hostname tinytext NOT NULL, email tinytext NOT NULL, `date` int(11) NOT NULL default '0', expire int(11) NOT NULL default '0', message text NOT NULL, reason text NOT NULL, PRIMARY KEY (id), KEY active (active)) ENGINE=MyISAM

   2. Error
        CREATE TABLE 4images_ban_logs ( id mediumint(10) NOT NULL auto_increment, `date` int(11) NOT NULL default '0', ban_id mediumint(12) NOT NULL default '0', user_id mediumint(8) NOT NULL default '0', ip tinytext NOT NULL, uri varchar(255) NOT NULL default '', PRIMARY KEY (id)) ENGINE=MyISAM

   3. Done
        INSERT INTO `4images_settings` ( `setting_name` , `setting_value` ) VALUES ('look_hostname', '1')

   4. Done
        INSERT INTO `4images_settings` ( `setting_name` , `setting_value` ) VALUES ('ban_update', '0')

Why??!??

help me please...


b.o.fan
Title: Re: [MOD] Ban v1.6
Post by: Josef Florian on May 17, 2005, 04:48:26 PM
Hello. I´ve got this Error, when i do the ban_install.php:

Code: [Select]
DB Error: Bad SQL Query: CREATE TABLE 4images_ban (id mediumint(12) NOT NULL auto_increment, `type` tinyint(1) NOT NULL default '0', active tinyint(1) NOT NULL default '0', ip1_start tinyint(3) unsigned NOT NULL default '0', ip1_end tinyint(3) unsigned NOT NULL default '0', ip2_start tinyint(3) unsigned NOT NULL default '0', ip2_end tinyint(3) unsigned NOT NULL default '0', ip3_start tinyint(3) unsigned NOT NULL default '0', ip3_end tinyint(3) unsigned NOT NULL default '0', ip4_start tinyint(3) unsigned NOT NULL default '0', ip4_end tinyint(3) unsigned NOT NULL default '0', user_id mediumint(10) NOT NULL default '0', name varchar(255) NOT NULL default '', hostname tinytext NOT NULL, email tinytext NOT NULL, `date` int(11) NOT NULL default '0', expire int(11) NOT NULL default '0', message text NOT NULL, reason text NOT NULL, PRIMARY KEY (id), KEY active (active)) ENGINE=MyISAM
You have an error in your SQL syntax near 'ENGINE=MyISAM' at line 1

DB Error: Bad SQL Query: CREATE TABLE 4images_ban_logs ( id mediumint(10) NOT NULL auto_increment, `date` int(11) NOT NULL default '0', ban_id mediumint(12) NOT NULL default '0', user_id mediumint(8) NOT NULL default '0', ip tinytext NOT NULL, uri varchar(255) NOT NULL default '', PRIMARY KEY (id)) ENGINE=MyISAM
You have an error in your SQL syntax near 'ENGINE=MyISAM' at line 1

   1. Error
        CREATE TABLE 4images_ban (id mediumint(12) NOT NULL auto_increment, `type` tinyint(1) NOT NULL default '0', active tinyint(1) NOT NULL default '0', ip1_start tinyint(3) unsigned NOT NULL default '0', ip1_end tinyint(3) unsigned NOT NULL default '0', ip2_start tinyint(3) unsigned NOT NULL default '0', ip2_end tinyint(3) unsigned NOT NULL default '0', ip3_start tinyint(3) unsigned NOT NULL default '0', ip3_end tinyint(3) unsigned NOT NULL default '0', ip4_start tinyint(3) unsigned NOT NULL default '0', ip4_end tinyint(3) unsigned NOT NULL default '0', user_id mediumint(10) NOT NULL default '0', name varchar(255) NOT NULL default '', hostname tinytext NOT NULL, email tinytext NOT NULL, `date` int(11) NOT NULL default '0', expire int(11) NOT NULL default '0', message text NOT NULL, reason text NOT NULL, PRIMARY KEY (id), KEY active (active)) ENGINE=MyISAM

   2. Error
        CREATE TABLE 4images_ban_logs ( id mediumint(10) NOT NULL auto_increment, `date` int(11) NOT NULL default '0', ban_id mediumint(12) NOT NULL default '0', user_id mediumint(8) NOT NULL default '0', ip tinytext NOT NULL, uri varchar(255) NOT NULL default '', PRIMARY KEY (id)) ENGINE=MyISAM

   3. Done
        INSERT INTO `4images_settings` ( `setting_name` , `setting_value` ) VALUES ('look_hostname', '1')

   4. Done
        INSERT INTO `4images_settings` ( `setting_name` , `setting_value` ) VALUES ('ban_update', '0')

Why??!??

help me please...


b.o.fan

Ich habe das selbe Problem! Hängt es irgendwie mit der MyISAM zusammen?  // I have the same problem!  :D
Title: Re: [MOD] Ban v1.6
Post by: Josef Florian on May 17, 2005, 04:59:16 PM
Ich habe das Problem behoben!

Da bei meiner SQL-Datenbank sowieso standardmäßig der Typ MyISAM ist, habe ich einfach statt:

Quote
CREATE TABLE fotos1_4images_ban_logs ( id mediumint(10) NOT NULL auto_increment, `date` int(11) NOT NULL default '0', ban_id mediumint(12) NOT NULL default '0', user_id mediumint(8) NOT NULL default '0', ip tinytext NOT NULL, uri varchar(255) NOT NULL default '', PRIMARY KEY (id)) ENGINE=MyISAM

Quote
CREATE TABLE fotos1_4images_ban_logs ( id mediumint(10) NOT NULL auto_increment, `date` int(11) NOT NULL default '0', ban_id mediumint(12) NOT NULL default '0', user_id mediumint(8) NOT NULL default '0', ip tinytext NOT NULL, uri varchar(255) NOT NULL default '', PRIMARY KEY (id))
Ich habe also " ENGINE=MyISAM" gelöscht!



Das gleiche habe ich mit dem 2. Fehler gemacht:

statt:
Quote
CREATE TABLE fotos1_4images_ban (id mediumint(12) NOT NULL auto_increment, `type` tinyint(1) NOT NULL default '0', active tinyint(1) NOT NULL default '0', ip1_start tinyint(3) unsigned NOT NULL default '0', ip1_end tinyint(3) unsigned NOT NULL default '0', ip2_start tinyint(3) unsigned NOT NULL default '0', ip2_end tinyint(3) unsigned NOT NULL default '0', ip3_start tinyint(3) unsigned NOT NULL default '0', ip3_end tinyint(3) unsigned NOT NULL default '0', ip4_start tinyint(3) unsigned NOT NULL default '0', ip4_end tinyint(3) unsigned NOT NULL default '0', user_id mediumint(10) NOT NULL default '0', name varchar(255) NOT NULL default '', hostname tinytext NOT NULL, email tinytext NOT NULL, `date` int(11) NOT NULL default '0', expire int(11) NOT NULL default '0', message text NOT NULL, reason text NOT NULL, PRIMARY KEY (id), KEY active (active)) ENGINE=MyISAM
Quote
CREATE TABLE fotos1_4images_ban (id mediumint(12) NOT NULL auto_increment, `type` tinyint(1) NOT NULL default '0', active tinyint(1) NOT NULL default '0', ip1_start tinyint(3) unsigned NOT NULL default '0', ip1_end tinyint(3) unsigned NOT NULL default '0', ip2_start tinyint(3) unsigned NOT NULL default '0', ip2_end tinyint(3) unsigned NOT NULL default '0', ip3_start tinyint(3) unsigned NOT NULL default '0', ip3_end tinyint(3) unsigned NOT NULL default '0', ip4_start tinyint(3) unsigned NOT NULL default '0', ip4_end tinyint(3) unsigned NOT NULL default '0', user_id mediumint(10) NOT NULL default '0', name varchar(255) NOT NULL default '', hostname tinytext NOT NULL, email tinytext NOT NULL, `date` int(11) NOT NULL default '0', expire int(11) NOT NULL default '0', message text NOT NULL, reason text NOT NULL, PRIMARY KEY (id), KEY active (active))
Ich habe also " ENGINE=MyISAM" gelöscht!



einfach mit phpMyAdmin bequem ausgeführt und mein Ban v1.6 läuft einwandfrei!  :D


Liebe Grüße
Josef Florian Glatz
Title: Re: [MOD] Ban v1.6
Post by: b.o.fan on May 17, 2005, 08:09:35 PM
ja. danke
@Josef Florian Glatz

here is my ban_install.php:

Code: [Select]
REMOVEDthe half of the ban_install.php is oky but than: Look @ the screenshot
die hälfte des ban_install.php lief auch. aber dann:


B.o.fan
Title: Re: [MOD] Ban v1.6
Post by: V@no on May 18, 2005, 12:14:36 AM
and what is your MySQL version?

@b.o.fan:
dont worry about the errors from the screenshot, your database was successfuly updated.


[EDIT]
I just found out that ENGINE syntax is availiable in MySQL v4.1.x and later versions
And I updated the installer.
Title: Re: [MOD] Ban v1.6
Post by: b.o.fan on May 18, 2005, 05:47:47 AM
oki.

thankx.

i will look.


b.o.fan
Title: Re: [MOD] Ban v1.6
Post by: universal on May 18, 2005, 09:22:53 AM
OK, i`ve installed succefully, no error apeared during installation. BUT there is one BUT :)
Script doesnt work. Or i cant understand how it works.
So I add a ban on my host or on my ip but I still can login page, I tryied to login and logout but still nothing happened.
Is there something wrong or what? :)
Title: Re: [MOD] Ban v1.6
Post by: b.o.fan on May 18, 2005, 01:07:31 PM
@universal

yes. thats my problem too.

i give in a other User. but he can loggin.

:) :) :)

MfG

b.o.fan
Title: Re: [MOD] Ban v1.6
Post by: V@no on May 18, 2005, 02:49:28 PM
Ok, how about this idea: ban my IP: 65.35.35.155 or 65.35.35.*
I'll come back in 9 hours and check it out, also, please post a screenshot of your ban list.
Title: Re: [MOD] Ban v1.6
Post by: universal on May 18, 2005, 03:57:20 PM
Here you go :)
http://www.pramoga.net

Added ban for IP: 65.35.35.*
Title: Re: [MOD] Ban v1.6
Post by: b.o.fan on May 18, 2005, 04:04:51 PM
here you can test.

i´ve got 4images 1.71.

:)

http://www.wartenaufden15.de --> look there

the screenshot look under this... 8O 8O 8O :D :D :D
Title: Re: [MOD] Ban v1.6
Post by: V@no on May 18, 2005, 11:56:01 PM
@universal:
ok it didnt work for me...


@b.o.fan:
It worked first time I opened the site, after refresh the ban was gone..

So, try replace in includes/functions.php:
Code: [Select]
$force = false; with:
Code: [Select]
$force = true;it will force query the database each time someone opens a page. if it works, then there is something wrong with the way your 4images stores some sessions...
if it works, then restore that line, clear your cookies, then put your site domain into "black list" in your browser so it would block any cookies from your site and try to login. if u be able login and browse the site without problem, then we'll go from there, otherwise there is something wrong with your server and u should contact your hoster about it...
Title: Re: [MOD] Ban v1.6
Post by: waleed on May 19, 2005, 04:00:03 AM
how can i ban ppl using proxy
if i ban someone he can use proxy to login again
so ?
Title: Re: [MOD] Ban v1.6
Post by: V@no on May 19, 2005, 04:47:01 AM
sorry, there is no a "real" sollution for a proxy...if someone really wants to get to your site, the only way to stop them is close up your site intirely.
Title: Re: [MOD] Ban v1.6
Post by: universal on May 19, 2005, 05:15:31 AM
I have changed false to true
Code: [Select]
else
  {
    $ip = $site_sess->session_info['session_ip'];
    $email = $user_info['user_email'];
    $user_id = $user_info['user_id'];
    $name = $user_info['user_name'];
    $hostname = "";
    $force = true;
  }


But now
Quote
Warning: main(./includes/functions.php): failed to open stream: No such file or directory in /home/pramoga/public_html/global.php on line 266

Warning: main(./includes/functions.php): failed to open stream: No such file or directory in /home/pramoga/public_html/global.php on line 266

Warning: main(): Failed opening './includes/functions.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/pramoga/public_html/global.php on line 266

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/pramoga/public_html/global.php:266) in /home/pramoga/public_html/includes/sessions.php on line 99

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/pramoga/public_html/global.php:266) in /home/pramoga/public_html/includes/sessions.php on line 99

Warning: Cannot modify header information - headers already sent by (output started at /home/pramoga/public_html/global.php:266) in /home/pramoga/public_html/includes/sessions.php on line 107

Warning: Cannot modify header information - headers already sent by (output started at /home/pramoga/public_html/global.php:266) in /home/pramoga/public_html/includes/sessions.php on line 107

Warning: Cannot modify header information - headers already sent by (output started at /home/pramoga/public_html/global.php:266) in /home/pramoga/public_html/includes/sessions.php on line 107

Fatal error: Call to undefined function: check_ban() in /home/pramoga/public_html/includes/sessions.php on line 412
Title: Re: [MOD] Ban v1.6
Post by: V@no on May 19, 2005, 05:53:50 AM
u've changed something else, or did something to functions.php.
restore backups, and try again ;)
Title: Re: [MOD] Ban v1.6
Post by: universal on May 19, 2005, 07:43:02 AM
what do you mean i`ve something changed?
I`ve nothing changed for your mod...
Title: Re: [MOD] Ban v1.6
Post by: b.o.fan on May 19, 2005, 08:26:27 AM
@v@no

thanx. it gone all.
very good mod.

:)
Title: Re: [MOD] Ban v1.6
Post by: universal on May 19, 2005, 10:04:54 AM
This is my functions.php ... http://www.pramoga.net/includes/functions.php.txt
Maybe if it is not dificult, you can say if there is any bugs? (as they really is)
Title: Re: [MOD] Ban v1.6
Post by: V@no on May 19, 2005, 02:11:42 PM
sounds like something went wrong during uploading the file.
make sure its uploaded in text mod.
Title: Re: [MOD] Ban v1.6
Post by: universal on May 20, 2005, 03:27:56 PM
V@no try now, looks like when date is not red anymore ban works
http://www.pramoga.net
So it works?
Title: Re: [MOD] Ban v1.6
Post by: V@no on May 21, 2005, 12:13:34 AM
it worked first time I opened the page, but after refresh it didnt ban me...try the changes I mentioned on previos page.
Title: Re: [MOD] Ban v1.6
Post by: universal on May 21, 2005, 07:26:39 AM
Everythig is very strange...
Now it works when i ma de force true.
But bans still not working...
http://www.pramoga.net works?
Title: Re: [MOD] Ban v1.6
Post by: V@no on May 21, 2005, 07:33:41 AM
yes, its working now, I'm banned.

so, for some reason something is wrong when caching the results into the session....
I'll get back to u with some debug code u'll need to add...tommorow though ;)
Title: Re: [MOD] Ban v1.6
Post by: universal on May 21, 2005, 07:35:18 AM
great, thanks for that, i`ll wait :)
Title: Re: [MOD] Ban v1.6
Post by: V@no on May 21, 2005, 03:58:54 PM
ok, for now, restore the $force variable and try insert in functions.php below:
Code: [Select]
  $ban_banned = $site_sess->get_session_var("ban_banned");this code:
Code: [Select]
  if (in_array($site_sess->session_info['session_ip'], array("65.35.35.155")))
  {
    @error_reporting(E_ALL);
    echo "Ban checked: ".$ban_checked;
    echo "<br>Ban banned: ".$ban_banned;
  }
u should not see any changes, because it should work only from my IP.
Title: Re: [MOD] Ban v1.6
Post by: universal on May 21, 2005, 04:04:31 PM
ok, try now
Title: Re: [MOD] Ban v1.6
Post by: V@no on May 21, 2005, 04:13:40 PM
ok, now I know the reason, but I dont know why its happening...
I'm getting this:
Quote
Ban banned: a:10:{i:0;s:1:\"4\";s:2:\"id\";s:1:\"4\";i:1;s:1:\"1\";s:4:\"type\";s:1:\"1\";i:2;s:7:\"Testing\";s:7:\"message\";s:7:\"Testing\";i:3;s:10:\"1116460302\";s:4:\"date\";s:10:\"1116460302\";i:4;s:1:\"0\";s:6:\"expire\";s:1:\"0\";}
Notice: unserialize(): Error at offset 10 of 227 bytes in /home/pramoga/public_html/includes/functions.php on line 1758

The wierd thing is when I tested the serialized string on my site it worked just fine!

Now, please insert above
Code: [Select]
    @error_reporting(E_ALL); (in the code I've posted in my previous reply)
this line:
Code: [Select]
    phpinfo();
Title: Re: [MOD] Ban v1.6
Post by: universal on May 21, 2005, 04:20:41 PM
try now
Title: Re: [MOD] Ban v1.6
Post by: V@no on May 21, 2005, 04:31:38 PM
my suspicion is magick quotes that is turned on your server (btw, is zend optimizer was updated on your server?)
so try replace unserialize($ban_banned) with unserialize(stripslashes($ban_banned))

P.S. u forgot restore $force variable to 'false' ?
Title: Re: [MOD] Ban v1.6
Post by: universal on May 21, 2005, 04:36:44 PM
yeah sorry i restored true to false not in that place where you wanted, now i fixed it
and replaced unserialize($ban_banned) too

I am not sure about zend optimizer...
Title: Re: [MOD] Ban v1.6
Post by: V@no on May 21, 2005, 04:38:20 PM
ok, I think it should work now,  u can remove the debug code ;)
Title: Re: [MOD] Ban v1.6
Post by: universal on May 21, 2005, 04:44:26 PM
are you sure about that? because i think it does not work for me...
and what is the meaning of red column? When [ 2005-05-21 17:39:51 ] column is red?
Title: Re: [MOD] Ban v1.6
Post by: V@no on May 21, 2005, 05:12:53 PM
the red color indicates a "problem" either the ban has not active yet (the start date is in the future) or the end date is in the past (expired)

and its working for me, I'm banned on your site now :P
Title: Re: [MOD] Ban v1.6
Post by: universal on May 21, 2005, 05:16:06 PM
yeah, you are banned because a ban was set a time ago, but why the ban not activates after when i add it?
Title: Re: [MOD] Ban v1.6
Post by: V@no on May 21, 2005, 05:18:22 PM
I asume your host has different time then the time where u live...this mod does not support time offset (maybe yet?)
Title: Re: [MOD] Ban v1.6
Post by: universal on May 21, 2005, 05:23:20 PM
oh... I forgot server time... it offset is about 9h... so this script can`t take time offset of 4images settings?
Title: Re: [MOD] Ban v1.6
Post by: Xandra on June 01, 2005, 09:32:15 PM
I successfully installed this mod - thank you!  :D (go me lol).. have not tested it yet though if banning works.

I have no idea where to place this query of mine but since it concerns banning, I thought I'd post it here:

In ACP under EDIT USERS (where I get the list of all registered users - activated and non-activated -  when doing a search), I would like their IP addresses to be added in the table. How do I go about with this? I feel this is vital to have this feature showing there
- in order to be able to check the users before giving them access to the Members' area
- for the banning process
Title: Re: [MOD] Ban v1.6
Post by: V@no on June 02, 2005, 12:14:13 AM
4images does not log visitor's IPs, only stores IPs of currently active sessions.
Title: Re: [MOD] Ban v1.6
Post by: Xandra on June 02, 2005, 12:21:55 AM
4images does not log visitor's IPs, only stores IPs of currently active sessions.

Does this mean, that I would have to take notes of their IPs separately? I mean, if I would ban a registered user via Email address, user Id or the name, that banned person could just make a new account if I would not ban his/her IP.
Title: Re: [MOD] Ban v1.6
Post by: V@no on June 02, 2005, 12:46:29 AM
Does this mean, that I would have to take notes of their IPs separately? I mean, if I would ban a registered user via Email address, user Id or the name, that banned person could just make a new account if I would not ban his/her IP.
That is correct.
A little help would be if the user posted a comment, it logs the IP.

But then ofcourse u can add a little code in includes/sessions.php that would save IPs of each visitor in the database ;)
Title: Re: [MOD] Ban v1.6
Post by: Xandra on June 02, 2005, 12:50:30 AM
But then ofcourse u can add a little code in includes/sessions.php that would save IPs of each visitor in the database ;)

lol that would be great.. but what "little code" would that be?
I have no PHP knowledge (guess it's time to edit my profile here and put this line as signature  :lol:)
Title: Re: [MOD] Ban v1.6
Post by: V@no on June 02, 2005, 12:59:03 AM
but what "little code" would that be?
some how I had a feeling this is going to be next question...:lol:
Well, since its not really related to this mod, perhaps u should start a new topic in the mod requests forum ;)
Title: Re: [MOD] Ban v1.6
Post by: Xandra on June 02, 2005, 06:40:06 PM
some how I had a feeling this is going to be next question...:lol:
Well, since its not really related to this mod, perhaps u should start a new topic in the mod requests forum ;)

you know, I already did.. so how about giving me that "little code" instruction?  :lol:
http://www.4homepages.de/forum/index.php?topic=8220.0
Title: Re: [MOD] Ban v1.6
Post by: Nova on June 04, 2005, 12:34:53 AM
Great Mod V@no! Works like a charm!

You also have fantastic English langauge skills, but remember, it is "says", not "sais".  :wink:
Title: Re: [MOD] Ban v1.6
Post by: V@no on June 04, 2005, 01:01:38 AM
You also have fantastic English langauge skills, but remember, it is "says", not "sais". :wink:
thank you for the correction, I appretiate it ;)
The problem on the internet chats that no one corrects u, u can spell words as u wish, just enough for people understand u...and most of the time nobody say a word about your spelling...:(
thanks again :)
Title: Re: [MOD] Ban v1.6.1
Post by: martrix on June 05, 2005, 02:15:34 PM
The problem on the internet chats that no one corrects u, u can spell words as u wish, just enough for people understand u...and most of the time nobody say a word about your spelling...:(
this sounds like an encouragement to start annoying about any little mistake...  :twisted: hehehe

would you really like to be corrected anytime you make a mistake?
Title: Re: [MOD] Ban v1.6.1
Post by: Fastian on July 08, 2005, 08:30:48 PM
Hi ..
I just installed this mod. I went through installation without any error or warning message. BUT I m having some problem with it.

Foot IP Ban ---- > It really works fine. No problem at all.
For E-Mail ---- > It doesn’t work
For Username --- > It doesn’t work
For User id    --- > It gives error message (Please enter a user ID) Even when I enter a valid ID

Ok. Here is a little explanation.

I test it by banning my own IP. And an IP of my friend.  And it works fine.

Then I ban my test account "Fastian" (using user name option)
Then I add e-mail belongs to the same user name.  (E-mail option)

I Log out myself. Delete all Cookies. And tried login by "Fastian" ... No error message and no problem. I was able to login and download files.

When I try banning "Fastian" By the option "User ID”......... It simply says "Please enter a user ID"
Looks like the field is not working or its not taking any input.

I tried using all the steps again. But same result. SO I thought its time to ask for some Help :) 
Title: Re: [MOD] Ban v1.6.1
Post by: V@no on July 09, 2005, 12:06:43 AM
make sure your "Fastian" account is not admin ;)
Title: Re: [MOD] Ban v1.6.1
Post by: Fastian on July 09, 2005, 02:27:57 AM
Yes, I m 100% sure. "Fastian" is just a normal user account.

Here what I did today. I added an account "test" through "Add User" as "Registered"
I went to Ban option. Tried banning by "User ID"  got an error message saying "Please enter a user ID” Although I have entered "test"

Banned user by name & by e-mail. But again it didn’t work.

One more thing. What’s the difference b/w "User ID" & "Name"

My Website is not made public yet. Presently I m just installing MOD’s and updating it. Can I PM u the URL if u want to check?
Title: Re: [MOD] Ban v1.6.1
Post by: V@no on July 09, 2005, 05:11:17 AM
User id is...is...user id...:?

User's information is asigned to their user id, and username is used for login in and displaying.

user id represented by a number, name, on other hand can be a anything.

P.S. if u wish so, u can PM me with the url.
Title: Re: [MOD] Ban v1.6.1
Post by: Fastian on July 09, 2005, 08:01:14 AM
Oopss ...So  Sorry    :oops:

Stupid me, i just didn't get the idea of "User ID"

Sorry again

Just send u th PM  with picture and link
Title: Re: [MOD] Ban v1.6.1
Post by: V@no on July 09, 2005, 05:12:22 PM
ok, I think u found a bug :?
try redo Step 3.

Since I have no way to test it (I couldnt reporoduce it on my server), u are the only one who can tell ;)


Just in case u are curious the reason of this happening, is because this mod using sessions to "cache" the resultat of the last ban check (this was done to minimize server load). So, when a visitor visit your gallery, a sessionid asigned to them, and ban being checked and the result being saved in the session. Then when they login in, 4images is still using the onl session (this is wierd, because it does change on my server), and the ban check is using the cached results of the previous check, which is clean...
Title: Re: [MOD] Ban v1.6.2
Post by: Fastian on July 09, 2005, 06:19:00 PM
It Works ... It Works ..  :D

Thanks Vano

Does this anything to do with "Friendly URL Mod" ? I think that was the only Mod i applied that does something with sessions id.

If the previous one minimize server load, It will be a good idea to mark this change separately. Coz I think that was working for most of the people.
Anyways, Its working for me like a charm. Thankx Vano
Title: Re: [MOD] Ban v1.6.2
Post by: Flo2005 on October 26, 2005, 09:46:11 PM
I´m right that I must disable the chache-function?

V@no:
Quote
this mod is using 4images sessions to "cache" the results (to avoid extra server load).

u can try disable "caching" feature by replacing $force = false; with $force = true; in includes/functions.php (require Ban v1.5 or above)
Title: Re: [MOD] Ban v1.6.2
Post by: V@no on October 26, 2005, 11:53:22 PM
"must"? no, unless something is wrong.
Title: Re: [MOD] Ban v1.6.2
Post by: Flo2005 on October 26, 2005, 11:56:16 PM
Okay, I´ll try it! This MOD must work, because someone is spaming in my comments  :cry:

Thanks for your answer!
Title: Re: [MOD] Ban v1.6.2
Post by: V@no on October 27, 2005, 12:02:20 AM
Just to clarify. The cache feature mentioned is not the 4images v1.7.x build-in cache feature, its specific cache for this mod only ;)
Title: Re: [MOD] Ban v1.6.2
Post by: Flo2005 on October 27, 2005, 12:42:12 AM
I´ve got a question to IP-Range:

These are the IP´s where I get spam:

200.21.201.250
203.131.191.204
204.174.23.11

What´s the best way for blocking?
Title: Re: [MOD] Ban v1.6.2
Post by: V@no on October 27, 2005, 12:49:45 AM
These are completely different IPs, so you only should block them individualy, no IP range.
Title: Re: [MOD] Ban v1.6.2
Post by: Flo2005 on October 27, 2005, 12:55:48 AM
But I don´t know the next IP from this user  :roll: hmm
Title: Re: [MOD] Ban v1.6.2
Post by: V@no on October 27, 2005, 12:59:53 AM
Well, nothing you can do about it...ban whatever IP you have on file...
Title: Re: [MOD] Ban v1.6.2
Post by: Flo2005 on October 27, 2005, 01:07:30 AM
Yes I see... but the MOD works :mrgreen:
Title: Re: [MOD] Ban v1.6.2
Post by: SAD on December 19, 2005, 12:09:23 PM
Please help me :)

install this MOD
Add IP is Ban and click "Test" in Action

open page:
Fatal error: Call to a member function on a non-object in /_____/includes/page_header.php on line 33

page_header.php :

28 // Cache Templates
29 $template_list = 'header,footer,category_dropdown_form,user_logininfo,user_loginform';
30 if (isset($templates_used) && $templates_used != "") {
31   $template_list = $template_list.",".$templates_used;
32 }
33 $site_template->cache_templates($template_list);

How to solve this problem?

Title: Re: [MOD] Ban v1.6.2
Post by: SAD on December 19, 2005, 02:36:13 PM
I look trouble:

Step 4
Open includes/sessions.php
Find:
Code: [Select]
$user_info = $site_sess->return_user_info();

And I had to insert a code after a line

Code: [Select]
$site_template = new Template(TEMPLATE_PATH);
//--- End Templates -----------------------------------

Now works!
:lol:
Title: Re: [MOD] Ban v1.6.2
Post by: Dom01 on December 21, 2005, 03:10:55 AM
Hi Leute,
ich habe alles Laut anweisung gemacht, aber bei mir hat sich die Ban-Tabelle nicht installiert.
Ich hatte auch den CMOD der ban_install.php auf 777 gestellt gehabt.
Und nun das, siehe Bild.
Ich würde mich über hilfe freuen.
Noch mehr, wenn sie in deutsch ist, da mein englisch sehr sehr schlecht ist und ich googel nutzen muß zum Übersetzen.
mfg Dom :)
Title: Re: [MOD] Ban v1.6.2
Post by: V@no on December 21, 2005, 03:49:28 AM
Step 7.1
Title: Re: [MOD] Ban v1.6.2
Post by: Dom01 on December 21, 2005, 04:01:58 AM
Hi V@no,
Quote
Step 7.1

Step 7.1
Login with your administrator account and run the installer (ban_install.php)
by typing in your browser: http://<yoursiteaddress>/<path_to_4images>/ban_install.php
Once the database update is finished, delete ban_install.php

Yes, I made this step.  But nevertheless it does not function.

Ja, diesen Schritt habe ich ja gemacht.  Aber trotzdem funktioniert es nicht.

mfg Dom  :?:
Title: Re: [MOD] Ban v1.6.2
Post by: Stoleti on December 21, 2005, 06:20:00 AM
this give me a error :

Fatal error: Call to a member function on a non-object in /home/_____/public_html/includes/page_header.php on line 200


 8O

here is lines 190 to 200 :

Code: [Select]
     $lang_select .= " selected=\"selected\"";
   }

   $lang_select .= ">".$folder."</option>\n";
 }
}

$lang_select .= "</select>\n</form>";

// Register the dropdown code for the template engine
$site_template->register_vars("lang_select", $lang_select);
Title: Re: [MOD] Ban v1.6.2
Post by: V@no on December 21, 2005, 06:50:37 AM
restore backups and try again.

@Dom01:
Sorry I can't help you with deutsch langauge, but if you would run the installer and it would update the database and showed you green colored words "done" after each database query that was successfuly executed by the installer, you would not have this problem. So my point is, you did not do properly Step 7.1 period.
Title: Re: [MOD] Ban v1.6.2
Post by: Dom01 on December 21, 2005, 06:40:41 PM
Hi  V@no,
Ich habe mir Schritt 7.1 noch einmal durchgelesen und Übersetzen lassen.
Nun hat es funktioniert.

Nun Versuche ich noch die Landesfahnen ein zu bauen.

Frohes Fest

I read myself step 7,1 again and a translating to leave.  Now it
functioned.

Now to build attempts I still the national flags.

Glad celebration

mfg Dom  :D
Title: Re: [MOD] Ban v1.6.2
Post by: pipemba on March 03, 2006, 01:59:22 AM
ya sdelal vse kak napisanno,
zahoju v adminku, stavlu ban po ip adressu
i nichego ne proishodit
chelovek kak zahodil na sait tak i posle bana zahodit i smotrit foto
i ego ip visit v spiske bana
pochemu on ne zabanen? chto ya ne tak sdelal moget?
Title: Re: [MOD] Ban v1.6.2
Post by: pipemba on March 03, 2006, 10:34:06 AM
V@no
pimogi pliz pochemu ne rabotaet?
u menya ploho s Engesh
Title: Re: [MOD] Ban v1.6.2
Post by: wallpapers on March 09, 2006, 06:46:58 PM
This is a great mod.  :D
The install was very easy (10 min)  8)
Thanks V@NO  :lol:
Title: Re: [MOD] Ban v1.6.2
Post by: Chicco on March 15, 2006, 04:07:32 PM
Ich habe nun ein riesen Problem.
Anfangs, als ich diesen Mod eingebaut hatte, hat dieser super funktioniert. Seit kurzem habe ich nun den Mod (http://www.4homepages.de/forum/index.php?topic=6220.0) drin, bei dem User verschiedene Templates auswählen können. Dabei wird unter anderem aus der global.php folgender Code herausgenommen (step 1.2):

include (ROOT_PATH.'includes/template.php');
$site_template = new Template(TEMPLATE_PATH);

Jetzt musste ich feststellen, das mein BAN-Mod nicht mehr geht!!! Bekomme die Fehlermeldung:
Fatal error: Call to a member function on a non-object in /var/www/web517/html/THEPICTUREWORLD/includes/page_header.php on line 86

Also habe ich diese beiden Zeilen wieder eingebaut. Dann geht aber meine Seite nicht mehr!!!

Was ist da los?

Sorry, das evtl. bei diesem Thread eher falsch bin und eher zu dem Thread mit dem User Templates muss...aber kann ich ja ggf. noch nachträglich machen....;-)
Title: Re: [MOD] Ban v1.6.2
Post by: V@no on March 16, 2006, 01:56:20 AM
In Step 4 you will need insert the code below the code from members template mod...
Title: Re: [MOD] Ban v1.6.2
Post by: Chicco on March 16, 2006, 08:45:15 AM
Perfect! Thanks V@ano. Its work! :D

I have change the code on the session.php after the mod members template. BAN and MEMBER TEMPLATE is work perfect! 8)

Thank you.
Title: Re: [MOD] Ban v1.6.2
Post by: pipemba on March 20, 2006, 02:20:29 PM
Why he could enter??

(http://chat.compot.ru/pip/ban1.jpg)

(http://chat.compot.ru/pip/ban2.jpg)

Others do not work also bans.
All to whom have forbidden an input can quietly enter and to look a photo and to write the comments


4images 1.7.1
Title: Re: [MOD] Ban v1.6.2
Post by: V@no on March 20, 2006, 02:34:38 PM
Try to follow our discussion for atleast 2 pages started from this reply:
http://www.4homepages.de/forum/index.php?topic=7066.msg36656#msg36656
Title: Re: [MOD] Ban v1.6.2
Post by: pipemba on March 21, 2006, 06:15:32 PM
Try to follow our discussion for atleast 2 pages started from this reply:
http://www.4homepages.de/forum/index.php?topic=7066.msg36656#msg36656
ÿ íå äðóæó ñ àíãëèéñêèì ÿçûêîì ;(
íî ìíå î÷åíü ñðî÷íî íóæíî ÷òîáû  ýòîò ìîä çàðàáîòàë
Âàíî ïîìîãè ïîæàëóéñòà....
åñëè ìîæíî â êîíêðåòíûõ ïðèìåðàõ òîãî, ÷òî íóæíî ñäåëàòü
ìîæåø ïîïðîáûâàòü çàéòè êî ìíå íà ñàéò: http://chat.compot.ru/foto
ÿ ïîñòàâèë íà òåáÿ áàí
IP 65.35.35.* 2006-03-21 20:09:57 Never test ban test ban [Ðåäàêòèðîâàòü]   [Copy]   [Óäàëèòü]   [Test]
Title: Re: [MOD] Ban v1.6.2
Post by: V@no on March 22, 2006, 01:16:36 AM
Значит мод не правильно установлен. Он работает без проблем как на v1.7 так и на v1.7.1 (на v1.7.2 тоже должен работать). Попробуй переустановить ещё раз.
Title: Re: [MOD] Ban v1.6.2
Post by: wallpapers on March 22, 2006, 06:54:48 AM
MOD is installed in version 1.7.2 and has no problems  :D
Title: Re: [MOD] Ban v1.6.2
Post by: Bear on March 22, 2006, 10:37:03 PM
using version 1.7.1 and MySQL 4.1.12

getting an error when clicking ban in admin control, looks like its looking for the wrong table.
mine is
web16_4images_ban
web16_4images_ban_logs

how can i correct ????

thank you

Code: [Select]
DB Error: Bad SQL Query: SELECT count(id) as num FROM BAN_TABLE WHERE (type=0 OR type = BAN_IP OR type = BAN_HOSTNAME OR type = BAN_NAME OR type = BAN_EMAIL OR type = BAN_USERID) AND date <= 1143063022 OR date > 1143063022 OR (expire AND expire <= 1143063022)
Table 'web16_images.BAN_TABLE' doesn't exist

DB Error: Bad SQL Query: SELECT * FROM BAN_TABLE WHERE (type=0 OR type = BAN_IP OR type = BAN_HOSTNAME OR type = BAN_NAME OR type = BAN_EMAIL OR type = BAN_USERID) AND date <= 1143063022 OR date > 1143063022 OR (expire AND expire <= 1143063022) ORDER BY type asc LIMIT 0, 30
Table 'web16_images.BAN_TABLE' doesn't exist

Title: Re: [MOD] Ban v1.6.2
Post by: V@no on March 23, 2006, 12:33:03 AM
Missed Step 2 ?
Title: Re: [MOD] Ban v1.6.2
Post by: Bear on March 23, 2006, 01:07:11 PM
solved that one thank you  :D

got another problem and i know whats causing it but cannot remember why the line of code was removed
in Step 4
Open includes/sessions.php
Find:
Code: [Select]
$user_info = $site_sess->return_user_info(); That line is missing i only have
Code: [Select]
$session_info = $site_sess->return_session_info();]
If i add step 4 code below this i them get this error on home page and cannot log in to home or admin control.
Code: [Select]
DB Error: Bad SQL Query: SELECT a.cat_id, a.auth_viewcat, a.auth_viewimage, a.auth_download, a.auth_upload, a.auth_directupload, a.auth_vote, a.auth_sendpostcard, a.auth_readcomment, a.auth_postcomment FROM 4images_groupaccess a, 4images_groupmatch m WHERE m.user_id = AND a.group_id = m.group_id AND m.groupmatch_startdate <= 1143114575 AND (groupmatch_enddate > 1143114575 OR groupmatch_enddate = 0)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND a.group_id = m.group_id AND m.groupmatch_startdate <= 114311457' at line 4

DB Error: Bad SQL Query: SELECT a.cat_id, a.auth_viewcat, a.auth_viewimage, a.auth_download, a.auth_upload, a.auth_directupload, a.auth_vote, a.auth_sendpostcard, a.auth_readcomment, a.auth_postcomment FROM 4images_groupaccess a, 4images_groupmatch m WHERE m.user_id = AND a.group_id = m.group_id AND m.groupmatch_startdate <= 1143114576 AND (groupmatch_enddate > 1143114576 OR groupmatch_enddate = 0)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND a.group_id = m.group_id AND m.groupmatch_startdate <= 114311457' at line 4
If i add the missing line then every thing works fine but i am not sure why the line of code was removed, just checking through my mods as i feel it must have been removed due to one of them.
Is there a work round to this missing line.
Thank you again
Title: suggestions
Post by: RoadDogg on April 03, 2006, 08:17:35 PM
In "secure code at comment"-thread we´ve worked some suggestions out, how this Ban Mod can be improved
http://www.4homepages.de/forum/index.php?topic=11405.msg66532#msg66532

You´re right, I´ve tested this Mod now.

An Improvement would be to ban
- selected comment headline
- selected comment text

- to add an obligatory email field und ban selected email adresses

just some ideas :)
Title: Re: [MOD] Ban v1.6.2
Post by: sau4scr on April 04, 2006, 03:47:37 AM
Great mod!

I searched through the code, but I want to add the ban ability on the comments page in ACP to be able to just click ban and it automatically bans them? I can not find the code where it spits out the url to take it to the ban page. Any help would be great.
Title: Re: [MOD] Ban v1.6.2
Post by: V@no on April 04, 2006, 04:22:30 AM
You can try replace in details.php
Code: [Select]
      $comment_user_ip = ($user_info['user_level'] == ADMIN) ? $comment_row[$i]['comment_ip'] : "";with:
Code: [Select]
      $comment_user_ip = ($user_info['user_level'] == ADMIN) ? "<a href=\"".$site_sess->url(ROOT_PATH."admin/plugins/ban.php?ip=".$comment_row[$i]['comment_ip'])."\" target=\"_blank\">".$comment_row[$i]['comment_ip']."</a>" : "";
Title: Re: [MOD] Ban v1.6.2
Post by: motorhead85021 on May 08, 2006, 07:04:24 AM
I have a question before I install this MOD:

Will this record the IP Address of whoever uploads a picture to my gallery?
I'm allowing Guests access to upload pictures.    And I'd like to able to ban an IP Address if a Guest uploads something bad.

Thanks.
Title: Re: [MOD] Ban v1.6.2
Post by: V@no on May 08, 2006, 07:48:28 AM
No, it wont.
Title: Re: [MOD] Ban v1.6.2
Post by: boerdi on May 10, 2006, 08:41:25 PM
Heb folgendes Problem..und zwar:

DB Error: Bad SQL Query: SELECT b.*, l.*, u.user_name, u.user_level FROM 4images_ban_logs l LEFT JOIN 4images_ban b ON (b.id = l.ban_id) LEFT JOIN user u ON (u.user_id = l.user_id) ORDER BY l.date asc LIMIT 0, 30
Unknown column 'u.user_name' in 'field list'

Habe VBULLETIN INTEGRIERT!

Kann mir wer helfen?

lg
Title: Re: [MOD] Ban v1.6.2
Post by: boerdi on May 11, 2006, 04:54:20 PM
nobody here who can help me, please??

i have following problem:

when i click on logs.....this message appears aboth the list:

DB Error: Bad SQL Query: SELECT b.*, l.*, u.user_name, u.user_level FROM 4images_ban_logs l LEFT JOIN 4images_ban b ON (b.id = l.ban_id) LEFT JOIN user u ON (u.user_id = l.user_id) ORDER BY l.date desc LIMIT 0, 30
Unknown column 'u.user_name' in 'field list'


thank´s a lot!
Title: Re: [MOD] Ban v1.6.2
Post by: V@no on May 12, 2006, 12:27:34 AM
Sorry, current version does not support integrations... :(
Title: Re: [MOD] Ban v1.6.2
Post by: boerdi on May 12, 2006, 05:45:11 PM
ok!
and how i can reinstall this mod???
Title: Re: [MOD] Ban v1.6.2
Post by: boerdi on May 12, 2006, 05:51:18 PM
what you mean with current version???
Title: Re: [MOD] Ban v1.6.2
Post by: Lucifix on May 20, 2006, 05:57:38 PM
Hi,

I have one question. Can guests or normal users see profile of banned user?

Asking becouse as admin I can't see profile (banned sign), but if I visit banned profile as guest or regular user I can see it.

Is there a bug in my code or is it normal?
Title: Re: [MOD] Ban v1.6.2
Post by: V@no on May 20, 2006, 06:14:09 PM
This mod does not affect other members/visitors in any way. So, if you cant see profiles of banned members - I have no clue what could be wrong...
Title: Re: [MOD] Ban v1.6.2
Post by: Lucifix on May 20, 2006, 06:16:44 PM
I tried to change line:

Quote
   if ($user_info['user_level'] == ADMIN)
in function.php to:

Quote
if ($user_info['user_level'] == GUEST)

Then as admin I could see banned user profile, but as guest I wasn't able.
Title: Re: [MOD] Ban v1.6.2
Post by: V@no on May 20, 2006, 06:54:41 PM
hmmmm...you know, you are right...I guess I never tested it properly with user id banned...

replace
Code: [Select]
   if ($user_info['user_level'] == ADMIN)
with
Code: [Select]
  if (isset($HTTP_GET_VARS['bantest']) && $user_info['user_level'] == ADMIN)
(or redo step 3 if you wish)

And redownload the package, replace ban.php
Title: Re: [MOD] Ban v1.6.3
Post by: Lucifix on May 20, 2006, 07:02:50 PM
But now you are able to see banned profile even if you are admin, registered user or guest?

I would like to unable viewing profile for all users - except for admin.
Title: Re: [MOD] Ban v1.6.3
Post by: V@no on May 20, 2006, 07:40:55 PM
opss....
1) please remove the changes above, and redo step 3 instead otherwise admin can get banned when trying access member profile page
2) I've added step 8 ;)
Title: Re: [MOD] Ban v1.7
Post by: martrix on May 22, 2006, 08:27:12 PM
Hi V@no,

if I redo step 3 I can't test the bans :(
Is that intended to work this way?

BTW: thank you for this mod after a huge spam-attack last month I was forced to implement it...
Title: Re: [MOD] Ban v1.7
Post by: V@no on May 23, 2006, 02:12:54 AM
if I redo step 3 I can't test the bans :(
Is that intended to work this way?
1) did you replace ban.php with the new version?
2) when you click on test link, do you see bantest in the url? if not, look 1) ;)
Title: Re: [MOD] Ban v1.7
Post by: martrix on May 23, 2006, 10:01:20 AM
1) did you replace ban.php with the new version?
2) when you click on test link, do you see bantest in the url? if not, look 1) ;)

ad 1) yes
ad 2) yes - i did download the ban.php from your page (even if it says 1.6 there)
:)
But I'll better re-check it again...
Title: Re: [MOD] Ban v1.7
Post by: V@no on May 23, 2006, 02:37:29 PM
ad 2) yes - i did download the ban.php from your page (even if it says 1.6 there)
:)
But I'll better re-check it again...
Yes, re-check that, because the current version in the package is v1.6.3 ;)
Title: Re: [MOD] Ban v1.7
Post by: ivan on June 15, 2006, 10:48:32 AM
hello,

I have quite many accessed the detail image 436, access for all guest.

it would be possible individual pictures to ban > for all guest?

would be beautiful if you me help could 

greets ivan
Title: Re: [MOD] Ban v1.7
Post by: ivan on June 15, 2006, 02:24:39 PM
hello, we can i the ip range block > ban

217.0.0.0 - 217.255.255.255 or / and
220.0.0.0 - 220.255.255.255

??

greets ivan
Title: Re: [MOD] Ban v1.7
Post by: martrix on June 15, 2006, 02:31:08 PM
just block
217.*.*.*
and
220.*.*.*
and both IP-ranges will be blocked
Title: Re: [MOD] Ban v1.7
Post by: ivan on June 16, 2006, 07:28:44 AM
hello, we can i in the logs next page (paging)

see image attachment

in the database ban_logs have 70 entrys!!

greets ivan
Title: Re: [MOD] Ban v1.7
Post by: martrix on June 16, 2006, 11:01:07 AM
Yep, paging would be nice :) and easier than going to PHPMyAdmin to see all the logs :)
Title: Re: [MOD] Ban v1.7
Post by: ivan on June 16, 2006, 08:11:26 PM
hello, the paging should be present.
why doesn't it function in ban.php :?:

Code: [Select]
include(ROOT_PATH.'includes/paging.php');
$getpaging = new Paging($page, $perpage, $result['num'], $site_sess->url(ROOT_PATH."admin/plugins/ban.php"));
$offset = $getpaging->get_offset();

greets ivan
Title: Re: [MOD] Ban v1.7
Post by: colorssky on June 16, 2006, 10:08:59 PM
can some body give me the package @ Step 7

the site is block for me!
Title: Re: [MOD] Ban v1.7
Post by: ivan on June 16, 2006, 10:27:57 PM
here is the file

 8)

greets
Title: Re: [MOD] Ban v1.7
Post by: colorssky on June 16, 2006, 10:30:02 PM
thanks buddy :)

I just install it and will see if this gone to stop the spam :)
Title: Re: [MOD] Ban v1.7
Post by: martrix on June 17, 2006, 10:26:59 AM
Hi,

just a minor tweak fo FF users:

in ban.php find:

Code: [Select]
          $username = "<img src=\"".ROOT_PATH."flags/".strtolower($cid).".gif"."\" alt=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "Unknown or LAN")."\" border=0> ".$username;
replace with:
Code: [Select]
          $username = "<img src=\"".ROOT_PATH."flags/".strtolower($cid).".gif"."\" alt=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "Unknown or LAN")."\" title=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "Unknown or LAN")."\" border=0> ".$username;
find:
Code: [Select]
          echo "<td><img src=\"".ROOT_PATH."flags/".strtolower($cid).".gif"."\" alt=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "Unknown or LAN")."\" border=0> ".$lang['userlevel_guest']."</td>\n";
and replace it with:

Code: [Select]
          echo "<td><img src=\"".ROOT_PATH."flags/".strtolower($cid).".gif"."\" alt=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "Unknown or LAN")."\" title=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "Unknown or LAN")."\" border=0> ".$lang['userlevel_guest']."</td>\n";

Now also FF users will see a tooltip-text over the flag ;)
Title: Re: [MOD] Ban v1.7
Post by: colorssky on June 17, 2006, 06:38:51 PM
unfortunately this patch can't help me to stop the SPAM with changable IP

 :cry: :cry: :cry: :cry:
Title: Re: [MOD] Ban v1.7
Post by: Flo2005 on June 17, 2006, 08:51:30 PM
-> nnjj, you are right, try a MOD "secure code" for comments or guestbook!
Title: Re: [MOD] Ban v1.7
Post by: colorssky on June 18, 2006, 09:08:00 AM
I did try it, dosn't help as well!  :roll:
Title: Re: [MOD] Ban v1.7
Post by: ivan on June 19, 2006, 11:01:03 AM
hello together,   
we can i activate the paging function for logs?

hallo zusammen, leider habe ich immer noch das kleine
problem, dass ich bei den logs nicht weiterblättern kann.
ich habe gemerkt dass die paging funktion zwar drin ist
aber nicht richtig funktioniert.

beispiel:
wenn ich die liste für die gesperrten ip's mehr als dreissig
sind, wird die paging funktion auch für den log angezeigt.
wenn ich dann bei log die weiterblättern funktion nutze,
wechselt es wieder auf listen seite.

wer kann sich mal den code ban.php mal genauer anschauen??
wie schon gesagt ist der code drin nur die paging funktion
wird bei LOG nicht richtig angezeigt.

es ist so wahnsinnig schwierig die ip's zu analysieren ohne
weiterblättern... habe pro tag ca 200 spam attaken....

bitte um hilfe
danke ivan
 
Title: Re: [MOD] Ban v1.7
Post by: colorssky on June 19, 2006, 03:44:59 PM
so people any ideas!  :roll:
Title: Re: [MOD] Ban v1.7
Post by: colorssky on June 22, 2006, 07:51:05 PM
so??? :cry:
Title: Re: [MOD] Ban v1.7
Post by: ivan on June 29, 2006, 03:09:15 PM
hello, i have still problems with paging in the log entrys :!:

i can not paging, paging function is active in the ban list

who can help me??
 
greets ivan
Title: Re: [MOD] Ban v1.7
Post by: mawenzi on June 29, 2006, 08:01:48 PM
Hallo Ivan, hallo martrix,

... habe das gleiche Problem mit dem Paging ...
... und dabei festgestellt, dass ein Form in $action == "logs" fehlt , dass die Loggs/Seite setzt (Dropdown) ...
... dieses Problem kann man aber vorläufig schnell lösen ...
... wobei dann die Logs/Seite mit dem Filter in der Bann-Liste, also gleich Bans/Seite, identisch gesetzt werden ...
... das ist noch keine endgültige Lösung, da die Logs/Seite nicht unabhängig von den Bans/Seite gesetzt werden können ...
... um das Problem perfekt zu lösen, müsste wie gesagt noch das Form in $action == "logs" eingebaut werden ...
... dennoch ist meine Lösung zunächst absolut praktikabel ... und vielleicht meldet sich V@no ja noch ...

also was ist zu tun :

1. finde in ban.php in if ($action == "logs") { folgendes :
Code: [Select]
$perpage = $site_sess->get_session_var("ban_logs_perpage");
und ersetze es durch :
Code: [Select]
$perpage = $site_sess->get_session_var("ban_perpage");

2. finde in ban.php in if ($action == "logs") { folgendes :
Code: [Select]
$getpaging = new Paging($page, $perpage, $result['num'], $site_sess->url(ROOT_PATH."admin/plugins/ban.php"));
und ersetze es durch :
Code: [Select]
$getpaging = new Paging($page, $perpage, $result['num'], $site_sess->url(ROOT_PATH."admin/plugins/ban.php?action=logs"));

... so, wie gesagt, das Paging funktioniert jetzt bei mir bestens ...
... vielleicht fällt mir zu dem Form <select name=\"perpage\"> in $action == "logs" ja auch noch was ein ...
... wobei ich mir sicher bin, dass V@no sich vorher melden wird ...

Das Resultat :
(http://img518.imageshack.us/img518/4892/ban7mh.jpg)
Title: Re: [MOD] Ban v1.7
Post by: martrix on June 29, 2006, 08:21:00 PM
funzt bei mir leider nicht - danke aber für die Bemühung, mawenzi!
Title: Re: [MOD] Ban v1.7
Post by: mawenzi on June 29, 2006, 08:34:43 PM
@ martrix

... bevor du in die Logliste gehst, musst du vorher noch die Seitenanzahl im Filter in der Ban-Liste setzen ...  :!:
... ist vielleicht in meiner Beschreibung nicht ganz so rüber gekommen ...
... wie gesagt, von dort wird dann die Einstellung für das Paging übernommen ...
... und wenn der Filter nicht gesetzt ist ... dann funktioniert das Paging in der Log-List auch nicht ...
... ist halt noch 'ne Übergangslösung ... die aber funktioniert ...
Title: Re: [MOD] Ban v1.7
Post by: martrix on June 29, 2006, 08:44:52 PM
Habe ich auch gemacht - wahrscheinlich habe ich auch die Datei falsch geändert,
weil ich bei einem Versuch auf Seite n zu kommen aber auf die Homepage komme...
Title: Re: [MOD] Ban v1.7
Post by: ivan on June 29, 2006, 09:56:29 PM
hey mawenzi danke vielmals
habe mir gerade das teil eingebaut und es hat nicht funktioniert. beim genauen
betrachten muss folgendes geändert werden

$getpaging = new Paging($page, $perpage, $result['num'], $site_sess->url(ROOT_PATH."admin/plugins/ban.php?action=logs"));

danach funktioniert  :wink: jippie

p.s ich habe es nochmals durchgesehen
ORGINAL CODE
Code: [Select]
$getpaging = new Paging($page, $perpage, $result['num'], $site_sess->url(ROOT_PATH."admin/plugins/ban.php"));
fehlt am schluss action log

ABÄNDERN
Code: [Select]
$getpaging = new Paging($page, $perpage, $result['num'], $site_sess->url(ROOT_PATH."admin/plugins/ban.php?action=logs"));
ich habe nur das abgeändert und funktioniert so auch einwandfrei.

gruss und danke
Title: Re: [MOD] Ban v1.7
Post by: mawenzi on June 29, 2006, 10:18:46 PM
@ ivan
... hast natürlich Recht ... immer diese kleinen Schusseligkeiten ...
... hab es oben berichtigt ...
... hoffe jetzt wird es auch bei martrix rennen ...
Title: Re: [MOD] Ban v1.7
Post by: ivan on June 29, 2006, 11:18:58 PM
hallo mawenzi, dies ban script lässt mich nicht in ruhe
probier mal folgendes

search
Code: [Select]
    echo "<td><input type=\"checkbox\" name=\"del[]\" value=\"".$row['id']."\"></td>";
    echo "</tr>";
  }
  echo "</table></td></tr></table><br />";
  echo $getpaging->get_paging();
  show_form_footer($lang['delete'], "", (count($sort_logs_array)+1));

ersetzen durch
Code: [Select]
    echo "<td><input type=\"checkbox\" name=\"del[]\" value=\"".$row['id']."\"></td>";
    echo "</tr>";
  }
  echo "</table></td></tr></table><br />";
  echo $getpaging->get_paging();
  echo "&nbsp;&nbsp;";
  echo $lang['ban_perpage']."&nbsp;&nbsp;\n<select name=\"ban_perpage\">\n";
    for($i = 1; $i <= 30; $i++) {
    $setvalue = 5 * $i;
    echo "<option value=\"".$setvalue."\"";
    if ($setvalue == $perpage) {
      echo " selected=\"selected\"";
    }
    echo ">".$setvalue."</option>\n";
  }
  echo "</select></td></tr>\n";
  show_form_footer($lang['delete'], "", (count($sort_logs_array)+1));

jetzt wird  die zahl seiten per page angezeigt aber jetzt fehlt noch die action form
wenn man die zahlen anklickt passiert nichts, vielleicht kommst du da weiter
wenn du es hinkriegst, könnte man den löschen button rechts verlegen  :wink:

gruss ivan
Title: Re: [MOD] Ban v1.7
Post by: mawenzi on June 29, 2006, 11:26:58 PM
... ja soweit war ich auch schon ...
... habe das Form eingebaut, aber noch nicht zum Rennen gebracht und daher die Lösung oben erst einmal gepostet ...
... werde mir die Sache aber nochmals zu Gemüte ziehen ...
... aber vielleicht haben wir ja morgen schon aus kompetenterer Stelle 'ne Antwort ...
... denn ich kann mir nicht vorstellen, das V@no diese Diskusion hier in Ruhe lässt ...  :wink:
Title: Re: [MOD] Ban v1.7
Post by: ivan on June 29, 2006, 11:40:23 PM
hoffen dir das beste dass vano uns hilft  :D
gruss und danke
Title: Re: [MOD] Ban v1.7
Post by: martrix on June 30, 2006, 09:07:59 AM
JUCHU!*

* martrix springt bis zur Decke, weil es funktioniert.

 :D
Title: Re: [MOD] Ban v1.7
Post by: mawenzi on June 30, 2006, 09:35:24 PM
... habe den ganzen Abschnitt if ($action == "logs") komplett überarbeite und habe nun das gewünschte Resultat ...
... um nicht alle Änderungen einzeln zu erklären, hänge ich die neue ban.php als zip-File zum Download hinten an ...
... also ihr braucht die Datei nur nach /admin/plugins/ zu kopieren um folgende zusätzlichen Features zu bekommen ...

Additional Features of this version of ban.php
- Paging Stats in Ban-Logs-List
- Paging in Ban-Logs-List
- Setting Logs per page in Ban-Logs-List
- Number (Counter) for each Ban-Log in Ban-Logs-List

(http://img161.imageshack.us/img161/7456/banlogliste011sl.jpg)

Installation :

1. download ban_php.zip, entpacken und nach admin/plugins/ kopieren
2. finde in /lang/<your_lang>/admin
Code: [Select]
/*
  MOD BAN
  END INSERT
*/
und füge unmittelbar davor folgendes ein
Code: [Select]
//--- Ban-Log-List-Erweiterung ---
$lang['ban_found'] = "Gefunden :";
$lang['ban_logs_at'] = "Ban-Logs auf";
$lang['ban_pages'] = "Seite(n)";
$lang['ban_disp'] = "Angezeigt :";
$lang['ban_page'] = "Seite";
$lang['ban_with'] = "mit Ban-Log";
$lang['ban_to'] = "bis";

3. Jetzt kannst du deine neue Ban-Log-Liste mit den o.g. Features testen

viel Spaß mawenzi

PS.
- Habe die Änderung für die Buttogröße im FF eingearbeitet !
- Habe die Änderung für den Count = 0 als richtige Anzeige eingearbeitet !
- Danke an V@no für diesen tollen MOD und an Ivan für das Testen meiner Version !
Title: Re: [MOD] Ban v1.7
Post by: ivan on June 30, 2006, 11:47:56 PM
hallo detlev,
wenn du 0 logs hast
wird folgendes angezeigt

Gefunden: 0. Angezeigt: 1-0.
p.s habe auch mit deinem script probiert, dasselbe ergebnis :!:

wo kann ich dies ändern?

gruss ivan
Title: Re: [MOD] Ban v1.7
Post by: mawenzi on July 01, 2006, 12:07:49 AM
... wenn du schon beim optimieren bist, dann sollte das doch 'ne Kleinigkeit sein ...  :wink:
... habe das in meiner ban.php richtig gestellt ...
Title: Re: [MOD] Ban v1.7
Post by: ivan on July 01, 2006, 10:23:46 AM
hallo mawenzi, sorry war nicht gerade fair von mir, nochmals eine überabeitete version einzustellen.
du hast dir soviel mühe gemacht, die user sollen deine version nehmen :!:
vielen dank dass du die if und else abfrage noch geändert hast. es ist einfach schön, wenn man ein
script kriegt wie dieses, dass ohne wenn und aber funktioniert.

viele liebe grüsse aus der schweiz



Title: Re: [MOD] Ban v1.7
Post by: idijotaz on July 01, 2006, 01:41:33 PM
ban works... but when uve banned... u dont get a message bet get this:
Code: [Select]
Fatal error: Call to a member function on a non-object in /var/www/vhosts/laisvalaikis.yours.lt/httpdocs/includes/page_header.php on line 109
how can i fix it?  :roll:
Title: Re: [MOD] Ban v1.7
Post by: mawenzi on July 01, 2006, 02:21:31 PM
@ Ivan,

... danke ... auch für das Testen ... :mrgreen:
Title: Re: [MOD] Ban v1.7
Post by: colorssky on July 01, 2006, 08:48:38 PM
I think no body know my Q!  :roll:
Title: Re: [MOD] Ban v1.7
Post by: ivan on July 03, 2006, 09:53:06 AM
hallo detlev,
habe die log auf einem andern pc mit einem kleineren auflösung
angesehen und etwas stimmt nicht mit der tabelle (width). die log geht
über den rand raus. paging (log pro seite) ist normal auf 100% eingestellt.

siehe beispiel

gruss ivan
Title: Re: [MOD] Ban v1.7
Post by: mawenzi on July 03, 2006, 10:18:19 AM
@ Ivan,

... das hat aber nichts mit meiner Version zu tun ... !
... der Inhalt der Spalte "Besuchte URL" kann nicht mit einem automatischen Umbruch versehen werden ...
... und da die URL so lang ist, wird die Tabelle über die 100% dagestellt ...
... man könnte höchstens die URL verkürzt ausgeben ...
Title: Re: [MOD] Ban v1.7
Post by: ivan on July 03, 2006, 10:29:59 AM
hallo detlev,
danke für die antwort. kein problem, ich dachte nur dass man vielleicht etwas geändert hat.
bin einfach froh wenn alles funktioniert.

da hast du recht, man könnte bei der url die session id kürzen, die braucht man eh nicht...
wenn es immer die gleiche session id ist, ist es dann immer der gleiche benutzer oder
wird diese immer neu generiert??

gruss ivan
Title: Re: [MOD] Ban v1.7
Post by: martrix on July 03, 2006, 10:41:05 AM
da hast du recht, man könnte bei der url die session id kürzen, die braucht man eh nicht...

in manchen Fällen nicht - aber auf meiner Seite versuchen ein Paar Bots immer über die gleiche Session-Nummer "hineinzukommen"
Ohne die Session zu sehen, habe ich dann keine Übersicht über diese Bots.

Have fun
Title: Re: [MOD] Ban v1.7
Post by: ivan on July 03, 2006, 11:06:43 AM
hallo martrix
bei mir ist das problem, dass sich die bots auf das bild 4xx stürzen. immer das gleiche bild
und abwechselnde ip. zum kotzen ist das, wenn ich die session id anschaue, ist dies immer
die gleiche. musste sogar dies nur noch registierten usern zulassen, weil die hits pro tag um
100-150 zunahmen.

dann kann man sagen, dass wenn es die gleiche id ist, auch immer der gleiche benutzer ist??

gruss ivan
Title: Re: [MOD] Ban v1.7
Post by: mawenzi on July 03, 2006, 02:00:15 PM
@ Ivan ...

Short URL in Ban-Logs-List

1. finde in ban.php in Zeile 903 folgendes :
Code: [Select]
while ($row = $site_db->fetch_array($result))
  {
und füge unmittelbar dahinter folgendes ein :
Code: [Select]
// --- Verkürzte URL ... 03.07.2006 ---
    $max_url_length = 53; // max.Zeichen für URL
    $ban_url = stripslashes($row['uri']);
    if (strlen($ban_url) > $max_length) {
        $ban_url = substr(stripslashes($row['uri']), 0, $max_url_length)."...";
    } else {
        $ban_url = stripslashes($row['uri']);
    }
// --- Verkürzte URL ... 03.07.2006 ---
2. finde weiter unten folgendes :
Code: [Select]
    echo "<td>".substr(stripslashes($row['uri'])."</td>";
und ersetze es durch :
Code: [Select]
    echo "<td>".$ban_url."</td>";
Title: Re: [MOD] Ban v1.7
Post by: martrix on July 03, 2006, 04:11:05 PM
@Ivan:
kann es sein, dass du FF benutzt? ;)

Ich habe es nie als ein Problem gesehen, dass ich in den Logs nach rechts scrollen muss, um die ganze URL zu sehen,
aber als ich heute mal die Seite mit IE angesehen habe, waren die URL-Zeilen umgebrochen ;)

Title: Re: [MOD] Ban v1.7
Post by: ivan on July 03, 2006, 04:23:03 PM
hallo martrix
jepp ich nutze firefox. stimmt, habe nun die seite auch mal mit ie angesehen und
tatsächlich, es wird umgebrochen!

ja nu, ist egal...

@detlev, danke noch für dein short script!

gruss ivan
Title: Re: [MOD] Ban v1.7
Post by: ivan on July 06, 2006, 07:40:32 PM
hallo, ich hatte ein unmöglichen besuch von der ip 62.233.222.146.
dieser schreibt mir immer spam kommentare, ich benutze für die registrierung

vanos mod
http://www.4homepages.de/forum/index.php?topic=10200.0

und diesen für die kommentare
http://www.4homepages.de/forum/index.php?topic=11405.0

nun heute hatte ich über 100 neue kommentare von dieser ip!

wie kommst, dass ich diese adresse gebannt, diese in den logs steht, der captcha mit einem
zufälligen generierten code TROTZDEM SPAM kommentare schreiben kann?

wer weiss hier einen rat??

vielen dank für die hilfe

Title: Re: [MOD] Ban v1.7
Post by: martrix on July 07, 2006, 07:20:57 AM
Das liest sich ja schlimmer, als ein Horror!

Hast du mal versucht, ob bei dir die Ban-Funktion auf geht?
Versuch es doch mal, deine eigene IP für 5 Minuten zu blockieren...
Title: Re: [MOD] Ban v1.7
Post by: ivan on July 07, 2006, 08:40:18 AM
ist wirklick so.... es ist einfach mit aufwand verbunden diese kommentare wieder zu
löschen geschweige denn meine einstelllung (pm bei comment) wieder so herzustellen
wie es war. meine ip wird gebannt.... funktioniert einwandfrei. hat denn dieser eine
sicherheitslücke gefunden??

p.s als anhang die geblockten versuche

gruss ivan
Title: Re: [MOD] Ban v1.7
Post by: martrix on July 07, 2006, 08:50:19 AM
Alle bugfixes in deiner Gallerie sind eingebaut?
Title: Re: [MOD] Ban v1.7
Post by: ivan on July 07, 2006, 08:52:22 AM
alle in diesem ordner http://www.4homepages.de/forum/index.php?board=17.0
p.s ich lösche meine treads nachher wieder (ist mühsam wenn man einen mod einbaut und
so viel lesen muss)
Title: Re: [MOD] Ban v1.7
Post by: idijotaz on July 11, 2006, 11:41:35 AM
ban works... but when uve banned... u dont get a message bet get this:
Code: [Select]
Fatal error: Call to a member function on a non-object in /var/www/vhosts/laisvalaikis.yours.lt/httpdocs/includes/page_header.php on line 109
how can i fix it?  :roll:
anyone can help me?  :?
Title: Re: [MOD] Ban v1.7
Post by: V@no on July 11, 2006, 03:32:31 PM
and on line 109 in page_header.php is....
Title: Re: [MOD] Ban v1.7
Post by: radbe on July 12, 2006, 02:59:00 PM
I get error message when try to do test from interface
Fatal error: Call to a member function on a non-object in /xxxxxx/yyyyy/home/zzzzzzz/my-gallery.whatever.com/Badd/includes/page_header.php on line 33


this is my line 33 in page_header.php
$site_template->cache_templates($template_list);


Any Ideas?
by the way I use version 1.7 for 4images w/ ban 1.7

Title: Re: [MOD] Ban v1.7
Post by: idijotaz on July 17, 2006, 11:45:43 AM
V@no,  here my page_header.php file... can you look whats bad? becouse i dont have program to see what line is it  :roll:
Title: Re: [MOD] Ban v1.7
Post by: V@no on July 17, 2006, 03:07:03 PM
Its not the file that is on your server, is it? cause that line is commented out, it should NOT be parsed by PHP at all...
Title: Re: [MOD] Ban v1.7
Post by: idijotaz on July 17, 2006, 03:19:06 PM
damn... with server i think everything ok... maybe in some file mistake... anyway... ban works only dont show that html... nevermind :)
Title: Re: [MOD] Ban v1.7
Post by: __G__ on August 22, 2006, 05:50:47 AM
would this work with 1.7.3
Title: Re: [MOD] Ban v1.7
Post by: __G__ on August 22, 2006, 11:47:09 PM
Hi i did it exactlly as it said but when i run the installer it says MOD Ban    (by V@no)
 
Sorry, can not continue, you missed some steps of the installation. please help
Title: Re: [MOD] Ban v1.7
Post by: V@no on August 23, 2006, 12:32:55 AM
Forgot step 2?
Title: Re: [MOD] Ban v1.7
Post by: __G__ on August 23, 2006, 12:53:51 AM
Sorry abt that v@no u were rite I am sorry to disturb u but yea it works now thanks a lot :X and the mod is superb u r just too good @ what u do :X
Title: Re: [MOD] Ban v1.7
Post by: __G__ on August 23, 2006, 01:23:35 AM
V@no just a quick question that logs on this mod does that record every ip which comes and view the site or its something else and if its not that is it possible that the ban mod logs everyip which comes to site
Title: Re: [MOD] Ban v1.7
Post by: V@no on August 23, 2006, 01:29:25 AM
No, it doesnt log every IP, it only logs the banned visitors, so you could trace what they were trying to access and when.
If you need log every IP, then you can find bunch of other tools on google that can do it for you. i.e. pphlogger
Title: Re: [MOD] Ban v1.7
Post by: __G__ on August 23, 2006, 01:35:20 AM
is it possible that pphlogger can get integreate with 4images so we can control it from ACP
Title: Re: [MOD] Ban v1.7
Post by: V@no on August 23, 2006, 02:04:43 AM
yes, there is a mod for it.
Title: Re: [MOD] Ban v1.7
Post by: __G__ on August 23, 2006, 02:08:52 AM
Thanks i found the mod i will give it a try
Title: Re: [MOD] Ban v1.7
Post by: ThanhPhuoc on September 12, 2006, 04:47:56 AM
---------- [ F.A.Q. ] --------------

Q: Why when I ban someone, they see the ban message only first time they open the page, after refresh the ban doesnt work anymore?
A: This is a recent discover and its probably because your server has magic_quotes_gpc is turned on (check in phpinfo()).
To fix that, uncomment this line from includes/functions.php:
//  $ban_banned = stripslashes($ban_banned); //uncomment this line if magic_quotes_gpc is turned on on your server
Since v1.6.1 added auto check if magic_quotes_gpc is enabled
Why do I get same error? My magic_quotes_gpc is off.
Title: Re: [MOD] Ban v1.7
Post by: M@2T on September 22, 2006, 09:08:27 PM
Can someone please attach the required files as vano.org is down? Thank you :)

Oh and is there any way to make it work with 1.7.3?
Title: Re: [MOD] Ban v1.7
Post by: V@no on September 22, 2006, 10:27:36 PM
done
Title: Re: [MOD] Ban v1.7
Post by: M@2T on September 22, 2006, 10:56:30 PM
Thank you - much appreciated!
Title: Re: [MOD] Ban v1.7
Post by: andreas00 on September 23, 2006, 05:02:00 AM
V@no can you please add a link to the files for ban ip?
Title: Re: [MOD] Ban v1.7
Post by: V@no on September 23, 2006, 05:08:53 AM
sorry, didnt understand..."files for ban ip"? what do you mean?
Title: Re: [MOD] Ban v1.7
Post by: KurtW on October 29, 2006, 07:30:50 PM
Hi,

the mod works fine, but not in register
The mod block all postings in comment.
But i must spend a lot of time to delete the useraccounts with the ban-emails.
Is something wrong in my mod or is this standard :?:

Thanks

cu
Kurt
Title: Re: [MOD] Ban v1.7
Post by: lorddean on October 30, 2006, 09:19:59 PM
Hi...

Is this mod updated for version 1.7.4?
Title: Re: [MOD] Ban v1.7
Post by: qpatrick on November 01, 2006, 11:40:09 AM
Yes, works well with 1.7.4
Title: Re: [MOD] Ban v1.7
Post by: Jockl on November 12, 2006, 07:29:17 PM
I just installed this wonderful mod with 1.7.4 and tried it with a testuser, but after refresh he can easily get access to the gallery. magic_quotes_gpc is turned off.
Title: Re: [MOD] Ban v1.7
Post by: Jockl on November 20, 2006, 07:59:10 PM
No idea?

Keine Idee?
Title: Re: [MOD] Ban v1.7
Post by: Jockl on January 04, 2007, 10:15:22 PM
Can't somebody help me with that problem?  :(
Title: Re: [MOD] Ban v1.7
Post by: Jenn on March 15, 2007, 06:58:28 PM
Woohoo, worked beautifully.

Thanks so much!

Can't believe something installed without a hitch. LOL
Title: Re: [MOD] Ban v1.7
Post by: rinaldos on September 17, 2007, 08:15:31 PM
Hello,
I have installed this mod and it works perfectly with 1.7.4 :-) Thanks for this great mod.
Title: Re: [MOD] Ban v1.7
Post by: Suricata on September 29, 2007, 01:07:14 AM
Hallo,

heute bei 1.7.4 installiert.

Installation hat perfekt geklappt und auch der erste Test lief erfolgreich.

Als nächstes wird die Robots.txt angepasst. :-)

VG
Suricata
Title: Re: [MOD] Ban v1.7
Post by: Suricata on October 07, 2007, 06:28:05 PM
Hallo,

ich muss mich leider korrigieren. Ich habe mit dem MOD 2 Probleme.

1) Ich habe am 29.9. die 66.249.66.129   ge"banned". Diese besucht aber immer noch täglich alle Seiten bei mir. beispiel: http//fp-foto.de/rss.php?action=comments&image_id=539
Wieso kann diese IP immer noch alle Seiten aufrufen?

2) Ich kann die Log Datei nicht löschen. ich bekomme die Fehlermeldung:
"Es sind Fehler bei folgenden Aktionen aufgetreten:
    * Fehler beim löschen der log(s)"
Wo liegt der Fehler?

Viele Grüße
Suricata



Hallo,

heute bei 1.7.4 installiert.

Installation hat perfekt geklappt und auch der erste Test lief erfolgreich.

Als nächstes wird die Robots.txt angepasst. :-)

VG
Suricata
Title: Re: [MOD] Ban v1.7
Post by: ivan on October 07, 2007, 07:59:52 PM
probier mal dieses ban file
http://www.4homepages.de/forum/index.php?topic=7066.msg72847#msg72847

gruss
Title: Re: [MOD] Ban v1.7
Post by: Suricata on October 07, 2007, 08:26:09 PM
Hallo Ivan,

cool, damit hat es funktioniert!

Vielen Dank!

cu Suricata

probier mal dieses ban file
http://www.4homepages.de/forum/index.php?topic=7066.msg72847#msg72847

gruss
Title: Re: [MOD] Ban v1.7
Post by: redlove on November 28, 2007, 11:36:48 AM
Also bei mir funkt diesen Link nicht mehr

http://gallery.vano.org//file64dl


gruß
redlove
Title: Re: [MOD] Ban v1.7
Post by: Nicky on November 28, 2007, 12:04:14 PM
1st page 1st post
file attached ;)

but here the link http://www.4homepages.de/forum/index.php?action=dlattach;topic=7066.0;attach=975
Title: Re: [MOD] Ban v1.7
Post by: redlove on November 28, 2007, 12:07:24 PM
 thank u so much


redlove
Title: Re: [MOD] Ban v1.7
Post by: Nicky on November 28, 2007, 12:19:55 PM
Thank for posting  :mrgreen:

gern geschehen :!:
Title: Re: [MOD] Ban v1.7
Post by: redlove on November 28, 2007, 12:37:33 PM

jetzt habe ich eine Frage:)

habe alles installiert Ban wird angezeigt aber wenn ich drauf klicke sehe ich da oben eine fette Fehlermeldung:



DB Error: Bad SQL Query: SELECT count(id) as num FROM 4images_ban WHERE (type=0 OR type = 1 OR type = 2 OR type = 4 OR type = 5 OR type = 3) AND date <= 1196249692 OR date > 1196249692 OR (expire AND expire <= 1196249692)
Table 'meinehomepage_imga1.4images_ban' doesn't exist

DB Error: Bad SQL Query: SELECT * FROM 4images_ban WHERE (type=0 OR type = 1 OR type = 2 OR type = 4 OR type = 5 OR type = 3) AND date <= 1196249692 OR date > 1196249692 OR (expire AND expire <= 1196249692) ORDER BY type asc LIMIT 0, 30
Table 'meinehomepage_imga1.4images_ban' doesn't exist


danke für Deine Hilfe!!

gruß
redlove



Title: Re: [MOD] Ban v1.7
Post by: Nicky on November 28, 2007, 12:49:11 PM
hi,

das es die tabelle 4images_ban nicht gibt.
warscheinlich hast die ban_install.php aus dem zip nicht ausgeführt
Title: Re: [MOD] Ban v1.7
Post by: redlove on November 28, 2007, 02:45:37 PM



du hast Recht!!

jetzt funkt einwandfrei. thx

redlove
Title: How do you block a user?
Post by: dognation1 on January 01, 2008, 11:11:36 PM
How do you block a user? can you block their i.p. address to keep them from viewinf pictures on ur site?


thanks

chris
Title: Re: How do you block a user?
Post by: thunderstrike on January 01, 2008, 11:41:29 PM
Yes, with this:

http://www.4homepages.de/forum/index.php?topic=19535.0
http://www.4homepages.de/forum/index.php?topic=7066.0

;)
Title: Re: How do you block a user?
Post by: dognation1 on January 02, 2008, 01:15:04 AM


http://www.4homepages.de/forum/index.php?topic=7066.0  Will this mod work in version 1.7.4?


thanks

chris
Title: Re: How do you block a user?
Post by: thunderstrike on January 02, 2008, 01:18:28 AM
Yes, is work with v1.74.
Title: Re: How do you block a user?
Post by: dognation1 on January 02, 2008, 01:20:47 AM
will this one work with 1.7.4 also?


http://www.4homepages.de/forum/index.php?topic=7066.0


thansk for your help thunder!


chris
Title: Re: How do you block a user?
Post by: thunderstrike on January 02, 2008, 01:21:43 AM
You post 2 time same topic ... and again ... I say yes - is work v1.74.
Title: Re: How do you block a user?
Post by: dognation1 on January 02, 2008, 03:20:25 AM
thunder...I got to step 7....and the link for this package does not work....do you know the link i need to go to , to download this package? this is the link http://gallery.vano.org/file64dl


Step 7
Download this package.
Unzip it and upload acording the following directory tree:
ban_install.php
admin/plugins/ban.php
templates/<your template>/ban.html

(If u dont have admin/plugins/ folder, then simply create it)
Title: Re: How do you block a user?
Post by: thunderstrike on January 02, 2008, 03:23:58 AM
Download link is here:

http://www.4homepages.de/forum/index.php?action=dlattach;topic=7066.0;attach=975
Title: Re: How do you block a user?
Post by: dognation1 on January 02, 2008, 03:44:13 AM
thanks again!
Title: Re: How do you block a user?
Post by: dognation1 on January 02, 2008, 04:59:42 AM
THunder I got everything loaded......seems to be working I think but I am getting this message when I log on; and it wont let me log out....can you help?
 Here is my link if you need to look at it..   http://www.disguiseddisciple.com/photogallery/ (http://www.disguiseddisciple.com/photogallery/) 

thanks

chris

Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/lang/english/main.php:400) in /home/disgu2/public_html/photogallery/includes/sessions.php on line 101

Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/lang/english/main.php:400) in /home/disgu2/public_html/photogallery/includes/sessions.php on line 101

Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/lang/english/main.php:400) in /home/disgu2/public_html/photogallery/includes/sessions.php on line 101

Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/lang/english/main.php:400) in /home/disgu2/public_html/photogallery/includes/sessions.php on line 101

Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/lang/english/main.php:400) in /home/disgu2/public_html/photogallery/includes/sessions.php on line 101

Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/lang/english/main.php:400) in /home/disgu2/public_html/photogallery/includes/functions.php on line 114
Title: Re: How do you block a user?
Post by: dognation1 on January 02, 2008, 05:12:48 AM
now I cant log on either....get the same warning errors as posted above...



chris
Title: I loaded the ban a user Mod & now Im getting error messages
Post by: dognation1 on January 02, 2008, 02:50:00 PM
I loaded the ban a user Mod & now Im getting error messages....here is the link to my original question , that also shows the eroor messages.

http://www.4homepages.de/forum/index.php?topic=20017.0

any help will be appreciated.

thanks

chris
Title: Re: How do you block a user?
Post by: thunderstrike on January 02, 2008, 03:13:38 PM
If have problem with MOD, please report to right topic.
Title: Re: I loaded the ban a user Mod & now Im getting error messages
Post by: thunderstrike on January 02, 2008, 03:14:11 PM
Please no create new topic. If have problem with MOD, report to official topic.
Title: Re: How do you block a user?
Post by: dognation1 on January 02, 2008, 03:23:46 PM
this is the original topic.....can anyone help with this problem?

If not can you tell me how to delete this mod?


thanks

chris
Title: Re: How do you block a user?
Post by: thunderstrike on January 02, 2008, 04:01:13 PM
This is original topic:

http://www.4homepages.de/forum/index.php?topic=7066.0
Title: Re: [MOD] Ban v1.7
Post by: dognation1 on January 02, 2008, 04:07:01 PM
 I got everything loaded......seems to be working I think but I am getting this message when I log on; and it wont let me log out....can you help?
 Here is my link if you need to look at it..  http://www.disguiseddisciple.com/photogallery/ 

you can use user name  TEST and password TEST to login to see what it is doing.

any help is appreciated.

thanks

chris

Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/lang/english/main.php:400) in /home/disgu2/public_html/photogallery/includes/sessions.php on line 101

Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/lang/english/main.php:400) in /home/disgu2/public_html/photogallery/includes/sessions.php on line 101

Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/lang/english/main.php:400) in /home/disgu2/public_html/photogallery/includes/sessions.php on line 101

Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/lang/english/main.php:400) in /home/disgu2/public_html/photogallery/includes/sessions.php on line 101

Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/lang/english/main.php:400) in /home/disgu2/public_html/photogallery/includes/sessions.php on line 101

Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/lang/english/main.php:400) in /home/disgu2/public_html/photogallery/includes/functions.php on line 114
Title: Re: [MOD] Ban v1.7
Post by: thunderstrike on January 02, 2008, 04:08:32 PM
At end of lang/english/main.php file, remove empty space after: ?> .
Title: Re: [MOD] Ban v1.7
Post by: dognation1 on January 02, 2008, 04:26:39 PM
I removed the empty spaces like you said....

now in the admin control panel i am getting these messages:


Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/includes/constants.php:167) in /home/disgu2/public_html/photogallery/admin/admin_functions.php on line 168

Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/includes/constants.php:167) in /home/disgu2/public_html/photogallery/admin/admin_functions.php on line 169

Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/includes/constants.php:167) in /home/disgu2/public_html/photogallery/admin/admin_functions.php on line 170

Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/includes/constants.php:167) in /home/disgu2/public_html/photogallery/admin/admin_functions.php on line 171

Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/includes/constants.php:167) in /home/disgu2/public_html/photogallery/admin/admin_functions.php on line 172

and in the photo gallery when I try to log out I get this message:

Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/includes/constants.php:167) in /home/disgu2/public_html/photogallery/includes/sessions.php on line 101

Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/includes/constants.php:167) in /home/disgu2/public_html/photogallery/includes/sessions.php on line 101

Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/includes/constants.php:167) in /home/disgu2/public_html/photogallery/includes/functions.php on line 114

and in the photo gallery when I try to log in I get this message:


Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/includes/constants.php:167) in /home/disgu2/public_html/photogallery/includes/sessions.php on line 101

Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/includes/constants.php:167) in /home/disgu2/public_html/photogallery/includes/sessions.php on line 101

Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/includes/constants.php:167) in /home/disgu2/public_html/photogallery/includes/sessions.php on line 101

Warning: Cannot modify header information - headers already sent by (output started at /home/disgu2/public_html/photogallery/includes/constants.php:167) in /home/disgu2/public_html/photogallery/includes/functions.php on line 114
Title: Re: [MOD] Ban v1.7
Post by: thunderstrike on January 02, 2008, 04:52:03 PM
Do same for includes/constants.php file. This is problem with FTP software for upload file structure.
Title: Re: [MOD] Ban v1.7
Post by: dognation1 on January 02, 2008, 05:42:08 PM
okay...error messages are gone...but I have a member account named TEST with the password TEST. I put it on the banned list to check to see if MOD is working...it did not keep TEST from logging in. ANy help?

Also..can you ban a guest user from the site?



thanks


chris
Title: Re: [MOD] Ban v1.7
Post by: thunderstrike on January 02, 2008, 05:46:18 PM
Quote
okay...error messages are gone...but I have a member account named TEST with the password TEST. I put it on the banned list to check to see if MOD is working...it did not keep TEST from logging in. ANy help?

Check in topic, this answer before to other user. ;)

Quote
Also..can you ban a guest user from the site?

If by IP, I think is possible. ;)
Title: Re: [MOD] Ban v1.7
Post by: dognation1 on January 02, 2008, 08:25:08 PM
I tried to ban by: username, i.p. and email...none of them work.....I checked in topic for answer....but there are a lot of different anwsers and Im not sure which one applies to me.

any help grealty appreciated


chris
Title: Re: [MOD] Ban v1.7
Post by: dognation1 on January 02, 2008, 10:07:59 PM
I believe all is working now.....I did find something that may be helpful for others...


the time in the start & end date of the ban page does not take into account any time offset you have coded in.

so you have to manually change the time accordingly.

but in you ban logs the offset time is correct.

thanks for all your help Thunder!  (hey post me a picture  www.disguiseddisciple.com/photogallery)


chris
Title: Re: [MOD] Ban v1.7
Post by: urmasmuld on January 22, 2008, 11:31:57 AM
I've installed this mod, and in admin panel all works well, i can ban users, but when banned users goes to my homepage, he/she gets this error:

Code: [Select]
Fatal error: Call to a member function register_vars() on a non-object in /www/01/************/rskpower/includes/page_header.php on line 85
What i missed or did wrong ?
I have v 1.7.4
Title: Re: [MOD] Ban v1.7
Post by: VonHerzen on July 27, 2008, 01:53:11 PM

Hi everybody!
I would like to install this MOD but I have tried to download the files from the link in post #1 [http://gallery.vano.org/file64dl] and it does not work. Where I can find the necessary files to install this MOD? (ban_install.php, ban.php & ban.html)
Thx!
Title: Re: [MOD] Ban v1.7
Post by: ivan on July 27, 2008, 01:59:18 PM
control in first post under
"1.0 (2005-03-28)"
Title: Re: [MOD] Ban v1.7
Post by: VonHerzen on July 27, 2008, 02:03:27 PM

Hey! It is situated under a line after 1.0 (2005-03-28) I was not able to find it! sorry!  :oops: and thanks for the clue ivan!  :D
Title: Re: [MOD] Ban v1.7
Post by: qBass17 on July 29, 2008, 01:48:46 PM
Works perfectly on 1.7.6!
Nice Mod!
Title: Re: [MOD] Ban v1.7
Post by: RatedRWHC on August 30, 2008, 02:07:54 AM
the package u have to download link dosnt work for me :S
Title: Re: [MOD] Ban v1.7
Post by: V@no on August 30, 2008, 02:53:49 AM
the package u have to download link dosnt work for me :S
Link corrected.
Just so you know, all my mods that have files to download have the files as attachment to the post.
Title: Re: [MOD] Ban v1.7
Post by: axlrose on September 08, 2008, 08:49:34 AM
Got an error here installed on 4images 1.7.6:

the errors:
/* MOD BAN START INSERT */ $lang['ban_banned'] = "You've been banned"; /* MOD BAN END INSERT *//* MOD BAN START INSERT */ define("BAN_TABLE", $table_prefix."ban"); define("BAN_LOGS_TABLE", $table_prefix."ban_logs"); define("BAN_IP", 1); define("BAN_HOSTNAME", 2); define("BAN_USERID", 3); define("BAN_NAME", 4); define("BAN_EMAIL", 5); /* MOD BAN END INSERT *//* MOD BAN START INSERT */ function check_ban() { global $user_info, $site_sess, $config, $lang, $site_db, $HTTP_GET_VARS; $types = array("ip", "hostname", "name", "user_id", "email"); if (!$config['ban_update']) { return false; } if ($user_info['user_level'] == ADMIN) { if (!isset($HTTP_GET_VARS['bantest'])) return false; $return = true; foreach ($types as $key) { if (isset($HTTP_GET_VARS[$key]) && $$key = $HTTP_GET_VARS[$key]) $return = false; else $$key = ""; } if ($return) return false; $force = true; } else { $ip = $site_sess->session_info['session_ip']; $email = $user_info['user_email']; $user_id = $user_info['user_id']; $name = $user_info['user_name']; $hostname = ""; $force = false; } $ban = false; $ban_checked = $site_sess->get_session_var("ban_checked"); $ban_userid = $site_sess->get_session_var("ban_userid"); $ban_banned = $site_sess->get_session_var("ban_banned"); if (get_magic_quotes_gpc() != 0) { $ban_banned = stripslashes($ban_banned); } // $ban_banned = stripslashes($ban_banned); //uncomment this line if magic_quotes_gpc is turned on on your server $ban_banned = ($ban_banned) ? unserialize($ban_banned) : ""; if ($force || (!$ban_checked || !$ban_userid || ($ban_userid && $ban_userid != $user_info['user_id']) || ($ban_checked && $ban_checked < $config['ban_update']) || ($ban_banned && $ban_banned['expire'] < time()))) { $query = array(); if (preg_match('/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/', $ip, $ip_chop) == 1) { $query[] = "(type = ".BAN_IP." AND ($ip_chop[1] BETWEEN ip1_start AND ip1_end) AND ($ip_chop[2] BETWEEN ip2_start AND ip2_end) AND ($ip_chop[3] BETWEEN ip3_start AND ip3_end) AND ($ip_chop[4] BETWEEN ip4_start AND ip4_end))"; if ($config['look_hostname'] && !$hostname) { $hostname = @gethostbyaddr($ip); } } if ($hostname) { $query[] = "(type = ".BAN_HOSTNAME." AND ('$hostname' LIKE hostname))"; } if ($email) { $query[] = "(type = ".BAN_EMAIL." AND ('".addslashes($email)."' LIKE email))"; } if ($user_id && $user_id > GUEST) { $query[] = "(type = ".BAN_USERID." AND user_id = ".$user_id.")"; } if ($name) { $query[] = "(type = ".BAN_NAME." AND ('".addslashes($name)."' LIKE name))"; } if (!empty($query)) { $sql = "SELECT id, type, message, date, expire FROM ".BAN_TABLE." WHERE (".implode(' OR ', $query).")"; if ($result = $site_db->query($sql)) { while ($row = $site_db->fetch_array($result)) { $site_sess->set_session_var("ban_banned", addslashes(serialize($row))); if ($row['date'] <= time() && (!$row['expire'] || $row['expire'] > time())) { $ban = $row; break; } } } else { $site_sess->set_session_var("ban_banned", ""); } } $site_sess->set_session_var("ban_checked", time()); $site_sess->set_session_var("ban_userid", $user_info['user_id']); } elseif ($ban_banned && $ban_banned['date'] <= time() && (!$ban_banned['expire'] || $ban_banned['expire'] > time())) { $ban = $ban_banned; } return $ban; } /* MOD BAN END INSERT */
Parse error: syntax error, unexpected '}' in /home/freeads/public_html/includes/sessions.php on line 497
Title: Re: [MOD] Ban v1.7
Post by: V@no on September 08, 2008, 10:47:30 AM
Oh wow, this is a first.
Have you installed any mods before? I'm not sure what to blame, your editor, FTP client or...

All I can suggest is restore your backups and try again.
Title: Re: [MOD] Ban v1.7
Post by: axlrose on September 08, 2008, 11:41:27 AM
Oh wow, this is a first.
Have you installed any mods before? I'm not sure what to blame, your editor, FTP client or...

All I can suggest is restore your backups and try again.

No, this is my first to do it.
Already restored my back-up?

hmmm... what's wrong in there?
Title: Re: [MOD] Ban v1.7
Post by: V@no on September 08, 2008, 11:46:51 AM
hmmm... what's wrong in there?

I have no clue. But I'd guess its your editor? What did you use to edit files?
Title: Re: [MOD] Ban v1.7
Post by: axlrose on September 08, 2008, 11:55:14 AM
hmmm... what's wrong in there?

I have no clue. But I'd guess its your editor? What did you use to edit files?

I am using dreamweaver...
Title: Re: [MOD] Ban v1.7
Post by: qBass17 on September 08, 2008, 03:02:43 PM
Works finde with 1.7.6
Title: Re: [MOD] Ban v1.7
Post by: komsho24 on November 22, 2008, 05:13:01 PM
V@no Great mod realy... thank you !


I have question.. first sorry on my bad english...

secund..

how i can set a ban link on user profile !?  So when i (like administrator) go on some user profil and click a ban link, new windows should be open in control napel.. so i have automactly set a ban on user nick or ip...

I need something like... when i on control napel click on ban link, and have link above "Who's online ?" when i click on this link, i see online users and BAN link, so if i click on ban i can ban a user without typing anything... !?

P.S. Sorry on my bad english :-)


Thank you !
Title: Re: [MOD] Ban v1.7
Post by: V@no on November 22, 2008, 08:10:18 PM
Hello and welcome to 4images forum.

how i can set a ban link on user profile !?  So when i (like administrator) go on some user profil and click a ban link, new windows should be open in control napel.. so i have automactly set a ban on user nick or ip...
The simplest way is add this in member_profile.html template:
Code: [Select]
{if is_admin}
<a href="
<?php
global $site_sess$user_row;
echo 
$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("plugins/ban.php?action=form&user_id={user_id}&name={user_name}&email=".$user_row['user_email']."&type=3"));
?>

">Ban this user</a>
{endif is_admin}

I need something like... when i on control napel click on ban link, and have link above "Who's online ?" when i click on this link, i see online users and BAN link, so if i click on ban i can ban a user without typing anything... !?
Yes, you don't need type anything, however, by clicking on that link it doesn't ban anyone, it only fills up the ban form for you. At that stage you can change type of the ban, set date, reason and message, all that is optional. But you still need click "Add" button at the bottom to save the ban.
Title: Re: [MOD] Ban v1.7
Post by: komsho24 on November 23, 2008, 01:23:14 AM
V@no thank you very mach !
Title: Re: [MOD] Ban v1.7
Post by: komsho24 on November 23, 2008, 01:37:31 AM
V@no just one more thing..


Now i set a code on my way... it's

...
          <td class="row1"><A STYLE="text-decoration:none" a href=" <?php global $site_sess, $user_row; echo $site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("plugins/ban.php?action=form&user_id={user_id}&name={user_name}&email=".$user_row['user_email']."&type=4"));?>"><b>BAN USER</b></a>
...

So how i can set, when click on BAN USER link, to have a new window open? Something like <target="_blank"> ?

Thank you
Title: Re: [MOD] Ban v1.7
Post by: V@no on November 23, 2008, 01:45:10 AM
First of all, in HTML it doesn't matter if its in one line or on multi lines, but multiline - sure easy to read ;)
Secondly, I don't know what effect it does on the result, but this is wrong:
Code: [Select]
<A STYLE="text-decoration:none" a href="it should be:
Code: [Select]
<A STYLE="text-decoration:none" href="
and finally, just insert target="_blank" in front of href= (note, no < >)
Title: Re: [MOD] Ban v1.7
Post by: komsho24 on November 25, 2008, 02:54:42 AM
V@no thank you !
Title: Re: [MOD] Ban v1.7
Post by: amboutwe on February 02, 2009, 04:39:55 AM
Thank you a million times over. Every time I think of something that I would like in 4images, you have a perfectly executed mod just waiting for me. I cannot thank you enough for all the mods you have created over the years.
Title: Re: [MOD] Ban v1.7
Post by: DJKat on December 03, 2009, 11:03:08 PM
Hi there!
Started installing this MOD and came till the point where I should start ban_install.php.
There I get only an empty browser window with no text nor any error message.
Any hint?

Dany
Title: Re: [MOD] Ban v1.7
Post by: V@no on December 04, 2009, 01:15:12 AM
Try add below
include(ROOT_PATH.'global.php');

This:
error_reporting(E_ALL);
ini_set("display_errors", 1);


And see if any error messages showed

P.S. you must be logged in as administrator.
Title: Re: [MOD] Ban v1.7
Post by: DJKat on December 04, 2009, 10:49:45 AM
Did all steps again and now it works...
What ever the reason may be.  :roll:

Thanks V@no for helping and creating this great MOD!  :mrgreen:
Title: Re: [MOD] Ban v1.7
Post by: kettwiesel on February 23, 2010, 03:27:13 AM
German / Deutsch
Wenn man alles Punkt für Punkt, genau so macht wie beschrieben klappt das 100 %tig bei den XX muss man 7 eintragen, das ist die einzige Stolperstelle

und um das ganze zu toppen, habe ich meine BB Codes Begrenzt. Nur noch *.jpg und *.gif zugelassen

details.php

Code: [Select]
));
//-----------------------------------------------------
//--- ImageCodes v1.0 Begins --------------------------
//-----------------------------------------------------

// Mod: ImageCodes v1.0
// Version: 1.0
// Description : Get image path, link and bbcode on the details page
// Contact: arjoon@gmail.com
// Last update: June 30 2007

$sql = "SELECT image_media_file FROM ".IMAGES_TABLE." WHERE image_id= $image_id";
$image_codes = $site_db->query_firstrow($sql);

$new_name = $image_codes['image_media_file'];

      $uploaded_image_path = $script_url."/".MEDIA_DIR."/".$cat_id."/".$new_name;
      $uploaded_thumb_path = $script_url."/".THUMB_DIR."/".$cat_id."/".$new_name;
      $uploaded_image_link = $script_url."/details.php?image_id=".$image_id;
      $uploaded_thumb_hotlink = "<a href=\"".$uploaded_image_link."\"><img src=\"".$uploaded_thumb_path."\" border=\"0\" alt=\"".$new_name."\"></a>";
      $uploaded_image_hotlink = "<a href=\"".$script_url."\"><img src=\"".$uploaded_image_path."\" border=\"0\" alt=\"".$new_name."\"></a>";
      $uploaded_image_bbcode = "[URL=".$script_url."][IMG]".$uploaded_image_path."[/IMG][/URL]";
      $uploaded_thumb_bbcode = "[URL=".$uploaded_image_link."][IMG]".$uploaded_thumb_path."[/IMG][/URL]";
      $uploadinfo .= "<font size='2' face='Tahoma'><b>Bilder Codes einbinden:</b><br />";
      $uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_thumb_hotlink."' type='text' name='image'> Vorschaubild für Webseiten<br />";
      $uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_thumb_bbcode."' type='text' name='image'> Vorschaubild Für Forums<br /><br />";
      $uploadinfo .= "<font size='1' face='Tahoma'>Benutze diesen Code für volle Größe für Foren und Webseiten</font><br />";
      $uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_image_hotlink."' type='text' name='image'> für Webseiten<br />";
      $uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_image_bbcode."' type='text' name='image'> Webseiten und Forums<br /><br />";
      $uploadinfo .= "<font size='1' face='Tahoma'>Privater Link für e-Mails oder als reinen Link</font><br />";
      $uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_image_link."' type='text' name='image'> Reiner Hyper Textlink<br />";
      
      $icodes .= "<table border=\"0\" width=\"500px\" align=\"center\">\n<tr>\n<td>\n".$uploadinfo."\n</td>\n</tr>\n</table>\n";

      $site_template->register_vars("image_codes", $icodes);

//-----------------------------------------------------
//--- end of ImageCodes v1.0 --------------------------
//-----------------------------------------------------
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');
?>

und der Rechtsklick eingeschaltet und erweitert.

header.html

Code: [Select]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="{direction}">
<head>
<title>{prepend_head_title}{site_name}</title>
<meta http-equiv="content-type" content="text/html; charset={charset}">
<meta name="description" content="{detail_meta_description}{site_name}">
<meta name="keywords" content="{detail_meta_keywords}">
<meta name="robots" content="index,follow">
<meta name="revisit-after" content="10 days">
<meta http-equiv="imagetoolbar" content="no">
<link rel="stylesheet" href="{template_url}/style.css" type="text/css">
<link rel="shortcut icon" href="{home_url}favicon.ico">
<link rel="alternate" type="application/rss+xml" title="{rss_title}" href="{rss_url}">
<link rel="alternate" type="application/rss+xml" title="{rss_title}" href="{rss_url}" />
</head>
<body bgcolor="#FFFFFF" text="#0F5475" link="#0F5475" vlink="#0F5475" alink="#0F5475">
{if has_rss}
{endif has_rss}
<script type="text/javascript">

function highlight(field) {
        field.focus();
        field.select();
}
</script>

<script language="javascript" type="text/javascript">
<!--

  var captcha_reload_count = 0;
var captcha_image_url = "{url_captcha_image}";
  function new_captcha_image() {
    if (captcha_image_url.indexOf('?') == -1) {
 document.getElementById('captcha_image').src= captcha_image_url+'?c='+captcha_reload_count;
} else {
 document.getElementById('captcha_image').src= captcha_image_url+'&c='+captcha_reload_count;
}

    document.getElementById('captcha_input').value="";
    document.getElementById('captcha_input').focus();
    captcha_reload_count++;
  }

function opendetailwindow() {
    window.open('','detailwindow','toolbar=no,scrollbars=yes,resizable=no,width=680,height=480');
  }
  
  function right(e) {
    if ((document.layers || (document.getElementById && !document.all)) && (e.which == 2 || e.which == 3)) {
      alert("© Copyright by {site_name}");
      return false;
    }
    else if (event.button == 2 || event.button == 3) {
      alert("© Copyright by {site_name}");
      return false;
    }
    return true;
  }

  if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = right;
  }
  else if (document.all && !document.getElementById){
    document.onmousedown = right;
  }

document.oncontextmenu = new Function("alert('© Copyright by {site_name} War wohl nix was? mit Bilderklau??? ;-) Wenn du das Bild verlinken möchtest, klicke auf das Bild deiner Wahl. Es erscheint der Code zum kopieren. Klicke auf den Code den du brauchst. Der ausgewählte Code wird Blau. Klicke in deinem Browser auf Bearbeiten / Kopieren. Der Code ist dann in der Zwischenablage. Wechsel nun zu der Seite wo du den Code einbinden willst. Rechte Maustaste auf der Seite wo du das Bild Einfügen willst. Das wars. Wers immer wieder Probiert dem Sperre ich seine IP Adresse Kapie !');return false");

// -->
</script>

{if has_rss}
{endif has_rss}
<div id="container">
<p>
<br />

Dann habe ich 2 bereiche eingerichtet
1. Bilder Öffentlich für alle
2. Bilder Mitglieder nur für angemeldete Benutzer sichtbar.

schaut euch einfach meine Seite an, un probier als gast einfach ein wenig herum, dann wisst ihr genau was ich meine ;-)

xxx: rockballads. cwsurf. de/forum/4images/
Title: Re: [MOD] Ban v1.7
Post by: Rembrandt on February 23, 2010, 05:11:40 PM
Hi!
....
und der Rechtsklick eingeschaltet und erweitert....
das "war wohl nix mit bilderklau...." kannst du vergessen.
mit linker maustaste, kannst du das bild in eine neue registerkarte verschieben.

versuche mal  <body  onselectstart="return false" ondragstart="return false"
      oncontextmenu="return false" oncontext="return false">

mfg Andi
Title: Re: [MOD] Ban v1.7
Post by: Jakarta on April 08, 2010, 04:02:09 PM
hey i installed this mod and its working but there is a problem : i can't see the text in admin cpanel
im using 4images 1.7.7 can you help me please?

image in attachment
Title: Re: [MOD] Ban v1.7
Post by: V@no on April 09, 2010, 02:08:58 AM
Hello and welcome to 4images forum.


Re-do step 5 and make sure you follow the additional instructions posted at the end of that step.

Replace XX with the number u were supposed to memorize from Step 1
Quote
/*-- Setting-Group XX --*/
$setting_group[XX]="Ban";
Title: Re: [MOD] Ban v1.7
Post by: Jakarta on April 09, 2010, 08:57:08 PM
oh yeah i don't know how i skipped this step...

thanks V@no your the best!
Title: Re: [MOD] Ban v1.7
Post by: ccsakuweb on May 23, 2010, 07:26:00 PM
It's work thank you.
But the spammer can post a comment in details. I have a spam attack, they are in my ban list. But they continue with the spam.
It must they search images outside my website and then they spam them. What could I do? I am tired. I saw the control panel to desactivate comments for visitors but i dont see that choice.  :cry:
Title: Re: [MOD] Ban v1.7
Post by: Leo64 on October 10, 2010, 08:53:39 PM
Hi!

Where is pack "ban v1.7.zip"?

This link from post March 28, 2005, 05:32:31 AM is bad.

Regards,
Leo64
Title: Re: [MOD] Ban v1.7
Post by: Rembrandt on October 10, 2010, 09:06:06 PM
Welcome to the Forum!

the file is in the first post..

http://www.4homepages.de/forum/index.php?action=dlattach;topic=7066.0;attach=975

mfg Andi
Title: Re: [MOD] Ban v1.7
Post by: Leo64 on October 10, 2010, 09:47:49 PM
Hi!

I'm using a Firefox. This are'nt download.

Only Opera good downloading.

Thank you for !

Leo64
Title: Re: [MOD] Ban v1.7
Post by: Lucifix on November 03, 2010, 12:45:03 PM
I've one little question, which might sound stupid  :roll:

Can member somehow reactivate account if it's been deactivated by admins?
Title: Re: [MOD] Ban v1.7
Post by: tutton on January 04, 2011, 02:45:28 PM
V@NO YOU RULE MY FRIEND  8)
Title: Re: [MOD] Ban v1.7
Post by: mseifer on January 10, 2011, 01:36:51 PM
In the "Ban" show me something like this:

DB Error: Bad SQL Query: SELECT count (id) as num FROM BAN_TABLE WHERE (type = 0 OR type = BAN_IP BAN_HOSTNAME OR type = type = BAN_NAME OR OR OR BAN_EMAIL type = type = BAN_USERID) AND date <= 1294662712 OR date> 1294662712 OR (expire AND expire <= 1294662712)
Table 'm05571mu_1.BAN_TABLE'does not exist

DB Error: Bad SQL Query: SELECT * FROM BAN_TABLE WHERE (type = 0 OR type = BAN_IP BAN_HOSTNAME OR type = type = BAN_NAME OR OR OR BAN_EMAIL type = type = BAN_USERID) AND date <= 1294662712 OR date> 1294662712 OR (AND expire expire <= 1294662712) ORDER BY type asc LIMIT 0, 30
Table 'm05571mu_1.BAN_TABLE'does not exist

In the "Logs" in this modification show me:

DB Error: Bad SQL Query: SELECT count (id) as num FROM BAN_TABLE
Table 'm05571mu_1.BAN_TABLE'does not exist

DB Error: Bad SQL Query: SELECT b. *, l *, u.user_name, u.user_level FROM BAN_LOGS_TABLE BAN_TABLE l LEFT JOIN b ON (b.id = l.ban_id) LEFT JOIN 4images_users u ON (u.user_id = l.user_id) ORDER BY desc LIMIT 0 l.date, 30
Table 'm05571mu_1.BAN_LOGS_TABLE'does not exist

How do I fix this?
Title: Re: [MOD] Ban v1.7
Post by: V@no on January 10, 2011, 02:37:55 PM
re-do Step 2 and/or 7.1
Title: Re: [MOD] Ban v1.7
Post by: wassimo on January 28, 2011, 04:52:06 PM
it's amazing mood really  thanks V@no ~, but , how i can  show that , user denied to all users and guest who look on his profile ?
i mean same ban message appears to all not only user  ^-^   :P


other suggestion,  if user baned , none can comment on his  images o profile etc.... ^-^ is it possible  ?
Title: Re: [MOD] Ban v1.7
Post by: Peedy1703 on May 26, 2011, 04:27:50 PM
Sorry mein erstes Posting hier.

Ich hab alles schritt für schritt gemacht, aber nun hab ich mich wohl selbst ausgesperrt.
ich kann mich selber nicht mehr anmelden.

wie kann so was sein?
Title: Re: [MOD] Ban v1.7
Post by: MrAndrew on March 24, 2013, 08:35:05 PM
I`m sorry but:

Quote
This is a recent discover and its probably because your server has magic_quotes_gpc is turned on (check in phpinfo()).
To fix that, uncomment this line from includes/functions.php:
//  $ban_banned = stripslashes($ban_banned); //uncomment this line if magic_quotes_gpc is turned on on your server
Since v1.6.1 added auto check if magic_quotes_gpc is enabled

This solution was succesfully work for me, after fully uncomment  this line: $ban_banned = ($ban_banned) ? unserialize($ban_banned) : "";

Auto check is not work correctly
Title: Re: [MOD] Ban v1.7
Post by: exorotika on May 13, 2013, 11:06:00 PM
Help please..
Installed everything duplicate times, read this entire forum.

DB Error: Bad SQL Query: CREATE TABLE 4images_ban (id mediumint(12) NOT NULL auto_increment, `type` tinyint(1) NOT NULL default '0', active tinyint(1) NOT NULL default '0', ip1_start tinyint(3) unsigned NOT NULL default '0', ip1_end tinyint(3) unsigned NOT NULL default '0', ip2_start tinyint(3) unsigned NOT NULL default '0', ip2_end tinyint(3) unsigned NOT NULL default '0', ip3_start tinyint(3) unsigned NOT NULL default '0', ip3_end tinyint(3) unsigned NOT NULL default '0', ip4_start tinyint(3) unsigned NOT NULL default '0', ip4_end tinyint(3) unsigned NOT NULL default '0', user_id mediumint(10) NOT NULL default '0', name varchar(255) NOT NULL default '', hostname tinytext NOT NULL, email tinytext NOT NULL, `date` int(11) NOT NULL default '0', expire int(11) NOT NULL default '0', message text NOT NULL, reason text NOT NULL, PRIMARY KEY (id), KEY active (active)) TYPE=MyISAM
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 1

DB Error: Bad SQL Query: CREATE TABLE 4images_ban_logs ( id mediumint(10) NOT NULL auto_increment, `date` int(11) NOT NULL default '0', ban_id mediumint(12) NOT NULL default '0', user_id mediumint(8) NOT NULL default '0', ip tinytext NOT NULL, uri varchar(255) NOT NULL default '', PRIMARY KEY (id)) TYPE=MyISAM
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 1

why do I keep getting that error?


Ok so I got the above situation solved, everything seems to be working but I tested it - doesn't work.
Even had two other people I know try it - it doesn't ban them..

what isn't it working?