-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.php
More file actions
36 lines (33 loc) · 1.07 KB
/
plugin.php
File metadata and controls
36 lines (33 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
class BaldursPhotographyXMasLights extends KokenPlugin {
function __construct() {
$this->require_setup = false;
$this->register_hook('before_closing_body', 'render');
}
function render() {
$xmas_top = $this->data->xmas_light_top;
$xmas_position = $this->data->xmas_light_position;
$xmas_marg_left = $this->data->xmas_light_marg_left;
$xmas_zindex = $this->data->xmas_light_zindex;
$path = $this->get_path();
echo <<<OUT
<!-- xmas_lights [ start ] -->
<script type="text/javascript">
document.write("<div id='lights' style='z-index:{$xmas_zindex};position:{$xmas_position};width:956px;height:180px;top:{$xmas_top}px;background:url({$path}/light.png) no-repeat;left:50%;margin-left:{$xmas_marg_left}px'></div>")
setInterval( "xmasLights();", 1000 );
var lights = "active";
function xmasLights(){
var img = document.getElementById('lights');
if(lights == "active"){
img.style.backgroundPosition = "0 -180px";
lights = "inactive";
}else{
img.style.backgroundPosition = "";
lights = "active";
}
}
</script>
<!-- xmas_lights [ end ] -->
OUT;
}
}