includes/paths.php
changeset 974 6bfe9eb428e9
parent 960 e74741b8360b
child 979 aafb9f6806c9
equal deleted inserted replaced
973:451141c834fe 974:6bfe9eb428e9
   433   }
   433   }
   434   
   434   
   435   function sysmsg($n)
   435   function sysmsg($n)
   436   {
   436   {
   437     global $db, $session, $paths, $template, $plugins; // Common objects
   437     global $db, $session, $paths, $template, $plugins; // Common objects
       
   438     static $sm_cache = array();
       
   439     
       
   440     if ( isset($sm_cache[$n]) )
       
   441       return $sm_cache[$n];
   438     
   442     
   439     // sometimes this gets called during die_semicritical()...
   443     // sometimes this gets called during die_semicritical()...
   440     if ( !is_object($db) )
   444     if ( !is_object($db) )
   441       return false;
   445       return false;
   442     
   446     
   457     $db->free_result();
   461     $db->free_result();
   458     $message = $r['page_text'];
   462     $message = $r['page_text'];
   459     
   463     
   460     $message = preg_replace('/<noinclude>(.*?)<\/noinclude>/is', '', $message);
   464     $message = preg_replace('/<noinclude>(.*?)<\/noinclude>/is', '', $message);
   461     $message = preg_replace('/<nodisplay>(.*?)<\/nodisplay>/is', '\\1', $message);
   465     $message = preg_replace('/<nodisplay>(.*?)<\/nodisplay>/is', '\\1', $message);
       
   466     
       
   467     $sm_cache[$n] = $message;
   462     
   468     
   463     return $message;
   469     return $message;
   464   }
   470   }
   465   function get_pageid_from_url()
   471   function get_pageid_from_url()
   466   {
   472   {