diff options
Diffstat (limited to 'user/plugins/random-bg')
20 files changed, 33 insertions, 0 deletions
diff --git a/user/plugins/random-bg/README.md b/user/plugins/random-bg/README.md new file mode 100644 index 0000000..f3867fa --- /dev/null +++ b/user/plugins/random-bg/README.md @@ -0,0 +1,6 @@ +Random Background +================= +This is a sample plugin, for illustration purpose. +Don't modify this plugin. Instead, copy its folder +and modify your own copy. This way, your code won't +be overwritten when you upgrade YOURLS.
\ No newline at end of file diff --git a/user/plugins/random-bg/img/backup/bg_ants.png b/user/plugins/random-bg/img/backup/bg_ants.png Binary files differnew file mode 100644 index 0000000..1b736b0 --- /dev/null +++ b/user/plugins/random-bg/img/backup/bg_ants.png diff --git a/user/plugins/random-bg/img/backup/bg_boobs.png b/user/plugins/random-bg/img/backup/bg_boobs.png Binary files differnew file mode 100644 index 0000000..09d2dd4 --- /dev/null +++ b/user/plugins/random-bg/img/backup/bg_boobs.png diff --git a/user/plugins/random-bg/img/backup/bg_circles.png b/user/plugins/random-bg/img/backup/bg_circles.png Binary files differnew file mode 100644 index 0000000..27c2884 --- /dev/null +++ b/user/plugins/random-bg/img/backup/bg_circles.png diff --git a/user/plugins/random-bg/img/backup/bg_cross.png b/user/plugins/random-bg/img/backup/bg_cross.png Binary files differnew file mode 100644 index 0000000..3129cdd --- /dev/null +++ b/user/plugins/random-bg/img/backup/bg_cross.png diff --git a/user/plugins/random-bg/img/backup/bg_diag.png b/user/plugins/random-bg/img/backup/bg_diag.png Binary files differnew file mode 100644 index 0000000..f3c5fb7 --- /dev/null +++ b/user/plugins/random-bg/img/backup/bg_diag.png diff --git a/user/plugins/random-bg/img/backup/bg_fuzzy.png b/user/plugins/random-bg/img/backup/bg_fuzzy.png Binary files differnew file mode 100644 index 0000000..6850ca4 --- /dev/null +++ b/user/plugins/random-bg/img/backup/bg_fuzzy.png diff --git a/user/plugins/random-bg/img/backup/bg_fuzzy_bits.png b/user/plugins/random-bg/img/backup/bg_fuzzy_bits.png Binary files differnew file mode 100644 index 0000000..91ff805 --- /dev/null +++ b/user/plugins/random-bg/img/backup/bg_fuzzy_bits.png diff --git a/user/plugins/random-bg/img/backup/bg_life.png b/user/plugins/random-bg/img/backup/bg_life.png Binary files differnew file mode 100644 index 0000000..7d3e54f --- /dev/null +++ b/user/plugins/random-bg/img/backup/bg_life.png diff --git a/user/plugins/random-bg/img/backup/bg_yourls.png b/user/plugins/random-bg/img/backup/bg_yourls.png Binary files differnew file mode 100644 index 0000000..d96cde8 --- /dev/null +++ b/user/plugins/random-bg/img/backup/bg_yourls.png diff --git a/user/plugins/random-bg/img/bg_ants.gif b/user/plugins/random-bg/img/bg_ants.gif Binary files differnew file mode 100644 index 0000000..70b64c2 --- /dev/null +++ b/user/plugins/random-bg/img/bg_ants.gif diff --git a/user/plugins/random-bg/img/bg_boots.gif b/user/plugins/random-bg/img/bg_boots.gif Binary files differnew file mode 100644 index 0000000..2241ebc --- /dev/null +++ b/user/plugins/random-bg/img/bg_boots.gif diff --git a/user/plugins/random-bg/img/bg_circles.gif b/user/plugins/random-bg/img/bg_circles.gif Binary files differnew file mode 100644 index 0000000..ff57a16 --- /dev/null +++ b/user/plugins/random-bg/img/bg_circles.gif diff --git a/user/plugins/random-bg/img/bg_cross.gif b/user/plugins/random-bg/img/bg_cross.gif Binary files differnew file mode 100644 index 0000000..8cf785a --- /dev/null +++ b/user/plugins/random-bg/img/bg_cross.gif diff --git a/user/plugins/random-bg/img/bg_diag.gif b/user/plugins/random-bg/img/bg_diag.gif Binary files differnew file mode 100644 index 0000000..6996606 --- /dev/null +++ b/user/plugins/random-bg/img/bg_diag.gif diff --git a/user/plugins/random-bg/img/bg_fuzzy.gif b/user/plugins/random-bg/img/bg_fuzzy.gif Binary files differnew file mode 100644 index 0000000..a7709b2 --- /dev/null +++ b/user/plugins/random-bg/img/bg_fuzzy.gif diff --git a/user/plugins/random-bg/img/bg_fuzzy_bits.gif b/user/plugins/random-bg/img/bg_fuzzy_bits.gif Binary files differnew file mode 100644 index 0000000..e663faf --- /dev/null +++ b/user/plugins/random-bg/img/bg_fuzzy_bits.gif diff --git a/user/plugins/random-bg/img/bg_life.gif b/user/plugins/random-bg/img/bg_life.gif Binary files differnew file mode 100644 index 0000000..e32d025 --- /dev/null +++ b/user/plugins/random-bg/img/bg_life.gif diff --git a/user/plugins/random-bg/img/bg_yourls.gif b/user/plugins/random-bg/img/bg_yourls.gif Binary files differnew file mode 100644 index 0000000..107ecf4 --- /dev/null +++ b/user/plugins/random-bg/img/bg_yourls.gif diff --git a/user/plugins/random-bg/plugin.php b/user/plugins/random-bg/plugin.php new file mode 100644 index 0000000..c249637 --- /dev/null +++ b/user/plugins/random-bg/plugin.php @@ -0,0 +1,27 @@ +<?php +/* +Plugin Name: Random Backgrounds +Plugin URI: http://yourls.org/ +Description: Pretty random background patterns +Version: 1.0 +Author: Ozh +Author URI: http://ozh.org/ +*/ + +// No direct call +if( !defined( 'YOURLS_ABSPATH' ) ) die(); + +// Add the inline style +yourls_add_action( 'html_head', 'ozh_yourls_randombg' ); +function ozh_yourls_randombg() { + $bg = glob( __DIR__.'/img/*gif' ); + $url = yourls_plugin_url( __DIR__ ); + $rnd = yourls_plugin_url( $bg[ mt_rand( 0, count( $bg ) - 1 ) ] ); + echo <<<CSS +<style type="text/css"> + body {background:#e3f3ff url($rnd); background-size: cover;} + </style> + +CSS; +} + |