[ Index ]

PHP Cross Reference of MyBB 1.8.29

title

Body

[close]

/inc/tasks/ -> recachestylesheets.php (source)

   1  <?php
   2  /**
   3   * MyBB 1.8
   4   * Copyright 2014 MyBB Group, All Rights Reserved
   5   *
   6   * Website: http://www.mybb.com
   7   * License: http://www.mybb.com/about/license
   8   *
   9   */
  10  
  11  function task_recachestylesheets($task)
  12  {
  13      global $mybb, $db, $lang;
  14  
  15      if(file_exists(MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions_themes.php"))
  16      {
  17          require_once MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions_themes.php";
  18      }
  19      else if(file_exists(MYBB_ROOT."admin/inc/functions_themes.php"))
  20      {
  21          require_once  MYBB_ROOT."admin/inc/functions_themes.php";
  22      }
  23  
  24      $query = $db->simple_select('themestylesheets', '*');
  25  
  26      $num_recached = 0;
  27  
  28      while($stylesheet = $db->fetch_array($query))
  29      {
  30          if(cache_stylesheet($stylesheet['tid'], $stylesheet['name'], $stylesheet['stylesheet']))
  31          {
  32              $db->update_query("themestylesheets", array('cachefile' => $db->escape_string($stylesheet['name'])), "sid='{$stylesheet['sid']}'", 1);
  33              ++$num_recached;
  34          }
  35      }
  36  
  37      add_task_log($task, $lang->sprintf($lang->task_recachestylesheets_ran, $num_recached));
  38  }
  39  


2005 - 2021 © MyBB.de | Alle Rechte vorbehalten! | Sponsor: netcup Cross-referenced by PHPXref