[ Index ]
 

Code source de e107 0.7.8

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

title

Body

[fermer]

/e107_files/shortcode/ -> wmessage.sc (source)

   1  // $Id: wmessage.sc,v 1.20 2007/01/20 05:11:40 mrpete Exp $
   2  $prefwmsc = isset($pref['wmessage_sc']) && $pref['wmessage_sc'];
   3  if (($prefwmsc && $parm == "header") || (!$prefwmsc && ($parm !='header')) ){
   4      return;
   5  }
   6  
   7      global $e107,$e107cache;
   8  
   9  
  10      if (isset($pref['frontpage']['all']) && $pref['frontpage']['all']) {
  11          $full_url = ((strpos($pref['frontpage']['all'], 'http') === FALSE) ? SITEURL : '').$pref['frontpage']['all'];
  12      } else if (ADMIN) {
  13          $full_url = ((strpos($pref['frontpage']['254'], 'http') === FALSE) ? SITEURL : '').$pref['frontpage']['254'];
  14      } else if (USER) {
  15          require_once(e_HANDLER.'userclass_class.php');
  16          $class_list = get_userclass_list();
  17          foreach ($class_list as $fp_class) {
  18              if (check_class($fp_class['userclass_id'])) {
  19                  $full_url = ((strpos($pref['frontpage'][$fp_class['userclass_id']], 'http') === FALSE) ? SITEURL : '').$pref['frontpage'][$fp_class['userclass_id']];
  20          $class_match = true;
  21                  break;
  22              }
  23          }
  24          if (!$class_match) {
  25              $full_url = ((strpos($pref['frontpage']['253'], 'http') === FALSE) ? SITEURL : '').$pref['frontpage']['253'];
  26          }
  27      } else {
  28          $full_url = ((strpos($pref['frontpage']['252'], 'http') === FALSE) ? SITEURL : '').$pref['frontpage']['252'];
  29      }
  30      list($front_url,$front_qry) = explode("?",$full_url."?"); // extra '?' ensure the array is filled
  31  
  32      if($parm == "ignore_query"){
  33          $front_qry = e_QUERY;
  34      }
  35  
  36      if($parm == "force"){
  37          $front_url = e_SELF;
  38          $front_qry = e_QUERY;
  39      }
  40  
  41      if (e_SELF == $front_url && e_QUERY == $front_qry) {
  42          global $sql, $pref, $tp, $ns;
  43  
  44  
  45          if($cacheData = $e107cache->retrieve("wmessage"))
  46          {
  47              echo $cacheData;
  48                 return;
  49          }
  50  
  51  
  52          if (!defined("WMFLAG")) {
  53              $qry = "
  54              SELECT * FROM #generic
  55              WHERE gen_type ='wmessage' AND gen_intdata IN (".USERCLASS_LIST.")";
  56              $wmessage = "";
  57              $wmcaption = "";
  58              if($sql->db_Select_gen($qry))
  59              {
  60                  while ($row = $sql->db_Fetch())
  61                  {
  62                      $wmessage .= $tp->toHTML($row['gen_chardata'], TRUE, 'BODY, defs', 'admin')."<br />";
  63                      if(!$wmcaption){
  64                          $wmcaption = $tp->toHTML($row['gen_ip'], TRUE, 'TITLE');
  65                      }
  66                  }
  67              }
  68  
  69              if (isset($wmessage) && $wmessage)
  70              {
  71                  ob_start();
  72  
  73                  if ($pref['wm_enclose'])
  74                  {
  75                      $ns->tablerender($wmcaption, $wmessage, "wm");
  76                  }
  77                  else
  78                  {
  79                      echo ($wmcaption) ? $wmcaption."<br />" : "";
  80                      echo $wmessage;
  81                  }
  82  
  83                  $cache_data = ob_get_flush();
  84                  $e107cache->set("wmessage", $cache_data);
  85              }
  86          }
  87      }


Généré le : Sun Apr 1 01:23:32 2007 par Balluche grâce à PHPXref 0.7