diff options
| author | s1n <[email protected]> | 2020-03-28 10:36:41 -0700 |
|---|---|---|
| committer | s1n <[email protected]> | 2020-03-28 10:36:41 -0700 |
| commit | 25b7d2aab61ae6421398d3abae5da6ffe590333d (patch) | |
| tree | 611985ec78bb2d94099c9fd5dd687f5c9cee6f3e /user/plugins/random-bg/plugin.php | |
| parent | Initial commit (diff) | |
| download | crack.cf-backup-master.tar.xz crack.cf-backup-master.zip | |
Diffstat (limited to 'user/plugins/random-bg/plugin.php')
| -rw-r--r-- | user/plugins/random-bg/plugin.php | 27 |
1 files changed, 27 insertions, 0 deletions
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; +} + |