Автор Тема: проблема с хаком Auto Send PM для IBF 1.1  (Прочитано 2342 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн alex007

  • Фанат форума
  • Ветеран
  • *****
  • Сообщений: 835
  • +0/-0
  • 0
    • Просмотр профиля
    • http://www.russians-in-london.co.uk/
проблема с хаком Auto Send PM для IBF 1.1
« : 01 Апреля 2003, 18:52:11 »
Привет,

Установил хак Автоматической отсылки PM пользователю, когда он зарегистрируеться, все работает, да вот в Register.php выдает ошибку после заполнения формы.

Вот хак код:
Цитировать
/---------------------------------------------------/
// Auto Send PM to New Users
// Adapted for IBF 1.1 Beta 4 by RockStarCrest (rockstarcrest@yahoo.ca
// Originally written for 1.0.1 by SirReal (SirReal@clangrounds.com)
//
// When a user registers they will receive an
// editable welcome message pm from the admin
/---------------------------------------------------/

/-----------------------------------------/
/Step 1: Open sources/Register.php and find near line 413:
/-----------------------------------------/

      $member = array(
                   \'id\'              => $member_id,
                   \'name\'            => $in_username,
                   \'password\'        => $in_password,
                   \'email\'           => $in_email,
                   \'mgroup\'          => $mem_group,
                   \'posts\'           => 0,
                   \'avatar\'          => \'noavatar\',
                   \'joined\'          => time(),
                   \'ip_address\'      => $ibforums->input[\'IP_ADDRESS\'],
                   \'time_offset\'     => $ibforums->vars[\'time_offset\'],
                   \'view_sigs\'       => 1,
                   \'email_pm\'        => 1,
                   \'view_img\'        => 1,
                   \'view_avs\'        => 1,
                   \'allow_post\'      => 1,
                   \'view_pop\'        => 1,
                   \'vdirs\'           => "in:Inbox|sent:Sent Items",
                   \'msg_total\'       => 0,
                   \'new_msg\'         => 0,
                   \'coppa_user\'      => $coppa,
                  );

  -----------------------------------------
  REPLACE that with:
  -----------------------------------------

      if ($ibforums->vars[\'pm_send\'] == \'1\') {
         $DB->query("SELECT MAX(msg_id) as msg_msg_id FROM ibf_messages");
         $r = $DB->fetch_row();
         $msg_msg_id = $r[\'msg_msg_id\'] + 1;
         $now = time();
         $new_subject = str_replace("%USER%",$in_username,$ibforums->vars[\'pm_subject\']);
         $new_message = str_replace("%USER%",$in_username,$ibforums->vars[\'pm_msg\']);
         
         $DB->query("INSERT INTO ibf_messages VALUES ($msg_msg_id, $now, 0, \'$new_subject\', \'$new_message\', \'{$ibforums->vars[\'pm_id\']}\', \'in\', \'$member_id\', \'$member_id\', NULL, NULL, NULL, 0, NULL)");
      $member = array(
                   \'id\'              => $member_id,
                   \'name\'            => $in_username,
                   \'password\'        => $in_password,
                   \'email\'           => $in_email,
                   \'mgroup\'          => $mem_group,
                   \'posts\'           => 0,
                   \'avatar\'          => \'noavatar\',
                   \'joined\'          => time(),
                   \'ip_address\'      => $ibforums->input[\'IP_ADDRESS\'],
                   \'time_offset\'     => $ibforums->vars[\'time_offset\'],
                   \'view_sigs\'       => 1,
                   \'email_pm\'        => 1,
                   \'view_img\'        => 1,
                   \'view_avs\'        => 1,
                   \'allow_post\'      => 1,
                   \'view_pop\'        => 1,
                   \'vdirs\'           => "in:Inbox|sent:Sent Items",
                   \'msg_total\'       => 1, //New Msg on register
                   \'new_msg\'         => 1,
                   \'msg_from_id\'     => $ibforums->vars[\'pm_id\'],
                   \'msg_msg_id\'      => $msg_msg_id,
                   \'show_popup\'      => 1,
                   \'coppa_user\'      => $coppa,
                  );
} else {
      $member = array(
                   \'id\'              => $member_id,
                   \'name\'            => $in_username,
                   \'password\'        => $in_password,
                   \'email\'           => $in_email,
                   \'mgroup\'          => $mem_group,
                   \'posts\'           => 0,
                   \'avatar\'          => \'noavatar\',
                   \'joined\'          => time(),
                   \'ip_address\'      => $ibforums->input[\'IP_ADDRESS\'],
                   \'time_offset\'     => $ibforums->vars[\'time_offset\'],
                   \'view_sigs\'       => 1,
                   \'email_pm\'        => 1,
                   \'view_img\'        => 1,
                   \'view_avs\'        => 1,
                   \'allow_post\'      => 1,
                   \'view_pop\'        => 1,
                   \'vdirs\'           => "in:Inbox|sent:Sent Items",
                   \'msg_total\'       => 0,
                   \'new_msg\'         => 0,
                   \'coppa_user\'      => $coppa,
                  );
}

-----------------------------------------
Close sources/Register.php
-----------------------------------------

-----------------------------------------
Step 2: Open sources/admin/ad_settings.php and find near line 81:
-----------------------------------------

         case \'url\':
            $this->url();
            break;
         case \'dourl\':
            $this->save_config( array ( \'html_dir\',\'safe_mode_skins\', \'board_name\',\'board_url\',\'home_name\',\'home_url\', \'disable_gzip\',
                                  \'html_url\',\'upload_url\', \'upload_dir\', \'print_headers\', \'header_redirect\', \'debug_level\', \'sql_debug\') );
            break;

  -----------------------------------------
  REPLACE that with:
  -----------------------------------------

         case \'url\':
            $this->url();
            break;
         case \'dourl\':
            $this->save_config( array ( \'html_dir\',\'safe_mode_skins\', \'board_name\',\'board_url\',\'home_name\',\'home_url\', \'disable_gzip\',
                                  \'html_url\',\'upload_url\', \'upload_dir\', \'print_headers\', \'header_redirect\', \'debug_level\', \'sql_debug\', \'pm_send\', \'pm_id\', \'pm_subject\', \'pm_msg\' ) );
            break;

  -----------------------------------------
  then find near line 922:
  -----------------------------------------
$ADMIN->html .= $SKIN->add_td_row( array( "Debug level" ,
                                $SKIN->form_dropdown( "debug_level",
                                                   array(
                                                         0 => array( 0, \'0: None - Don\\\'t show any debug information\' ),
                                                         1 => array( 1, \'1: Show server load, page generation times and query count\' ),
                                                         2 => array( 2, \'2: Show level 1 (above) and GET and POST information\'),
                                                         3 => array( 3, \'3: Show level 1 + 2 and database queries\'),
                                                        ),
                                                   $INFO[\'debug_level\']  )
                         )      );
                        
                        
      $ADMIN->html .= $SKIN->add_td_row( array( "ENABLE SQL Debug Mode?
(If yes, add \'&debug=1\' to any page to view mySQL debug info)" ,
                                $SKIN->form_yes_no( "sql_debug", $INFO[\'sql_debug\'] )
                         )      );

  -----------------------------------------
  and below that ADD:
  -----------------------------------------

      //-----------------------------------------------------------------------------------------------------------                  
      
      $ADMIN->html .= $SKIN->add_td_basic( \'Auto-PM New Users Settings\', \'left\', \'catrow2\' );
      
      //-----------------------------------------------------------------------------------------------------------

      // START PM to new users mod
      $ADMIN->html .= $SKIN->add_td_row( array( "Send PM to new users?" ,
                                $SKIN->form_yes_no( "pm_send", $INFO[\'pm_send\'] )
                         )      );
                        
      $ADMIN->html .= $SKIN->add_td_row( array( "Registration PM From id
This must be the numerical memberID" ,
                                $SKIN->form_input( "pm_id", $INFO[\'pm_id\']  )
                         )      );
                        
      $ADMIN->html .= $SKIN->add_td_row( array( "PM Subject" ,
                                $SKIN->form_input( "pm_subject", $INFO[\'pm_subject\']  )
                         )      );
                        
      $ADMIN->html .= $SKIN->add_td_row( array( "PM Sent to New Members
use %USER% in the message and it will be replaced by their username" ,
                                $SKIN->form_textarea( "pm_msg", $INFO[\'pm_msg\']  )
                         )      );
      // END PM to new users mod
-----------------------------------------
Close sources/admin/ad_settings.php
-----------------------------------------


-----------------------------------------
Step 3: Login to Admin CP and goto Board Settings > Basic Config
-----------------------------------------
edit the 4 new settings to suit your needs
Send PM to new users? (YES/NO)- this turns the entire mod on and off
Registration PM From id - who do you want the PM to come from (MUST BE THE NUMERICAL ID!)
PM Subject - the subject line of the new pm
PM Sent to New Members - the main text of the pm
-----------------------------------------
ALL DONE !!
-----------------------------------------


А выдает слудющию шибку:
Warning: Compilation failed: nothing to repeat at offset 0 in forum/sources/Register.php on line 666

А в этой строке:
if (preg_match( "/$n/i", $in_username ))
 
Как решить эту проблему?
Жду Ответов.

С Уважением,
Алекс.
Русские-в-Лондоне. Как они там? Интересно. Инфо (FAQ), Форум и Магазин

IBR Team

  • Гость
проблема с хаком Auto Send PM для IBF 1.1
« Ответ #1 : 09 Апреля 2003, 11:29:48 »
ты наверно что-то не так ставил. У нас кто ставил вроде все прошло нормально.

Оффлайн alex007

  • Фанат форума
  • Ветеран
  • *****
  • Сообщений: 835
  • +0/-0
  • 0
    • Просмотр профиля
    • http://www.russians-in-london.co.uk/
проблема с хаком Auto Send PM для IBF 1.1
« Ответ #2 : 09 Апреля 2003, 19:34:17 »
IBR Team

Нашел и исправил давно эту ошибку, все правильно я установил просто бан лист не правильно заполнил использовав *
Русские-в-Лондоне. Как они там? Интересно. Инфо (FAQ), Форум и Магазин

 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28