From 7b5a2485d3765938af3701e0f4017b20610ed3d9 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Tue, 15 Jul 2003 14:58:46 +0000 Subject: [PATCH] Some basic imageset editing stuff ... doesn't actually "do" anything yet ... just testing out layouts, etc. git-svn-id: file:///svn/phpbb/trunk@4266 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/admin_styles.php | 262 +++++++++++++++++++++++-------------- 1 file changed, 165 insertions(+), 97 deletions(-) diff --git a/phpBB/adm/admin_styles.php b/phpBB/adm/admin_styles.php index ccad70c00f..ac3905dc41 100644 --- a/phpBB/adm/admin_styles.php +++ b/phpBB/adm/admin_styles.php @@ -333,6 +333,171 @@ switch ($mode) case 'imagesets': + $imageset_id = (isset($_REQUEST['id'])) ? intval($_REQUEST['id']) : 0; + + switch ($action) + { + case 'edit': + + $imgname = (!empty($_POST['imgname'])) ? htmlspecialchars($imgname) : ''; + + if ($imageset_id) + { + $sql = 'SELECT * + FROM ' . STYLES_IMAGE_TABLE . " + WHERE imageset_id = $imageset_id"; + $result = $db->sql_query($sql); + + if (!extract($db->sql_fetchrow($result))) + { + trigger_error($user->lang['NO_IMAGESET']); + } + + do { + extract($db->sql_fetchrow($result)); + } + while ($row = $db->sql_fetchrow($result)); + $db->sql_freeresult($result); + + + $imglist = array( + 'buttons' => array( + 'btn_post', 'btn_post_pm', 'btn_reply', 'btn_reply_pm', 'btn_locked', 'btn_profile', 'btn_pm', 'btn_delete', 'btn_ip', 'btn_quote', 'btn_search', 'btn_edit', 'btn_report', 'btn_email', 'btn_www', 'btn_icq', 'btn_aim', 'btn_yim', 'btn_msnm', 'btn_jabber', 'btn_online', 'btn_offline', 'btn_topic_watch', 'btn_topic_unwatch', + ), + 'icons' => array( + 'icon_unapproved', 'icon_reported', 'icon_attach', 'icon_post', 'icon_post_new', 'icon_post_latest', 'icon_post_newest',), + 'forums' => array( + 'forum', 'forum_new', 'forum_locked', 'forum_link', 'sub_forum', 'sub_forum_new',), + 'folders' => array( + 'folder', 'folder_posted', 'folder_new', 'folder_new_posted', 'folder_hot', 'folder_hot_posted', 'folder_hot_new', 'folder_hot_new_posted', 'folder_locked', 'folder_locked_posted', 'folder_locked_new', 'folder_locked_new_posted', 'folder_sticky', 'folder_sticky_posted', 'folder_sticky_new', 'folder_sticky_new_posted', 'folder_announce', 'folder_announce_posted', 'folder_announce_new', 'folder_announce_new_posted',), + 'polls' => array( + 'poll_left', 'poll_center', 'poll_right',), + 'custom' => array(), + ); + + + $test_ary = array(); + foreach ($imglist as $category => $img_ary) + { + foreach ($img_ary as $img) + { + if (!empty($$img)) + { + $test_ary[] = preg_replace('#^"styles/imagesets/' . $imageset_path . '/(\{LANG\}/)?(.*?)".*$#', '\2', $$img); + } + } + } + + $dp = @opendir($phpbb_root_path . 'styles/imagesets/' . $imageset_path); + while ($file = readdir($dp)) + { + if (is_file($phpbb_root_path . 'styles/imagesets/' . $imageset_path . '/' . $file)) + { + if (!in_array($file, $test_ary)) + { + $imglist['custom'][] = $file; + } + } + } + closedir($dp); + unset($matches); + unset($test_ary); + + $imgwidth = (preg_match('#width="([0-9]+?)"#i', $$imgname, $matches)) ? $matches[1] : 0; + $imgheight = (preg_match('#height="([0-9]+?)"#i', $$imgname, $matches)) ? $matches[1] : 0; + } + + + // Generate list of image options + $img_options = ''; + foreach ($imglist as $category => $img_ary) + { + $img_options .= ''; + foreach ($img_ary as $img) + { + $selected = ($img == $imgname) ? ' selected="selected"' : ''; + $img_options .= ''; + } + } + + // Grab list of potential images + $imagesetlist = filelist($phpbb_root_path . 'styles/imagesets/' . $imageset_path); + + $imagesetlist_options = ''; + foreach ($imagesetlist as $img) + { + $img = substr($img['path'], 1) . (($img['path'] != '') ? '/' : '') . $img['file']; + + $selected = (preg_match('#' . preg_quote($img) . '$#', $background_image)) ? ' selected="selected"' : ''; + $imagesetlist_options .= ''; + } + $imagesetlist_options = '' . $imagesetlist_options; + unset($imagesetlist); + + + adm_page_header($user->lang['EDIT_IMAGESET']); + +?> + +

lang['EDIT_IMAGESET']; ?>

+ +

lang['EDIT_IMAGESET_EXPLAIN']; ?>

+ +
"> + + + + + + + +
lang['SELECT_CLASS']; ?>:  
+ + + + + + + + + + + + + + + + + + + + + +
Preview
img_lang, $$imgname)) . ' vspace="5" />' : ''; ?>
ParameterValue
Image:
Dimensions:
Dimensions are optional, set to zero to ignore.
X
  
+ +lang['MANAGE_IMAGESET']); @@ -382,101 +547,6 @@ switch ($mode) sql_query($sql); - - $imgroot_options = ''; - while ($row = $db->sql_fetchrow($result)) - { - $selected = ($imgroot == $row['imageset_path']) ? ' selected="selected"' : ''; - $imgroot_options .= ''; - } - - $imgname_options = ''; - $dp = opendir($phpbb_root_path . 'imagesets/' . $imgroot . '/'); - while ($file = readdir($dp)) - { - if (preg_match('#\.(gif|png|jpg|jpeg)$#', $file) && is_file($phpbb_root_path . 'imagesets/' . $imgroot . '/' . $file)) - { - $selected = ($imgname == $file) ? ' selected="selected"' : ''; - $imgname_options .= ''; - } - } - closedir($dp); - - // Output page - adm_page_header($user->lang['Edit_Imageset']); - -?> - -
- -

Edit Imageset

- -

Template set:    

- -

Here you can create, edit, delete and download imagesets.

- -sql_query($sql); - - $images = $db->sql_fetchrow($result); - -?> - - - - -' : ''; - $img = str_replace('"imagesets/', '"../imagesets/', $img); - $img = str_replace('{LANG}', $user->img_lang, $img); - $img = str_replace('{RATE}', 3, $img); -?> - - - - - - - - - -
ImageGraphic 
 
- -