标签 标签 下的文章

给SeaCMS增加一个相似名称+同导演+同演员三个条件同时存在的标签

在内容页调用相关影片时,常用的标签有
rel=r 像似名称影片
rel=d 同导演影片
rel=y 同演员影片
这三个标签在一个循环内只能单独使用,当使用rel=r调用相似名称影片的数量非常少时,可能无法填满预留位置,严重影响页面美观。

解决方法:增加一个支持相似名字+同导演+同演员三个条件同时存在的标签

动态模式:
编辑 /include/main.class.php 文件第1379行

            $rel_d = explode ( ",", str_replace ( " ", ",", $zrel ['0']->v_director ) );
            $rel_y = explode ( ",", str_replace ( " ", ",", $zrel ['0']->v_actor ) );
            $rel_r = substr ( $zrel ['0']->v_name, 0, 9 );
            unset ( $zrel );
            switch ($vrel) {
                case "d" :
                    foreach ( $rel_d as $value ) {
                        $d_str .= "'%" . $value . "%'#";
                    }
                    $d_str = rtrim ( $d_str, "#" );
                    $d_str = str_replace ( "#", " or m.v_director like ", $d_str );
                    $whereRel = " and m.v_director like $d_str ";
                    break;
                case "y" :
                    foreach ( $rel_y as $value ) {
                        $y_str .= "'%" . $value . "%'#";
                    }
                    $y_str = rtrim ( $y_str, "#" );
                    $y_str = str_replace ( "#", " or m.v_actor like ", $y_str );
                    $whereRel = " and (m.v_actor like $y_str) ";
                    break;
                case "r" :
                    $whereRel = " and m.v_name like '%$rel_r%'";
                    break;

下方插入

                case "l":
                    foreach ( $rel_d as $value ) {
                        $d_str .= "'%" . $value . "%'#";
                    }
                    $d_str = rtrim ( $d_str, "#" );
                    $d_str = str_replace ( "#", " or m.v_director like ", $d_str );
                    foreach ( $rel_y as $value ) {
                        $y_str .= "'%" . $value . "%'#";
                    }
                    $y_str = rtrim ( $y_str, "#" );
                    $y_str = str_replace ( "#", " or m.v_actor like ", $y_str );
                    $whereRel=" and (m.v_name like '%$rel_r%' or (m.v_director like $d_str) or (m.v_actor like $y_str) )";
                    break;

静态模式:
编辑 /include/main2.class.php 文件第1372行

            $rel_d = explode ( ",", str_replace ( " ", ",", $zrel ['0']->v_director ) );
            $rel_y = explode ( ",", str_replace ( " ", ",", $zrel ['0']->v_actor ) );
            $rel_r = substr ( $zrel ['0']->v_name, 0, 9 );
            unset ( $zrel );
            switch ($vrel) {
                case "d" :
                    foreach ( $rel_d as $value ) {
                        $d_str .= "'%" . $value . "%'#";
                    }
                    $d_str = rtrim ( $d_str, "#" );
                    $d_str = str_replace ( "#", " or m.v_director like ", $d_str );
                    $whereRel = " and m.v_director like $d_str ";
                    break;
                case "y" :
                    foreach ( $rel_y as $value ) {
                        $y_str .= "'%" . $value . "%'#";
                    }
                    $y_str = rtrim ( $y_str, "#" );
                    $y_str = str_replace ( "#", " or m.v_actor like ", $y_str );
                    $whereRel = " and m.v_actor like $y_str ";
                    break;
                case "r" :
                    $whereRel = " and m.v_name like '%$rel_r%'";
                    break;

下方插入

                case "l":
                    foreach ( $rel_d as $value ) {
                        $d_str .= "'%" . $value . "%'#";
                    }
                    $d_str = rtrim ( $d_str, "#" );
                    $d_str = str_replace ( "#", " or m.v_director like ", $d_str );
                    foreach ( $rel_y as $value ) {
                        $y_str .= "'%" . $value . "%'#";
                    }
                    $y_str = rtrim ( $y_str, "#" );
                    $y_str = str_replace ( "#", " or m.v_actor like ", $y_str );
                    $whereRel=" and (m.v_name like '%$rel_r%' or (m.v_director like $d_str) )";
                    break;

给SeaCMS增加一个精确到分钟的时间标签

编辑/include/main.class.php文件

1、找到

case "yyyy-m-d":                                    $loopstrVlistNew=str_replace($matchfieldvalue,MyDate("Y-n-j",$videoTime),$loopstrVlistNew);
break;

在下方插入

case "m-d-h-i":                                    $loopstrVlistNew=str_replace($matchfieldvalue,MyDate("m-d H:i",$videoTime),$loopstrVlistNew);
break;

共有二处,分别是视频单层循环标签和文章单层循环标签处的调用

2、找到

case "yyyy-m-d":                                    $loopstrChannelNew=str_replace($matchfieldvalue,MyDate("Y-n-j",$videoTime),$loopstrChannelNew);
break;

在下方插入

case "m-d-h-i":                                    $loopstrChannelNew=str_replace($matchfieldvalue,MyDate("m-d H:i",$videoTime),$loopstrChannelNew);
break;

共有三处,分别是视频频道页、视频搜索页、视频筛选页和文章频道页、文章搜索页、文件筛选页 标签处的调用

3、找到

case "yyyy-m-d":
$content=str_replace($matchfieldvalue,MyDate("Y-n-j",$addtime),$content);
break;

在下方插入

case "m-d-h-i":
$content=str_replace($matchfieldvalue,MyDate("m-d H:i",$addtime),$content);
break;

共一处,视频内容页和播放页标签处的调用

- 阅读剩余部分 -

Html5 audio标签详解

audio标签的语法结构:

<audio src="音频地址">您的浏览器不支持audio标签</audio>

其中audio中间的文字可以去掉,加上这些文字是为了让一些不支持audio标签的浏览器进行识别.

audio标签的基本属性:
src(链接地址);
loop(设置是否循环播放);
autoplay(自动播放);
controls (提供给用户一个可以控制音频的控件);
preload(可以选择设置“none”,“metadata”,“auto”)

none:默认不加载,按需加载. metadata::元数据,默认不加载,但是可以提取该音频的元数据信息. auto:自动加载,如果不是动态载入的audio,该音频会随页面一起加载进来.

- 阅读剩余部分 -