diff -r 000000000000 -r e8db3e017691 plugins/EnaniumBackgrounds.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/EnaniumBackgrounds.php Fri Apr 17 00:02:18 2009 -0400 @@ -0,0 +1,109 @@ +attachHook('enanium_search_form', 'enanium_paint_bg_controls();'); +$plugins->attachHook('enanium_main_header', 'enanium_paint_bg_controls();'); +$plugins->attachHook('compile_template', 'enanium_add_headers();'); + +$ebg_images = array('default', 'aqua', 'blinds', 'dune', 'freshflower', 'garden', 'greenmeadow', 'ladybird', 'raindrops', 'storm', 'twowings', 'wood', 'yellowflower'); + +$ebg_outsiders = array(); +if ( $dr = @opendir(ENANO_ROOT . '/plugins/enaniumbg') ) +{ + while ( $dh = @readdir($dr) ) + { + if ( $dh == '.' || $dh == '..' || is_dir(ENANO_ROOT . "/plugins/enaniumbg/$dr") ) + continue; + + if ( in_array($dh, $ebg_images) || !preg_match('/\.jpg$/', $dh) ) + continue; + + $dh = preg_replace('/\.jpg$/', '', $dh); + + if ( !file_exists(ENANO_ROOT . "/plugins/enaniumbg/icons/$dh.png") ) + continue; + + $ebg_outsiders[] = $dh; + } + closedir($dr); +} +unset($dh, $dr); + +function enanium_paint_bg_controls() +{ + global $ebg_images, $ebg_outsiders; + global $lang; + + ?> +
+{
+ eng: {
+ categories: ['meta', 'enaniumbg'],
+ strings: {
+ meta: {
+ enaniumbg: 'Enanium backgrounds',
+ },
+ enaniumbg: {
+ default: 'Default',
+ aqua: 'Aqua',
+ blinds: 'Blinds',
+ dune: 'Dune',
+ freshflower: 'Fresh flower',
+ garden: 'Garden',
+ greenmeadow: 'Greenmeadow',
+ ladybird: 'Ladybird',
+ raindrops: 'Raindrops',
+ storm: 'Storm',
+ twowings: 'Two Wings',
+ wood: 'Wood',
+ yellowflower: 'Yellow flower'
+ }
+ }
+ }
+}
+
+**!*/
+