コード例 #1
0
function get_menu_images()
{
    global $db, $userdata, $phpbb_root_path, $images;
    $link_images_dir = get_bl_theme();
    $dir = @opendir($link_images_dir);
    while ($file = @readdir($dir)) {
        if (!@is_dir($link_images_dir . $file) && substr($file, 0, 1) != '.') {
            $link_images[] = $file;
        }
    }
    @closedir($dir);
    sort($link_images);
    $bl_images = '<select name="bl_img"><option value="---"></option>';
    foreach ($link_images as $bl_image) {
        $bl_images .= '<option value="' . $bl_image . '">' . $bl_image . '</option>';
    }
    $bl_images .= '</select>';
    return $bl_images;
}
コード例 #2
0
     include $phpbb_root_path . 'includes/page_tail.' . $phpEx;
 } else {
     if ($manage_links && $userdata['user_level'] == ADMIN) {
         // Load Page Header
         $page_title = $lang['Board_menu_manager'];
         include $phpbb_root_path . 'includes/page_header.' . $phpEx;
         $template->set_filenames(array('body' => 'board_menu_links_admin.tpl'));
         $template->assign_vars(array('L_PAGE_TITLE' => $page_title, 'L_WELCOME' => $lang['Board_manager_welcome'], 'L_MANAGER_EXPLAIN' => $lang['Board_manager_manage_links'], 'L_BL_IMG' => $lang['Bl_img'], 'L_BL_NAME' => $lang['Bl_name'], 'L_BL_PARAMETER' => $lang['Bl_parameter'], 'L_BL_PARAMETER_EXPLAIN' => $lang['Bl_parameter_explain'], 'L_BL_LINK' => $lang['Bl_link'], 'L_BL_LINK_EXPLAIN' => $lang['Bl_link_explain'], 'L_BL_LEVEL' => $lang['Bl_level'], 'BLIMG' => get_menu_images(), 'BLNAME' => get_menu_language_names(), 'BLPARAMETER' => '<input type="text" name="bl_parameter" size="50" maxlength="50"/>', 'BLLINK' => '<input type="text" name="bl_link" size="50" maxlength="128"/>', 'BLLEVEL' => get_bl_access(), 'U_CLOSE_WINDOW' => '<input type="hidden" name="save_links" value="1"><input type="submit" name="submit" value="' . $lang['Submit'] . '" class="mainoption" />&nbsp;&nbsp;&nbsp;<input type="submit" name="cancel" value="' . $lang['Board_menu_manager'] . '" class="liteoption" />', 'S_ACTION' => append_sid("board_menu_manager.{$phpEx}")));
         // Get saved Board Menu Links
         $sql = 'SELECT * FROM ' . BOARD_LINKS_TABLE . '
 ORDER BY bl_dsort, bl_id';
         if (!($result = $db->sql_query($sql))) {
             message_die(GENERAL_ERROR, 'Could not read saves board menu links', '', __LINE__, __FILE__, $sql);
         }
         while ($row = $db->sql_fetchrow($result)) {
             $board_menu_links = $row['bl_img'] != '' ? '<img src="' . get_bl_theme() . $row['bl_img'] . '" border="0" />&nbsp;' : '';
             if (substr($row['bl_link'], 0, 10) != 'javascript') {
                 $board_menu_links .= '<a href="' . append_sid($row['bl_link'] . '.' . $phpEx . ($row['bl_parameter'] != '' ? '?' . $row['bl_parameter'] : ''));
             } else {
                 $board_menu_links .= '<a href="' . $row['bl_link'] . ($row['bl_parameter'] != '' ? '?' . $row['bl_parameter'] : '');
             }
             $board_menu_links .= '" class="mainmenu" title="' . $lang[$row['bl_name']] . '">' . $lang[$row['bl_name']] . '</a>';
             switch ($row['bl_level']) {
                 case ANONYMOUS:
                     $bl_access_level = $lang['Bl_guest'];
                     break;
                 case USER:
                     $bl_access_level = $lang['Bl_user'];
                     break;
                 case MOD:
                     $bl_access_level = $lang['Bl_mod'];