Source Code for Me (s-c.me)

Allows you to paste souce code to blogs! Adapted for Twitter! Here is Search Form in case you missed your code.
Tags: Php,$arFields,$USER_NAME,$rs,$ar, Created At: 10/24/2016 8:08:09 PMViews:

HTML view:
Copy Source | Copy HTML
  1. // регистрируем обработчик 
  2. AddEventHandler("subscribe", "BeforePostingSendMail", Array("CatchSubscriter", "beforePostingSendMailHandler"));
  3. class CatchSubscriter{
  4.     // создаем обработчик события "BeforePostingSendMail" 
  5.     function beforePostingSendMailHandler(&$arFields){
  6.         //$USER_NAME = "Подписчик"; 
  7.         //Попробуем найти подписчика. 
  8.         $rs = CSubscription::GetByEmail($arFields["EMAIL"]);
  9.         if($ar = $rs->Fetch()){
  10.             //echo "<p>[</p>";
  11.             //print_r($ar);
  12.             //echo "<p>]</p>";
  13.             $arFields["BODY"] = str_replace("#CONFIRM_CODE#", $ar["CONFIRM_CODE"], $arFields["BODY"]);
  14.             $arFields["BODY"] = str_replace("#ID#", $ar["ID"], $arFields["BODY"]);
  15.             $arFields["BODY"] = str_replace("#EMAIL#", $ar["EMAIL"], $arFields["BODY"]);
  16.         }
  17.         //$arFields["BODY"] = str_replace("#NAME#", $USER_NAME, $arFields["BODY"]); 
  18.         return $arFields;
  19.     }
  20. }

Based on Manoli.Net's CodeFormatter. Made by Topbot (c) 2008-2017