# HG changeset patch # User Dan # Date 1239940938 14400 # Node ID e8db3e01769120985da5fd51b83e39b22b628fe9 First revision. 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'
+ }
+ }
+ }
+}
+
+**!*/
+
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/aqua.jpg
Binary file plugins/enaniumbg/aqua.jpg has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/blinds.jpg
Binary file plugins/enaniumbg/blinds.jpg has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/dune.jpg
Binary file plugins/enaniumbg/dune.jpg has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/enaniumbg.css
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/enaniumbg/enaniumbg.css Fri Apr 17 00:02:18 2009 -0400
@@ -0,0 +1,17 @@
+div#enanium_bg_list {
+ position: absolute;
+ right: 10px;
+ top: 43px;
+ background-image: url(../../themes/enanium/images/transb50.png);
+ padding: 11px 4px 8px 4px;
+}
+
+div#enanium_bg_list a {
+ padding: 8px 4px 1px 4px;
+ margin: 0 4px;
+ border: 1px solid #808080;
+}
+
+div#enanium_bg_list a:hover, div#enanium_bg_list a.selected {
+ border-color: #ffcb00;
+}
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/enaniumbg.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/enaniumbg/enaniumbg.js Fri Apr 17 00:02:18 2009 -0400
@@ -0,0 +1,42 @@
+function readCookie(name) {var nameEQ = name + "=";var ca = document.cookie.split(';');for(var i=0;i < ca.length;i++){var c = ca[i];while (c.charAt(0)==' ') c = c.substring(1,c.length);if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);}return null;}
+function createCookie(name,value,days){if (days){var date = new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires = "; expires="+date.toGMTString();}else var expires = "";document.cookie = name+"="+value+expires+"; path=/";}
+function eraseCookie(name) {createCookie(name,"",-1);}
+
+function enanium_change_bg(image)
+{
+ var body = document.getElementsByTagName('body')[0];
+ var cw = document.getElementById('cell-content');
+ if ( image == 'default' )
+ {
+ body.style.backgroundImage = 'url(' + cdnPath + '/themes/enanium/images/background.gif)';
+ body.style.backgroundRepeat = 'repeat';
+ body.style.backgroundAttachment = 'scroll';
+ cw.style.backgroundImage = null;
+ cw.style.backgroundColor = '#ffffff';
+ }
+ else
+ {
+ body.style.backgroundRepeat = 'no-repeat';
+ body.style.backgroundPosition = 'center top';
+ body.style.backgroundColor = '#000000';
+ body.style.backgroundImage = 'url(' + scriptPath + '/plugins/enaniumbg/' + image + '.jpg)';
+ body.style.backgroundAttachment = 'fixed';
+ cw.style.backgroundImage = 'url(' + scriptPath + '/plugins/enaniumbg/transw70.png)';
+ cw.style.backgroundColor = 'transparent';
+ }
+
+ var as = getElementsByClassName(document.getElementById('enanium_bg_list'), 'a', 'selected');
+ for ( var i = 0; i < as.length; i++ )
+ $dynano(as[i]).rmClass('selected');
+
+ $dynano('ebg_' + image).addClass('selected');
+
+ createCookie('enanium_bg', image, 365);
+}
+
+addOnloadHook(function()
+ {
+ var ck = readCookie('enanium_bg');
+ if ( ck )
+ enanium_change_bg(ck);
+ });
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/freshflower.jpg
Binary file plugins/enaniumbg/freshflower.jpg has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/garden.jpg
Binary file plugins/enaniumbg/garden.jpg has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/greenmeadow.jpg
Binary file plugins/enaniumbg/greenmeadow.jpg has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/icons/aqua.png
Binary file plugins/enaniumbg/icons/aqua.png has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/icons/blinds.png
Binary file plugins/enaniumbg/icons/blinds.png has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/icons/default.png
Binary file plugins/enaniumbg/icons/default.png has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/icons/dune.png
Binary file plugins/enaniumbg/icons/dune.png has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/icons/freshflower.png
Binary file plugins/enaniumbg/icons/freshflower.png has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/icons/garden.png
Binary file plugins/enaniumbg/icons/garden.png has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/icons/greenmeadow.png
Binary file plugins/enaniumbg/icons/greenmeadow.png has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/icons/ladybird.png
Binary file plugins/enaniumbg/icons/ladybird.png has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/icons/raindrops.png
Binary file plugins/enaniumbg/icons/raindrops.png has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/icons/sprite.png
Binary file plugins/enaniumbg/icons/sprite.png has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/icons/storm.png
Binary file plugins/enaniumbg/icons/storm.png has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/icons/twowings.png
Binary file plugins/enaniumbg/icons/twowings.png has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/icons/wood.png
Binary file plugins/enaniumbg/icons/wood.png has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/icons/yellowflower.png
Binary file plugins/enaniumbg/icons/yellowflower.png has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/ladybird.jpg
Binary file plugins/enaniumbg/ladybird.jpg has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/orig/aqua.jpg
Binary file plugins/enaniumbg/orig/aqua.jpg has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/orig/blinds.jpg
Binary file plugins/enaniumbg/orig/blinds.jpg has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/orig/dune.jpg
Binary file plugins/enaniumbg/orig/dune.jpg has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/orig/freshflower.jpg
Binary file plugins/enaniumbg/orig/freshflower.jpg has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/orig/garden.jpg
Binary file plugins/enaniumbg/orig/garden.jpg has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/orig/greenmeadow.jpg
Binary file plugins/enaniumbg/orig/greenmeadow.jpg has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/orig/ladybird.jpg
Binary file plugins/enaniumbg/orig/ladybird.jpg has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/orig/raindrops.jpg
Binary file plugins/enaniumbg/orig/raindrops.jpg has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/orig/storm.jpg
Binary file plugins/enaniumbg/orig/storm.jpg has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/orig/twowings.jpg
Binary file plugins/enaniumbg/orig/twowings.jpg has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/orig/wood.jpg
Binary file plugins/enaniumbg/orig/wood.jpg has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/orig/yellowflower.jpg
Binary file plugins/enaniumbg/orig/yellowflower.jpg has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/raindrops.jpg
Binary file plugins/enaniumbg/raindrops.jpg has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/storm.jpg
Binary file plugins/enaniumbg/storm.jpg has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/transw70.png
Binary file plugins/enaniumbg/transw70.png has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/twowings.jpg
Binary file plugins/enaniumbg/twowings.jpg has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/wood.jpg
Binary file plugins/enaniumbg/wood.jpg has changed
diff -r 000000000000 -r e8db3e017691 plugins/enaniumbg/yellowflower.jpg
Binary file plugins/enaniumbg/yellowflower.jpg has changed