예제 #1
0
function rebuildThemes($action, $boardname = false)
{
    global $config, $board, $current_locale, $error;
    // Save the global variables
    $_config = $config;
    $_board = $board;
    // List themes
    if ($themes = Cache::get("themes")) {
        // OK, we already have themes loaded
    } else {
        $query = query("SELECT `theme` FROM ``theme_settings`` WHERE `name` IS NULL AND `value` IS NULL") or error(db_error());
        $themes = array();
        while ($theme = $query->fetch(PDO::FETCH_ASSOC)) {
            $themes[] = $theme;
        }
        Cache::set("themes", $themes);
    }
    foreach ($themes as $theme) {
        // Restore them
        $config = $_config;
        $board = $_board;
        // Reload the locale
        if ($config['locale'] != $current_locale) {
            $current_locale = $config['locale'];
            init_locale($config['locale'], $error);
        }
        rebuildTheme($theme['theme'], $action, $boardname);
    }
    // Restore them again
    $config = $_config;
    $board = $_board;
    // Reload the locale
    if ($config['locale'] != $current_locale) {
        $current_locale = $config['locale'];
        init_locale($config['locale'], $error);
    }
}
예제 #2
0
파일: mod.php 프로젝트: niksfish/Tinyboard
         }
         $body .= '</p>';
     }
     echo Element('page.html', array('config' => $config, 'title' => _('Moderation log'), 'body' => $body, 'mod' => true));
 } elseif (preg_match('/^\\/themes\\/none$/', $query, $match)) {
     if (!hasPermission($config['mod']['themes'])) {
         error($config['error']['noaccess']);
     }
     // Clearsettings
     query("TRUNCATE TABLE `theme_settings`") or error(db_error());
     echo Element('page.html', array('config' => $config, 'title' => 'No theme', 'body' => '<p style="text-align:center">Successfully uninstalled all themes.</p>' . '<p style="text-align:center"><a href="?/themes">Go back to themes</a>.</p>', 'mod' => true));
 } elseif (preg_match('/^\\/themes\\/([\\w\\-]+)\\/rebuild$/', $query, $match)) {
     if (!hasPermission($config['mod']['themes'])) {
         error($config['error']['noaccess']);
     }
     rebuildTheme($match[1], 'all');
     echo Element('page.html', array('config' => $config, 'title' => 'Rebuilt', 'body' => '<p style="text-align:center">Successfully rebuilt the <strong>' . $match[1] . '</strong> theme.</p>' . '<p style="text-align:center"><a href="?/themes">Go back to themes</a>.</p>', 'mod' => true));
 } elseif (preg_match('/^\\/themes\\/(\\w+)\\/uninstall$/', $query, $match)) {
     if (!hasPermission($config['mod']['themes'])) {
         error($config['error']['noaccess']);
     }
     $query = prepare("DELETE FROM `theme_settings` WHERE `theme` = :theme");
     $query->bindValue(':theme', $match[1]);
     $query->execute() or error(db_error($query));
     echo Element('page.html', array('config' => $config, 'title' => 'Uninstalled', 'body' => '<p style="text-align:center">Successfully uninstalled the <strong>' . $match[1] . '</strong> theme.</p>' . '<p style="text-align:center"><a href="?/themes">Go back to themes</a>.</p>', 'mod' => true));
 } elseif (preg_match('/^\\/themes(\\/([\\w\\-]+))?$/', $query, $match)) {
     if (!hasPermission($config['mod']['themes'])) {
         error($config['error']['noaccess']);
     }
     if (!is_dir($config['dir']['themes'])) {
         error(_('Themes directory doesn\'t exist!'));
예제 #3
0
파일: cron.php 프로젝트: nabm/Tinyboard
<?php

$_SERVER = array('REQUEST_URI' => '', 'HTTP_HOST' => '', 'SCRIPT_FILENAME' => '');
chdir(str_replace('\\', '/', dirname(__FILE__)) . '/../../../');
require 'inc/functions.php';
require 'inc/display.php';
require 'inc/template.php';
require 'inc/database.php';
require 'theme.php';
rebuildTheme('rrdtool', 'cron');
예제 #4
0
function sb_sitemap()
{
    rebuildTheme("sitemap", "all");
    return true;
}
예제 #5
0
파일: pages.php 프로젝트: vicentil/vichan
function mod_theme_rebuild($theme_name)
{
    global $config;
    if (!hasPermission($config['mod']['themes'])) {
        error($config['error']['noaccess']);
    }
    rebuildTheme($theme_name, 'all');
    mod_page(sprintf(_('Rebuilt theme: %s'), $theme_name), 'mod/theme_rebuilt.html', array('theme_name' => $theme_name));
}
예제 #6
0
function rebuildThemes($action, $board = false)
{
    // List themes
    $query = query("SELECT `theme` FROM ``theme_settings`` WHERE `name` IS NULL AND `value` IS NULL") or error(db_error());
    while ($theme = $query->fetch(PDO::FETCH_ASSOC)) {
        rebuildTheme($theme['theme'], $action, $board);
    }
}
예제 #7
0
function rebuildThemes($action, $boardname = false)
{
    global $config, $board;
    // Save the global variables
    $_config = $config;
    $_board = $board;
    // List themes
    $query = query("SELECT `theme` FROM ``theme_settings`` WHERE `name` IS NULL AND `value` IS NULL") or error(db_error());
    while ($theme = $query->fetch(PDO::FETCH_ASSOC)) {
        rebuildTheme($theme['theme'], $action, $boardname);
    }
    // Restore them
    $config = $_config;
    $board = $_board;
}
예제 #8
0
function rebuildThemes($action)
{
    // List themes
    $query = query("SELECT `theme` FROM `theme_settings` WHERE `name` IS NULL AND `value` IS NULL") or error(db_error());
    while ($theme = $query->fetch()) {
        rebuildTheme($theme['theme'], $action);
    }
}