示例#1
0
function xoops_module_pre_install_mywords(&$mod)
{
    xoops_setActiveModules();
    $mods = xoops_getActiveModules();
    if (!in_array("rmcommon", $mods)) {
        $mod->setErrors('MyWords could not be instaled if <a href="http://www.redmexico.com.mx/w/common-utilities/" target="_blank">Common Utilities</a> has not be installed previously!<br />Please install <a href="http://www.redmexico.com.mx/w/common-utilities/" target="_blank">Common Utilities</a>.');
        return false;
    }
    return true;
}
示例#2
0
function xoops_module_install_rmcommon($mod)
{
    // Restore previous configurations
    $db = Database::getInstance();
    $db->queryF("UPDATE " . $db->prefix("config") . " SET conf_value='redmexico' WHERE conf_name='cpanel'");
    // Temporary solution
    $contents = file_get_contents(XOOPS_VAR_PATH . '/configs/xoopsconfig.php');
    $write = "if(file_exists(XOOPS_ROOT_PATH.'/modules/rmcommon/loader.php')) include_once XOOPS_ROOT_PATH.'/modules/rmcommon/loader.php';";
    if (strpos($contents, $write) !== FALSE) {
        return true;
    }
    $pos = strpos($contents, '<?php');
    file_put_contents(XOOPS_VAR_PATH . '/configs/xoopsconfig.php', substr($contents, $pos, 5) . "\n" . $write . "\n" . substr($contents, $pos + 5));
    xoops_setActiveModules();
    return true;
}
示例#3
0
function xoops_module_install_rmcommon($mod)
{
    // Prepare welcome screen
    $domain = preg_replace("/http:\\/\\/|https:\\/\\//", '', XOOPS_URL);
    setcookie("rmcwelcome", 1, time() + 365 * 86400, '/', $domain);
    // Restore previous configurations
    $db = XoopsDatabaseFactory::getDatabaseConnection();
    $db->queryF("UPDATE " . $db->prefix("config") . " SET conf_value='redmexico' WHERE conf_name='cpanel'");
    // Temporary solution
    $contents = file_get_contents(XOOPS_VAR_PATH . '/configs/xoopsconfig.php');
    $write = "if(file_exists(XOOPS_ROOT_PATH.'/modules/rmcommon/loader.php')) include_once XOOPS_ROOT_PATH.'/modules/rmcommon/loader.php';";
    if (strpos($contents, $write) !== FALSE) {
        return true;
    }
    $pos = strpos($contents, '<?php');
    file_put_contents(XOOPS_VAR_PATH . '/configs/xoopsconfig.php', substr($contents, $pos, 5) . "\n" . $write . "\n" . substr($contents, $pos + 5));
    xoops_setActiveModules();
    return true;
}
示例#4
0
 $verif_cache = false;
 $verif_session = false;
 $verif_avatar = false;
 $verif_maintenance = false;
 $result_cache = false;
 $result_session = false;
 $result_avatar = false;
 $result_maintenance = false;
 $maintenance = new SystemMaintenance();
 //Cache
 if (!empty($cache)) {
     $verif_cache = true;
     if ($maintenance->CleanCache($_REQUEST['cache'])) {
         $result_cache = true;
         //Set active modules in cache folder
         xoops_setActiveModules();
     }
 }
 //Session
 if ($session == 1) {
     $verif_session = true;
     if ($maintenance->CleanSession()) {
         $result_session = true;
     }
 }
 //Maintenance tables
 if (!empty($tables)) {
     $verif_maintenance = true;
     if (!empty($tables_op)) {
         $result_maintenance = $maintenance->CheckRepairAnalyzeOptimizeQueries($tables, $tables_op);
     }
示例#5
0
/**
 * xoops_getActiveModules()
 *
 * Get active modules from cache file
 *
 * @return array
 */
function xoops_getActiveModules()
{
    static $modules_active;
    if (is_array($modules_active)) {
        return $modules_active;
    }
    xoops_load('XoopsCache');
    if (!($modules_active = XoopsCache::read('system_modules_active'))) {
        $modules_active = xoops_setActiveModules();
    }
    return $modules_active;
}