Beispiel #1
0
function menu_themeswitcher_themeswitcher($position, $block)
{
    global $CONFIG, $THEME_CONFIG, $User, $LANG, $Session;
    $switchtheme = !empty($_GET['switchtheme']) ? urldecode($_GET['switchtheme']) : '';
    if (!empty($switchtheme)) {
        if ($User->check_level(MEMBER_LEVEL)) {
            $Session->csrf_get_protect();
        }
        if (preg_match('`[ a-z0-9_-]{3,20}`i', $switchtheme) && strpos($switchtheme, '\'') === false) {
            $User->update_user_theme($switchtheme);
            if (QUERY_STRING != '') {
                redirect(trim(HOST . SCRIPT . '?' . preg_replace('`switchtheme=[^&]+`', '', QUERY_STRING), '?'));
            } else {
                redirect(HOST . SCRIPT);
            }
        }
    }
    $tpl = new Template('menus/themeswitcher/themeswitcher.tpl');
    import('core/menu_service');
    MenuService::assign_positions_conditions($tpl, $block);
    $utheme = get_utheme();
    foreach ($THEME_CONFIG as $theme => $array_info) {
        if ($User->check_level($array_info['secure']) && $theme != 'default') {
            $selected = $utheme == $theme ? ' selected="selected"' : '';
            $info_theme = @parse_ini_file(PATH_TO_ROOT . '/templates/' . $theme . '/config/' . get_ulang() . '/config.ini');
            $tpl->assign_block_vars('themes', array('NAME' => $info_theme['name'], 'IDNAME' => $theme, 'SELECTED' => $selected));
        }
    }
    $tpl->assign_vars(array('DEFAULT_THEME' => $CONFIG['theme'], 'L_SWITCHTHEME' => 'Changer le thème', 'L_DEFAULT_THEME' => 'Thème par défaut', 'L_SUBMIT' => $LANG['submit']));
    return $tpl->parse(TEMPLATE_STRING_MODE);
}
 function ModuleInterface($moduleId = '', $error = 0)
 {
     global $CONFIG, $MODULES;
     $this->id = $moduleId;
     $this->name = $this->id;
     $this->attributes = array();
     $this->infos = array();
     $this->functionalities = array();
     $this->enabled = !empty($MODULES[strtolower($this->get_id())]) && $MODULES[strtolower($this->get_id())]['activ'] == '1';
     $this->infos = load_ini_file(PATH_TO_ROOT . '/' . $this->id . '/lang/', get_ulang());
     if (isset($this->infos['name'])) {
         $this->name = $this->infos['name'];
     }
     if ($error == 0) {
         $class = ucfirst($moduleId) . 'Interface';
         $module_methods = get_class_methods($class);
         $generics_methods = get_class_methods('ModuleInterface');
         $generics_methods[] = $class;
         $methods_diff = array_diff($module_methods, $generics_methods);
         foreach ($methods_diff as $method) {
             if (substr($method, 0, 1) != '_') {
                 $this->functionalities[] = $method;
             }
         }
         $this->functionalities[] = 'none';
     }
     $this->errors = $error;
 }
 function Template($tpl = '', $auto_load_vars = AUTO_LOAD_FREQUENT_VARS)
 {
     if (!empty($tpl)) {
         global $User, $Session;
         $this->tpl = $this->_check_file($tpl);
         $this->files[$this->tpl] = $this->tpl;
         if ($auto_load_vars) {
             $member_connected = $User->check_level(MEMBER_LEVEL);
             $this->assign_vars(array('SID' => SID, 'THEME' => get_utheme(), 'LANG' => get_ulang(), 'C_USER_CONNECTED' => $member_connected, 'C_USER_NOTCONNECTED' => !$member_connected, 'PATH_TO_ROOT' => TPL_PATH_TO_ROOT, 'PHP_PATH_TO_ROOT' => PATH_TO_ROOT, 'TOKEN' => !empty($Session) ? $Session->get_token() : ''));
         }
     }
 }
Beispiel #4
0
 function _add_update_alert(&$app)
 {
     import('events/administrator_alert_service');
     $identifier = $app->get_identifier();
     if (AdministratorAlertService::find_by_identifier($identifier, 'updates', 'kernel') === null) {
         $alert = new AdministratorAlert();
         global $LANG, $CONFIG;
         require_once PATH_TO_ROOT . '/lang/' . get_ulang() . '/admin.php';
         if ($app->get_type() == APPLICATION_TYPE__KERNEL) {
             $alert->set_entitled(sprintf($LANG['kernel_update_available'], $app->get_version()));
         } else {
             $alert->set_entitled(sprintf($LANG['update_available'], $app->get_type(), $app->get_name(), $app->get_version()));
         }
         $alert->set_fixing_url('admin/updates/detail.php?identifier=' . $identifier);
         $alert->set_priority($app->get_priority());
         $alert->set_properties(serialize($app));
         $alert->set_type('updates');
         $alert->set_identifier($identifier);
         AdministratorAlertService::save_alert($alert);
     }
 }
