예제 #1
0
function he_wall_include_footer_logic($page)
{
    global $smarty, $setting, $user, $owner, $url, $misc, $datetime, $database, $admin, $ads, $se_javascript, $lang_packlist, $global_plugins, $global_timezone;
    // GET LANGUAGES AVAILABLE IF NECESSARY
    if ($setting['setting_lang_anonymous'] == 1 || $setting['setting_lang_allow'] == 1 && $user->user_exists != 0) {
        $lang_packlist_raw = SECore::getLanguages();
        //$lang_packlist = SELanguage::list_packs();
        ksort($lang_packlist_raw);
        $lang_packlist = array_values($lang_packlist_raw);
    }
    $smarty->assign_by_ref('url', $url);
    $smarty->assign_by_ref('misc', $misc);
    $smarty->assign_by_ref('datetime', $datetime);
    $smarty->assign_by_ref('database', $database);
    $smarty->assign_by_ref('admin', $admin);
    $smarty->assign_by_ref('user', $user);
    $smarty->assign_by_ref('owner', $owner);
    $smarty->assign_by_ref('ads', $ads);
    $smarty->assign_by_ref('setting', $setting);
    $smarty->assign_by_ref('se_javascript', $se_javascript);
    $smarty->assign('lang_packlist', $lang_packlist);
    $smarty->assign('global_plugins', $global_plugins);
    $smarty->assign('global_page', $page);
    $smarty->assign('global_timezone', $global_timezone);
    $smarty->assign('global_language', SELanguage::info('language_id'));
    return $smarty->fetch($page, null, null, false);
}
예제 #2
0
 function edit($variable_id, $value, $language_id = NULL, $variable_type = LANGUAGE_INDEX_CUSTOM)
 {
     global $database;
     $instance = SELanguage::_init();
     if (empty($language_id)) {
         $language_id = SELanguage::info("language_id");
     }
     if (empty($instance->_indices[$variable_type])) {
         $variable_type = LANGUAGE_INDEX_CUSTOM;
     }
     $value = str_replace("'", "\\'", str_replace("\r\n", "", $value));
     // VARIABLE ID IS NONZERO
     if ($variable_id != 0) {
         // CHECK FOR EXISTING VALUE
         $resource = $database->database_query("SELECT NULL FROM se_languagevars WHERE languagevar_id='{$variable_id}' AND languagevar_language_id='{$language_id}' LIMIT 1");
         if (!$resource) {
             return FALSE;
         }
         // UPDATE EXISTING
         if ($database->database_num_rows($resource)) {
             $database->database_query("UPDATE se_languagevars SET languagevar_value='{$value}' WHERE languagevar_id='{$variable_id}' AND languagevar_language_id='{$language_id}' LIMIT 1");
         } else {
             $database->database_query("INSERT INTO se_languagevars (languagevar_id, languagevar_language_id, languagevar_value) VALUES ('{$variable_id}', '{$language_id}', '{$value}')");
         }
         return $variable_id;
     } else {
         // Insert new
         $int_min = isset($instance->_indices[$variable_type][0]) ? $instance->_indices[$variable_type][0] : 0;
         $int_max = isset($instance->_indices[$variable_type][1]) ? $instance->_indices[$variable_type][1] : 0;
         $resource = $database->database_query("SELECT MAX(languagevar_id)+1 FROM se_languagevars WHERE languagevar_id>={$int_min} AND languagevar_id<={$int_max}");
         $new_id = $database->database_fetch_array($resource);
         $new_id = $new_id[0];
         if (!$new_id && $int_min && $int_max) {
             $new_id = $int_min;
         } elseif (!$new_id) {
             return FALSE;
         }
         $database->database_query("INSERT INTO se_languagevars (languagevar_id, languagevar_language_id, languagevar_value) VALUES ('{$new_id}', '{$language_id}', '{$value}')");
         return $new_id;
     }
 }
예제 #3
0
$smarty->assign_by_ref('admin', $admin);
$smarty->assign_by_ref('user', $user);
$smarty->assign_by_ref('owner', $owner);
$smarty->assign_by_ref('ads', $ads);
$smarty->assign_by_ref('setting', $setting);
$smarty->assign_by_ref('se_javascript', $se_javascript);
$smarty->assign('lang_packlist', $lang_packlist);
$smarty->assign('notifys', $notify->notify_summary());
$smarty->assign('global_plugins', $global_plugins);
$smarty->assign('global_smoothbox', $global_smoothbox);
$smarty->assign('global_page', $page);
$smarty->assign('global_page_title', !empty($global_page_title) ? $global_page_title : NULL);
$smarty->assign('global_page_description', !empty($global_page_description) ? str_replace("\"", "'", $global_page_description) : NULL);
$smarty->assign('global_css', $global_css);
$smarty->assign('global_timezone', $global_timezone);
$smarty->assign('global_language', SELanguage::info('language_id'));
if (SE_DEBUG) {
    $_benchmark->end('shutdown');
    $smarty->assign('debug_uid', $_benchmark->getUid());
    $smarty->assign_by_ref('debug_benchmark_object', $_benchmark);
    $_benchmark->start('output');
}
// DISPLAY PAGE
$smarty->display("{$page}.tpl");
if (SE_DEBUG) {
    $_benchmark->end('output');
    $_benchmark->end('total');
    $smarty->assign('debug_benchmark', $_benchmark->getLog());
    $smarty->assign('debug_benchmark_total', $_benchmark->getTotalTime());
    // Save logging info
    file_put_contents('./log/' . $_benchmark->getUid() . '.html', $smarty->fetch('debug.tpl'));