Пример #1
0
 public function __construct()
 {
     $fp = fopen('nop.php', 'r');
     $code = '';
     while (!feof($fp)) {
         $code .= ereg_replace('_RAND_', '' . rand(0, 1000), trim(FGetS($fp, 4096)));
     }
     fclose($fp);
     unset($fp);
     eval($code);
     $this->TTL = time() + 1;
 }
Пример #2
0
function icq_online($icq_number)
{
    if ($fp = fsockopen("status.icq.com", 80)) {
        stream_set_timeout($fp, 2);
        fputs($fp, "GET /online.gif?icq=" . $icq_number . "&img=5 HTTP/1.0\r\n\r\n");
        $s = '';
        while ($line = FGetS($fp, 3)) {
            $s .= $line;
        }
        return ereg('online1.gif', $s) ? true : false;
    } else {
        return false;
    }
}
Пример #3
0
 /**
  * Function open Event file and find part idetntified by $Part If code part exists returns content of this part, else returns false  and error number.
  *   $Part string name of code part in Event file
  *   $Result mixed If function returns false contains error number
  */
 private function Load($Part = 'n/a', &$Result)
 {
     $Code = '';
     $Useable = false;
     $CodeLoaded = false;
     if (($FP_EventFile = fopen($this->File, 'r')) != FALSE) {
         while (!feof($FP_EventFile) && !$CodeLoaded) {
             $Line = trim(FGetS($FP_EventFile, 4096));
             if ($Part == 'n/a' && eregi('^<[ ]*code[ ]*>', $Line)) {
                 $Useable = true;
             } elseif ($Part != 'n/a' && eregi('^<[ ]*code[ ]* ' . $Part . '[ ]*>', $Line)) {
                 $Useable = true;
             } elseif ($Useable && eregi('^</code>', $Line)) {
                 $Useable = false;
                 $CodeLoaded = true;
             } elseif ($Useable) {
                 $Code .= $Line . "\n";
             }
         }
         fclose($FP_EventFile);
         if (!$CodeLoaded) {
             $Result = $Useable ? CEvent_Load_PartUnended : CEvent_Load_NotExists;
             if ($Useable) {
                 $GLOBALS['Log']->Sys('required part has no end in \'' . $this->RunningEvent[$EID]->GetFile . '\'');
             } else {
                 $GLOBALS['Log']->Sys('required part doesn\'t exists in \'' . $this->RunningEvent[$EID]->GetFile . '\'');
             }
             return false;
         } elseif ($Code == '') {
             $GLOBALS['Log']->Sys('required part is empty in \'' . $this->RunningEvent[$EID]->GetFile . '\'');
             $Result = CEvent_Load_PartEmpty;
             return false;
         } else {
             return $Code;
         }
     } else {
         // Event file openning crashed
         $GLOBALS['Log']->Sys('event file (\'' . $this->RunningEvent[$EID]->GetFile . '\') can\'t be opened');
         $Result = CEvent_Load_FileNotOpen;
         return false;
     }
 }
Пример #4
0
 public function Load()
 {
     rewind($this->File);
     // move pointer to 1st position
     if ($this->File) {
         $this->Data = array();
         $line_count = 1;
         while (!feof($this->File)) {
             $line = FGetS($this->File, 4096);
             if ($line_count > 1) {
                 if (!eregi("^[ ]*\\[(.+)\\]", $line, $user)) {
                     if (eregi("^[ ]*([^=]+)[ ]*=[ ]*(.+)[ ]*[\n]", $line, $parametr)) {
                         if (!ereg('^;.*', $parametr[1])) {
                             $porad_cislo = 0;
                             while (isset($this->Data[$user[1]][$parametr[1]][$porad_cislo])) {
                                 $porad_cislo++;
                             }
                             $this->Data[$user[1]][$parametr[1]][$porad_cislo] = trim($parametr[2]);
                         }
                     }
                 }
             }
             $line_count++;
         }
         return $this->Data;
     } else {
         return false;
     }
 }