Beispiel #5
0
                case 'gif':
                case 'bmp':
                    list($width_source, $height_source) = @getimagesize('../upload/' . $row['path']);
                    $size_img = ' (' . $width_source . 'x' . $height_source . ')';
                    $width_source = !empty($width_source) ? $width_source + 30 : 0;
                    $height_source = !empty($height_source) ? $height_source + 30 : 0;
                    $bbcode = '[img]/upload/' . $row['path'] . '[/img]';
                    $link = '<a class="com" href="javascript:popup_upload(\'' . $row['id'] . '\', ' . $width_source . ', ' . $height_source . ', \'yes\')">';
                    break;
                case 'mp3':
                    $bbcode = '[sound]/upload/' . $row['path'] . '[/sound]';
                    $link = '<a class="com" href="javascript:popup_upload(\'' . $row['id'] . '\', 220, 10, \'no\')">';
                    break;
                default:
                    $bbcode = '[url=/upload/' . $row['path'] . ']' . $row['name'] . '[/url]';
                    $link = '<a class="com" href="../upload/' . $row['path'] . '">';
            }
            $Template->assign_block_vars('files', array('ID' => $row['id'], 'IMG' => '<img src="../templates/' . get_utheme() . '/images/upload/' . $get_img_mimetype['img'] . '" alt="" />', 'URL' => $link, 'NAME' => $name_cut, 'RENAME_FILE' => '<span id="fihref' . $row['id'] . '"><a href="javascript:display_rename_file(\'' . $row['id'] . '\', \'' . addslashes($row['name']) . '\', \'' . addslashes($name_cut) . '\');" title="' . $LANG['edit'] . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/edit.png" alt="" style="vertical-align:middle;" /></a></span>', 'FILETYPE' => $get_img_mimetype['filetype'] . $size_img, 'BBCODE' => '<input size="25" type="text" class="text" onclick="select_div(\'text_' . $row['id'] . '\');" id="text_' . $row['id'] . '" style="margin-top:2px;cursor:pointer;" value="' . $bbcode . '" />', 'SIZE' => $row['size'] > 1024 ? number_round($row['size'] / 1024, 2) . ' ' . $LANG['unit_megabytes'] : number_round($row['size'], 0) . ' ' . $LANG['unit_kilobytes'], 'DATE' => gmdate_format('date_format', $row['timestamp']), 'LOGIN' => '<a href="../member/member.php?id=' . $row['user_id'] . '">' . $row['login'] . '</a>', 'U_MOVE' => '.php?movefi=' . $row['id'] . '&amp;f=' . $folder . '&amp;fm=' . $row['user_id']));
            $total_folder_size += $row['size'];
            $total_files++;
        }
        $Sql->query_close($result);
    }
    $total_size = $Sql->query("SELECT SUM(size) FROM " . PREFIX . "upload", __LINE__, __FILE__);
    $Template->assign_vars(array('TOTAL_SIZE' => $total_size > 1024 ? number_round($total_size / 1024, 2) . ' ' . $LANG['unit_megabytes'] : number_round($total_size, 0) . ' ' . $LANG['unit_kilobytes'], 'TOTAL_FOLDER_SIZE' => $total_folder_size > 1024 ? number_round($total_folder_size / 1024, 2) . ' ' . $LANG['unit_megabytes'] : number_round($total_folder_size, 0) . ' ' . $LANG['unit_kilobytes'], 'TOTAL_FOLDERS' => $total_directories, 'TOTAL_FILES' => $total_files));
    if ($total_directories == 0 && $total_files == 0 && (!empty($folder) || !empty($show_member))) {
        $Template->assign_vars(array('C_EMPTY_FOLDER' => true, 'L_EMPTY_FOLDER' => $LANG['empty_folder']));
    }
    $Template->pparse('admin_files_management');
}
require_once '../admin/admin_footer.php';
Beispiel #6
0
    ###### Régénération du cache des rangs #######
    $Cache->Generate_file('ranks');
    redirect(HOST . SCRIPT);
} else {
    $Template->set_filenames(array('admin_ranks' => 'admin/admin_ranks.tpl'));
    $Template->assign_vars(array('THEME' => get_utheme(), 'L_REQUIRE_RANK_NAME' => $LANG['require_rank_name'], 'L_REQUIRE_NBR_MSG_RANK' => $LANG['require_nbr_msg_rank'], 'L_CONFIRM_DEL_RANK' => $LANG['confirm_del_rank'], 'L_RANKS_MANAGEMENT' => $LANG['rank_management'], 'L_ADD_RANKS' => $LANG['rank_add'], 'L_RANK_NAME' => $LANG['rank_name'], 'L_NBR_MSG' => $LANG['nbr_msg'], 'L_IMG_ASSOC' => $LANG['img_assoc'], 'L_DELETE' => $LANG['delete'], 'L_UPDATE' => $LANG['update'], 'L_RESET' => $LANG['reset'], 'L_ADD' => $LANG['add']));
    import('io/filesystem/folder');
    $rank_options_array = array();
    $image_folder_path = new Folder(PATH_TO_ROOT . '/templates/' . get_utheme() . '/images/ranks');
    foreach ($image_folder_path->get_files('`\\.(png|jpg|bmp|gif)$`i') as $image) {
        $file = $image->get_name();
        $rank_options_array[] = $file;
    }
    $result = $Sql->query_while("SELECT id, name, msg, icon, special\n\tFROM " . DB_TABLE_RANKS . " \n\tORDER BY msg", __LINE__, __FILE__);
    while ($row = $Sql->fetch_assoc($result)) {
        if ($row['special'] == 0) {
            $del = '<a href="admin_ranks.php?del=1&amp;id=' . $row['id'] . '" onclick="javascript:return Confirm();"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/delete.png" alt="" title="" /></a>';
        } else {
            $del = $LANG['special_rank'];
        }
        $rank_options = '<option value="">--</option>';
        foreach ($rank_options_array as $icon) {
            $selected = $icon == $row['icon'] ? ' selected="selected"' : '';
            $rank_options .= '<option value="' . $icon . '"' . $selected . '>' . $icon . '</option>';
        }
        $Template->assign_block_vars('rank', array('ID' => $row['id'], 'RANK' => $row['name'], 'MSG' => $row['special'] == 0 ? '<input type="text" maxlength="6" size="6" name="' . $row['id'] . 'msg" value="' . $row['msg'] . '" class="text" />' : $LANG['special_rank'], 'RANK_OPTIONS' => $rank_options, 'IMG_RANK' => $row['icon'], 'DELETE' => $del));
    }
    $Sql->query_close($result);
    $Template->pparse('admin_ranks');
}
require_once '../admin/admin_footer.php';
    $query = "SELECT * FROM " . $table . $Sql->limit($Pagination->get_first_msg(30, 'p'), 30);
    $result = $Sql->query_while($query, __LINE__, __FILE__);
    $i = 1;
    while ($row = $Sql->fetch_assoc($result)) {
        $Template->assign_block_vars('line', array());
        if ($i == 1) {
            $Template->assign_block_vars('line.field', array('FIELD' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', 'CLASS' => 'row1', 'STYLE' => ''));
            foreach ($row as $field_name => $field_value) {
                $Template->assign_block_vars('line.field', array('FIELD' => '<strong>' . $field_name . '</strong>', 'CLASS' => 'row1'));
            }
            $Template->assign_block_vars('line', array());
        }
        $j = 0;
        foreach ($row as $field_name => $field_value) {
            if ($j == 0 && !empty($primary_key)) {
                $Template->assign_block_vars('line.field', array('FIELD' => '<a href="admin_database_tools.php?table=' . $table . '&amp;field=' . $field_name . '&amp;value=' . $field_value . '&amp;action=update&amp;token=' . $Session->get_token() . '" title="' . $LANG['update'] . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/edit.png" alt="" class="valign_middle" /></a> <a href="admin_database_tools.php?table=' . $table . '&amp;field=' . $field_name . '&amp;value=' . $field_value . '&amp;action=delete&amp;token=' . $Session->get_token() . '" onclick="javascript:return Confirm_del_entry()" title="' . $LANG['delete'] . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/delete.png" alt="" class="valign_middle" /></a>', 'CLASS' => 'row1', 'STYLE' => ''));
            }
            $Template->assign_block_vars('line.field', array('FIELD' => str_replace("\n", '<br />', strprotect($field_value, HTML_PROTECT, ADDSLASHES_NONE)), 'CLASS' => 'row2', 'STYLE' => is_numeric($field_value) ? 'text-align:right;' : ''));
            $j++;
        }
        $i++;
    }
    $Template->assign_vars(array('C_DATABASE_TABLE_DATA' => true, 'C_DATABASE_TABLE_STRUCTURE' => false, 'QUERY' => Sql::indent_query($query), 'QUERY_HIGHLIGHT' => Sql::highlight_query($query), 'PAGINATION' => $Pagination->display('admin_database_tools.php?table=' . $table . '&amp;action=data&amp;p=%d', $nbr_lines, 'p', 30, 3), 'L_REQUIRE' => $LANG['require'], 'L_EXPLAIN_QUERY' => $LANG['db_query_explain'], 'L_CONFIRM_QUERY' => $LANG['db_confirm_query'], 'L_EXECUTE' => $LANG['db_submit_query'], 'L_RESULT' => $LANG['db_query_result'], 'L_PAGE' => $LANG['page'], 'L_EXECUTED_QUERY' => $LANG['db_executed_query']));
} elseif (!empty($table) && $action == 'delete') {
    $Session->csrf_get_protect();
    $field = retrieve(GET, 'field', '');
    $value = retrieve(GET, 'value', '');
    if (!empty($value) && !empty($field)) {
        $Sql->query_inject("DELETE FROM " . $table . " WHERE " . $field . " = '" . $value . "'", __LINE__, __FILE__);
    }
    redirect(HOST . DIR . '/database/admin_database_tools.php?table=' . $table . '&action=data');
Beispiel #8
0
 for ($i = -12; $i <= 14; $i++) {
     $selected = $i == $CONFIG['timezone'] ? 'selected="selected"' : '';
     $name = !empty($i) ? $i > 0 ? ' + ' . $i : ' - ' . -$i : '';
     $select_timezone .= '<option value="' . $i . '" ' . $selected . '> [GMT' . $name . ']</option>';
 }
 $Template->assign_vars(array('JS_LANG_IDENTIFIER' => $array_identifier, 'IMG_LANG_IDENTIFIER' => $lang_identifier, 'SELECT_EDITORS' => $select_editors, 'SELECT_TIMEZONE' => $select_timezone, 'L_REQUIRE_MAIL' => $LANG['require_mail'], 'L_REQUIRE_PSEUDO' => $LANG['require_pseudo'], 'L_REQUIRE_PASSWORD' => $LANG['require_password'], 'L_REGISTER' => $LANG['register'], 'L_REQUIRE' => $LANG['require'], 'L_PASSWORD_SAME' => $LANG['e_pass_same'], 'L_MAIL_INVALID' => $LANG['e_mail_invalid'], 'L_PSEUDO_AUTH' => $LANG['e_pseudo_auth'], 'L_MAIL_AUTH' => $LANG['e_mail_auth'], 'L_MAIL' => $LANG['mail'], 'L_VALID' => $LANG['valid'], 'L_PSEUDO' => $LANG['pseudo'], 'L_PSEUDO_HOW' => $LANG['pseudo_how'], 'L_PASSWORD' => $LANG['password'], 'L_PASSWORD_HOW' => $LANG['password_how'], 'L_CONFIRM_PASSWORD' => $LANG['confirm_password'], 'L_VERIF_CODE' => $LANG['verif_code'], 'L_VERIF_CODE_EXPLAIN' => $LANG['verif_code_explain'], 'L_LANG_CHOOSE' => $LANG['choose_lang'], 'L_OPTIONS' => $LANG['options'], 'L_THEME_CHOOSE' => $LANG['choose_theme'], 'L_EDITOR_CHOOSE' => $LANG['choose_editor'], 'L_TIMEZONE_CHOOSE' => $LANG['timezone_choose'], 'L_TIMEZONE_CHOOSE_EXPLAIN' => $LANG['timezone_choose_explain'], 'L_HIDE_MAIL' => $LANG['hide_mail'], 'L_HIDE_MAIL_WHO' => $LANG['hide_mail_who'], 'L_INFO' => $LANG['info'], 'L_WEB_SITE' => $LANG['web_site'], 'L_LOCALISATION' => $LANG['localisation'], 'L_JOB' => $LANG['job'], 'L_HOBBIES' => $LANG['hobbies'], 'L_SEX' => $LANG['sex'], 'L_MALE' => $LANG['male'], 'L_FEMALE' => $LANG['female'], 'L_DATE_OF_BIRTH' => $LANG['date_of_birth'], 'L_DATE_FORMAT' => $LANG['date_birth_format'], 'L_SIGN' => $LANG['sign'], 'L_SIGN_WHERE' => $LANG['sign_where'], 'L_CONTACT' => $LANG['contact'], 'L_AVATAR_MANAGEMENT' => $LANG['avatar_gestion'], 'L_AVATAR_LINK' => $LANG['avatar_link'], 'L_AVATAR_LINK_WHERE' => $LANG['avatar_link_where'], 'L_WEIGHT_MAX' => $LANG['weight_max'], 'L_UPLOAD_AVATAR' => $LANG['upload_avatar'], 'L_UPLOAD_AVATAR_WHERE' => $LANG['upload_avatar_where'], 'L_SUBMIT' => $LANG['submit'], 'L_PREVIOUS_PASS' => $LANG['previous_password'], 'L_EDIT_JUST_IF_MODIF' => $LANG['fill_only_if_modified'], 'L_NEW_PASS' => $LANG['new_password'], 'L_CONFIRM_PASS' => $LANG['confirm_password'], 'L_LANG_CHOOSE' => $LANG['choose_lang'], 'L_HIDE_MAIL' => $LANG['hide_mail'], 'L_HIDE_MAIL_WHO' => $LANG['hide_mail_who'], 'L_INFO' => $LANG['info'], 'L_SITE_WEB' => $LANG['web_site'], 'L_LOCALISATION' => $LANG['localisation'], 'L_HEIGHT_MAX' => $LANG['height_max'], 'L_WIDTH_MAX' => $LANG['width_max']));
 if ($CONFIG_USER['force_theme'] == 0) {
     foreach ($THEME_CONFIG as $theme => $array_info) {
         if ($CONFIG['theme'] == $theme || $array_info['secure'] == -1 && $theme != 'default') {
             $selected = $CONFIG['theme'] == $theme ? ' selected="selected"' : '';
             $info_theme = load_ini_file('../templates/' . $theme . '/config/', $CONFIG['lang']);
             $Template->assign_block_vars('select_theme', array('NAME' => $info_theme['name'], 'IDNAME' => $theme, 'SELECTED' => $selected));
         }
     }
 } else {
     $theme_info = load_ini_file('/config/', get_ulang());
     $Template->assign_block_vars('select_theme', array('NAME' => !empty($theme_info['name']) ? $theme_info['name'] : $CONFIG['theme'], 'IDNAME' => $CONFIG['theme']));
 }
 $extend_field_exist = $Sql->query("SELECT COUNT(*) FROM " . DB_TABLE_MEMBER_EXTEND_CAT . " WHERE display = 1", __LINE__, __FILE__);
 if ($extend_field_exist > 0) {
     $Template->assign_vars(array('L_MISCELLANEOUS' => $LANG['miscellaneous']));
     $Template->assign_block_vars('miscellaneous', array());
     $result = $Sql->query_while("SELECT exc.name, exc.contents, exc.field, exc.required, exc.field_name, exc.possible_values, exc.default_values\n\t\t\tFROM " . DB_TABLE_MEMBER_EXTEND_CAT . " AS exc\n\t\t\tWHERE exc.display = 1\n\t\t\tORDER BY exc.class", __LINE__, __FILE__);
     while ($row = $Sql->fetch_assoc($result)) {
         $field = '';
         switch ($row['field']) {
             case 1:
                 $field = '<input type="text" size="30" name="' . $row['field_name'] . '" id="' . $row['field_name'] . '" class="text" value="' . $row['default_values'] . '" />';
                 break;
             case 2:
                 $field = '<textarea class="post" rows="4" cols="27" name="' . $row['field_name'] . '" id="' . $row['field_name'] . '">' . unparse($row['default_values']) . '</textarea>';
        $creation_date = $this_contribution->get_creation_date();
        $fixing_date = $this_contribution->get_fixing_date();
        if ($User->check_auth($this_contribution->get_auth(), CONTRIBUTION_AUTH_BIT) || $User->get_attribute('user_id') == $this_contribution->get_poster_id()) {
            if ($num_contributions > CONTRIBUTIONS_PER_PAGE * ($pagination->get_current_page() - 1) && $num_contributions <= CONTRIBUTIONS_PER_PAGE * $pagination->get_current_page()) {
                $template->assign_block_vars('contributions', array('ENTITLED' => $this_contribution->get_entitled(), 'MODULE' => $this_contribution->get_module_name(), 'STATUS' => $this_contribution->get_status_name(), 'CREATION_DATE' => $creation_date->format(DATE_FORMAT_SHORT), 'FIXING_DATE' => $fixing_date->format(DATE_FORMAT_SHORT), 'POSTER' => $this_contribution->get_poster_login(), 'FIXER' => $this_contribution->get_fixer_login(), 'ACTIONS' => '', 'U_FIXER_PROFILE' => PATH_TO_ROOT . '/member/' . url('member.php?id=' . $this_contribution->get_fixer_id(), 'member-' . $this_contribution->get_fixer_id() . '.php'), 'U_POSTER_PROFILE' => PATH_TO_ROOT . '/member/' . url('member.php?id=' . $this_contribution->get_poster_id(), 'member-' . $this_contribution->get_poster_id() . '.php'), 'U_CONSULT' => PATH_TO_ROOT . '/member/' . url('contribution_panel.php?id=' . $this_contribution->get_id()), 'C_FIXED' => $this_contribution->get_status() == EVENT_STATUS_PROCESSED, 'C_PROCESSING' => $this_contribution->get_status() == EVENT_STATUS_BEING_PROCESSED));
            }
            $num_contributions++;
        }
    }
    if ($num_contributions > 1) {
        $template->assign_vars(array('PAGINATION' => $pagination->display('contribution_panel.php?p=%d&criteria=' . $criteria . '&order=' . $order, $num_contributions - 1, 'p', CONTRIBUTIONS_PER_PAGE, 3)));
    } else {
        $template->assign_vars(array('C_NO_CONTRIBUTION' => true, 'L_NO_CONTRIBUTION_TO_DISPLAY' => $LANG['no_contribution']));
    }
    define('NUMBER_OF_MODULES_PER_LINE', 4);
    $i_module = 0;
    foreach ($MODULES as $module_name => $module_infos) {
        $module_ini = load_ini_file(PATH_TO_ROOT . '/' . $module_name . '/lang/', get_ulang());
        if (!empty($module_ini['contribution_interface'])) {
            if ($i_module % NUMBER_OF_MODULES_PER_LINE == 0) {
                $template->assign_block_vars('row', array());
            }
            $template->assign_block_vars('row.module', array('WIDTH' => (int) (100.0 / NUMBER_OF_MODULES_PER_LINE), 'U_MODULE_LINK' => PATH_TO_ROOT . '/' . $module_name . '/' . url($module_ini['contribution_interface']), 'MODULE_ID' => $module_name, 'MODULE_NAME' => $module_ini['name'], 'LINK_TITLE' => sprintf($LANG['contribute_in_module_name'], $module_ini['name'])));
            $i_module++;
        }
    }
    $template->assign_vars(array('L_ENTITLED' => $LANG['contribution_entitled'], 'L_STATUS' => $LANG['contribution_status'], 'L_POSTER' => $LANG['contributor'], 'L_CREATION_DATE' => $LANG['contribution_creation_date'], 'L_FIXER' => $LANG['contribution_fixer'], 'L_FIXING_DATE' => $LANG['contribution_fixing_date'], 'L_MODULE' => $LANG['contribution_module'], 'L_CONTRIBUTION_PANEL' => $LANG['contribution_panel'], 'L_CONTRIBUTION_LIST' => $LANG['contribution_list'], 'L_CONTRIBUTE' => $LANG['contribute'], 'L_CONTRIBUTE_EXPLAIN' => $LANG['contribute_in_modules_explain'], 'L_NO_MODULE_IN_WHICH_CONTRIBUTE' => $LANG['no_module_to_contribute'], 'C_NO_MODULE_IN_WHICH_CONTRIBUTE' => $i_module == 0));
    $template->assign_vars(array('C_ORDER_ENTITLED_ASC' => $criteria == 'entitled' && $order == 'asc', 'U_ORDER_ENTITLED_ASC' => url('contribution_panel.php?p=' . $pagination->_get_var_page('p') . '&amp;criteria=entitled&amp;order=asc'), 'C_ORDER_ENTITLED_DESC' => $criteria == 'entitled' && $order == 'desc', 'U_ORDER_ENTITLED_DESC' => url('contribution_panel.php?p=' . $pagination->_get_var_page('p') . '&amp;criteria=entitled&amp;order=desc'), 'C_ORDER_MODULE_ASC' => $criteria == 'module' && $order == 'asc', 'U_ORDER_MODULE_ASC' => url('contribution_panel.php?p=' . $pagination->_get_var_page('p') . '&amp;criteria=module&amp;order=asc'), 'C_ORDER_MODULE_DESC' => $criteria == 'module' && $order == 'desc', 'U_ORDER_MODULE_DESC' => url('contribution_panel.php?p=' . $pagination->_get_var_page('p') . '&amp;criteria=module&amp;order=desc'), 'C_ORDER_STATUS_ASC' => $criteria == 'current_status' && $order == 'asc', 'U_ORDER_STATUS_ASC' => url('contribution_panel.php?p=' . $pagination->_get_var_page('p') . '&amp;criteria=current_status&amp;order=asc'), 'C_ORDER_STATUS_DESC' => $criteria == 'current_status' && $order == 'desc', 'U_ORDER_STATUS_DESC' => url('contribution_panel.php?p=' . $pagination->_get_var_page('p') . '&amp;criteria=current_status&amp;order=desc'), 'C_ORDER_CREATION_DATE_ASC' => $criteria == 'creation_date' && $order == 'asc', 'U_ORDER_CREATION_DATE_ASC' => url('contribution_panel.php?p=' . $pagination->_get_var_page('p') . '&amp;criteria=creation_date&amp;order=asc'), 'C_ORDER_CREATION_DATE_DESC' => $criteria == 'creation_date' && $order == 'desc', 'U_ORDER_CREATION_DATE_DESC' => url('contribution_panel.php?p=' . $pagination->_get_var_page('p') . '&amp;criteria=creation_date&amp;order=desc'), 'C_ORDER_FIXING_DATE_ASC' => $criteria == 'fixing_date' && $order == 'asc', 'U_ORDER_FIXING_DATE_ASC' => url('contribution_panel.php?p=' . $pagination->_get_var_page('p') . '&amp;criteria=fixing_date&amp;order=asc'), 'C_ORDER_FIXING_DATE_DESC' => $criteria == 'fixing_date' && $order == 'desc', 'U_ORDER_FIXING_DATE_DESC' => url('contribution_panel.php?p=' . $pagination->_get_var_page('p') . '&amp;criteria=fixing_date&amp;order=desc'), 'C_ORDER_POSTER_ASC' => $criteria == 'poster_id' && $order == 'asc', 'U_ORDER_POSTER_ASC' => url('contribution_panel.php?p=' . $pagination->_get_var_page('p') . '&amp;criteria=poster_id&amp;order=asc'), 'C_ORDER_POSTER_DESC' => $criteria == 'poster_id' && $order == 'desc', 'U_ORDER_POSTER_DESC' => url('contribution_panel.php?p=' . $pagination->_get_var_page('p') . '&amp;criteria=poster_id&amp;order=desc'), 'C_ORDER_FIXER_ASC' => $criteria == 'fixer_id' && $order == 'asc', 'U_ORDER_FIXER_ASC' => url('contribution_panel.php?p=' . $pagination->_get_var_page('p') . '&amp;criteria=fixer_id&amp;order=asc'), 'C_ORDER_FIXER_DESC' => $criteria == 'fixer_id' && $order == 'desc', 'U_ORDER_FIXER_DESC' => url('contribution_panel.php?p=' . $pagination->_get_var_page('p') . '&amp;criteria=fixer_id&amp;order=desc')));
}
$template->parse();
require_once '../kernel/footer.php';
Beispiel #10
0
 $CONFIG['mail_exp'] = '';
 $CONFIG['mail'] = '';
 $CONFIG['sign'] = $LANG['site_config_mail_signature'];
 $CONFIG['anti_flood'] = 0;
 $CONFIG['delay_flood'] = 7;
 $CONFIG['unlock_admin'] = '';
 $CONFIG['pm_max'] = 50;
 $CONFIG['search_cache_time'] = 30;
 $CONFIG['search_max_use'] = 100;
 $CONFIG['html_auth'] = array('r2' => 1);
 $CONFIG['forbidden_tags'] = array();
 require_once 'functions.php';
 load_db_connection();
 $Sql->query_inject("UPDATE " . DB_TABLE_CONFIGS . " SET value = '" . addslashes(serialize($CONFIG)) . "' WHERE name = 'config'", __LINE__, __FILE__);
 $Sql->query_inject("INSERT INTO " . DB_TABLE_LANG . " (lang, activ, secure) VALUES ('" . strprotect($CONFIG['lang']) . "', 1, -1)", __LINE__, __FILE__);
 $info_theme = load_ini_file('../templates/' . $CONFIG['theme'] . '/config/', get_ulang());
 $Sql->query_inject("INSERT INTO " . DB_TABLE_THEMES . " (theme, activ, secure, left_column, right_column) VALUES ('" . strprotect($CONFIG['theme']) . "', 1, -1, '" . $info_theme['left_column'] . "', '" . $info_theme['right_column'] . "')", __LINE__, __FILE__);
 include '../kernel/framework/core/cache.class.php';
 include '../lang/' . $lang . '/main.php';
 $Cache = new Cache();
 import('modules/packages_manager');
 foreach ($DISTRIBUTION_MODULES as $module_name) {
     $Cache->load('modules', RELOAD_CACHE);
     PackagesManager::install_module($module_name, true, DO_NOT_GENERATE_CACHE_AFTER_THE_OPERATION);
 }
 $Cache->generate_file('modules');
 $Cache->load('modules', RELOAD_CACHE);
 import('core/menu_service');
 MenuService::enable_all(true);
 $modules_menu = MenuService::website_modules(VERTICAL_MENU);
 MenuService::move($modules_menu, BLOCK_POSITION__LEFT, false);
Beispiel #11
0
<?php

require_once '../admin/admin_begin.php';
define('TITLE', $LANG['administration']);
require_once '../admin/admin_header.php';
$Template->set_filenames(array('admin_extend' => 'admin/admin_extend.tpl'));
$Template->assign_vars(array('LANG' => get_ulang(), 'THEME' => get_utheme(), 'L_CONFIGURATION' => $LANG['configuration'], 'L_INDEX_SITE' => $LANG['site'], 'L_INDEX_ADMIN' => $LANG['administration'], 'L_SITE_LINK' => $LANG['link_management'], 'L_SITE_MENU' => $LANG['menu_management'], 'L_MODERATION' => $LANG['moderation'], 'L_MAINTAIN' => $LANG['maintain'], 'L_USER' => $LANG['member'], 'L_EXTEND_FIELD' => $LANG['extend_field'], 'L_RANKS' => $LANG['ranks'], 'L_GROUP' => $LANG['group'], 'L_THEME' => $LANG['themes'], 'L_SMILEY' => $LANG['smile'], 'L_ROBOTS' => $LANG['robots'], 'L_ERRORS' => $LANG['errors'], 'L_COM' => $LANG['com'], 'L_UPDATER' => $LANG['updater'], 'L_MODULES' => $LANG['modules'], 'L_CACHE' => $LANG['cache'], 'U_INDEX_SITE' => substr($CONFIG['start_page'], 0, 1) == '/' ? '..' . $CONFIG['start_page'] : $CONFIG['start_page'], 'L_WEBSITE_UPDATES' => $LANG['website_updates']));
$i = 1;
$nbr_modules = count($modules_config);
foreach ($modules_config as $module_name => $auth) {
    if (is_array($modules_config[$module_name])) {
        $name = $modules_config[$module_name]['module_name'];
        if (!empty($modules_config[$module_name]['admin'])) {
            $Template->assign_block_vars('modules_extend', array('NAME' => $module_name, 'IMG' => '../' . $name . '/' . $name . '.png', 'START_TR' => ($i - 1) % 5 == 0 || $i == 1 ? '<tr style="text-align:center;">' : '', 'END_TR' => $i % 5 == 0 && $i != 1 || $i == $nbr_modules ? '</tr>' : '', 'U_ADMIN_MODULE' => '../' . $name . '/admin_' . $name . '.php'));
            $i++;
        }
    }
}
if ($i != 0) {
    $i--;
    while ($i % 5 != 0) {
        $Template->assign_block_vars('modules_extend.td', array('TD' => '<td class="row2" style="width:20%;">&nbsp;</td>'));
        $i++;
    }
}
$Template->pparse('admin_extend');
require_once '../admin/admin_footer.php';
Beispiel #12
0
define('PATH_TO_ROOT', '../../..');
define('NO_SESSION_LOCATION', true);
$get_brw = !empty($_GET['browsers']) ? true : false;
$get_os = !empty($_GET['os']) ? true : false;
$get_lang = !empty($_GET['lang']) ? true : false;
$get_bot = !empty($_GET['bot']) ? true : false;
$get_theme = !empty($_GET['theme']) ? true : false;
$get_sex = !empty($_GET['sex']) ? true : false;
$get_visit_month = !empty($_GET['visit_month']) ? true : false;
$get_visit_year = !empty($_GET['visit_year']) ? true : false;
$get_pages_day = !empty($_GET['pages_day']) ? true : false;
$get_pages_month = !empty($_GET['pages_month']) ? true : false;
$get_pages_year = !empty($_GET['pages_year']) ? true : false;
include_once PATH_TO_ROOT . '/kernel/begin.php';
include_once PATH_TO_ROOT . '/lang/' . get_ulang() . '/stats.php';
import('util/images_stats');
$Stats = new Stats();
$array_stats = array('other' => 0);
if ($get_visit_month) {
    $year = !empty($_GET['year']) ? numeric($_GET['year']) : '';
    $month = !empty($_GET['month']) ? numeric($_GET['month']) : '1';
    $array_stats = array();
    $result = $Sql->query_while("SELECT nbr, stats_day\n\tFROM " . DB_TABLE_STATS . " WHERE stats_year = '" . $year . "' AND stats_month = '" . $month . "' \n\tORDER BY stats_day", __LINE__, __FILE__);
    while ($row = $Sql->fetch_assoc($result)) {
        $array_stats[$row['stats_day']] = $row['nbr'];
    }
    $Sql->query_close($result);
    $bissextile = date("L", mktime(0, 0, 0, 1, 1, $year)) == 1 ? 29 : 28;
    $array_month = array(31, $bissextile, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
    for ($i = 1; $i <= $array_month[$month - 1]; $i++) {
 function get_module_name()
 {
     global $CONFIG;
     if (!empty($this->module)) {
         $module_ini = load_ini_file(PATH_TO_ROOT . '/' . $this->module . '/lang/', get_ulang());
         return isset($module_ini['name']) ? $module_ini['name'] : '';
     } else {
         return '';
     }
 }
 function add_mini_module($module, $generate_cache = true)
 {
     $info_module = load_ini_file(PATH_TO_ROOT . '/' . $module . '/lang/', get_ulang());
     if (empty($info_module) || empty($info_module['mini_module'])) {
         return false;
     }
     $mini_modules_menus = parse_ini_array($info_module['mini_module']);
     if (empty($mini_modules_menus)) {
         return false;
     }
     $installed = false;
     foreach ($mini_modules_menus as $filename => $location) {
         if (file_exists(PATH_TO_ROOT . '/' . $module . '/' . $filename)) {
             $file = explode('.', $filename, 2);
             if (!is_array($file) || count($file) < 1) {
                 continue;
             }
             include_once PATH_TO_ROOT . '/' . $module . '/' . $filename;
             if (!function_exists($file[0])) {
                 continue;
             }
             $menu = new ModuleMiniMenu($module, $file[0]);
             $menu->enabled(false);
             $menu->set_auth(array('r1' => MENU_AUTH_BIT, 'r0' => MENU_AUTH_BIT, 'r-1' => MENU_AUTH_BIT));
             $menu->set_block(MenuService::str_to_location($location));
             MenuService::save($menu);
             if ($generate_cache) {
                 MenuService::generate_cache();
             }
             $installed = true;
         }
     }
     return $installed;
 }
 function _get_installed_version()
 {
     global $CONFIG;
     switch ($this->type) {
         case APPLICATION_TYPE__KERNEL:
             return $CONFIG['version'];
         case APPLICATION_TYPE__MODULE:
             $infos = get_ini_config(PATH_TO_ROOT . '/' . $this->id . '/lang/', get_ulang());
             return !empty($infos['version']) ? $infos['version'] : '0';
         case APPLICATION_TYPE__THEME:
             $infos = get_ini_config(PATH_TO_ROOT . '/templates/' . $this->id . '/config/', get_ulang());
             return !empty($infos['version']) ? $infos['version'] : '0';
         default:
             return '0';
     }
 }
Beispiel #16
0
            $sort = 'user_aprob';
            break;
        default:
            $sort = 'timestamp';
    }
    $get_mode = retrieve(GET, 'mode', '');
    $mode = $get_mode == 'asc' ? 'ASC' : 'DESC';
    $unget = !empty($get_sort) && !empty($mode) ? '&amp;sort=' . $get_sort . '&amp;mode=' . $get_mode : '';
    $Template->assign_vars(array('PAGINATION' => $Pagination->display('admin_members.php?p=%d' . $unget, $nbr_membre, 'p', 25, 3), 'THEME' => get_utheme(), 'LANG' => get_ulang(), 'KERNEL_EDITOR' => display_editor(), 'L_REQUIRE_MAIL' => $LANG['require_mail'], 'L_REQUIRE_PASS' => $LANG['require_pass'], 'L_REQUIRE_RANK' => $LANG['require_rank'], 'L_REQUIRE_LOGIN' => $LANG['require_pseudo'], 'L_REQUIRE_TEXT' => $LANG['require_text'], 'L_CONFIRM_DEL_USER' => $LANG['confirm_del_member'], 'L_CONFIRM_DEL_ADMIN' => $LANG['confirm_del_admin'], 'L_CONTENTS' => $LANG['content'], 'L_SUBMIT' => $LANG['submit'], 'L_UPDATE' => $LANG['update'], 'L_USERS_MANAGEMENT' => $LANG['members_management'], 'L_USERS_ADD' => $LANG['members_add'], 'L_USERS_CONFIG' => $LANG['members_config'], 'L_USERS_PUNISHMENT' => $LANG['members_punishment'], 'L_PSEUDO' => $LANG['pseudo'], 'L_PASSWORD' => $LANG['password'], 'L_MAIL' => $LANG['mail'], 'L_RANK' => $LANG['rank'], 'L_APROB' => $LANG['aprob'], 'L_USER' => $LANG['member'], 'L_MODO' => $LANG['modo'], 'L_ADMIN' => $LANG['admin'], 'L_SEARCH_USER' => $LANG['search_member'], 'L_JOKER' => $LANG['joker'], 'L_SEARCH' => $LANG['search'], 'L_WEBSITE' => $LANG['website'], 'L_REGISTERED' => $LANG['registered'], 'L_DELETE' => $LANG['delete']));
    $result = $Sql->query_while("SELECT login, user_id, user_mail, timestamp, user_web, level, user_aprob\n\tFROM " . DB_TABLE_MEMBER . " \n\tORDER BY " . $sort . " " . $mode . $Sql->limit($Pagination->get_first_msg(25, 'p'), 25), __LINE__, __FILE__);
    while ($row = $Sql->fetch_assoc($result)) {
        switch ($row['level']) {
            case 0:
                $rank = $LANG['member'];
                break;
            case 1:
                $rank = $LANG['modo'];
                break;
            case 2:
                $rank = $LANG['admin'];
                break;
            default:
                0;
        }
        $user_web = !empty($row['user_web']) ? '<a href="' . $row['user_web'] . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/user_web.png" alt="' . $row['user_web'] . '" title="' . $row['user_web'] . '" /></a>' : '';
        $Template->assign_block_vars('member', array('IDMBR' => $row['user_id'], 'NAME' => $row['login'], 'RANK' => $rank, 'MAIL' => $row['user_mail'], 'WEB' => $user_web, 'LEVEL' => $row['level'], 'DATE' => gmdate_format('date_format_short', $row['timestamp']), 'APROB' => $row['user_aprob'] == 0 ? $LANG['no'] : $LANG['yes']));
    }
    $Sql->query_close($result);
    $Template->pparse('admin_members_management');
}
require_once '../admin/admin_footer.php';
Beispiel #17
0
    if (!$lock_file->exists()) {
        $lock_file->write('');
        $lock_file->flush();
    }
    $lock_file->lock(false);
    $yesterday_timestamp = time() - 86400;
    if ((int) $Sql->query("\n\t    SELECT COUNT(*)\n            FROM " . DB_TABLE_STATS . "\n            WHERE stats_year = '" . gmdate_format('Y', $yesterday_timestamp, TIMEZONE_SYSTEM) . "' AND\n                stats_month = '" . gmdate_format('m', $yesterday_timestamp, TIMEZONE_SYSTEM) . "' AND\n                stats_day = '" . gmdate_format('d', $yesterday_timestamp, TIMEZONE_SYSTEM) . "'", __LINE__, __FILE__) == 0) {
        $Cache->generate_file('day');
        require_once PATH_TO_ROOT . '/kernel/changeday.php';
        change_day();
    }
    $lock_file->close();
}
define('MODULE_NAME', get_module_name());
if (isset($MODULES[MODULE_NAME])) {
    if ($MODULES[MODULE_NAME]['activ'] == 0) {
        $Errorh->handler('e_unactivated_module', E_USER_REDIRECT);
    } else {
        if (!$User->check_auth($MODULES[MODULE_NAME]['auth'], ACCESS_MODULE)) {
            $Errorh->handler('e_auth', E_USER_REDIRECT);
        }
    }
} elseif (!in_array(MODULE_NAME, array('member', 'admin', 'kernel', ''))) {
    $array_info_module = load_ini_file(PATH_TO_ROOT . '/' . MODULE_NAME . '/lang/', get_ulang());
    if (!empty($array_info_module['name'])) {
        $Errorh->handler('e_uninstalled_module', E_USER_REDIRECT);
    }
}
if ($User->check_level(MEMBER_LEVEL)) {
    $Session->csrf_post_protect();
}
Beispiel #18
0
    $idcat = retrieve(POST, 'idcat', 0);
    $compt = retrieve(POST, 'compt', 0);
    $aprob = retrieve(POST, 'aprob', 0);
    if (!empty($title) && !empty($url) && !empty($idcat)) {
        $Sql->query_inject("UPDATE " . PREFIX . "web SET title = '" . $title . "', contents = '" . $contents . "', url = '" . $url . "', idcat = '" . $idcat . "', compt = '" . $compt . "', aprob = '" . $aprob . "' WHERE id = '" . $id_post . "'", __LINE__, __FILE__);
        redirect(HOST . SCRIPT);
    } else {
        redirect(HOST . DIR . '/web/admin_web.php?id= ' . $id_post . '&error=incomplete#errorh');
    }
} elseif ($del && !empty($id)) {
    $Session->csrf_get_protect();
    $Sql->query_inject("DELETE FROM " . PREFIX . "web WHERE id = '" . $id . "'", __LINE__, __FILE__);
    $Sql->query_inject("DELETE FROM " . DB_TABLE_COM . " WHERE idprov = '" . $id . "' AND script = 'web'", __LINE__, __FILE__);
    redirect(HOST . SCRIPT);
} else {
    $Template->set_filenames(array('admin_web_management' => 'web/admin_web_management.tpl'));
    $nbr_web = $Sql->count_table('web', __LINE__, __FILE__);
    import('util/pagination');
    $Pagination = new Pagination();
    $Template->assign_vars(array('PAGINATION' => $Pagination->display('admin_web.php?p=%d', $nbr_web, 'p', 25, 3), 'THEME' => get_utheme(), 'LANG' => get_ulang(), 'KERNEL_EDITOR' => display_editor(), 'L_WEB_ADD' => $LANG['web_add'], 'L_WEB_MANAGEMENT' => $LANG['web_management'], 'L_WEB_CAT' => $LANG['cat_management'], 'L_WEB_CONFIG' => $LANG['web_config'], 'L_DEL_ENTRY' => $LANG['delete_link'], 'L_LISTE' => $LANG['list'], 'L_NAME' => $LANG['name'], 'L_CATEGORY' => $LANG['category'], 'L_URL' => $LANG['url'], 'L_VIEW' => $LANG['view'], 'L_DATE' => $LANG['date'], 'L_APROB' => $LANG['aprob'], 'L_UPDATE' => $LANG['update'], 'L_DELETE' => $LANG['delete']));
    $result = $Sql->query_while("SELECT d.*, ad.name \n\tFROM " . PREFIX . "web d \n\tLEFT JOIN " . PREFIX . "web_cat ad ON ad.id = d.idcat\n\tORDER BY timestamp DESC \n\t" . $Sql->limit($Pagination->get_first_msg(25, 'p'), 25), __LINE__, __FILE__);
    while ($row = $Sql->fetch_assoc($result)) {
        $aprob = $row['aprob'] == 1 ? $LANG['yes'] : $LANG['no'];
        $title = $row['title'];
        $title = strlen($title) > 45 ? substr_html($title, 0, 45) . '...' : $title;
        $Template->assign_block_vars('web', array('IDWEB' => $row['id'], 'NAME' => $title, 'IDCAT' => $row['idcat'], 'CAT' => $row['name'], 'DATE' => gmdate_format('date_format_short', $row['timestamp']), 'APROBATION' => $aprob, 'COMPT' => $row['compt']));
    }
    $Sql->query_close($result);
    $Template->pparse('admin_web_management');
}
require_once '../admin/admin_footer.php';
Beispiel #19
0
                $class = 'calendar_other';
            }
            $contents = '<td class="' . $class . '">' . $action . '</td>';
            $j++;
        } else {
            $contents = '<td class="calendar_none">&nbsp;</td>';
        }
        $Template->assign_block_vars('calendar', array('DAY' => $contents, 'TR' => $i % 7 == 0 && $i != 42 ? '</tr><tr style="text-align:center;">' : ''));
    }
    if (!empty($day)) {
        $java = '';
        $result = $Sql->query_while("SELECT cl.id, cl.timestamp, cl.title, cl.contents, cl.user_id, cl.nbr_com, m.login\n\t\tFROM " . PREFIX . "calendar cl\n\t\tLEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id=cl.user_id\n\t\tWHERE cl.timestamp BETWEEN '" . mktime(0, 0, 0, $month, $day, $year) . "' AND '" . mktime(23, 59, 59, $month, $day, $year) . "'\n\t\tGROUP BY cl.id", __LINE__, __FILE__);
        while ($row = $Sql->fetch_assoc($result)) {
            if ($User->check_level(ADMIN_LEVEL)) {
                $edit = '&nbsp;&nbsp;<a href="calendar' . url('.php?edit=1&amp;id=' . $row['id']) . '" title="' . $LANG['edit'] . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/edit.png" class="valign_middle" /></a>';
                $del = '&nbsp;&nbsp;<a href="calendar' . url('.php?delete=1&amp;id=' . $row['id'] . '&amp;token=' . $Session->get_token()) . '" title="' . $LANG['delete'] . '" onclick="javascript:return Confirm_del();"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/delete.png" class="valign_middle" alt="" /></a>';
                $java = '<script type="text/javascript">
				<!--
				function Confirm_del() {
				return confirm("' . $LANG['alert_delete_msg'] . '");
				}
				-->
				</script>';
            } else {
                $edit = '';
                $del = '';
                $java = '';
            }
            import('content/comments');
            $Template->assign_block_vars('action', array('DATE' => gmdate_format('date_format', $row['timestamp']), 'TITLE' => $row['title'], 'CONTENTS' => second_parse($row['contents']), 'LOGIN' => '<a class="com" href="../member/member' . url('.php?id=' . $row['user_id'], '-' . $row['user_id'] . '.php') . '">' . $row['login'] . '</a>', 'COM' => Comments::com_display_link($row['nbr_com'], '../calendar/calendar' . url('.php?d=' . $day . '&amp;m=' . $month . '&amp;y=' . $year . '&amp;e=' . $row['id'] . '&amp;com=0', '-' . $day . '-' . $month . '-' . $year . '-' . $row['id'] . '.php?com=0'), $row['id'], 'calendar'), 'EDIT' => $edit, 'DEL' => $del, 'L_ON' => $LANG['on']));
            $check_action = true;
Beispiel #20
0
 function _get_table_module()
 {
     global $Sql, $CONFIG;
     $info_module = load_ini_file(PATH_TO_ROOT . '/' . $this->module_folder . '/lang/', get_ulang());
     $check_script = false;
     if (isset($info_module['note'])) {
         if ($info_module['note'] == $this->script) {
             $idprov = $Sql->query("SELECT id FROM " . PREFIX . $info_module['note'] . " WHERE id = '" . $this->idprov . "'", __LINE__, __FILE__);
             if ($idprov == $this->idprov) {
                 $check_script = true;
             }
         }
     }
     return $check_script ? $info_module['note'] : '0';
 }
$update = !empty($_GET['update']) ? true : false;
if ($update) {
    $module_name = retrieve(GET, 'update', '');
    if (empty($module_name)) {
        foreach ($_POST as $key => $value) {
            if ($value == $LANG['update_module']) {
                $module_name = $key;
            }
        }
        $activ_module = retrieve(POST, $module_name . 'activ', 0);
    }
    $ckeck_module = $Sql->query("SELECT COUNT(*) FROM " . DB_TABLE_MODULES . " WHERE name = '" . strprotect($module_name) . "'", __LINE__, __FILE__);
    if (!empty($ckeck_module)) {
        $info_module = load_ini_file('../' . $module_name . '/lang/', get_ulang());
        $previous_version = $Sql->query("SELECT version FROM " . DB_TABLE_MODULES . " WHERE name = '" . strprotect($module_name) . "'", __LINE__, __FILE__);
        $dir_db_module = get_ulang();
        $dir = '../' . $module_name . '/db';
        import('io/filesystem/folder');
        $folder_path = new Folder($dir . '/' . $dir_db_module);
        foreach ($folder_path->get_folders('`^[a-z0-9_ -]+$`i') as $dir) {
            $dir_db_module = $dir->get_name();
            break;
        }
        $filesupdate = array();
        $dir_db = '../' . urldecode($module_name) . '/db/' . $dir_db_module . '/';
        $folder_path = new Folder($dir_db);
        foreach ($folder_path->get_files('`.*\\.(php|sql)$`i') as $files) {
            $file = $files->get_name();
            if (strpos($file, DBTYPE) !== false) {
                $array_info = explode('_', $file);
                if (isset($array_info[1]) && version_compare($info_module['version'], $array_info[1], '>=') && version_compare($previous_version, $array_info[1], '<')) {
Beispiel #22
0
        $Errorh->handler($LANG['e_incomplete'], E_USER_NOTICE);
    } elseif (!empty($get_error) && isset($LANG[$get_error])) {
        $Errorh->handler($LANG[$get_error], E_USER_WARNING);
    }
    $i = 0;
    $array_modules = array();
    $array_info_module = array();
    $array_ranks = array(-1 => $LANG['guest'], 0 => $LANG['member'], 1 => $LANG['modo'], 2 => $LANG['admin']);
    $result = $Sql->query_while("SELECT id, name, auth, activ\n\tFROM " . PREFIX . "modules\n\tORDER BY name", __LINE__, __FILE__);
    while ($row = $Sql->fetch_assoc($result)) {
        $array_info_module[$row['name']] = load_ini_file('../' . $row['name'] . '/lang/', get_ulang());
        $array_modules[$array_info_module[$row['name']]['name']] = array('id' => $row['id'], 'name' => $row['name'], 'auth' => $row['auth'], 'activ' => $row['activ']);
    }
    $Sql->query_close($result);
    ksort($array_modules);
    foreach ($array_modules as $name => $array_config) {
        $row = $array_modules[$name];
        $info_module = $array_info_module[$array_config['name']];
        $array_auth = !empty($row['auth']) ? unserialize($row['auth']) : array();
        $l_tables = $info_module['sql_table'] > 1 ? $LANG['tables'] : $LANG['table'];
        $Template->assign_block_vars('installed', array('ID' => $row['id'], 'NAME' => ucfirst($info_module['name']), 'ICON' => $row['name'], 'VERSION' => $info_module['version'], 'AUTHOR' => !empty($info_module['author_mail']) ? '<a href="mailto:' . $info_module['author_mail'] . '">' . $info_module['author'] . '</a>' : $info_module['author'], 'AUTHOR_WEBSITE' => !empty($info_module['author_link']) ? '<a href="' . $info_module['author_link'] . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/user_web.png" alt="" /></a>' : '', 'DESC' => $info_module['info'], 'COMPAT' => $info_module['compatibility'], 'ADMIN' => $info_module['admin'] ? $LANG['yes'] : $LANG['no'], 'USE_SQL' => $info_module['sql_table'] > 0 ? $LANG['yes'] : $LANG['no'], 'SQL_TABLE' => $info_module['sql_table'] > 0 ? '(' . $info_module['sql_table'] . ' ' . $l_tables . ')' : '', 'USE_CACHE' => $info_module['cache'] ? $LANG['yes'] : $LANG['no'], 'ALTERNATIVE_CSS' => $info_module['css'] ? $LANG['yes'] : $LANG['no'], 'STARTEABLE_PAGE' => $info_module['starteable_page'] ? $LANG['yes'] : $LANG['no'], 'ACTIV_ENABLED' => $row['activ'] == 1 ? 'checked="checked"' : '', 'ACTIV_DISABLED' => $row['activ'] == 0 ? 'checked="checked"' : '', 'AUTH_MODULES' => Authorizations::generate_select(ACCESS_MODULE, $array_auth, array(2 => true), $row['id'])));
        $i++;
    }
    if ($i == 0) {
        $Template->assign_vars(array('C_NO_MODULE_INSTALLED' => true));
    } else {
        $Template->assign_vars(array('C_MODULES_INSTALLED' => true));
    }
    $Template->pparse('admin_modules_management');
}
require_once '../admin/admin_footer.php';
    $key = array_search('default', $tpl_array);
    if (isset($key)) {
        unset($tpl_array[$key]);
    }
    $result = $Sql->query_while("SELECT theme \n\tFROM " . DB_TABLE_THEMES . "", __LINE__, __FILE__);
    while ($row = $Sql->fetch_assoc($result)) {
        $key = array_search($row['theme'], $tpl_array);
        if ($key !== false) {
            unset($tpl_array[$key]);
        }
    }
    $Sql->query_close($result);
    $array_ranks = array(-1 => $LANG['guest'], 0 => $LANG['member'], 1 => $LANG['modo'], 2 => $LANG['admin']);
    foreach ($tpl_array as $theme_array => $value_array) {
        $info_theme = load_ini_file('../templates/' . $value_array . '/config/', get_ulang());
        $options = '';
        for ($i = -1; $i <= 2; $i++) {
            $selected = $i == -1 ? 'selected="selected"' : '';
            $options .= '<option value="' . $i . '" ' . $selected . '>' . $array_ranks[$i] . '</option>';
        }
        $Template->assign_block_vars('list', array('IDTHEME' => $value_array, 'THEME' => $info_theme['name'], 'ICON' => $value_array, 'VERSION' => $info_theme['version'], 'AUTHOR' => !empty($info_theme['author_mail']) ? '<a href="mailto:' . $info_theme['author_mail'] . '">' . $info_theme['author'] . '</a>' : $info_theme['author'], 'AUTHOR_WEBSITE' => !empty($info_theme['author_link']) ? '<a href="' . $info_theme['author_link'] . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/user_web.png" alt="" /></a>' : '', 'DESC' => $info_theme['info'], 'COMPAT' => $info_theme['compatibility'], 'HTML_VERSION' => $info_theme['html_version'], 'CSS_VERSION' => $info_theme['css_version'], 'MAIN_COLOR' => $info_theme['main_color'], 'VARIABLE_WIDTH' => $info_theme['variable_width'] ? $LANG['yes'] : $LANG['no'], 'WIDTH' => $info_theme['width'], 'OPTIONS' => $options));
        $z++;
    }
    if ($z != 0) {
        $Template->assign_vars(array('C_THEME_PRESENT' => true));
    } else {
        $Template->assign_vars(array('C_NO_THEME_PRESENT' => true));
    }
    $Template->pparse('admin_themes_add');
}
require_once '../admin/admin_footer.php';
Beispiel #24
0
        $img_announce .= $row['status'] == '0' && $row['type'] == '0' ? '_lock' : '';
        if (!empty($row['last_view_id'])) {
            $last_msg_id = $row['last_view_id'];
            $last_page = 'idm=' . $row['last_view_id'] . '&amp;';
            $last_page_rewrite = '-0-' . $row['last_view_id'];
        } else {
            $last_msg_id = $row['last_msg_id'];
            $last_page = ceil($row['nbr_msg'] / $CONFIG_FORUM['pagination_msg']);
            $last_page_rewrite = $last_page > 1 ? '-' . $last_page : '';
            $last_page = $last_page > 1 ? 'pt=' . $last_page . '&amp;' : '';
        }
        $rewrited_title = $CONFIG['rewrite'] == 1 ? '+' . url_encode_rewrite($row['title']) : '';
        $last_msg = '<a href="topic' . url('.php?' . $last_page . 'id=' . $row['id'], '-' . $row['id'] . $last_page_rewrite . $rewrited_title . '.php') . '#m' . $last_msg_id . '" title=""><img src="../templates/' . get_utheme() . '/images/ancre.png" alt="" /></a>' . ' ' . $LANG['on'] . ' ' . gmdate_format('date_format', $row['last_timestamp']) . '<br /> ' . $LANG['by'] . ' ' . (!empty($row['last_login']) ? '<a class="small_link" href="../member/member' . url('.php?id=' . $row['last_user_id'], '-' . $row['last_user_id'] . '.php') . '">' . wordwrap_html($row['last_login'], 13) . '</a>' : '<em>' . $LANG['guest'] . '</em>');
        $new_ancre = $new_msg === true && $User->get_attribute('user_id') !== -1 ? '<a href="topic' . url('.php?' . $last_page . 'id=' . $row['id'], '-' . $row['id'] . $last_page_rewrite . $rewrited_title . '.php') . '#m' . $last_msg_id . '" title=""><img src="../templates/' . get_utheme() . '/images/ancre.png" alt="" /></a>' : '';
        $Template->assign_block_vars('topics', array('C_HOT_TOPIC' => $row['type'] == '0' && $row['status'] != '0' && $row['nbr_msg'] > $CONFIG_FORUM['pagination_msg'], 'ID' => $row['id'], 'INCR' => $nbr_topics_compt, 'CHECKED_PM' => $row['pm'] == 1 ? 'checked="checked"' : '', 'CHECKED_MAIL' => $row['mail'] == 1 ? 'checked="checked"' : '', 'IMG_ANNOUNCE' => $img_announce, 'ANCRE' => $new_ancre, 'POLL' => !empty($row['question']) ? '<img src="' . $Template->get_module_data_path('forum') . '/images/poll_mini.png" class="valign_middle" alt="" />' : '', 'TRACK' => '<img src="' . $Template->get_module_data_path('forum') . '/images/track_mini.png" class="valign_middle" alt="" />', 'DISPLAY_MSG' => $CONFIG_FORUM['activ_display_msg'] && $CONFIG_FORUM['icon_activ_display_msg'] && $row['display_msg'] ? '<img src="' . $Template->get_module_data_path('forum') . '/images/msg_display_mini.png" alt="" style="vertical-align:middle;" />' : '', 'TYPE' => $type[$row['type']], 'TITLE' => ucfirst($row['title']), 'AUTHOR' => !empty($row['login']) ? '<a href="../member/member' . url('.php?id=' . $row['user_id'], '-' . $row['user_id'] . '.php') . '" class="small_link">' . $row['login'] . '</a>' : '<em>' . $LANG['guest'] . '</em>', 'DESC' => $row['subtitle'], 'PAGINATION_TOPICS' => $Pagination->display('topic' . url('.php?id=' . $row['id'] . '&amp;pt=%d', '-' . $row['id'] . '-%d.php'), $row['nbr_msg'], 'pt', $CONFIG_FORUM['pagination_msg'], 2, 10, false), 'MSG' => $row['nbr_msg'] - 1, 'VUS' => $row['nbr_views'], 'U_TOPIC_VARS' => url('.php?id=' . $row['id'], '-' . $row['id'] . $rewrited_title . '.php'), 'U_LAST_MSG' => $last_msg, 'L_DISPLAY_MSG' => $CONFIG_FORUM['activ_display_msg'] && $row['display_msg'] ? $CONFIG_FORUM['display_msg'] : ''));
        $nbr_topics_compt++;
    }
    $Sql->query_close($result);
    $nbr_topics = $Sql->query("SELECT COUNT(*) FROM " . PREFIX . "forum_topics t\n\tLEFT JOIN " . PREFIX . "forum_track tr ON tr.idtopic = t.id\n\tWHERE tr.user_id = '" . $User->get_attribute('user_id') . "'", __LINE__, __FILE__);
    if ($nbr_topics == 0) {
        $Template->assign_vars(array('C_NO_TRACKED_TOPICS' => true, 'L_NO_TRACKED_TOPICS' => '0 ' . $LANG['show_topic_track']));
    }
    $l_topic = $nbr_topics > 1 ? $LANG['topic_s'] : $LANG['topic'];
    $Template->assign_vars(array('NBR_TOPICS' => $nbr_topics, 'FORUM_NAME' => $CONFIG_FORUM['forum_name'], 'SID' => SID, 'MODULE_DATA_PATH' => $Template->get_module_data_path('forum'), 'PAGINATION' => $Pagination->display('track' . url('.php?p=%d'), $nbr_topics, 'p', $CONFIG_FORUM['pagination_topic'], 3), 'LANG' => get_ulang(), 'U_MSG_SET_VIEW' => '<a class="small_link" href="../forum/action' . url('.php?read=1&amp;favorite=1', '') . '" title="' . $LANG['mark_as_read'] . '" onclick="javascript:return Confirm_read_topics();">' . $LANG['mark_as_read'] . '</a>', 'U_CHANGE_CAT' => 'track.php' . SID . '&amp;token=' . $Session->get_token(), 'U_ONCHANGE' => url(".php?id=' + this.options[this.selectedIndex].value + '", "-' + this.options[this.selectedIndex].value + '.php"), 'U_ONCHANGE_CAT' => url("index.php?id=' + this.options[this.selectedIndex].value + '", "cat-' + this.options[this.selectedIndex].value + '.php"), 'U_FORUM_CAT' => '<a href="../forum/track.php' . SID . '">' . $LANG['show_topic_track'] . '</a>', 'U_POST_NEW_SUBJECT' => '', 'U_TRACK_ACTION' => url('.php?p=' . $page . '&amp;token=' . $Session->get_token()), 'L_FORUM_INDEX' => $LANG['forum_index'], 'L_AUTHOR' => $LANG['author'], 'L_FORUM' => $LANG['forum'], 'L_DELETE' => $LANG['delete'], 'L_MAIL' => $LANG['mail'], 'L_PM' => $LANG['pm'], 'L_EXPLAIN_TRACK' => $LANG['explain_track'], 'L_TOPIC' => $l_topic, 'L_MESSAGE' => $LANG['replies'], 'L_VIEW' => $LANG['views'], 'L_LAST_MESSAGE' => $LANG['last_message'], 'L_SUBMIT' => $LANG['submit']));
    list($users_list, $total_admin, $total_modo, $total_member, $total_visit, $total_online) = forum_list_user_online("AND s.session_script = '/forum/track.php'");
    $Template->assign_vars(array('TOTAL_ONLINE' => $total_online, 'USERS_ONLINE' => $total_online - $total_visit == 0 ? '<em>' . $LANG['no_member_online'] . '</em>' : $users_list, 'ADMIN' => $total_admin, 'MODO' => $total_modo, 'MEMBER' => $total_member, 'GUEST' => $total_visit, 'SELECT_CAT' => forum_list_cat(0, 0), 'L_USER' => $total_online > 1 ? $LANG['user_s'] : $LANG['user'], 'L_ADMIN' => $total_admin > 1 ? $LANG['admin_s'] : $LANG['admin'], 'L_MODO' => $total_modo > 1 ? $LANG['modo_s'] : $LANG['modo'], 'L_MEMBER' => $total_member > 1 ? $LANG['member_s'] : $LANG['member'], 'L_GUEST' => $total_visit > 1 ? $LANG['guest_s'] : $LANG['guest'], 'L_AND' => $LANG['and'], 'L_ONLINE' => strtolower($LANG['online'])));
    $Template->pparse('forum_track');
} else {
    redirect(HOST . DIR . '/forum/index.php' . SID2);
}
include '../kernel/footer.php';
Beispiel #25
0
        $img_announce .= $row['type'] == '1' ? '_post' : '';
        $img_announce .= $row['type'] == '2' ? '_top' : '';
        $img_announce .= $row['status'] == '0' && $row['type'] == '0' ? '_lock' : '';
        if (!empty($row['last_view_id'])) {
            $last_msg_id = $row['last_view_id'];
            $last_page = 'idm=' . $row['last_view_id'] . '&amp;';
            $last_page_rewrite = '-0-' . $row['last_view_id'];
        } else {
            $last_msg_id = $row['last_msg_id'];
            $last_page = ceil($row['nbr_msg'] / $CONFIG_FORUM['pagination_msg']);
            $last_page_rewrite = $last_page > 1 ? '-' . $last_page : '';
            $last_page = $last_page > 1 ? 'pt=' . $last_page . '&amp;' : '';
        }
        $rewrited_title = $CONFIG['rewrite'] == 1 ? '+' . url_encode_rewrite($row['title']) : '';
        $last_msg = '<a href="topic' . url('.php?' . $last_page . 'id=' . $row['id'], '-' . $row['id'] . $last_page_rewrite . $rewrited_title . '.php') . '#m' . $last_msg_id . '" title=""><img src="../templates/' . get_utheme() . '/images/ancre.png" alt="" /></a>' . ' ' . $LANG['on'] . ' ' . gmdate_format('date_format', $row['last_timestamp']) . '<br /> ' . $LANG['by'] . ' ' . (!empty($row['last_login']) ? '<a class="small_link" href="../member/member' . url('.php?id=' . $row['last_user_id'], '-' . $row['last_user_id'] . '.php') . '">' . wordwrap_html($row['last_login'], 13) . '</a>' : '<em>' . $LANG['guest'] . '</em>');
        $new_ancre = '<a href="topic' . url('.php?' . $last_page . 'id=' . $row['id'], '-' . $row['id'] . $last_page_rewrite . $rewrited_title . '.php') . '#m' . $last_msg_id . '" title=""><img src="../templates/' . get_utheme() . '/images/ancre.png" alt="" /></a>';
        $Template->assign_block_vars('topics', array('C_IMG_POLL' => !empty($row['question']), 'C_IMG_TRACK' => !empty($row['idtrack']), 'C_DISPLAY_MSG' => $CONFIG_FORUM['activ_display_msg'] && $CONFIG_FORUM['icon_activ_display_msg'] && $row['display_msg'], 'C_HOT_TOPIC' => $row['type'] == '0' && $row['status'] != '0' && $row['nbr_msg'] > $CONFIG_FORUM['pagination_msg'], 'IMG_ANNOUNCE' => $img_announce, 'ANCRE' => $new_ancre, 'TYPE' => $type[$row['type']], 'TITLE' => ucfirst($row['title']), 'AUTHOR' => !empty($row['login']) ? '<a href="../member/member' . url('.php?id=' . $row['user_id'], '-' . $row['user_id'] . '.php') . '" class="small_link">' . $row['login'] . '</a>' : '<em>' . $LANG['guest'] . '</em>', 'DESC' => $row['subtitle'], 'PAGINATION_TOPICS' => $Pagination->display('topic' . url('.php?id=' . $row['id'] . '&amp;pt=%d', '-' . $row['id'] . '-%d.php'), $row['nbr_msg'], 'pt', $CONFIG_FORUM['pagination_msg'], 2, 10, false), 'MSG' => $row['nbr_msg'] - 1, 'VUS' => $row['nbr_views'], 'U_TOPIC_VARS' => url('.php?id=' . $row['id'], '-' . $row['id'] . $rewrited_title . '.php'), 'U_LAST_MSG' => $last_msg, 'L_DISPLAY_MSG' => $CONFIG_FORUM['activ_display_msg'] && $row['display_msg'] ? $CONFIG_FORUM['display_msg'] : ''));
    }
    $Sql->query_close($result);
    $nbr_topics = $Sql->query("SELECT COUNT(*)\n\tFROM " . PREFIX . "forum_view v\n\tLEFT JOIN " . PREFIX . "forum_topics t ON t.id = v.idtopic\n\tWHERE t.last_timestamp >= '" . $max_time . "' AND v.user_id = '" . $User->get_attribute('user_id') . "'", __LINE__, __FILE__);
    if ($nbr_topics == 0) {
        $Template->assign_vars(array('C_NO_TOPICS' => true, 'L_NO_TOPICS' => '0 ' . $LANG['no_last_read']));
    }
    $Template->assign_vars(array('FORUM_NAME' => $CONFIG_FORUM['forum_name'], 'SID' => SID, 'MODULE_DATA_PATH' => $Template->get_module_data_path('forum'), 'PAGINATION' => $Pagination->display('lastread' . url('.php?p=%d'), $nbr_topics, 'p', $CONFIG_FORUM['pagination_topic'], 3), 'LANG' => get_ulang(), 'U_CHANGE_CAT' => 'unread.php' . SID . '&amp;token=' . $Session->get_token(), 'U_ONCHANGE' => url(".php?id=' + this.options[this.selectedIndex].value + '", "-' + this.options[this.selectedIndex].value + '.php"), 'U_ONCHANGE_CAT' => url("index.php?id=' + this.options[this.selectedIndex].value + '", "cat-' + this.options[this.selectedIndex].value + '.php"), 'U_FORUM_CAT' => '<a href="../forum/lastread.php' . SID . '">' . $LANG['show_last_read'] . '</a>', 'U_POST_NEW_SUBJECT' => '', 'L_FORUM_INDEX' => $LANG['forum_index'], 'L_FORUM' => $LANG['forum'], 'L_AUTHOR' => $LANG['author'], 'L_TOPIC' => $nbr_topics > 1 ? $LANG['topic_s'] : $LANG['topic'], 'L_MESSAGE' => $LANG['replies'], 'L_ANSWERS' => $LANG['answers'], 'L_VIEW' => $LANG['views'], 'L_LAST_MESSAGE' => $LANG['last_message']));
    list($users_list, $total_admin, $total_modo, $total_member, $total_visit, $total_online) = forum_list_user_online("AND s.session_script = '/forum/lastread.php'");
    $Template->assign_vars(array('TOTAL_ONLINE' => $total_online, 'USERS_ONLINE' => $total_online - $total_visit == 0 ? '<em>' . $LANG['no_member_online'] . '</em>' : $users_list, 'ADMIN' => $total_admin, 'MODO' => $total_modo, 'MEMBER' => $total_member, 'GUEST' => $total_visit, 'SELECT_CAT' => forum_list_cat(0, 0), 'L_USER' => $total_online > 1 ? $LANG['user_s'] : $LANG['user'], 'L_ADMIN' => $total_admin > 1 ? $LANG['admin_s'] : $LANG['admin'], 'L_MODO' => $total_modo > 1 ? $LANG['modo_s'] : $LANG['modo'], 'L_MEMBER' => $total_member > 1 ? $LANG['member_s'] : $LANG['member'], 'L_GUEST' => $total_visit > 1 ? $LANG['guest_s'] : $LANG['guest'], 'L_AND' => $LANG['and'], 'L_ONLINE' => strtolower($LANG['online'])));
    $Template->pparse('forum_topics');
} else {
    redirect(HOST . DIR . '/forum/index.php' . SID2);
}
include '../kernel/footer.php';
Beispiel #26
0
                $name_cut = strlen(html_entity_decode($row['name'], ENT_COMPAT, 'ISO-8859-1')) > 22 ? htmlentities(substr(html_entity_decode($row['name'], ENT_COMPAT, 'ISO-8859-1'), 0, 22), ENT_COMPAT, 'ISO-8859-1') . '...' : $row['name'];
                $name = html_entity_decode($row['name'], ENT_COMPAT, 'ISO-8859-1');
                $name = strlen($name) > 20 ? substr($name, 0, 20) . '...' : $name;
                $tr_start = is_int($j / $nbr_column_pics) ? '<tr>' : '';
                $j++;
                $tr_end = is_int($j / $nbr_column_pics) ? '</tr>' : '';
                if ($CONFIG_GALLERY['display_pics'] == 3) {
                    $display_link = HOST . DIR . '/gallery/show_pics' . url('.php?id=' . $row['id'] . '&amp;cat=' . $row['idcat']);
                } elseif ($CONFIG_GALLERY['display_pics'] == 2) {
                    $display_link = 'javascript:display_pics_popup(\'' . HOST . DIR . '/gallery/show_pics' . url('.php?id=' . $row['id'] . '&amp;cat=' . $row['idcat']) . '\', \'' . $row['width'] . '\', \'' . $row['height'] . '\')';
                } elseif ($CONFIG_GALLERY['display_pics'] == 1) {
                    $display_link = 'javascript:display_pics(' . $row['id'] . ', \'' . HOST . DIR . '/gallery/show_pics' . url('.php?id=' . $row['id'] . '&amp;cat=' . $row['idcat']) . '\', 0)';
                } else {
                    $display_link = 'admin_gallery.php?cat=' . $row['idcat'] . '&amp;id=' . $row['id'] . '#pics_max';
                }
                $cat_list = '';
                foreach ($array_cat_list as $key_cat => $option_value) {
                    $cat_list .= $key_cat == $row['idcat'] ? sprintf($option_value, 'selected="selected"') : sprintf($option_value, '');
                }
                $Template->assign_block_vars('pics.list', array('ID' => $row['id'], 'IMG' => '<img src="pics/thumbnails/' . $row['path'] . '" alt="' . $name . '" />', 'PATH' => $row['path'], 'NAME' => $name_cut, 'TITLE' => str_replace('"', '\\"', $row['name']), 'RENAME_FILE' => '<span id="fihref' . $row['id'] . '"><a href="javascript:display_rename_file(\'' . $row['id'] . '\', \'' . addslashes($row['name']) . '\', \'' . addslashes($name_cut) . '\');"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/edit.png" alt="' . $LANG['edit'] . '" class="valign_middle" /></a></span>', 'IMG_APROB' => $row['aprob'] == 1 ? 'unvisible.png' : 'visible.png', 'TR_START' => $tr_start, 'TR_END' => $tr_end, 'CAT' => $cat_list, 'L_APROB_IMG' => $row['aprob'] == 1 ? $LANG['unaprob'] : $LANG['aprob'], 'U_DISPLAY' => $display_link, 'U_POSTOR' => $LANG['by'] . ' <a class="com" href="../member/member' . url('.php?id=' . $row['user_id'], '-' . $row['user_id'] . '.php') . '">' . $row['login'] . '</a>'));
            }
            $Sql->query_close($result);
            while (!is_int($j / $nbr_column_pics)) {
                $j++;
                $Template->assign_block_vars('pics.end_td_pics', array('TD_END' => '<td class="row2" style="width:' . $column_width_pics . '%">&nbsp;</td>', 'TR_END' => is_int($j / $nbr_column_pics) ? '</tr>' : ''));
            }
        }
    }
    $Template->pparse('admin_gallery_management');
}
require_once '../admin/admin_footer.php';
<?php

