[ Index ]
 

Code source de WordPress 2.1.2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/wp-includes/ -> vars.php (source)

   1  <?php
   2  
   3  // On which page are we ?
   4  if ( preg_match('#([^/]+\.php)$#', $PHP_SELF, $self_matches) ) {
   5      $pagenow = $self_matches[1];
   6  } elseif ( strpos($PHP_SELF, '?') !== false ) {
   7      $pagenow = explode('/', $PHP_SELF);
   8      $pagenow = trim($pagenow[(sizeof($pagenow)-1)]);
   9      $pagenow = explode('?', $pagenow);
  10      $pagenow = $pagenow[0];
  11  } else {
  12      $pagenow = 'index.php';
  13  }
  14  
  15  // Simple browser detection
  16  // We should probably be doing true/false instead of 1/0 here ~ Mark
  17  $is_lynx = 0; $is_gecko = 0; $is_winIE = 0; $is_macIE = 0; $is_opera = 0; $is_NS4 = 0;
  18  
  19  if ( preg_match('/Lynx/', $_SERVER['HTTP_USER_AGENT']) )
  20      $is_lynx = 1;
  21  elseif ( preg_match('/Gecko/', $_SERVER['HTTP_USER_AGENT']) )
  22      $is_gecko = 1;
  23  elseif ( preg_match('/MSIE/', $_SERVER['HTTP_USER_AGENT']) && preg_match('/Win/', $_SERVER['HTTP_USER_AGENT']) )
  24      $is_winIE = 1;
  25  elseif ( preg_match('/MSIE/', $_SERVER['HTTP_USER_AGENT']) && preg_match('/Mac/', $_SERVER['HTTP_USER_AGENT']) )
  26      $is_macIE = 1;
  27  elseif ( preg_match('/Opera/', $_SERVER['HTTP_USER_AGENT']) )
  28      $is_opera = 1;
  29  elseif ( preg_match('/Nav/', $_SERVER['HTTP_USER_AGENT']) || preg_match('/Mozilla\/4\./', $_SERVER['HTTP_USER_AGENT']) )
  30      $is_NS4 = 1;
  31  
  32  $is_IE = ( $is_macIE || $is_winIE );
  33  
  34  // Server detection
  35  $is_apache = ( strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') || strstr($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') ) ? 1 : 0;
  36  $is_IIS = strstr($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') ? 1 : 0;
  37  
  38  // if the config file does not provide the smilies array, let's define it here
  39  if (!isset($wpsmiliestrans)) {
  40      $wpsmiliestrans = array(
  41      ':mrgreen:' => 'icon_mrgreen.gif',
  42      ':neutral:' => 'icon_neutral.gif',
  43      ':twisted:' => 'icon_twisted.gif',
  44        ':arrow:' => 'icon_arrow.gif',
  45        ':shock:' => 'icon_eek.gif',
  46        ':smile:' => 'icon_smile.gif',
  47          ':???:' => 'icon_confused.gif',
  48         ':cool:' => 'icon_cool.gif',
  49         ':evil:' => 'icon_evil.gif',
  50         ':grin:' => 'icon_biggrin.gif',
  51         ':idea:' => 'icon_idea.gif',
  52         ':oops:' => 'icon_redface.gif',
  53         ':razz:' => 'icon_razz.gif',
  54         ':roll:' => 'icon_rolleyes.gif',
  55         ':wink:' => 'icon_wink.gif',
  56          ':cry:' => 'icon_cry.gif',
  57          ':eek:' => 'icon_surprised.gif',
  58          ':lol:' => 'icon_lol.gif',
  59          ':mad:' => 'icon_mad.gif',
  60          ':sad:' => 'icon_sad.gif',
  61            '8-)' => 'icon_cool.gif',
  62            '8-O' => 'icon_eek.gif',
  63            ':-(' => 'icon_sad.gif',
  64            ':-)' => 'icon_smile.gif',
  65            ':-?' => 'icon_confused.gif',
  66            ':-D' => 'icon_biggrin.gif',
  67            ':-P' => 'icon_razz.gif',
  68            ':-o' => 'icon_surprised.gif',
  69            ':-x' => 'icon_mad.gif',
  70            ':-|' => 'icon_neutral.gif',
  71            ';-)' => 'icon_wink.gif',
  72             '8)' => 'icon_cool.gif',
  73             '8O' => 'icon_eek.gif',
  74             ':(' => 'icon_sad.gif',
  75             ':)' => 'icon_smile.gif',
  76             ':?' => 'icon_confused.gif',
  77             ':D' => 'icon_biggrin.gif',
  78             ':P' => 'icon_razz.gif',
  79             ':o' => 'icon_surprised.gif',
  80             ':x' => 'icon_mad.gif',
  81             ':|' => 'icon_neutral.gif',
  82             ';)' => 'icon_wink.gif',
  83            ':!:' => 'icon_exclaim.gif',
  84            ':?:' => 'icon_question.gif',
  85      );
  86  }
  87  
  88  // generates smilies' search & replace arrays
  89  foreach ( (array) $wpsmiliestrans as $smiley => $img ) {
  90      $wp_smiliessearch[] = '/(\s|^)'.preg_quote($smiley, '/').'(\s|$)/';
  91      $smiley_masked = htmlspecialchars(trim($smiley), ENT_QUOTES);
  92      $wp_smiliesreplace[] = " <img src='" . get_option('siteurl') . "/wp-includes/images/smilies/$img' alt='$smiley_masked' class='wp-smiley' /> ";
  93  }
  94  
  95  ?>


Généré le : Fri Mar 30 19:41:27 2007 par Balluche grâce à PHPXref 0.7