daydiff

logo.png decoded

Jul 3rd, 2014
785
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 60.19 KB | None | 0 0
  1. <?
  2.  
  3. function _527006668($i){
  4. $a = array (
  5.   0 => '_TRUSTLINK_USER',
  6.   1 => '_TRUSTLINK_USER',
  7.   2 => '0a70cdb962f17a3f437983921fa02647',
  8.   3 => '',
  9.   4 => 'host',
  10.   5 => 'host',
  11.   6 => 'use_server_array',
  12.   7 => 'use_server_array',
  13.   8 => 'HTTP_HOST',
  14.   9 => '/^http:\\/\\//',
  15.   10 => '',
  16.   11 => '/^www\\./',
  17.   12 => '',
  18.   13 => 'request_uri',
  19.   14 => 'request_uri',
  20.   15 => 'request_uri',
  21.   16 => 'REQUEST_URI',
  22.   17 => 'REQUEST_URI',
  23.   18 => 'multi_site',
  24.   19 => 'multi_site',
  25.   20 => 'debug',
  26.   21 => 'debug',
  27.   22 => 'trustlink_cookie',
  28.   23 => 'trustlink_cookie',
  29.   24 => 'trustlink_debug',
  30.   25 => 'trustlink_debug',
  31.   26 => 'REQUEST_URI',
  32.   27 => 'REQUEST_URI',
  33.   28 => 'trustlink_updatedb',
  34.   29 => 'trustlink_updatedb',
  35.   30 => 'verbose',
  36.   31 => 'verbose',
  37.   32 => 'charset',
  38.   33 => 'charset',
  39.   34 => 'charset',
  40.   35 => 'windows-1251',
  41.   36 => 'fetch_remote_type',
  42.   37 => 'fetch_remote_type',
  43.   38 => 'fetch_remote_type',
  44.   39 => 'socket_timeout',
  45.   40 => 'socket_timeout',
  46.   41 => 'socket_timeout',
  47.   42 => 'socket_timeout',
  48.   43 => 'force_show_code',
  49.   44 => 'force_show_code',
  50.   45 => '_TRUSTLINK_USER',
  51.   46 => 'Не задана константа _TRUSTLINK_USER',
  52.   47 => 'ignore_case',
  53.   48 => 'ignore_case',
  54.   49 => ' ',
  55.   50 => 'allow_url_fopen',
  56.   51 => 'default_socket_timeout',
  57.   52 => 'user_agent',
  58.   53 => 'file_get_contents',
  59.   54 => '',
  60.   55 => 'allow_url_fopen',
  61.   56 => 'file_get_contents',
  62.   57 => '
  63. ',
  64.   58 => 'http://',
  65.   59 => 'http://',
  66.   60 => 'curl',
  67.   61 => '',
  68.   62 => 'curl',
  69.   63 => 'http://',
  70.   64 => 'Accept-Charset: ',
  71.   65 => 'socket',
  72.   66 => '',
  73.   67 => '
  74.  
  75. ',
  76.   68 => '
  77.  
  78. ',
  79.   69 => 'Не могу подключиться к серверу: ',
  80.   70 => ', type: ',
  81.   71 => 'rb',
  82.   72 => '',
  83.   73 => 'Не могу считать данные из файла: ',
  84.   74 => 'ab',
  85.   75 => 'Нарушена целостность данных при записи в файл: ',
  86.   76 => 'Не могу записать данные в файл: ',
  87.   77 => '<p style="color: red; font-weight: bold;">TRUSTLINK ERROR: ',
  88.   78 => '</p>',
  89.   79 => 'Нет файла ',
  90.   80 => '. Создать не удалось. Выставите права 777 на папку.',
  91.   81 => 'Нет доступа на запись к файлу: ',
  92.   82 => '! Выставите права 777 на папку.',
  93.   83 => '&charset=',
  94.   84 => 'FATAL ERROR:',
  95.   85 => '__trustlink_charset__',
  96.   86 => '__last_update__',
  97.   87 => '__multi_site__',
  98.   88 => '__fetch_remote_type__',
  99.   89 => '__ignore_case__',
  100.   90 => '__php_version__',
  101.   91 => '__server_software__',
  102.   92 => 'SERVER_SOFTWARE',
  103.   93 => '=',
  104.   94 => '?',
  105.   95 => '&',
  106.   96 => '',
  107.   97 => '<sape_noindex>',
  108.   98 => '</sape_noindex>',
  109.   99 => 'is_block_links',
  110.   100 => 'is_block_links',
  111.   101 => 'nof_links_requested',
  112.   102 => 'nof_links_requested',
  113.   103 => 'nof_links_displayed',
  114.   104 => 'nof_links_displayed',
  115.   105 => 'nof_obligatory',
  116.   106 => 'nof_obligatory',
  117.   107 => 'nof_conditional',
  118.   108 => 'nof_conditional',
  119.   109 => '<sape_block nof_req="',
  120.   110 => 'nof_links_requested',
  121.   111 => '" nof_displ="',
  122.   112 => 'nof_links_displayed',
  123.   113 => '" nof_oblig="',
  124.   114 => 'nof_obligatory',
  125.   115 => '" nof_cond="',
  126.   116 => 'nof_conditional',
  127.   117 => '">',
  128.   118 => '</sape_block>',
  129.   119 => 'block_no_css',
  130.   120 => 'block_orientation',
  131.   121 => 'block_width',
  132.   122 => '',
  133.   123 => '',
  134.   124 => 'is_block_links',
  135.   125 => '',
  136.   126 => '',
  137.   127 => 'is_block_links',
  138.   128 => 'nof_links_requested',
  139.   129 => 'nof_links_displayed',
  140.   130 => 'nof_obligatory',
  141.   131 => 'nof_conditional',
  142.   132 => 'block_no_css',
  143.   133 => 'css',
  144.   134 => 'block_orientation',
  145.   135 => 'block',
  146.   136 => 'item',
  147.   137 => 'item_container',
  148.   138 => '{item}',
  149.   139 => '',
  150.   140 => '#<a href="(https?://([^"/]+)[^"]*)"[^>]*>[\\s]*([^<]+)</a>#i',
  151.   141 => '1251',
  152.   142 => '{header}',
  153.   143 => '{text}',
  154.   144 => '{url}',
  155.   145 => '{link}',
  156.   146 => '{item}',
  157.   147 => '{item}',
  158.   148 => '',
  159.   149 => '{items}',
  160.   150 => '{td_width}',
  161.   151 => '{td_width}',
  162.   152 => 'block_width',
  163.   153 => 'block_width',
  164.   154 => '{block_style_custom}',
  165.   155 => 'style="width: ',
  166.   156 => 'block_width',
  167.   157 => '!important;"',
  168.   158 => 'block_no_css',
  169.   159 => 'block_orientation',
  170.   160 => 'block_width',
  171.   161 => '{',
  172.   162 => '}',
  173.   163 => '#\\{[a-z\\d_\\-]+\\}#',
  174.   164 => ' ',
  175.   165 => 'is_block_links',
  176.   166 => 'nof_links_requested',
  177.   167 => 'nof_links_displayed',
  178.   168 => 'nof_obligatory',
  179.   169 => 'nof_conditional',
  180.   170 => 'as_block',
  181.   171 => 'as_block',
  182.   172 => '<sape_noindex>',
  183.   173 => '</sape_noindex>',
  184.   174 => '<sape_noindex></sape_noindex>',
  185.   175 => '/',
  186.   176 => '.home.jpg',
  187.   177 => '/home.jpg',
  188.   178 => '/code.php?user=',
  189.   179 => '&host=',
  190.   180 => '__trustlink_delimiter__',
  191.   181 => '__trustlink_delimiter__',
  192.   182 => '__trustlink_charset__',
  193.   183 => '__trustlink_charset__',
  194.   184 => '',
  195.   185 => '__trustlink_new_url__',
  196.   186 => '__trustlink_new_url__',
  197.   187 => '__trustlink_new_url__',
  198.   188 => '__trustlink_show_only_block__',
  199.   189 => '__trustlink_show_only_block__',
  200.   190 => '__sape_block_tpl__',
  201.   191 => '__sape_block_tpl__',
  202.   192 => '__sape_block_tpl__',
  203.   193 => '__sape_block_tpl__',
  204.   194 => '__sape_block_tpl_options__',
  205.   195 => '__sape_block_tpl_options__',
  206.   196 => '__sape_block_tpl_options__',
  207.   197 => '__sape_block_tpl_options__',
  208.   198 => '__sape_block_uri_idna__',
  209.   199 => '__sape_block_uri_idna__',
  210.   200 => '__sape_block_uri_idna__',
  211.   201 => '__sape_block_uri_idna__',
  212.   202 => 'beforeall',
  213.   203 => 'beforeblock',
  214.   204 => 'afterblock',
  215.   205 => 'itemobligatory',
  216.   206 => 'itemconditional',
  217.   207 => 'afterall',
  218.   208 => '__sape_block_ins_',
  219.   209 => '__',
  220.   210 => '_block_ins_',
  221.   211 => '',
  222.   212 => '<!-- argument for replace_in_text_segment:
  223. ',
  224.   213 => '
  225. -->',
  226.   214 => '<!-- sentences for replace: ',
  227.   215 => '&amp;',
  228.   216 => '&',
  229.   217 => '&quot;',
  230.   218 => '"',
  231.   219 => '&#039;',
  232.   220 => '\'',
  233.   221 => '&lt;',
  234.   222 => '<',
  235.   223 => '&gt;',
  236.   224 => '>',
  237.   225 => '/',
  238.   226 => '/(&[#a-zA-Z0-9]{2,6};)/isU',
  239.   227 => '((',
  240.   228 => ')|(',
  241.   229 => '))',
  242.   230 => ' ',
  243.   231 => '((\\s)|(&nbsp;))+',
  244.   232 => '
  245.  
  246. ',
  247.   233 => '-->',
  248.   234 => '',
  249.   235 => '',
  250.   236 => ' ',
  251.   237 => '<',
  252.   238 => '/(?si)^(\\/?[a-z0-9]+)/',
  253.   239 => '/',
  254.   240 => '<!-- close_tag: ',
  255.   241 => ' -->',
  256.   242 => '',
  257.   243 => '<!-- open_tag: ',
  258.   244 => ' -->',
  259.   245 => '<!-- ',
  260.   246 => ' - deleted from open_tags -->',
  261.   247 => '<!-- start replacement -->',
  262.   248 => '>',
  263.   249 => '/',
  264.   250 => '/',
  265.   251 => '/',
  266.   252 => '/',
  267.   253 => '$',
  268.   254 => '\\$',
  269.   255 => '<!-- ',
  270.   256 => ' --- ',
  271.   257 => ' replaced -->',
  272.   258 => '>',
  273.   259 => '<!-- ',
  274.   260 => ' - added to open_tags, stop replacement -->',
  275.   261 => '/',
  276.   262 => '/',
  277.   263 => '/',
  278.   264 => '/',
  279.   265 => '$',
  280.   266 => '\\$',
  281.   267 => '<!-- ',
  282.   268 => ' --- ',
  283.   269 => ' replaced -->',
  284.   270 => '',
  285.   271 => '<',
  286.   272 => '<',
  287.   273 => '<!-- No word`s for page -->',
  288.   274 => '<!-- END: work of replace_in_text_segment() -->',
  289.   275 => '<sape_index>',
  290.   276 => '</sape_index>',
  291.   277 => '__trustlink_new_url__',
  292.   278 => '__trustlink_new_url__',
  293.   279 => '__trustlink_new_url__',
  294.   280 => '<!-- Not replaced: ',
  295.   281 => '
  296. ',
  297.   282 => '
  298.  
  299. ',
  300.   283 => '-->',
  301.   284 => '/(?smi)(<\\/?sape_index>)/',
  302.   285 => '',
  303.   286 => '<!-- Split by Sape_index cnt_parts=',
  304.   287 => '-->',
  305.   288 => '/(?smi)(<\\/?body[^>]*>)/',
  306.   289 => '<!-- Split by BODY -->',
  307.   290 => '<!-- Can`t split by BODY -->',
  308.   291 => '/(?smi)(<\\/?sape_index>)/',
  309.   292 => '',
  310.   293 => '__trustlink_new_url__',
  311.   294 => '__trustlink_new_url__',
  312.   295 => '__trustlink_new_url__',
  313.   296 => '<!-- No word`s for page -->',
  314.   297 => '/',
  315.   298 => '.words.db',
  316.   299 => '/words.db',
  317.   300 => '/code_context.php?user=',
  318.   301 => '&host=',
  319.   302 => 'headers_enabled',
  320.   303 => 'headers_enabled',
  321.   304 => 'charset',
  322.   305 => 'charset',
  323.   306 => 'charset',
  324.   307 => '',
  325.   308 => 'index',
  326.   309 => 'announcements_delimiter',
  327.   310 => 'index',
  328.   311 => 'announcements_delimiter',
  329.   312 => 'index',
  330.   313 => 'charset',
  331.   314 => 'charset',
  332.   315 => 'charset',
  333.   316 => 'index',
  334.   317 => 'charset',
  335.   318 => 'host',
  336.   319 => 'host',
  337.   320 => 'HTTP_HOST',
  338.   321 => 'index',
  339.   322 => 'announcements',
  340.   323 => '/',
  341.   324 => '/',
  342.   325 => 'index',
  343.   326 => 'announcements',
  344.   327 => '',
  345.   328 => 'index',
  346.   329 => 'checkCode',
  347.   330 => 'index',
  348.   331 => 'checkCode',
  349.   332 => 'index',
  350.   333 => 'announcements',
  351.   334 => 'index',
  352.   335 => 'announcements',
  353.   336 => 'index',
  354.   337 => 'announcements',
  355.   338 => 'index',
  356.   339 => 'announcements',
  357.   340 => '<sape_noindex>',
  358.   341 => '</sape_noindex>',
  359.   342 => 'index',
  360.   343 => 'articles.db',
  361.   344 => 'index',
  362.   345 => 'index',
  363.   346 => 'articles',
  364.   347 => 'index',
  365.   348 => 'index',
  366.   349 => 'images',
  367.   350 => 'index',
  368.   351 => 'checkCode',
  369.   352 => 'article',
  370.   353 => 'index',
  371.   354 => 'articles',
  372.   355 => 'id',
  373.   356 => '.article.db',
  374.   357 => 'id',
  375.   358 => 'article',
  376.   359 => 'date_updated',
  377.   360 => 'article',
  378.   361 => 'date_updated',
  379.   362 => 'date_updated',
  380.   363 => 'index',
  381.   364 => 'templates',
  382.   365 => 'template_id',
  383.   366 => 'url',
  384.   367 => 'template_id',
  385.   368 => '/images/',
  386.   369 => 'Нет папки ',
  387.   370 => '. Создать не удалось. Выставите права 777 на папку.',
  388.   371 => '.',
  389.   372 => 'image',
  390.   373 => 'index',
  391.   374 => 'images',
  392.   375 => 'id',
  393.   376 => '.',
  394.   377 => 'ext',
  395.   378 => 'date_updated',
  396.   379 => 'date_updated',
  397.   380 => 'dispenser_path',
  398.   381 => 'FATAL ERROR:',
  399.   382 => 'mime',
  400.   383 => 'mime',
  401.   384 => 'image',
  402.   385 => 'Content-Type: ',
  403.   386 => '{meta_charset}',
  404.   387 => 'index',
  405.   388 => 'template_fields',
  406.   389 => 'article',
  407.   390 => '{',
  408.   391 => '}',
  409.   392 => 'article',
  410.   393 => '{',
  411.   394 => '}',
  412.   395 => '',
  413.   396 => 'tpl.articles.db',
  414.   397 => 'templates',
  415.   398 => 'templates',
  416.   399 => 'templates',
  417.   400 => 'date_updated',
  418.   401 => 'index',
  419.   402 => 'templates',
  420.   403 => 'lifetime',
  421.   404 => 'templates',
  422.   405 => 'Не найден шаблон для статьи',
  423.   406 => 'templates',
  424.   407 => 'body',
  425.   408 => '',
  426.   409 => 'path',
  427.   410 => 'path',
  428.   411 => 'query',
  429.   412 => '?',
  430.   413 => 'query',
  431.   414 => 'templates',
  432.   415 => 'body',
  433.   416 => 'date_updated',
  434.   417 => 'templates',
  435.   418 => 'mask',
  436.   419 => 'code',
  437.   420 => 'len',
  438.   421 => 'mask',
  439.   422 => 'code',
  440.   423 => 'len',
  441.   424 => '~(\\<a [^\\>]*?href[^\\>]*?\\=["\']{0,1}http[^\\>]*?\\>.*?\\</a[^\\>]*?\\>|\\<a [^\\>]*?href[^\\>]*?\\=["\']{0,1}http[^\\>]*?\\>|\\<area [^\\>]*?href[^\\>]*?\\=["\']{0,1}http[^\\>]*?\\>)~si',
  442.   425 => '~\\<a |\\<area ~si',
  443.   426 => '~[\\s]{1}rel\\=["\']{1}[^ "\'\\>]*?["\']{1}| rel\\=[^ "\'\\>]*?[\\s]{1}~si',
  444.   427 => '~[\\s]{1}href\\=["\']{0,1}(http[^ "\'\\>]*)?["\']{0,1} {0,1}~si',
  445.   428 => 'index',
  446.   429 => 'ext_links_allowed',
  447.   430 => 'www.',
  448.   431 => 'C',
  449.   432 => '|<!--(.*?)-->|smi',
  450.   433 => 'S',
  451.   434 => '|<script[^>]*>.*?</script>|si',
  452.   435 => 'N',
  453.   436 => '|<noindex[^>]*>.*?</noindex>|si',
  454.   437 => 'host',
  455.   438 => 'host',
  456.   439 => '<noindex>',
  457.   440 => '</noindex>',
  458.   441 => '',
  459.   442 => 'N',
  460.   443 => 'host',
  461.   444 => 'host',
  462.   445 => '',
  463.   446 => '$0rel="nofollow" ',
  464.   447 => '',
  465.   448 => 'S',
  466.   449 => 'C',
  467.   450 => 'index',
  468.   451 => 'template_required_fields',
  469.   452 => '{',
  470.   453 => '}',
  471.   454 => 'В шаблоне не хватает поля ',
  472.   455 => '.',
  473.   456 => 'HTTP/1.x 200 OK',
  474.   457 => 'Content-Type: text/html; charset=',
  475.   458 => 'HTTP/1.x 404 Not Found',
  476.   459 => 'index',
  477.   460 => '/?user=',
  478.   461 => '&host=',
  479.   462 => '&rtype=',
  480.   463 => 'article',
  481.   464 => '/?user=',
  482.   465 => '&host=',
  483.   466 => '&rtype=',
  484.   467 => '&artid=',
  485.   468 => 'image',
  486.   469 => '/',
  487.   470 => '.',
  488.   471 => '/',
  489. );
  490.  
  491. return $a[$i];
  492. }
  493.  
  494. if (!defined("_TRUSTLINK_USER")) {
  495.     define("_TRUSTLINK_USER" , "0a70cdb962f17a3f437983921fa02647");
  496. }
  497.  
  498. class TRUSTLINK_base
  499.  
  500. {
  501.     var $_0 = '1.1.6';
  502.     var $_1 = false;
  503.     var $_2 = '';
  504.     var $_3 = '';
  505.     var $_4 = array(
  506.         'dispenser-01.strangled.net',
  507.         'dispenser-02.us.to'
  508.     );
  509.     var $_5 = 3600;
  510.     var $_6 = 600;
  511.     var $_7 = '';
  512.     var $_8 = '';
  513.     var $_9 = '';
  514.     var $_10 = false;
  515.     var $_11 = '';
  516.     var $_12 = 6;
  517.     var $_13 = false;
  518.     var $_14 = false;
  519.     var $_15 = false;
  520.     var $_16 = false;
  521.     var $_17 = '';
  522.     var $_18 = false;
  523.     var $_19 = false;
  524.     var $_20 = false;
  525.     var $_21 = false;
  526.     function TRUSTLINK_base($_22 = null)
  527.     {
  528.         $_23 = "";
  529.         if (is_array($_22)) {
  530.             if (isset($_22["host"])) {
  531.                 $_23 = $_22["host"];
  532.             }
  533.         }
  534.         elseif (strlen($_22)) {
  535.             $_23 = $_22;
  536.             $_22 = array();
  537.         }
  538.         else {
  539.             $_22 = array();
  540.         }
  541.  
  542.         if (isset($_22["use_server_array"]) && $_22["use_server_array"] == true) {
  543.             $this->_18 = true;
  544.         }
  545.  
  546.         if (strlen($_23)) {
  547.             $this->_8 = $_23;
  548.         }
  549.         else {
  550.             $this->_8 = $_SERVER["HTTP_HOST"];
  551.         }
  552.  
  553.         $this->_8 = preg_replace('/^http:\/\//' , '' , $this->_8);
  554.         $this->_8 = preg_replace('/^www\./' , '' , $this->_8);
  555.         if (isset($_22["request_uri" ]) && strlen($_22["request_uri" ])) {
  556.             $this->_9 = $_22["request_uri" ];
  557.         }
  558.         elseif ($this->_18 === false) {
  559.             $this->_9 = getenv("REQUEST_URI");
  560.         }
  561.  
  562.         if (strlen($this->_9) == round(0)) {
  563.             $this->_9 = $_SERVER["REQUEST_URI" ];
  564.         }
  565.  
  566.         if (isset($_22["multi_site" ]) && $_22["multi_site" ] == true) {
  567.             $this->_10 = true;
  568.         }
  569.  
  570.         if (isset($_22["debug" ]) && $_22["debug" ] == true) {
  571.             $this->_15 = true;
  572.         }
  573.  
  574.         if (isset($_COOKIE["trustlink_cookie" ]) && ($_COOKIE["trustlink_cookie" ] == _TRUSTLINK_USER)) {
  575.             $this->_14 = true;
  576.             if (isset($_COOKIE["trustlink_debug" ]) && ($_COOKIE["trustlink_debug" ] == round(0 + 0.25 + 0.25 + 0.25 + 0.25))) {
  577.                 $this->_15 = true;
  578.                 $this->_24 = $_22;
  579.                 $this->_25 = $this->_9 = $_SERVER["REQUEST_URI" ];
  580.                 $this->_26 = getenv("REQUEST_URI");
  581.                 $this->_27 = _TRUSTLINK_USER;
  582.             }
  583.  
  584.             if (isset($_COOKIE["trustlink_updatedb" ]) && ($_COOKIE["trustlink_updatedb" ] == round(0 + 0.5 + 0.5))) {
  585.                 $this->_19 = true;
  586.             }
  587.         }
  588.         else {
  589.             $this->_14 = false;
  590.         }
  591.  
  592.         if (isset($_22["verbose" ]) && $_22["verbose" ] == true || $this->_15) {
  593.             $this->_1 = true;
  594.         }
  595.  
  596.         if (isset($_22["charset" ]) && strlen($_22["charset" ])) {
  597.             $this->_2 = $_22["charset" ];
  598.         }
  599.         else {
  600.             $this->_2 = "windows-1251";
  601.         }
  602.  
  603.         if (isset($_22["fetch_remote_type" ]) && strlen($_22["fetch_remote_type" ])) {
  604.             $this->_11 = $_22["fetch_remote_type" ];
  605.         }
  606.  
  607.         if (isset($_22["socket_timeout" ]) && is_numeric($_22["socket_timeout" ]) && $_22["socket_timeout" ] > round(0)) {
  608.             $this->_12 = $_22["socket_timeout" ];
  609.         }
  610.  
  611.         if (isset($_22["force_show_code" ]) && $_22["force_show_code" ] == true) {
  612.             $this->_13 = true;
  613.         }
  614.  
  615.         if (!defined("_TRUSTLINK_USER")) {
  616.             return $this->raise_error("Не задана константа _TRUSTLINK_USER");
  617.         }
  618.  
  619.         if (isset($_22["ignore_case" ]) && $_22["ignore_case" ] == true) {
  620.             $this->_16 = true;
  621.             $this->_9 = strtolower($this->_9);
  622.         }
  623.     }
  624.  
  625.     function fetch_remote_file($_23, $_28, $_29 = false)
  626.     {
  627.         $_30 = $this->_31 . " " . $this->_0;
  628.         @ini_set("allow_url_fopen" , round(0 + 0.2 + 0.2 + 0.2 + 0.2 + 0.2));
  629.         @ini_set("default_socket_timeout" , $this->_12);
  630.         @ini_set("user_agent" , $_30);
  631.         if ($this->_11 == "file_get_contents" || ($this->_11 == "" && function_exists('file_get_contents') && ini_get("allow_url_fopen") == round(0 + 0.5 + 0.5))) {
  632.             $this->_11 = "file_get_contents";
  633.             if ($_29 && function_exists('stream_context_create')) {
  634.                 $_32 = array(
  635.                     'http' => array(
  636.                         'method' => 'GET',
  637.                         'header' => 'Accept-Charset: ' . $this->_2 . "
  638. "
  639.                     )
  640.                 );
  641.                 $_33 = @stream_context_create($_32);
  642.                 if ($_34 = @file_get_contents("http://" . $_23 . $_28, null, $_33)) {
  643.                     return $_34;
  644.                 }
  645.             }
  646.             else {
  647.                 if ($_34 = @file_get_contents("http://" . $_23 . $_28)) {
  648.                     return $_34;
  649.                 }
  650.             }
  651.         }
  652.         elseif ($this->_11 == "curl" || ($this->_11 == "" && function_exists('curl_init'))) {
  653.             $this->_11 = "curl";
  654.             if ($_35 = @curl_init()) {
  655.                 @curl_setopt($_35, 10002, "http://" . $_23 . $_28);
  656.                 @curl_setopt($_35, 42, false);
  657.                 @curl_setopt($_35, 19913, true);
  658.                 @curl_setopt($_35, 78, $this->_12);
  659.                 @curl_setopt($_35, 10018, $_30);
  660.                 if ($_29) {
  661.                     @curl_setopt($_35, 10023, array(
  662.                         "Accept-Charset: " . $this->_2
  663.                     ));
  664.                 }
  665.  
  666.                 $_34 = @curl_exec($_35);
  667.                 @curl_close($_35);
  668.                 if ($_34) {
  669.                     return $_34;
  670.                 }
  671.             }
  672.         }
  673.         else {
  674.             $this->_11 = "socket";
  675.             $_36 = "";
  676.             $_37 = @fsockopen($_23, round(0 + 16 + 16 + 16 + 16 + 16) , $_38, $_39, $this->_12);
  677.             if ($_37) {
  678.                 @fputs($_37, "GET {$_28} HTTP/1.0\r\nHost: {$_23}\r\n");
  679.                 if ($_29) {
  680.                     @fputs($_37, "Accept-Charset: {$this->_2}\r\n");
  681.                 }
  682.  
  683.                 @fputs($_37, "User-Agent: {$_30}\r\n\r\n");
  684.                 while (!@feof($_37)) {
  685.                     $_36.= @fgets($_37, round(0 + 32 + 32 + 32 + 32));
  686.                 }
  687.  
  688.                 @fclose($_37);
  689.                 $_40 = explode("
  690.  
  691. " , $_36);
  692.                 unset($_40[round(0) ]);
  693.                 return implode("
  694.  
  695. " , $_40);
  696.             }
  697.         }
  698.  
  699.         return $this->raise_error("Не могу подключиться к серверу: " . $_23 . $_28 . ", type: " . $this->_11);
  700.     }
  701.  
  702.     function _read($_41)
  703.     {
  704.         $_37 = @fopen($_41, "rb");
  705.         @flock($_37, 1);
  706.         if ($_37) {
  707.             clearstatcache();
  708.             $_42 = @filesize($_41);
  709.             $_43 = @get_magic_quotes_runtime();
  710.             @set_magic_quotes_runtime(round(0));
  711.             if ($_42) {
  712.                 $_34 = @fread($_37, $_42);
  713.             }
  714.             else {
  715.                 $_34 = "";
  716.             }
  717.  
  718.             @set_magic_quotes_runtime($_43);
  719.             @flock($_37, 3);
  720.             @fclose($_37);
  721.             return $_34;
  722.         }
  723.  
  724.         return $this->raise_error("Не могу считать данные из файла: " . $_41);
  725.     }
  726.  
  727.     function _write($_41, $_34)
  728.     {
  729.         $_37 = @fopen($_41, "ab");
  730.         if ($_37) {
  731.             if (flock($_37, 2 | 4)) {
  732.                 ftruncate($_37, round(0));
  733.                 $_43 = @get_magic_quotes_runtime();
  734.                 @set_magic_quotes_runtime(round(0));
  735.                 @fwrite($_37, $_34);
  736.                 @set_magic_quotes_runtime($_43);
  737.                 @flock($_37, 3);
  738.                 @fclose($_37);
  739.                 if (md5($this->_read($_41)) != md5($_34)) {
  740.                     @unlink($_41);
  741.                     return $this->raise_error("Нарушена целостность данных при записи в файл: " . $_41);
  742.                 }
  743.             }
  744.             else {
  745.                 return false;
  746.             }
  747.  
  748.             return true;
  749.         }
  750.  
  751.         return $this->raise_error("Не могу записать данные в файл: " . $_41);
  752.     }
  753.  
  754.     function raise_error($_44)
  755.     {
  756.         $this->_7 = '<p style="color: red; font-weight: bold;">TRUSTLINK ERROR: ' . $_44 . '</p>';
  757.         if ($this->_1 == true) {
  758.             print $this->_7;
  759.         }
  760.  
  761.         return false;
  762.     }
  763.  
  764.     function load_data()
  765.     {
  766.         $this->_17 = $this->_get_db_file();
  767.         if (!is_file($this->_17)) {
  768.             if (@touch($this->_17)) {
  769.                 @chmod($this->_17, round(0 + 438));
  770.             }
  771.             else {
  772.                 return $this->raise_error("Нет файла " . $this->_17 . ". Создать не удалось. Выставите права 777 на папку.");
  773.             }
  774.         }
  775.  
  776.         if (!is_writable($this->_17)) {
  777.             return $this->raise_error("Нет доступа на запись к файлу: " . $this->_17 . "! Выставите права 777 на папку.");
  778.         }
  779.  
  780.         @clearstatcache();
  781.         $_34 = $this->_read($this->_17);
  782.         if ($this->_19 || (!$this->_14 && (filemtime($this->_17) < (time() - $this->_5) || filesize($this->_17) == round(0) || @unserialize($_34) == false))) {
  783.             @touch($this->_17, (time() - $this->_5 + $this->_6));
  784.             $_28 = $this->_get_dispenser_path();
  785.             if (strlen($this->_2)) {
  786.                 $_28.= "&charset=" . $this->_2;
  787.             }
  788.  
  789.             foreach($this->_4 as $_45 => $_46) {
  790.                 if ($_34 = $this->fetch_remote_file($_46, $_28)) {
  791.                     if (substr($_34, round(0) , round(0 + 2.4 + 2.4 + 2.4 + 2.4 + 2.4)) == "FATAL ERROR:") {
  792.                         $this->raise_error($_34);
  793.                     }
  794.                     else {
  795.                         $_47 = @unserialize($_34);
  796.                         if ($_47 != false) {
  797.                             $_47["__trustlink_charset__" ] = $this->_2;
  798.                             $_47["__last_update__" ] = time();
  799.                             $_47["__multi_site__" ] = $this->_10;
  800.                             $_47["__fetch_remote_type__" ] = $this->_11;
  801.                             $_47["__ignore_case__" ] = $this->_16;
  802.                             $_47["__php_version__" ] = phpversion();
  803.                             $_47["__server_software__" ] = $_SERVER["SERVER_SOFTWARE" ];
  804.                             $_48 = @serialize($_47);
  805.                             if ($_48) {
  806.                                 $_34 = $_48;
  807.                             }
  808.  
  809.                             $this->_write($this->_17, $_34);
  810.                             break;
  811.                         }
  812.                     }
  813.                 }
  814.             }
  815.         }
  816.  
  817.         if (strlen(session_id())) {
  818.             $_49 = session_name() . "=" . session_id();
  819.             $this->_9 = str_replace(array(
  820.                 "?" . $_49,
  821.                 "&" . $_49
  822.             ) , "" , $this->_9);
  823.         }
  824.  
  825.         $this->set_data(@unserialize($_34));
  826.     }
  827. }
  828.  
  829. class TRUSTLINK_client extends TRUSTLINK_base
  830.  
  831. {
  832.     var $_50 = '';
  833.     var $_51 = array();
  834.     var $_52 = array();
  835.     var $_31 = 'TRUSTLINK_Client PHP';
  836.     function TRUSTLINK_client($_22 = null)
  837.     {
  838.         parent::TRUSTLINK_base($_22);
  839.         $this->load_data();
  840.     }
  841.  
  842.     function _return_array_links_html($_53, $_22 = null)
  843.     {
  844.         if (empty($_22)) {
  845.             $_22 = array();
  846.         }
  847.  
  848.         if (strlen($this->_2) > round(0) && strlen($this->_3) > round(0) && $this->_3 != $this->_2 && function_exists('iconv')) {
  849.             $_54 = @iconv($this->_3, $this->_2, $_53);
  850.             if ($_54) {
  851.                 $_53 = $_54;
  852.             }
  853.         }
  854.  
  855.         if ($this->_14) {
  856.             $_53 = "<sape_noindex>" . $_53 . "</sape_noindex>";
  857.             if (isset($_22["is_block_links" ]) && true == $_22["is_block_links" ]) {
  858.                 if (!isset($_22["nof_links_requested" ])) {
  859.                     $_22["nof_links_requested" ] = round(0);
  860.                 }
  861.  
  862.                 if (!isset($_22["nof_links_displayed" ])) {
  863.                     $_22["nof_links_displayed" ] = round(0);
  864.                 }
  865.  
  866.                 if (!isset($_22["nof_obligatory" ])) {
  867.                     $_22["nof_obligatory" ] = round(0);
  868.                 }
  869.  
  870.                 if (!isset($_22["nof_conditional" ])) {
  871.                     $_22["nof_conditional" ] = round(0);
  872.                 }
  873.  
  874.                 $_53 = '<sape_block nof_req="' . $_22["nof_links_requested" ] . '" nof_displ="' . $_22["nof_links_displayed" ] . '" nof_oblig="' . $_22["nof_obligatory" ] . '" nof_cond="' . $_22["nof_conditional" ] . '">' . $_53 . '</sape_block>';
  875.             }
  876.         }
  877.  
  878.         return $_53;
  879.     }
  880.  
  881.     function _return_html($_53)
  882.     {
  883.         if ($this->_15) {
  884.             $_53.= print_r($this, true);
  885.         }
  886.  
  887.         return $_53;
  888.     }
  889.  
  890.     function return_block_links($_55 = null, $_56 = 0, $_22 = null)
  891.     {
  892.         if (empty($_22)) {
  893.             $_22 = array();
  894.         }
  895.  
  896.         $_57 = array();
  897.         $_57["block_no_css" ] = false;
  898.         $_57["block_orientation" ] = round(0 + 0.33333333333333 + 0.33333333333333 + 0.33333333333333);
  899.         $_57["block_width" ] = "";
  900.         $_58 = array();
  901.         if (isset($this->_59) && is_array($this->_59)) {
  902.             $_58 = $this->_59;
  903.         }
  904.  
  905.         $_22 = array_merge($_57, $_58, $_22);
  906.         if (!is_array($this->_52)) {
  907.             $_53 = $this->_return_array_links_html("" , array(
  908.                 "is_block_links" => true
  909.             ));
  910.             return $this->_return_html($this->_52 . $_53);
  911.         }
  912.         elseif (!isset($this->_60)) {
  913.             return $this->_return_html("");
  914.         }
  915.  
  916.         $_61 = count($this->_52);
  917.         $_62 = false;
  918.         $_63 = false;
  919.         $_64 = round(0);
  920.         if (isset($this->_65)) {
  921.             $_62 = true;
  922.         }
  923.  
  924.         if (is_numeric($_55) && $_55 >= $_61) {
  925.             $_64 = $_55;
  926.             if (isset($this->_66)) {
  927.                 $_63 = true;
  928.             }
  929.         }
  930.  
  931.         if (!is_numeric($_55) || $_55 > $_61) {
  932.             $_55 = $_61;
  933.         }
  934.  
  935.         $_67 = array();
  936.         for ($_45 = round(0 + 0.5 + 0.5); $_45 <= $_55; $_45++) {
  937.             if ($_56 > round(0) && $_45 <= $_56) {
  938.                 array_shift($this->_52);
  939.             }
  940.             else {
  941.                 $_67[] = array_shift($this->_52);
  942.             }
  943.         }
  944.  
  945.         $_53 = "";
  946.         $_68 = round(0);
  947.         if (count($_67) < $_64 && true == $_63) {
  948.             $_68 = $_64 - count($_67);
  949.         }
  950.  
  951.         if (empty($_67) && $_62 == false && $_68 == round(0)) {
  952.             $_69 = array(
  953.                 "is_block_links" => true,
  954.                 "nof_links_requested" => $_64,
  955.                 "nof_links_displayed" => round(0) ,
  956.                 "nof_obligatory" => round(0) ,
  957.                 "nof_conditional" => round(0)
  958.             );
  959.             $_53 = $this->_return_array_links_html($_53, $_69);
  960.             return $this->_return_html($_53);
  961.         }
  962.  
  963.         if (!$this->_20 && false == $_22["block_no_css" ]) {
  964.             $_53.= $this->_60["css" ];
  965.             $this->_20 = true;
  966.         }
  967.  
  968.         if (isset($this->_70) && !$this->_21) {
  969.             $_53.= $this->_70;
  970.             $this->_21 = true;
  971.         }
  972.  
  973.         if (isset($this->_71)) {
  974.             $_53.= $this->_71;
  975.         }
  976.  
  977.         $_72 = $this->_60[$_22["block_orientation" ]];
  978.         $_73 = $_72["block" ];
  979.         $_74 = $_72["item" ];
  980.         $_75 = $_72["item_container" ];
  981.         $_76 = str_replace("{item}" , $_74, $_75);
  982.         $_77 = "";
  983.         $_78 = count($_67);
  984.         foreach($_67 as $_79) {
  985.             preg_match('#<a href="(https?://([^"/]+)[^"]*)"[^>]*>[\s]*([^<]+)</a>#i' , $_79, $_80);
  986.             if (function_exists('mb_strtoupper') && strlen($this->_3) > round(0)) {
  987.                 $_81 = mb_substr($_80[round(0 + 1.5 + 1.5) ], round(0 + 1) , mb_strlen($_80[round(0 + 0.75 + 0.75 + 0.75 + 0.75) ], $this->_3) - round(0 + 0.5 + 0.5) , $this->_3);
  988.                 $_82 = mb_strtoupper(mb_substr($_80[round(0 + 0.75 + 0.75 + 0.75 + 0.75) ], round(0) , round(0 + 1) , $this->_3) , $this->_3);
  989.                 $_80[round(0 + 1.5 + 1.5) ] = $_82 . $_81;
  990.             }
  991.             elseif (function_exists('ucfirst') && (strlen($this->_3) == round(0) || strpos($this->_3, "1251") !== false)) {
  992.                 $_80[round(0 + 1 + 1 + 1) ][round(0) ] = ucfirst($_80[round(0 + 3) ][round(0) ]);
  993.             }
  994.  
  995.             if (isset($this->_83) && isset($this->_83[$_80[round(0 + 1 + 1) ]])) {
  996.                 $_80[round(0 + 1 + 1) ] = $this->_83[$_80[round(0 + 2) ]];
  997.             }
  998.  
  999.             $_84 = $_76;
  1000.             $_84 = str_replace("{header}" , $_80[round(0 + 1.5 + 1.5) ], $_84);
  1001.             $_84 = str_replace("{text}" , trim($_79) , $_84);
  1002.             $_84 = str_replace("{url}" , $_80[round(0 + 1 + 1) ], $_84);
  1003.             $_84 = str_replace("{link}" , $_80[round(0 + 0.33333333333333 + 0.33333333333333 + 0.33333333333333) ], $_84);
  1004.             $_77.= $_84;
  1005.         }
  1006.  
  1007.         if (true == $_62) {
  1008.             $_77.= str_replace("{item}" , $this->_65, $_75);
  1009.             $_78+= round(0 + 0.2 + 0.2 + 0.2 + 0.2 + 0.2);
  1010.         }
  1011.  
  1012.         if ($_63 == true && $_68 > round(0)) {
  1013.             for ($_45 = round(0); $_45 < $_68; $_45++) {
  1014.                 $_77.= str_replace("{item}" , $this->_66, $_75);
  1015.             }
  1016.  
  1017.             $_78+= $_68;
  1018.         }
  1019.  
  1020.         if ($_77 != "") {
  1021.             $_53.= str_replace("{items}" , $_77, $_73);
  1022.             if ($_78 > round(0)) {
  1023.                 $_53 = str_replace("{td_width}" , round(round(0 + 20 + 20 + 20 + 20 + 20) / $_78) , $_53);
  1024.             }
  1025.             else {
  1026.                 $_53 = str_replace("{td_width}" , round(0) , $_53);
  1027.             }
  1028.  
  1029.             if (isset($_22["block_width" ]) && !empty($_22["block_width" ])) {
  1030.                 $_53 = str_replace("{block_style_custom}" , 'style="width: ' . $_22["block_width" ] . '!important;"' , $_53);
  1031.             }
  1032.         }
  1033.  
  1034.         unset($_72, $_73, $_77, $_84, $_74, $_75);
  1035.         if (isset($this->_85)) {
  1036.             $_53.= $this->_85;
  1037.         }
  1038.  
  1039.         unset($_22["block_no_css" ], $_22["block_orientation" ], $_22["block_width" ]);
  1040.         $_86 = array_keys($_22);
  1041.         foreach($_86 as $_87 => $_88) {
  1042.             $_86[$_87] = "{" . $_88 . "}";
  1043.         }
  1044.  
  1045.         unset($_88, $_87);
  1046.         $_89 = array_values($_22);
  1047.         $_53 = str_replace($_86, $_89, $_53);
  1048.         unset($_86, $_89);
  1049.         $_90 = "#\{[a-z\d_\-]+\}#";
  1050.         $_53 = preg_replace($_90, " " , $_53);
  1051.         $_69 = array(
  1052.             "is_block_links" => true,
  1053.             "nof_links_requested" => $_64,
  1054.             "nof_links_displayed" => $_55,
  1055.             "nof_obligatory" => ($_62 == true ? round(0 + 0.5 + 0.5) : round(0)) ,
  1056.             "nof_conditional" => $_68
  1057.         );
  1058.         $_53 = $this->_return_array_links_html($_53, $_69);
  1059.         return $this->_return_html($_53);
  1060.     }
  1061.  
  1062.     function return_links($_55 = null, $_56 = 0, $_22 = null)
  1063.     {
  1064.         $_91 = $this->_92;
  1065.         if (is_array($_22) && isset($_22["as_block" ]) && false == $_91) {
  1066.             $_91 = $_22["as_block" ];
  1067.         }
  1068.  
  1069.         if (true == $_91 && isset($this->_60)) {
  1070.             return $this->return_block_links($_55, $_56, $_22);
  1071.         }
  1072.  
  1073.         if (is_array($this->_52)) {
  1074.             $_61 = count($this->_52);
  1075.             if (!is_numeric($_55) || $_55 > $_61) {
  1076.                 $_55 = $_61;
  1077.             }
  1078.  
  1079.             $_67 = array();
  1080.             for ($_45 = round(0 + 0.33333333333333 + 0.33333333333333 + 0.33333333333333); $_45 <= $_55; $_45++) {
  1081.                 if ($_56 > round(0) && $_45 <= $_56) {
  1082.                     array_shift($this->_52);
  1083.                 }
  1084.                 else {
  1085.                     $_67[] = array_shift($this->_52);
  1086.                 }
  1087.             }
  1088.  
  1089.             $_53 = join($this->_50, $_67);
  1090.             if (strlen($this->_2) > round(0) && strlen($this->_3) > round(0) && $this->_3 != $this->_2 && function_exists('iconv')) {
  1091.                 $_54 = @iconv($this->_3, $this->_2, $_53);
  1092.                 if ($_54) {
  1093.                     $_53 = $_54;
  1094.                 }
  1095.             }
  1096.  
  1097.             if ($this->_14) {
  1098.                 $_53 = "<sape_noindex>" . $_53 . "</sape_noindex>";
  1099.             }
  1100.         }
  1101.         else {
  1102.             $_53 = $this->_52;
  1103.             if ($this->_14) {
  1104.                 $_53.= "<sape_noindex></sape_noindex>";
  1105.             }
  1106.         }
  1107.  
  1108.         if ($this->_15) {
  1109.             $_53.= print_r($this, true);
  1110.         }
  1111.  
  1112.         return $_53;
  1113.     }
  1114.  
  1115.     function _get_db_file()
  1116.     {
  1117.         if ($this->_10) {
  1118.             return dirname(__FILE__) . "/" . $this->_8 . ".home.jpg";
  1119.         }
  1120.         else {
  1121.             return dirname(__FILE__) . "/home.jpg";
  1122.         }
  1123.     }
  1124.  
  1125.     function _get_dispenser_path()
  1126.     {
  1127.         return "/code.php?user=" . _TRUSTLINK_USER . "&host=" . $this->_8;
  1128.     }
  1129.  
  1130.     function set_data($_34)
  1131.     {
  1132.         if ($this->_16) {
  1133.             $this->_51 = array_change_key_case($_34);
  1134.         }
  1135.         else {
  1136.             $this->_51 = $_34;
  1137.         }
  1138.  
  1139.         if (isset($this->_51["__trustlink_delimiter__" ])) {
  1140.             $this->_50 = $this->_51["__trustlink_delimiter__" ];
  1141.         }
  1142.  
  1143.         if (isset($this->_51["__trustlink_charset__" ])) {
  1144.             $this->_3 = $this->_51["__trustlink_charset__" ];
  1145.         }
  1146.         else {
  1147.             $this->_3 = "";
  1148.         }
  1149.  
  1150.         if (@array_key_exists($this->_9, $this->_51) && is_array($this->_51[$this->_9])) {
  1151.             $this->_52 = $this->_51[$this->_9];
  1152.         }
  1153.         else {
  1154.             if (isset($this->_51["__trustlink_new_url__" ]) && strlen($this->_51["__trustlink_new_url__" ])) {
  1155.                 if ($this->_14 || $this->_13) {
  1156.                     $this->_52 = $this->_51["__trustlink_new_url__" ];
  1157.                 }
  1158.             }
  1159.         }
  1160.  
  1161.         if (isset($this->_51["__trustlink_show_only_block__" ])) {
  1162.             $this->_92 = $this->_51["__trustlink_show_only_block__" ];
  1163.         }
  1164.         else {
  1165.             $this->_92 = false;
  1166.         }
  1167.  
  1168.         if (isset($this->_51["__sape_block_tpl__" ]) && !empty($this->_51["__sape_block_tpl__" ]) && is_array($this->_51["__sape_block_tpl__" ])) {
  1169.             $this->_60 = $this->_51["__sape_block_tpl__" ];
  1170.         }
  1171.  
  1172.         if (isset($this->_51["__sape_block_tpl_options__" ]) && !empty($this->_51["__sape_block_tpl_options__" ]) && is_array($this->_51["__sape_block_tpl_options__" ])) {
  1173.             $this->_59 = $this->_51["__sape_block_tpl_options__" ];
  1174.         }
  1175.  
  1176.         if (isset($this->_51["__sape_block_uri_idna__" ]) && !empty($this->_51["__sape_block_uri_idna__" ]) && is_array($this->_51["__sape_block_uri_idna__" ])) {
  1177.             $this->_83 = $this->_51["__sape_block_uri_idna__" ];
  1178.         }
  1179.  
  1180.         $_93 = array(
  1181.             "beforeall" ,
  1182.             "beforeblock" ,
  1183.             "afterblock" ,
  1184.             "itemobligatory" ,
  1185.             "itemconditional" ,
  1186.             "afterall"
  1187.         );
  1188.         foreach($_93 as $_94) {
  1189.             $_95 = "__sape_block_ins_" . $_94 . "__";
  1190.             $_96 = "_block_ins_" . $_94;
  1191.             if (isset($this->_51[$_95]) && strlen($this->_51[$_95]) > round(0)) {
  1192.                 $this->$_96 = $this->_51[$_95];
  1193.             }
  1194.         }
  1195.     }
  1196. }
  1197.  
  1198. class TRUSTLINK_context extends TRUSTLINK_base
  1199.  
  1200. {
  1201.     var $_97 = array();
  1202.     var $_98 = array();
  1203.     var $_31 = 'TRUSTLINK_Context PHP';
  1204.     var $_99 = array(
  1205.         'a',
  1206.         'textarea',
  1207.         'select',
  1208.         'script',
  1209.         'style',
  1210.         'label',
  1211.         'noscript',
  1212.         'noindex',
  1213.         'button'
  1214.     );
  1215.     function TRUSTLINK_context($_22 = null)
  1216.     {
  1217.         parent::TRUSTLINK_base($_22);
  1218.         $this->load_data();
  1219.     }
  1220.  
  1221.     function replace_in_text_segment($_100)
  1222.     {
  1223.         $_101 = "";
  1224.         if ($this->_15) {
  1225.             $_101.= "<!-- argument for replace_in_text_segment:
  1226. " . base64_encode($_100) . "
  1227. -->";
  1228.         }
  1229.  
  1230.         if (count($this->_98) > round(0)) {
  1231.             $_102 = array();
  1232.             if ($this->_15) {
  1233.                 $_101.= "<!-- sentences for replace: ";
  1234.             }
  1235.  
  1236.             foreach($this->_98 as $_55 => $_103) {
  1237.                 $_104 = array(
  1238.                     "&amp;" => "&" ,
  1239.                     "&quot;" => '"' ,
  1240.                     "&#039;" => "'" ,
  1241.                     "&lt;" => "<" ,
  1242.                     "&gt;" => ">"
  1243.                 );
  1244.                 $_103 = strip_tags($_103);
  1245.                 foreach($_104 as $_105 => $_106) {
  1246.                     str_replace($_105, $_106, $_103);
  1247.                 }
  1248.  
  1249.                 $_103 = htmlspecialchars($_103);
  1250.                 $_103 = preg_quote($_103, "/");
  1251.                 $_107 = array();
  1252.                 if (preg_match_all('/(&[#a-zA-Z0-9]{2,6};)/isU' , $_103, $_108)) {
  1253.                     for ($_45 = round(0); $_45 < count($_108[round(0 + 0.2 + 0.2 + 0.2 + 0.2 + 0.2) ]); $_45++) {
  1254.                         $_109 = $_104[$_108[round(0 + 0.5 + 0.5) ][$_45]];
  1255.                         $_110 = $_108[round(0 + 0.25 + 0.25 + 0.25 + 0.25) ][$_45];
  1256.                         $_107[$_109] = $_110;
  1257.                     }
  1258.                 }
  1259.  
  1260.                 foreach($_107 as $_109 => $_110) {
  1261.                     $_103 = str_replace($_110, "((" . $_110 . ")|(" . $_109 . "))" , $_103);
  1262.                 }
  1263.  
  1264.                 $_111[$_55] = str_replace(" " , "((\s)|(&nbsp;))+" , $_103);
  1265.                 if ($this->_15) {
  1266.                     $_101.= $_111[$_55] . "
  1267.  
  1268. ";
  1269.                 }
  1270.             }
  1271.  
  1272.             if ($this->_15) {
  1273.                 $_101.= "-->";
  1274.             }
  1275.  
  1276.             $_112 = true;
  1277.             if (count($_111) > round(0)) {
  1278.                 $_113 = "";
  1279.                 $_114 = array();
  1280.                 $_115 = "";
  1281.                 $_116 = strtok(" " . $_100, "<");
  1282.                 while ($_116 !== false) {
  1283.                     if (preg_match('/(?si)^(\/?[a-z0-9]+)/' , $_116, $_117)) {
  1284.                         $_118 = strtolower($_117[round(0 + 0.5 + 0.5) ]);
  1285.                         if (substr($_118, round(0) , round(0 + 0.2 + 0.2 + 0.2 + 0.2 + 0.2)) == "/") {
  1286.                             $_115 = substr($_118, round(0 + 0.5 + 0.5));
  1287.                             if ($this->_15) {
  1288.                                 $_101.= "<!-- close_tag: " . $_115 . " -->";
  1289.                             }
  1290.                         }
  1291.                         else {
  1292.                             $_115 = "";
  1293.                             if ($this->_15) {
  1294.                                 $_101.= "<!-- open_tag: " . $_118 . " -->";
  1295.                             }
  1296.                         }
  1297.  
  1298.                         $_119 = count($_114);
  1299.                         if (($_119 > round(0)) && ($_114[$_119 - round(0 + 0.25 + 0.25 + 0.25 + 0.25) ] == $_115)) {
  1300.                             array_pop($_114);
  1301.                             if ($this->_15) {
  1302.                                 $_101.= "<!-- " . $_118 . " - deleted from open_tags -->";
  1303.                             }
  1304.  
  1305.                             if ($_119 - round(0 + 0.5 + 0.5) == round(0)) {
  1306.                                 if ($this->_15) {
  1307.                                     $_101.= "<!-- start replacement -->";
  1308.                                 }
  1309.                             }
  1310.                         }
  1311.  
  1312.                         if (count($_114) == round(0)) {
  1313.                             if (!in_array($_118, $this->_99)) {
  1314.                                 $_120 = explode(">" , $_116, round(0 + 2));
  1315.                                 if (count($_120) == round(0 + 1 + 1)) {
  1316.                                     foreach($_111 as $_55 => $_103) {
  1317.                                         if (preg_match("/" . $_103 . "/" , $_120[round(0 + 0.5 + 0.5) ]) == round(0 + 1)) {
  1318.                                             $_120[round(0 + 1) ] = preg_replace("/" . $_103 . "/" , str_replace("$" , "\$" , $this->_98[$_55]) , $_120[round(0 + 0.25 + 0.25 + 0.25 + 0.25) ], round(0 + 0.5 + 0.5));
  1319.                                             if ($this->_15) {
  1320.                                                 $_101.= "<!-- " . $_103 . " --- " . $this->_98[$_55] . " replaced -->";
  1321.                                             }
  1322.  
  1323.                                             unset($_111[$_55]);
  1324.                                             unset($this->_98[$_55]);
  1325.                                         }
  1326.                                     }
  1327.  
  1328.                                     $_116 = $_120[round(0) ] . ">" . $_120[round(0 + 0.33333333333333 + 0.33333333333333 + 0.33333333333333) ];
  1329.                                     unset($_120);
  1330.                                 }
  1331.                             }
  1332.                             else {
  1333.                                 $_114[] = $_118;
  1334.                                 if ($this->_15) {
  1335.                                     $_101.= "<!-- " . $_118 . " - added to open_tags, stop replacement -->";
  1336.                                 }
  1337.                             }
  1338.                         }
  1339.                     }
  1340.                     else {
  1341.                         foreach($_111 as $_55 => $_103) {
  1342.                             if (preg_match("/" . $_103 . "/" , $_116) == round(0 + 1)) {
  1343.                                 $_116 = preg_replace("/" . $_103 . "/" , str_replace("$" , "\$" , $this->_98[$_55]) , $_116, round(0 + 0.33333333333333 + 0.33333333333333 + 0.33333333333333));
  1344.                                 if ($this->_15) {
  1345.                                     $_101.= "<!-- " . $_103 . " --- " . $this->_98[$_55] . " replaced -->";
  1346.                                 }
  1347.  
  1348.                                 unset($_111[$_55]);
  1349.                                 unset($this->_98[$_55]);
  1350.                             }
  1351.                         }
  1352.                     }
  1353.  
  1354.                     if ($this->_15) {
  1355.                         $_113.= $_101;
  1356.                         $_101 = "";
  1357.                     }
  1358.  
  1359.                     if ($_112) {
  1360.                         $_113.= $_116;
  1361.                         $_112 = false;
  1362.                     }
  1363.                     else {
  1364.                         $_113.= $_101 . "<" . $_116;
  1365.                     }
  1366.  
  1367.                     unset($_116);
  1368.                     $_116 = strtok("<");
  1369.                 }
  1370.  
  1371.                 $_100 = ltrim($_113);
  1372.                 unset($_113);
  1373.             }
  1374.         }
  1375.         else {
  1376.             if ($this->_15) {
  1377.                 $_101.= "<!-- No word`s for page -->";
  1378.             }
  1379.         }
  1380.  
  1381.         if ($this->_15) {
  1382.             $_101.= "<!-- END: work of replace_in_text_segment() -->";
  1383.         }
  1384.  
  1385.         if ($this->_14 || $this->_13 || $this->_15) {
  1386.             $_100 = "<sape_index>" . $_100 . "</sape_index>";
  1387.             if (isset($this->_97["__trustlink_new_url__" ]) && strlen($this->_97["__trustlink_new_url__" ])) {
  1388.                 $_100.= $this->_97["__trustlink_new_url__" ];
  1389.             }
  1390.         }
  1391.  
  1392.         if ($this->_15) {
  1393.             if (count($this->_98) > round(0)) {
  1394.                 $_100.= "<!-- Not replaced: " . "
  1395. ";
  1396.                 foreach($this->_98 as $_55 => $_121) {
  1397.                     $_100.= $_121 . "
  1398.  
  1399. ";
  1400.                 }
  1401.  
  1402.                 $_100.= "-->";
  1403.             }
  1404.  
  1405.             $_100.= $_101;
  1406.         }
  1407.  
  1408.         return $_100;
  1409.     }
  1410.  
  1411.     function replace_in_page(&$_122)
  1412.     {
  1413.         if (count($this->_98) > round(0)) {
  1414.             $_123 = preg_split("/(?smi)(<\/?sape_index>)/" , $_122, -round(0 + 1));
  1415.             $_124 = count($_123);
  1416.             if ($_124 > round(0 + 0.25 + 0.25 + 0.25 + 0.25)) {
  1417.                 if ($_124 >= round(0 + 1.5 + 1.5)) {
  1418.                     for ($_45 = round(0 + 1); $_45 < $_124; $_45 = $_45 + round(0 + 2)) {
  1419.                         $_123[$_45] = $this->replace_in_text_segment($_123[$_45]);
  1420.                     }
  1421.                 }
  1422.  
  1423.                 $_122 = implode("" , $_123);
  1424.                 if ($this->_15) {
  1425.                     $_122.= "<!-- Split by Sape_index cnt_parts=" . $_124 . "-->";
  1426.                 }
  1427.             }
  1428.             else {
  1429.                 $_123 = preg_split("/(?smi)(<\/?body[^>]*>)/" , $_122, -round(0 + 0.25 + 0.25 + 0.25 + 0.25) , 2);
  1430.                 if (count($_123) == round(0 + 1 + 1 + 1 + 1 + 1)) {
  1431.                     $_123[round(0) ] = $_123[round(0) ] . $_123[round(0 + 0.5 + 0.5) ];
  1432.                     $_123[round(0 + 0.33333333333333 + 0.33333333333333 + 0.33333333333333) ] = $this->replace_in_text_segment($_123[round(0 + 0.4 + 0.4 + 0.4 + 0.4 + 0.4) ]);
  1433.                     $_123[round(0 + 1 + 1) ] = $_123[round(0 + 3) ] . $_123[round(0 + 1.3333333333333 + 1.3333333333333 + 1.3333333333333) ];
  1434.                     unset($_123[round(0 + 0.6 + 0.6 + 0.6 + 0.6 + 0.6) ]);
  1435.                     unset($_123[round(0 + 0.8 + 0.8 + 0.8 + 0.8 + 0.8) ]);
  1436.                     $_122 = $_123[round(0) ] . $_123[round(0 + 0.33333333333333 + 0.33333333333333 + 0.33333333333333) ] . $_123[round(0 + 0.5 + 0.5 + 0.5 + 0.5) ];
  1437.                     if ($this->_15) {
  1438.                         $_122.= "<!-- Split by BODY -->";
  1439.                     }
  1440.                 }
  1441.                 else {
  1442.                     if ($this->_15) {
  1443.                         $_122.= "<!-- Can`t split by BODY -->";
  1444.                     }
  1445.                 }
  1446.             }
  1447.         }
  1448.         else {
  1449.             if (!$this->_14 && !$this->_13 && !$this->_15) {
  1450.                 $_122 = preg_replace("/(?smi)(<\/?sape_index>)/" , "" , $_122);
  1451.             }
  1452.             else {
  1453.                 if (isset($this->_97["__trustlink_new_url__" ]) && strlen($this->_97["__trustlink_new_url__" ])) {
  1454.                     $_122.= $this->_97["__trustlink_new_url__" ];
  1455.                 }
  1456.             }
  1457.  
  1458.             if ($this->_15) {
  1459.                 $_122.= "<!-- No word`s for page -->";
  1460.             }
  1461.         }
  1462.  
  1463.         return $_122;
  1464.     }
  1465.  
  1466.     function _get_db_file()
  1467.     {
  1468.         if ($this->_10) {
  1469.             return dirname(__FILE__) . "/" . $this->_8 . ".words.db";
  1470.         }
  1471.         else {
  1472.             return dirname(__FILE__) . "/words.db";
  1473.         }
  1474.     }
  1475.  
  1476.     function _get_dispenser_path()
  1477.     {
  1478.         return "/code_context.php?user=" . _TRUSTLINK_USER . "&host=" . $this->_8;
  1479.     }
  1480.  
  1481.     function set_data($_34)
  1482.     {
  1483.         $this->_97 = $_34;
  1484.         if (@array_key_exists($this->_9, $this->_97) && is_array($this->_97[$this->_9])) {
  1485.             $this->_98 = $this->_97[$this->_9];
  1486.         }
  1487.     }
  1488. }
  1489.  
  1490. class TRUSTLINK_articles extends TRUSTLINK_base
  1491.  
  1492. {
  1493.     var $_125;
  1494.     var $_4 = array(
  1495.         'dispenser.amursk-rayon.ru'
  1496.     );
  1497.     var $_126 = array();
  1498.     var $_127;
  1499.     var $_128;
  1500.     var $_129 = '';
  1501.     var $_130;
  1502.     var $_131 = false;
  1503.     var $_132 = '<!--sape_noindex-->';
  1504.     var $_133 = false;
  1505.     var $_134;
  1506.     var $_135;
  1507.     var $_31 = 'TRUSTLINK_Articles_Client PHP';
  1508.     function TRUSTLINK_articles($_22 = null)
  1509.     {
  1510.         parent::TRUSTLINK_base($_22);
  1511.         if (is_array($_22) && isset($_22["headers_enabled" ])) {
  1512.             $this->_133 = $_22["headers_enabled" ];
  1513.         }
  1514.  
  1515.         if (isset($_22["charset" ]) && strlen($_22["charset" ])) {
  1516.             $this->_2 = $_22["charset" ];
  1517.         }
  1518.         else {
  1519.             $this->_2 = "";
  1520.         }
  1521.  
  1522.         $this->_get_index();
  1523.         if (!empty($this->_126["index" ]["announcements_delimiter" ])) {
  1524.             $this->_129 = $this->_126["index" ]["announcements_delimiter" ];
  1525.         }
  1526.  
  1527.         if (!empty($this->_126["index" ]["charset" ]) and !(isset($_22["charset" ]) && strlen($_22["charset" ]))) {
  1528.             $this->_2 = $this->_126["index" ]["charset" ];
  1529.         }
  1530.  
  1531.         if (is_array($_22)) {
  1532.             if (isset($_22["host" ])) {
  1533.                 $_23 = $_22["host" ];
  1534.             }
  1535.         }
  1536.         elseif (strlen($_22)) {
  1537.             $_23 = $_22;
  1538.             $_22 = array();
  1539.         }
  1540.  
  1541.         if (isset($_23) && strlen($_23)) {
  1542.             $this->_135 = $_23;
  1543.         }
  1544.         else {
  1545.             $this->_135 = $_SERVER["HTTP_HOST" ];
  1546.         }
  1547.  
  1548.         if (!isset($this->_126["index" ]["announcements" ][$this->_9])) {
  1549.             $this->_correct_uri();
  1550.         }
  1551.     }
  1552.  
  1553.     function _correct_uri()
  1554.     {
  1555.         if (substr($this->_9, -round(0 + 0.5 + 0.5)) == "/") {
  1556.             $_136 = substr($this->_9, round(0) , -round(0 + 1));
  1557.         }
  1558.         else {
  1559.             $_136 = $this->_9 . "/";
  1560.         }
  1561.  
  1562.         if (isset($this->_126["index" ]["announcements" ][$_136])) {
  1563.             $this->_9 = $_136;
  1564.         }
  1565.     }
  1566.  
  1567.     function return_announcements($_55 = null, $_56 = 0)
  1568.     {
  1569.         $_137 = "";
  1570.         if ($this->_13 || $this->_14) {
  1571.             if (isset($this->_126["index" ]["checkCode" ])) {
  1572.                 $_137.= $this->_126["index" ]["checkCode" ];
  1573.             }
  1574.         }
  1575.  
  1576.         if (isset($this->_126["index" ]["announcements" ][$this->_9])) {
  1577.             $_61 = count($this->_126["index" ]["announcements" ][$this->_9]);
  1578.             if (!is_numeric($_55) || $_55 > $_61) {
  1579.                 $_55 = $_61;
  1580.             }
  1581.  
  1582.             $_67 = array();
  1583.             for ($_45 = round(0 + 0.5 + 0.5); $_45 <= $_55; $_45++) {
  1584.                 if ($_56 > round(0) && $_45 <= $_56) {
  1585.                     array_shift($this->_126["index" ]["announcements" ][$this->_9]);
  1586.                 }
  1587.                 else {
  1588.                     $_67[] = array_shift($this->_126["index" ]["announcements" ][$this->_9]);
  1589.                 }
  1590.             }
  1591.  
  1592.             $_53 = join($this->_129, $_67);
  1593.             if ($this->_14) {
  1594.                 $_53 = "<sape_noindex>" . $_53 . "</sape_noindex>";
  1595.             }
  1596.  
  1597.             $_137.= $_53;
  1598.         }
  1599.  
  1600.         return $_137;
  1601.     }
  1602.  
  1603.     function _get_index()
  1604.     {
  1605.         $this->_set_request_mode("index");
  1606.         $this->_128 = "articles.db";
  1607.         $this->load_data();
  1608.     }
  1609.  
  1610.     function process_request()
  1611.     {
  1612.         if (!empty($this->_126["index" ]) and isset($this->_126["index" ]["articles" ][$this->_9])) {
  1613.             return $this->_return_article();
  1614.         }
  1615.         elseif (!empty($this->_126["index" ]) and isset($this->_126["index" ]["images" ][$this->_9])) {
  1616.             return $this->_return_image();
  1617.         }
  1618.         else {
  1619.             if ($this->_14) {
  1620.                 return $this->_return_html($this->_126["index" ]["checkCode" ] . $this->_132);
  1621.             }
  1622.             else {
  1623.                 return $this->_return_not_found();
  1624.             }
  1625.         }
  1626.     }
  1627.  
  1628.     function _return_article()
  1629.     {
  1630.         $this->_set_request_mode("article");
  1631.         $_138 = $this->_126["index" ]["articles" ][$this->_9];
  1632.         $this->_128 = $_138["id" ] . ".article.db";
  1633.         $this->_127 = $_138["id" ];
  1634.         $this->load_data();
  1635.         if (!isset($this->_126["article" ]["date_updated" ]) OR $this->_126["article" ]["date_updated" ] < $_138["date_updated" ]) {
  1636.             unlink($this->_get_db_file());
  1637.             $this->load_data();
  1638.         }
  1639.  
  1640.         $_139 = $this->_get_template($this->_126["index" ]["templates" ][$_138["template_id" ]]["url" ], $_138["template_id" ]);
  1641.         $_140 = $this->_fetch_article($_139);
  1642.         if ($this->_14) {
  1643.             $_140.= $this->_132;
  1644.         }
  1645.  
  1646.         return $this->_return_html($_140);
  1647.     }
  1648.  
  1649.     function _prepare_path_to_images()
  1650.     {
  1651.         $this->_130 = dirname(__FILE__) . "/images/";
  1652.         if (!is_dir($this->_130)) {
  1653.             if (@mkdir($this->_130)) {
  1654.                 @chmod($this->_130, round(0 + 255.5 + 255.5));
  1655.             }
  1656.             else {
  1657.                 return $this->raise_error("Нет папки " . $this->_130 . ". Создать не удалось. Выставите права 777 на папку.");
  1658.             }
  1659.         }
  1660.  
  1661.         if ($this->_10) {
  1662.             $this->_130.= $this->_8 . ".";
  1663.         }
  1664.     }
  1665.  
  1666.     function _return_image()
  1667.     {
  1668.         $this->_set_request_mode("image");
  1669.         $this->_prepare_path_to_images();
  1670.         $_141 = $this->_126["index" ]["images" ][$this->_9];
  1671.         $_142 = $this->_130 . $_141["id" ] . "." . $_141["ext" ];
  1672.         if (!is_file($_142) or filemtime($_142) > $_141["date_updated" ]) {
  1673.             @touch($_142, $_141["date_updated" ]);
  1674.             $_28 = $_141["dispenser_path" ];
  1675.             foreach($this->_4 as $_45 => $_46) {
  1676.                 if ($_34 = $this->fetch_remote_file($_46, $_28)) {
  1677.                     if (substr($_34, round(0) , round(0 + 3 + 3 + 3 + 3)) == "FATAL ERROR:") {
  1678.                         $this->raise_error($_34);
  1679.                     }
  1680.                     else {
  1681.                         if (strlen($_34) > round(0)) {
  1682.                             $this->_write($_142, $_34);
  1683.                             break;
  1684.                         }
  1685.                     }
  1686.                 }
  1687.             }
  1688.         }
  1689.  
  1690.         unset($_34);
  1691.         if (!is_file($_142)) {
  1692.             return $this->_return_not_found();
  1693.         }
  1694.  
  1695.         $_143 = @getimagesize($_142);
  1696.         $_144 = isset($_143["mime" ]) ? $_143["mime" ] : "image";
  1697.         if ($this->_133) {
  1698.             header("Content-Type: " . $_144);
  1699.         }
  1700.  
  1701.         return $this->_read($_142);
  1702.     }
  1703.  
  1704.     function _fetch_article($_139)
  1705.     {
  1706.         if (strlen($this->_2)) {
  1707.             $_139 = str_replace("{meta_charset}" , $this->_2, $_139);
  1708.         }
  1709.  
  1710.         foreach($this->_126["index" ]["template_fields" ] as $_145) {
  1711.             if (isset($this->_126["article" ][$_145])) {
  1712.                 $_139 = str_replace("{" . $_145 . "}" , $this->_126["article" ][$_145], $_139);
  1713.             }
  1714.             else {
  1715.                 $_139 = str_replace("{" . $_145 . "}" , "" , $_139);
  1716.             }
  1717.         }
  1718.  
  1719.         return ($_139);
  1720.     }
  1721.  
  1722.     function _get_template($_146, $_147)
  1723.     {
  1724.         $this->_128 = "tpl.articles.db";
  1725.         $_148 = $this->_get_db_file();
  1726.         if (file_exists($_148)) {
  1727.             $this->_126["templates" ] = unserialize($this->_read($_148));
  1728.         }
  1729.  
  1730.         if (!isset($this->_126["templates" ][$_146]) or (time() - $this->_126["templates" ][$_146]["date_updated" ]) > $this->_126["index" ]["templates" ][$_147]["lifetime" ]) {
  1731.             $this->_refresh_template($_146, $_148);
  1732.         }
  1733.  
  1734.         if (!isset($this->_126["templates" ][$_146])) {
  1735.             if ($this->_131) {
  1736.                 return $this->raise_error($this->_131);
  1737.             }
  1738.  
  1739.             return $this->raise_error("Не найден шаблон для статьи");
  1740.         }
  1741.  
  1742.         return $this->_126["templates" ][$_146]["body" ];
  1743.     }
  1744.  
  1745.     function _refresh_template($_146, $_148)
  1746.     {
  1747.         $_149 = parse_url($_146);
  1748.         $_150 = "";
  1749.         if ($_149["path" ]) {
  1750.             $_150.= $_149["path" ];
  1751.         }
  1752.  
  1753.         if (isset($_149["query" ])) {
  1754.             $_150.= "?" . $_149["query" ];
  1755.         }
  1756.  
  1757.         $_151 = $this->fetch_remote_file($this->_135, $_150, true);
  1758.         if (!$this->_is_valid_template($_151)) {
  1759.             return false;
  1760.         }
  1761.  
  1762.         $_151 = $this->_cut_template_links($_151);
  1763.         $this->_126["templates" ][$_146] = array(
  1764.             "body" => $_151,
  1765.             "date_updated" => time()
  1766.         );
  1767.         $this->_write($_148, serialize($this->_126["templates" ]));
  1768.     }
  1769.  
  1770.     function _fill_mask($_34)
  1771.     {
  1772.         global $_152;
  1773.         $_153 = strlen($_34[round(0) ]);
  1774.         $_154 = str_repeat($this->_134, $_153);
  1775.         $_152[$this->_134][] = array(
  1776.             "mask" => $_154,
  1777.             "code" => $_34[round(0) ],
  1778.             "len" => $_153
  1779.         );
  1780.         return $_154;
  1781.     }
  1782.  
  1783.     function _cut_unnecessary(&$_155, $_156, $_154)
  1784.     {
  1785.         global $_152;
  1786.         $this->_134 = $_156;
  1787.         $_157[$this->_134] = array();
  1788.         $_155 = preg_replace_callback($_154, array(
  1789.             $this,
  1790.             '_fill_mask'
  1791.         ) , $_155);
  1792.     }
  1793.  
  1794.     function _restore_unnecessary(&$_155, $_156)
  1795.     {
  1796.         global $_152;
  1797.         $_56 = round(0);
  1798.         if (!empty($_152[$_156])) {
  1799.             foreach($_152[$_156] as $_158) {
  1800.                 $_56 = strpos($_155, $_158["mask" ], $_56);
  1801.                 $_155 = substr($_155, round(0) , $_56) . $_158["code" ] . substr($_155, $_56 + $_158["len" ]);
  1802.             }
  1803.         }
  1804.     }
  1805.  
  1806.     function _cut_template_links($_151)
  1807.     {
  1808.         $_159 = "~(\<a [^\>]*?href[^\>]*?\=[\"']{0,1}http[^\>]*?\>.*?\</a[^\>]*?\>|\<a [^\>]*?href[^\>]*?\=[\"']{0,1}http[^\>]*?\>|\<area [^\>]*?href[^\>]*?\=[\"']{0,1}http[^\>]*?\>)~si";
  1809.         $_160 = "~\<a |\<area ~si";
  1810.         $_161 = "~[\s]{1}rel\=[\"']{1}[^ \"'\>]*?[\"']{1}| rel\=[^ \"'\>]*?[\s]{1}~si";
  1811.         $_162 = "~[\s]{1}href\=[\"']{0,1}(http[^ \"'\>]*)?[\"']{0,1} {0,1}~si";
  1812.         $_163 = $this->_126["index" ]["ext_links_allowed" ];
  1813.         $_163[] = $this->_8;
  1814.         $_163[] = "www." . $this->_8;
  1815.         $this->_cut_unnecessary($_151, "C" , "|<!--(.*?)-->|smi");
  1816.         $this->_cut_unnecessary($_151, "S" , "|<script[^>]*>.*?</script>|si");
  1817.         $this->_cut_unnecessary($_151, "N" , "|<noindex[^>]*>.*?</noindex>|si");
  1818.         $_164 = preg_split($_159, $_151, -round(0 + 0.33333333333333 + 0.33333333333333 + 0.33333333333333) , 2);
  1819.         if (is_array($_164)) {
  1820.             foreach($_164 as $_165 => $_79) {
  1821.                 if ($_165 % round(0 + 0.5 + 0.5 + 0.5 + 0.5) == round(0)) {
  1822.                     continue;
  1823.                 }
  1824.  
  1825.                 if (preg_match($_162, $_79, $_166)) {
  1826.                     $_167 = @parse_url($_166[round(0 + 0.5 + 0.5) ]);
  1827.                     $_23 = isset($_167["host" ]) ? $_167["host" ] : false;
  1828.                     if (!in_array($_23, $_163) || !$_23) {
  1829.                         $_164[$_165] = "<noindex>" . $_164[$_165] . "</noindex>";
  1830.                     }
  1831.                 }
  1832.             }
  1833.  
  1834.             $_151 = implode("" , $_164);
  1835.         }
  1836.  
  1837.         $this->_restore_unnecessary($_151, "N");
  1838.         $_164 = preg_split($_159, $_151, -round(0 + 0.2 + 0.2 + 0.2 + 0.2 + 0.2) , 2);
  1839.         if (is_array($_164)) {
  1840.             foreach($_164 as $_165 => $_79) {
  1841.                 if ($_165 % round(0 + 2) == round(0)) {
  1842.                     continue;
  1843.                 }
  1844.  
  1845.                 if (preg_match($_162, $_79, $_166)) {
  1846.                     $_167 = @parse_url($_166[round(0 + 0.5 + 0.5) ]);
  1847.                     $_23 = isset($_167["host" ]) ? $_167["host" ] : false;
  1848.                     if (!in_array($_23, $_163) || !$_23) {
  1849.                         $_164[$_165] = preg_replace($_161, "" , $_79);
  1850.                         $_164[$_165] = preg_replace($_160, "$0rel="nofollow" " , $_164[$_165]);
  1851.                     }
  1852.                 }
  1853.             }
  1854.  
  1855.             $_151 = implode("" , $_164);
  1856.         }
  1857.  
  1858.         $this->_restore_unnecessary($_151, "S");
  1859.         $this->_restore_unnecessary($_151, "C");
  1860.         return $_151;
  1861.     }
  1862.  
  1863.     function _is_valid_template($_151)
  1864.     {
  1865.         foreach($this->_126["index" ]["template_required_fields" ] as $_145) {
  1866.             if (strpos($_151, "{" . $_145 . "}") === false) {
  1867.                 $this->_131 = "В шаблоне не хватает поля " . $_145 . ".";
  1868.                 return false;
  1869.             }
  1870.         }
  1871.  
  1872.         return true;
  1873.     }
  1874.  
  1875.     function _return_html($_53)
  1876.     {
  1877.         if ($this->_133) {
  1878.             header("HTTP/1.x 200 OK");
  1879.             if (!empty($this->_2)) {
  1880.                 header("Content-Type: text/html; charset=" . $this->_2);
  1881.             }
  1882.         }
  1883.  
  1884.         return $_53;
  1885.     }
  1886.  
  1887.     function _return_not_found()
  1888.     {
  1889.         header("HTTP/1.x 404 Not Found");
  1890.     }
  1891.  
  1892.     function _get_dispenser_path()
  1893.     {
  1894.         switch ($this->_125) {
  1895.         case "index":
  1896.             return "/?user=" . _TRUSTLINK_USER . "&host=" . $this->_8 . "&rtype=" . $this->_125;
  1897.             break;
  1898.  
  1899.         case "article":
  1900.             return "/?user=" . _TRUSTLINK_USER . "&host=" . $this->_8 . "&rtype=" . $this->_125 . "&artid=" . $this->_127;
  1901.             break;
  1902.  
  1903.         case "image":
  1904.             return $this->_168;
  1905.             break;
  1906.         }
  1907.     }
  1908.  
  1909.     function _set_request_mode($_169)
  1910.     {
  1911.         $this->_125 = $_169;
  1912.     }
  1913.  
  1914.     function _get_db_file()
  1915.     {
  1916.         if ($this->_10) {
  1917.             return dirname(__FILE__) . "/" . $this->_8 . "." . $this->_128;
  1918.         }
  1919.         else {
  1920.             return dirname(__FILE__) . "/" . $this->_128;
  1921.         }
  1922.     }
  1923.  
  1924.     function set_data($_34)
  1925.     {
  1926.         $this->_126[$this->_125] = $_34;
  1927.     }
  1928. }
Add Comment
Please, Sign In to add comment