require_once '../admin/admin_begin.php';
define('TITLE', $LANG['administration']);
require_once '../admin/admin_header.php';
$template = new Template('admin/admin_system_report.tpl');
$template->assign_vars(array('L_YES' => $LANG['yes'], 'L_NO' => $LANG['no'], 'L_UNKNOWN' => $LANG['unknown'], 'L_SYSTEM_REPORT' => $LANG['system_report'], 'L_SERVER' => $LANG['server'], 'L_PHPINFO' => $LANG['phpinfo'], 'L_PHP_VERSION' => $LANG['php_version'], 'L_DBMS_VERSION' => $LANG['dbms_version'], 'L_GD_LIBRARY' => $LANG['dg_library'], 'L_URL_REWRITING' => $LANG['url_rewriting'], 'L_REGISTER_GLOBALS_OPTION' => $LANG['register_globals_option'], 'L_SERVER_URL' => $LANG['serv_name'], 'L_SITE_PATH' => $LANG['serv_path'], 'L_PHPBOOST_CONFIG' => $LANG['phpboost_config'], 'L_KERNEL_VERSION' => $LANG['kernel_version'], 'L_DEFAULT_THEME' => $LANG['default_theme'], 'L_DEFAULT_LANG' => $LANG['default_language'], 'L_DEFAULT_EDITOR' => $LANG['choose_editor'], 'L_START_PAGE' => $LANG['start_page'], 'L_OUTPUT_GZ' => $LANG['output_gz'], 'L_COOKIE_NAME' => $LANG['cookie_name'], 'L_SESSION_LENGTH' => $LANG['session_time'], 'L_SESSION_GUEST_LENGTH' => $LANG['session invit'], 'L_DIRECTORIES_AUTH' => $LANG['directories_auth'], 'L_SUMMERIZATION' => $LANG['system_report_summerization'], 'L_SUMMERIZATION_EXPLAIN' => $LANG['system_report_summerization_explain']));
$temp_var = function_exists('apache_get_modules') ? apache_get_modules() : array();
$server_path = !empty($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF');
if (!$server_path) {
    $server_path = !empty($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
}
$server_path = trim(str_replace('/admin', '', dirname($server_path)));
$server_name = 'http://' . (!empty($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : getenv('HTTP_HOST'));
$lang_ini_file = load_ini_file('../lang/', get_ulang());
$template_ini_file = load_ini_file('../templates/' . get_utheme() . '/config/', get_ulang());
$directories_summerization = '';
$directories_list = array('/', '/cache', '/cache/backup', '/cache/syndication/', '/cache/tpl', '/images/avatars', '/images/group', '/images/maths', '/images/smileys', '/lang', '/menus', '/templates', '/upload');
foreach ($directories_list as $dir) {
    $dir_status = is_dir('..' . $dir) && is_writable('..' . $dir);
    $template->assign_block_vars('directories', array('NAME' => $dir, 'C_AUTH_DIR' => $dir_status));
    $directories_summerization .= $dir . str_repeat(' ', 25 - strlen($dir)) . ": " . (int) $dir_status . "\n";
}
$summerization = "---------------------------------System report---------------------------------\n-----------------------------generated by PHPBoost-----------------------------\n\nSERVER CONFIGURATION-----------------------------------------------------------\n\nphp version              : " . phpversion() . "\ndbms version             : " . $Sql->get_dbms_version() . "\ngd library               : " . (int) @extension_loaded('gd') . "\nurl rewriting            : " . (function_exists('apache_get_modules') ? (int) (!empty($temp_var[5])) : "?") . "\nregister globals         : " . (int) (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on') . "\nserver url               : " . $server_name . "\nsite path                : " . $server_path . "\n\nPHPBOOST CONFIGURATION---------------------------------------------------------\n\nphpboost version         : " . phpboost_version() . "\nserver url               : " . $CONFIG['server_name'] . "\nsite path                : " . $CONFIG['server_path'] . "\ndefault theme            : " . $template_ini_file['name'] . "\ndefault language         : " . get_ulang() . "\ndefault editor           : " . $CONFIG['editor'] . "\nstart page               : " . $CONFIG['start_page'] . "\nurl rewriting            : " . $CONFIG['rewrite'] . "\noutput gz                : " . $CONFIG['ob_gzhandler'] . "\nsession cookie name      : " . $CONFIG['site_cookie'] . "\nsession length           : " . $CONFIG['site_session'] . "\nguest session length     : " . $CONFIG['site_session_invit'] . "\n\nDIRECTORIES AUTHORIZATIONS-----------------------------------------------------\n\n" . $directories_summerization;
$template->assign_vars(array('PHP_VERSION' => phpversion(), 'DBMS_VERSION' => $Sql->get_dbms_version(), 'C_SERVER_GD_LIBRARY' => @extension_loaded('gd'), 'C_URL_REWRITING_KNOWN' => function_exists('apache_get_modules'), 'C_SERVER_URL_REWRITING' => function_exists('apache_get_modules') ? !empty($temp_var[5]) : false, 'C_REGISTER_GLOBALS' => @ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on', 'SERV_SERV_URL' => $server_name, 'SERV_SITE_PATH' => $server_path, 'KERNEL_VERSION' => phpboost_version(), 'KERNEL_SERV_URL' => $CONFIG['server_name'], 'KERNEL_SITE_PATH' => $CONFIG['server_path'], 'KERNEL_DEFAULT_THEME' => $template_ini_file['name'], 'KERNEL_DEFAULT_LANGUAGE' => $lang_ini_file['name'], 'KERNEL_DEFAULT_EDITOR' => $CONFIG['editor'] == 'tinymce' ? 'TinyMCE' : 'BBCode', 'KERNEL_START_PAGE' => $CONFIG['start_page'], 'C_KERNEL_URL_REWRITING' => (bool) $CONFIG['rewrite'], 'C_KERNEL_OUTPUT_GZ' => (bool) $CONFIG['ob_gzhandler'], 'COOKIE_NAME' => $CONFIG['site_cookie'], 'SESSION_LENGTH' => $CONFIG['site_session'], 'SESSION_LENGTH_GUEST' => $CONFIG['site_session_invit'], 'SUMMERIZATION' => $summerization));
$template->parse();
require_once '../admin/admin_footer.php';
Beispiel #28
0
<?php

require_once '../admin/admin_begin.php';
load_module_lang('download');
define('TITLE', $LANG['administration']);
require_once '../admin/admin_header.php';
$Cache->load('download');
$Template->set_filenames(array('admin_download_management' => 'download/admin_download_management.tpl'));
$nbr_dl = $Sql->count_table('download', __LINE__, __FILE__);
import('util/pagination');
$Pagination = new Pagination();
$Template->assign_vars(array('THEME' => get_utheme(), 'LANG' => get_ulang(), 'PAGINATION' => $Pagination->display('admin_download.php?p=%d', $nbr_dl, 'p', 25, 3), 'L_DEL_ENTRY' => $LANG['del_entry'], 'L_DOWNLOAD_ADD' => $DOWNLOAD_LANG['download_add'], 'L_DOWNLOAD_MANAGEMENT' => $DOWNLOAD_LANG['download_management'], 'L_DOWNLOAD_CAT' => $LANG['cat_management'], 'L_DOWNLOAD_CONFIG' => $DOWNLOAD_LANG['download_config'], 'L_CATEGORY' => $LANG['category'], 'L_SIZE' => $LANG['size'], 'L_TITLE' => $LANG['title'], 'L_APROB' => $LANG['aprob'], 'L_UPDATE' => $LANG['update'], 'L_DELETE' => $LANG['delete'], 'L_DATE' => $LANG['date'], 'L_CONFIRM_DELETE' => str_replace('\'', '\\\'', $DOWNLOAD_LANG['confirm_delete_file'])));
$result = $Sql->query_while("SELECT id, idcat, title, timestamp, approved, start, end, size\nFROM " . PREFIX . "download\nORDER BY timestamp DESC \n" . $Sql->limit($Pagination->get_first_msg(25, 'p'), 25), __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
    if ($row['approved'] == 1) {
        $aprob = $LANG['yes'];
    } else {
        $aprob = $LANG['no'];
    }
    $title =& $row['title'];
    $title = strlen($title) > 45 ? substr($title, 0, 45) . '...' : $title;
    $Template->assign_block_vars('list', array('TITLE' => $title, 'IDCAT' => $row['idcat'], 'CAT' => $row['idcat'] > 0 ? $DOWNLOAD_CATS[$row['idcat']]['name'] : $LANG['root'], 'PSEUDO' => !empty($row['login']) ? $row['login'] : $LANG['guest'], 'DATE' => gmdate_format('date_format_short', $row['timestamp']), 'SIZE' => $row['size'] >= 1 ? number_round($row['size'], 1) . ' ' . $LANG['unit_megabytes'] : number_round($row['size'] * 2524, 1) . ' ' . $LANG['unit_kilobytes'], 'APROBATION' => $aprob, 'U_FILE' => url('download.php?id=' . $row['id'], 'download-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php'), 'U_EDIT_FILE' => url('management.php?edit=' . $row['id']), 'U_DEL_FILE' => url('management.php?del=' . $row['id'] . '&amp;token=' . $Session->get_token())));
}
$Sql->query_close($result);
include_once 'admin_download_menu.php';
$Template->pparse('admin_download_management');
require_once '../admin/admin_footer.php';
Beispiel #29
0
 $auth_cats = '';
 if (is_array($CAT_FORUM)) {
     foreach ($CAT_FORUM as $idcat => $key) {
         if (!$User->check_auth($CAT_FORUM[$idcat]['auth'], READ_CAT_FORUM)) {
             $auth_cats .= $idcat . ',';
         }
     }
     $auth_cats = !empty($auth_cats) ? "AND id NOT IN (" . trim($auth_cats, ',') . ")" : '';
 }
 $cat_forum = '<option value="0" checked="checked">' . $LANG['root'] . '</option>';
 $result = $Sql->query_while("SELECT id, name, level\n\tFROM " . PREFIX . "forum_cats \n\tWHERE url = '' " . $auth_cats . "\n\tORDER BY id_left", __LINE__, __FILE__);
 while ($row = $Sql->fetch_assoc($result)) {
     $cat_forum .= $row['level'] > 0 ? '<option value="' . $row['id'] . '">' . str_repeat('--------', $row['level']) . ' ' . $row['name'] . '</option>' : '<option value="' . $row['id'] . '" disabled="disabled">-- ' . $row['name'] . '</option>';
 }
 $Sql->query_close($result);
 $Template->assign_vars(array('C_FORUM_CUT_CAT' => true, 'CATEGORIES' => $cat_forum, 'KERNEL_EDITOR' => display_editor(), 'THEME' => get_utheme(), 'LANG' => get_ulang(), 'MODULE_DATA_PATH' => $Template->get_module_data_path('forum'), 'FORUM_NAME' => $CONFIG_FORUM['forum_name'] . ' : ' . $LANG['cut_topic'], 'SID' => SID, 'IDTOPIC' => 0, 'U_ACTION' => url('move.php?token=' . $Session->get_token()), 'U_TITLE_T' => '<a href="topic' . url('.php?id=' . $msg['idtopic'], '-' . $msg['idtopic'] . '.php') . '">' . ucfirst($topic['title']) . '</a>', 'U_FORUM_CAT' => '<a href="forum' . url('.php?id=' . $cat['id'], '-' . $cat['id'] . '.php') . '">' . $cat['name'] . '</a>', 'L_ACTION' => $LANG['forum_cut_subject'] . ' : ' . $topic['title'], 'L_REQUIRE' => $LANG['require'], 'L_REQUIRE_TEXT' => $LANG['require_text'], 'L_REQUIRE_TITLE' => $LANG['require_title'], 'L_REQUIRE_TITLE_POLL' => $LANG['require_title_poll'], 'L_FORUM_INDEX' => $LANG['forum_index'], 'L_CAT' => $LANG['category'], 'L_TITLE' => $LANG['title'], 'L_DESC' => $LANG['description'], 'L_MESSAGE' => $LANG['message'], 'L_SUBMIT' => $LANG['forum_cut_subject'], 'L_PREVIEW' => $LANG['preview'], 'L_RESET' => $LANG['reset'], 'L_POLL' => $LANG['poll'], 'L_OPEN_MENU_POLL' => $LANG['open_menu_poll'], 'L_QUESTION' => $LANG['question'], 'L_ANSWERS' => $LANG['answers'], 'L_POLL_TYPE' => $LANG['poll_type'], 'L_SINGLE' => $LANG['simple_answer'], 'L_MULTIPLE' => $LANG['multiple_answer']));
 if (empty($post_topic) && empty($preview_topic)) {
     $nbr_poll_field = 0;
     for ($i = 0; $i < 5; $i++) {
         $Template->assign_block_vars('answers_poll', array('ID' => $i, 'ANSWER' => ''));
         $nbr_poll_field++;
     }
     $Template->assign_vars(array('TITLE' => '', 'DESC' => '', 'CONTENTS' => unparse($msg['contents']), 'IDM' => $id_get_msg, 'CHECKED_NORMAL' => 'checked="checked"', 'SELECTED_SIMPLE' => 'checked="checked"', 'NO_DISPLAY_POLL' => 'true', 'NBR_POLL_FIELD' => $nbr_poll_field, 'L_TYPE' => '* ' . $LANG['type'], 'L_DEFAULT' => $LANG['default'], 'L_POST_IT' => $LANG['forum_postit'], 'L_ANOUNCE' => $LANG['forum_announce'], 'C_FORUM_POST_TYPE' => true, 'C_ADD_POLL_FIELD' => true));
 } elseif (!empty($preview_topic) && !empty($id_post_msg)) {
     $title = retrieve(POST, 'title', '', TSTRING_UNCHANGE);
     $subtitle = retrieve(POST, 'desc', '', TSTRING_UNCHANGE);
     $contents = retrieve(POST, 'contents', '', TSTRING_UNCHANGE);
     $question = retrieve(POST, 'question', '', TSTRING_UNCHANGE);
     $type = retrieve(POST, 'type', 0);
     $checked_normal = $type == 0 ? 'checked="ckecked"' : '';
     $checked_postit = $type == 1 ? 'checked="ckecked"' : '';
Beispiel #30
0
     $Template->set_filenames(array('news' => 'news/news.tpl'));
     if ($news_size > 1) {
         $size_tpl = $news_size . ' ' . $LANG['unit_megabytes'];
     } elseif ($news_size > 0) {
         $size_tpl = $news_size * 1024 . ' ' . $LANG['unit_kilobytes'];
     } else {
         $size_tpl = $NEWS_LANG['unknown_size'];
     }
     $creation_calendar = new MiniCalendar('creation');
     $creation_calendar->set_date($news_creation_date);
     $release_calendar = new MiniCalendar('release_date');
     $release_calendar->set_date($news_release_date);
     if ($news_visibility < 0 || $news_visibility > 2) {
         $news_visibility = 0;
     }
     $Template->assign_vars(array('C_DISPLAY_NEWS' => true, 'C_IMG' => !empty($news_image), 'C_EDIT_AUTH' => false, 'MODULE_DATA_PATH' => $Template->get_module_data_path('news'), 'NAME' => stripslashes($news_title), 'CONTENTS' => second_parse(stripslashes(strparse($news_contents))), 'CREATION_DATE' => $news_creation_date->format(DATE_FORMAT_SHORT), 'RELEASE_DATE' => $news_release_date->get_timestamp() > 0 ? $news_release_date->format(DATE_FORMAT_SHORT) : $NEWS_LANG['unknown_date'], 'SIZE' => $size_tpl, 'COUNT' => $news_hits, 'THEME' => get_utheme(), 'HITS' => sprintf($NEWS_LANG['n_times'], (int) $news_hits), 'NUM_NOTES' => sprintf($NEWS_LANG['num_notes'], 0), 'U_IMG' => $news_image, 'IMAGE_ALT' => str_replace('"', '\\"', $news_title), 'LANG' => get_ulang(), 'L_DATE' => $LANG['date'], 'L_SIZE' => $LANG['size'], 'L_NEWS' => $NEWS_LANG['news'], 'L_NEWS_FILE' => $NEWS_LANG['news_news'], 'L_FILE_INFOS' => $NEWS_LANG['news_infos'], 'L_INSERTION_DATE' => $NEWS_LANG['insertion_date'], 'L_RELEASE_DATE' => $NEWS_LANG['release_date'], 'L_NEWSED' => $NEWS_LANG['newsed'], 'L_NOTE' => $LANG['note'], 'U_NEWS_FILE' => url('count.php?id=' . $edit_news_id, 'news-' . $edit_news_id . '+' . url_encode_rewrite($news_title) . '.php')));
     $Template->assign_vars(array('TITLE' => stripslashes($news_title), 'COUNT' => $news_hits, 'DESCRIPTION' => $news_contents, 'SHORT_DESCRIPTION' => $news_short_contents, 'FILE_IMAGE' => $news_image, 'URL' => $news_url, 'SIZE_FORM' => $news_size, 'DATE' => $news_creation_date->format(DATE_FORMAT_SHORT, TIMEZONE_AUTO), 'CATEGORIES_TREE' => $news_categories->build_select_form($news_cat_id, 'idcat', 'idcat', 0, WRITE_CAT_NEWS, $CONFIG_NEWS['global_auth'], IGNORE_AND_CONTINUE_BROWSING_IF_A_CATEGORY_DOES_NOT_MATCH), 'SHORT_DESCRIPTION_PREVIEW' => second_parse(stripslashes(strparse($news_short_contents))), 'VISIBLE_WAITING' => $news_visibility == 2 ? ' checked="checked"' : '', 'VISIBLE_ENABLED' => $news_visibility == 1 ? ' checked="checked"' : '', 'VISIBLE_UNAPROVED' => $news_visibility == 0 ? ' checked="checked"' : '', 'DATE_CALENDAR_CREATION' => $creation_calendar->display(), 'DATE_CALENDAR_RELEASE' => $release_calendar->display(), 'BOOL_IGNORE_RELEASE_DATE' => $ignore_release_date ? 'true' : 'false', 'STYLE_FIELD_RELEASE_DATE' => $ignore_release_date ? 'none' : 'block', 'IGNORE_RELEASE_DATE_CHECKED' => $ignore_release_date ? ' checked="checked"' : '', 'BEGINING_CALENDAR' => $begining_calendar->display(), 'END_CALENDAR' => $end_calendar->display()));
 } else {
     $news_creation_date = new Date(DATE_NOW, TIMEZONE_AUTO);
     $news_release_date = new Date(DATE_NOW, TIMEZONE_AUTO);
     $creation_calendar = new MiniCalendar('creation');
     $creation_calendar->set_date($news_creation_date);
     $release_calendar = new MiniCalendar('release_date');
     $ignore_release_date = false;
     if (!$ignore_release_date) {
         $release_calendar->set_date($news_release_date);
     }
     $begining_calendar = new MiniCalendar('begining_date');
     $end_calendar = new MiniCalendar('end_date');
     $end_calendar->set_style('margin-left:150px;');
     $begining_calendar->set_date(new Date(DATE_NOW, TIMEZONE_AUTO));