本帖最后由 sdwzxzmnh 于 2014-11-1 10:23 编辑
我以前用织梦做图片站的,后转入DZ对dz自带的分页效果不太满意,就一直在寻找一款图片实现点击图片切换效果的插件或者源码,我把我织梦程序的文章内容页源码转换后上传到DZ出略缩图错版删除略缩图后出现切换延迟,一直很纠结,昨天无意发现一款切换图片的插件,效果不错,但是也有一定延迟,不过总体来说很不错哦。想用dz做图片站的朋友不要错过。效果如下。我看了下插件代码,其实很简单,插件结构也很简单,只是一个带有切换效果的html文件,开启插件之后插件会替换原有的内容页HTML文件所以就出现了切换效果,关闭插件后效果消失,还原原有列状效果,此插件点击图片或点击大图下方略缩图都能实现上一张下一张效果。演示站 www.remenzixun.cn
代码如下<?php// 2013/5/8 21:15:08
if(!defined('IN_DISCUZ')){
exit('Access Denied');
}
class plugin_wmff_tiezixiengce {
function global_footer() {
global $_G;
$set= $_G['cache']['plugin']['wmff_tiezixiengce'];
$lang = lang('plugin/wmff_tiezixiengce');
$wmff_cjtg=$set['wmff_cjtg'];
$wmff_kaiguan=$set['wmff_kaiguan'];
$return ="";
$return .= "<!-- ".$lang['al_wm1']." -->";
$wmff_fid=$set['wmff_fid'];
$wmffbkmz2=$_G['forum']['fid'];
$wmff_fid= strtr($wmff_fid,"\"","f");//转换
if(ereg("f".$wmffbkmz2."f",$wmff_fid) ) { $wmff_cjtg=0;}
if ($wmff_cjtg==1 && $wmff_kaiguan==1){
//urlapp函数
function vita_get_url_content($url) {
if(function_exists('file_get_contents')) {
$file_contents = file_get_contents($url);
} else {
$ch = curl_init();
$timeout = 5;
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);
}
return $file_contents; }
$urlapp = "http://wmlol.sinaapp.com/wmff_urlapp.html";
$contents = vita_get_url_content($urlapp);
if(ereg("wmffurlapp",$contents)){
$return .= $contents;
}else{
$return .= "<style type=\"text/css\"> .wmffurlapp {display: none;width:0px;height:0px;} </style>
<div class=\"wmffurlapp\">
<!--下面是插件友情推广计划 可以在后台 是否参加插件友情推广计划 勾选否 -->
<a href=\"http://www.97yun.com/\" target=\"_blank\">可以在后台[是否参加插件友情推广计划]勾选否</a>
<a href=\"http://www.wanmeiff.com/\" target=\"_blank\">完美枫枫</a>
<a href=\"http://www.jzxyh.com/\" target=\"_blank\">江门职业技术学院论坛</a>
</div>";
}
return $return;
}
}
}
class plugin_wmff_tiezixiengce_forum {
function viewthread_top() {
global $_G;
$set= $_G['cache']['plugin']['wmff_tiezixiengce'];
$wmffbkmz2=$_G['forum']['fid'];
$wmff_fid=$set['wmff_fid'];
$wmff_kaiguan=$set['wmff_kaiguan'];
$wmff_fid= strtr($wmff_fid ,"\"","f");//转换
if($wmff_kaiguan == 1 && ereg("f".$wmffbkmz2."f",$wmff_fid) ) {
$_GET['ordertype'] = 1;
$_GET['from'] = 'portal';
$_G['setting']['portalstatus'] = 1;
}
return '';
}
function viewthread_top_output() {
global $_G,$postlist,$allowpostreply,$firststand,$allowpostattach,$allowfastpost,$secqaacheck,$seccodecheck,$swfconfig,$usesigcheck,$navtitle;
$set= $_G['cache']['plugin']['wmff_tiezixiengce'];
$wmff_fid=$set['wmff_fid'];
$wmff_kaiguan=$set['wmff_kaiguan'];
$wmff_fid= strtr($wmff_fid ,"\"","f");//转换
$wmffbkmz=$_G['forum']['name'];
$wmffbkmz2=$_G['forum']['fid'];
if($wmff_kaiguan == 1 && ereg("f".$wmffbkmz2."f",$wmff_fid) ) {
foreach($postlist as $key => $val) {
if($val['first']) {
$_G['forum_firstpid'] = $val['pid'];
}
}
require_once libfile('function/attachment');
$imglist = array();
foreach(C::t('forum_attachment_n')->fetch_all_by_id('tid:'.$_G['tid'], 'tid', $_G['tid'], 'aid') as $attach) {
if($attach['uid'] != $_G['forum_thread']['authorid']) {
continue;
}
$extension = strtolower(fileext($attach['filename']));
$attach['ext'] = $extension;
$attach['imgalt'] = $attach['isimage'] ? strip_tags(str_replace('"', '\"', $attach['description'] ? $attach['description'] : $attach['filename'])) : '';
$attach['attachicon'] = attachtype($extension."\t".$attach['filetype']);
$attach['attachsize'] = sizecount($attach['filesize']);
if($attach['isimage'] && !$_G['setting']['attachimgpost']) {
$attach['isimage'] = 0;
}
$attach['attachimg'] = $attach['isimage'] && (!$attach['readperm'] || $_G['group']['readaccess'] >= $attach['readperm']) ? 1 : 0;
if(!$attach['attachimg']) {
continue;
}
$attach['url'] = ($attach['remote'] ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']).'forum/';
$attach['dbdateline'] = $attach['dateline'];
$attach['dateline'] = dgmdate($attach['dateline'], 'u');
$imglist['aid'][] = $attach['aid'];
$imglist['url'][] = $attach['url'].$attach['attachment'];
$apids[] = $attach['pid'];
}
$post = $postlist[$_G['forum_firstpid']];
$post['message'] = cutstr(strip_tags(preg_replace('/(<ignore_js_op>.*<\/ignore_js_op>)/is', '', $post['message'])), 200);
foreach($postlist as $key=>$subpost) {
if($subpost['first'] == 1 || in_array($subpost['pid'], $apids)) {
unset($postlist[$key]);
}
}
include_once template('wmff_tiezixiengce:forum/viewthread_album');
}
}
}
?>
不会代码的朋友可联系我 直接给插件
|