[ Index ]

WordPress Source Cross Reference

title

Body

[close]

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

Your comment here...

Name: Location:
Comments:


List: Classes | Functions | Variables | Constants | Tables

Generated: Sat Jul 15 11:57:04 2006 Courtesy of Taragana