Subversion Repositories personal-webbase

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. <?php
  2.  
  3. if (!defined('WBLEGAL')) die('Kann nicht ohne Personal WebBase ausgef&uuml;hrt werden.');
  4.  
  5. include('modules/'.$m2.'/includes/http_class.inc.php');
  6.  
  7. function inetconn_ok()
  8. {
  9.         global $configuration;
  10.  
  11.         // Ergebnis für Scriptlaufzeit zwischenspeichern aufgrund von Performancegründen
  12.         if (defined('inet_conn_result'))
  13.         {
  14.                 return inet_conn_result;
  15.         }
  16.         else
  17.         {
  18.                 $r = @fsockopen($configuration['common_internet']['internet-check-url'], $configuration['common_internet']['internet-check-port'], $errno, $errstr, 5);
  19.                 define('inet_conn_result', $r);
  20.                 return $r;
  21.         }
  22. }
  23.  
  24. $httpc = new HTTPClass;
  25.  
  26. $httpc->connection_checker = 'inetconn_ok';
  27. $httpc->error_level = HTTPC_ERRLVL_FATAL_ERRORS;
  28.  
  29. $httpc->user_agent = WBUserAgent();
  30.  
  31. function my_get_contents($url) {
  32.         global $httpc;
  33.  
  34.         $httpc_res = $httpc->execute_http_request($url, '');
  35.  
  36.         if ($httpc_res->error != HTTPC_NO_ERROR) {
  37.                 return false;
  38.         } else {
  39.                 return $httpc_res->content;
  40.         }
  41. }
  42.  
  43. function zwischen_url($url, $von, $bis, $flankierungen_miteinbeziehen = true)
  44. {
  45.         $cont = my_get_contents($url);
  46.  
  47.         if ($cont === false) return false;
  48.  
  49.         return zwischen_str($cont, $von, $bis, $flankierungen_miteinbeziehen);
  50. }
  51.  
  52. ?>
  53.