Ejemplo n.º 1
0
 private static function renderEvent($event, $read = 0)
 {
     $eventInfo = array();
     $eventInfo['attribute:id'] = $event->getId();
     $eventInfo['attribute:type-id'] = $event->getTypeId();
     $eventInfo['attribute:read'] = (int) $read;
     $eventDate = new umiDate($event->getDate());
     $eventInfo['attribute:timestamp'] = $eventDate->getDateTimeStamp();
     $eventInfo['attribute:date'] = $eventDate->getFormattedDate('d.m.Y H:i');
     $params = $event->getParams();
     $eventInfo['node:value'] = ulangStream::getLabelSimple($event->getTypeId() . "_msg", $params);
     return $eventInfo;
 }
Ejemplo n.º 2
0
 public function links()
 {
     $regedit = regedit::getInstance();
     $login = trim($regedit->getVal("//modules/seo/megaindex-login"));
     $password = trim($regedit->getVal("//modules/seo/megaindex-password"));
     if (CURRENT_VERSION_LINE === 'demo' && getRequest("host") == '') {
         $host = 'umi-cms.ru';
     } else {
         $host = (string) strlen(getRequest("host")) ? getRequest("host") : getServer('HTTP_HOST');
     }
     $params = array('login' => $login, 'password' => $password, 'url' => $host, 'method' => 'get_backlinks', 'output' => 'json');
     $headers = array("Content-type" => "application/x-www-form-urlencoded");
     $response = umiRemoteFileGetter::get('http://api.megaindex.ru/?' . http_build_query($params), false, $headers);
     $result = json_decode($response);
     $this->setDataType("settings");
     $this->setActionType("view");
     $preParams = array("config" => array("url:http_host" => $host));
     $links = array('nodes:link' => array());
     $errors = array('nodes:error' => array());
     if (!is_array($result)) {
         $result = array($result);
     }
     foreach ($result as $link) {
         if (!empty($link->error)) {
             $error = $link->error;
             if ($error == "Сайт не проиндексирован! Добавьте пожалуйста на индексацию.") {
                 $error = ulangStream::getLabelSimple('label-seo-noindex', array($host));
             }
             $errors['nodes:error'][] = array('node:value' => $error);
         } else {
             $links['nodes:link'][] = array('attribute:vs_from' => $link->vs_from, 'attribute:vs_to' => $link->vs_to, 'attribute:tic_from' => $link->tic_from, 'attribute:tic_to' => $link->tic_to, 'attribute:text' => $link->text, 'attribute:noi' => $link->noi, 'attribute:nof' => $link->nof);
         }
     }
     $data = $this->prepareData($preParams, 'settings');
     $data['links'] = $links;
     $data['errors'] = $errors;
     $this->setData($data);
     return $this->doData();
 }
Ejemplo n.º 3
0
 private static function renderEvent($v4119639092e62c55ea8be348e4d9260d, $vecae13117d6f0584c25a9da6c8f8415e = 0)
 {
     $vce3280d763b11208823de6adaa1d80dd = array();
     $vce3280d763b11208823de6adaa1d80dd['attribute:id'] = $v4119639092e62c55ea8be348e4d9260d->getId();
     $vce3280d763b11208823de6adaa1d80dd['attribute:type-id'] = $v4119639092e62c55ea8be348e4d9260d->getTypeId();
     $vce3280d763b11208823de6adaa1d80dd['attribute:read'] = (int) $vecae13117d6f0584c25a9da6c8f8415e;
     $v8314f7e7b648c91b83817a870b5857a3 = new umiDate($v4119639092e62c55ea8be348e4d9260d->getDate());
     $vce3280d763b11208823de6adaa1d80dd['attribute:timestamp'] = $v8314f7e7b648c91b83817a870b5857a3->getDateTimeStamp();
     $vce3280d763b11208823de6adaa1d80dd['attribute:date'] = $v8314f7e7b648c91b83817a870b5857a3->getFormattedDate('d.m.Y H:i');
     $v21ffce5b8a6cc8cc6a41448dd69623c9 = $v4119639092e62c55ea8be348e4d9260d->getParams();
     $vce3280d763b11208823de6adaa1d80dd['node:value'] = ulangStream::getLabelSimple($v4119639092e62c55ea8be348e4d9260d->getTypeId() . "_msg", $v21ffce5b8a6cc8cc6a41448dd69623c9);
     return $vce3280d763b11208823de6adaa1d80dd;
 }