chengkun
2025-04-18 1bb985f32f2efe0f9dd69f3cf29a1c809b1cf96d
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
//百度自动推送功能
function smarty_function_webspecial($paramer,&$smarty){
         global $config;
        //加载首页主题
        include(PLUS_PATH."/indextpl.cache.php");
        if($_GET['tpltype']){//预览主题
            $tplindex=$indextpl[$_GET['tpltype']];
        }else{
            $time=time();
            foreach($indextpl as $key=>$v){
                if($v['status']==1 && $v['stime']<$time && $v['etime']>$time){
                    $tplindex=$v;
                    break;
                }
            }
        }
        
        if($tplindex['pic']){
            $tplindex['pic']=$config['sy_ossurl'].'/'.$tplindex['pic'];
            $content='';
            if($tplindex['pic']){
                if($tplindex['height']>0){//定义头部高度
                    $height='$(".yunheader_60").css("margin-top","'.$tplindex['height'].'px");';
                }
                
                $content.='<script>
                        window.onload = function() {
                            $("body").css("background","#f8f8f8 url('.$tplindex['pic'].') no-repeat center top");
                            $(".yunheader_60").css("background","none");
                            '.$height.'
                        }; 
                     </script>';                    
            }
            if($tplindex['se']==1){
                $content.='<script>
                                var o=navigator.userAgent.toLowerCase();
                                if((window.ActiveXObject||"ActiveXObject"in window)&&((o.match(/msie\s(\d+)/)||[])[1]||"11")){
                                    var d = document.createElement("script");
                                    d.src = "'.$config['sy_weburl'].'/js/grayscale.js";
                                    document.head.appendChild(d);
                                    setTimeout(function(){grayscale(document.body);},2000)
                                }else{
                                    document.body.style.filter = "grayscale(100%)";
                                }
                            </script>';
            }
            return $content;
        }
    }
?>