您现在的位置是:首页 > cms教程 > Discuz教程Discuz教程
Discuz NT相册查看插件开发实例
寻春2025-07-06Discuz教程已有人查阅
导读现在把他整合在Discuz NT 的相册程序中.下面介绍一下实现方法. 貌似太简单了点.然后在discuz NT网站的根目录下新建一个文件夹来放highslide库, 我这里是命名为static
现在把他整合在Discuz NT 的相册程序中.下面介绍一下实现方法. 貌似太简单了点.然后在discuz NT网站的根目录下新建一个文件夹来放highslide库, 我这里是命名为static. 然后把在http://highslide.com/下下载的文档解压,把highslide文件夹复制到static文件夹下.
在static文件夹下的highslide文件夹下新建一个javascirpt文件.我这里是discuzphoto.js.里面的脚本代码如下:
然后再在后台界面模板管理中找到 showalbum 这个html模板.把里面的内容改成这样:
在static文件夹下的highslide文件夹下新建一个javascirpt文件.我这里是discuzphoto.js.里面的脚本代码如下:
hs.graphicsDir = '/static/highslide/graphics/';
hs.align = 'center';
hs.transitions = ['expand', 'crossfade'];
hs.outlineType = 'rounded-white';
hs.fadeInOut = true;
hs.allowSizeReduction = true;
//hs.dimmingOpacity = 0.75;
// Add the controlbar
if (hs.addSlideshow) hs.addSlideshow({
//slideshowGroup: 'group1',
interval: 5000,
repeat: false,
useControls: true,
fixedControls: 'fit',
overlayOptions: {
opacity: .75,
position: 'bottom center',
hideOnMouseOut: true
}
});
然后再新建一个.css文件,我这里命名为: discuzphoto.css,里面的css代码如下:然后再在后台界面模板管理中找到 showalbum 这个html模板.把里面的内容改成这样:
<%inherits "Discuz.Album.Pages.showalbum"%>
<%template _albumheader%>
<%if page_err==0%>
<%template _albumnavigation%>
<div id="foruminfo">
<div id="userinfo">
<a href="{config.albumurl}" id="NavHome" onmouseover="showMenu(this.id);" onmouseout="showMenu(this.id);">{config.albumname}首頁</a> ? <a href="{albumurl}showalbumlist.aspx?cate={albumcategory.albumcateid}">{albumcategory.title}</a> ? {album.title}
</div>
<div id="headsearch">
<div id="search">
<%template _quicksearch%>
</div>
</div>
</div>
{navhomemenu}
<div id="ntforumbody">
<%if {!needpassword}%>
<div class="modulebox">
<div class="forumtitle spacetitle">
<h2>
{album.title} <strong>
<script type="text/javascript">
document.write(window.location);
</script>
</strong>(<a href="###" onclick="setcopy(window.location.href.replace('###','') + '&page={currentpage}', '已經復制到剪貼板');" class="copylink">復制到剪帖板</a>)
</h2>
<em>
<%if {config.silverlight}==1%>
<a id="silverlightalbum" target="_blank" title="Silverlight相冊展示" href="silverlight/album/index.html?albumid={album.albumid}"><img src="templates/{templatepath}/images/album/button_seeit.gif" alt="展開" /></a>
<%/if%>
</em>
</div>
<div class="controlPhoto">
<!-- highslide control start -->
<script type="text/javascript" src="/static/highslide/highslide-with-gallery.js"></script>
<script type="text/javascript" src="/static/highslide/discuzphoto.js"></script>
<link href="/static/highslide/discuzphoto.css" rel="stylesheet" type="text/css" />
<!-- highslide control end -->
<p>
<%if {config.enablespace}==1%><a href="{spaceurl}space/?uid={album.userid}" target="_blank"><img src="templates/{templatepath}/images/album/dotspace.gif" />{album.username}的空間</a><%/if%>
<%set {aspxrewriteurl} = this.UserInfoAspxRewrite({album.userid})%>
<a href="{forumurl}{aspxrewriteurl}"><img src="templates/{templatepath}/images/album/user_info.gif" alt="用戶信息:"/>{album.username}的用戶資料</a>
<a href="{albumurl}showalbumlist.aspx?uid={album.userid}"><img src="templates/{templatepath}/images/album/user_album.gif" alt="用戶相冊"/>{album.username}的全部相冊</a>
</p>
<p><%if {album.userid}=={userid}%>
<a href="{forumurl}usercpspacemanagephoto.aspx?albumid={album.albumid}" target="_blank"><img src="templates/{templatepath}/images/album/album_edit.gif" />管理</a>
<%/if%>
<a href="{forumurl}favorites.aspx?albumid={album.albumid}"><img src="templates/{templatepath}/images/album/album_fav.gif" alt="收藏" title="收藏" />收藏</a>
</p>
</div>
<%if {photolist.Count}>0%>
<div class="Photo">
<%set (int) {photoindex} = 1%>
<%loop (PhotoInfo) photo photolist%>
<%csharp%>
string highslide_bigPic = photo.Filename.Replace("_thumbnail","");
<%/csharp%>
<div class="photoItem">
<a href="{highslide_bigPic}" class="highslide" onclick="return hs.expand(this)">
<img src="{photo.filename}" alt="{photo.title}" title="{photo.title}" /></a>
<div class="highslide-caption">
(<script language="javascript" type="text/javascript">ShowFormatBytesStr({photo.filesize});</script>)
<a href="{albumurl}showphoto.aspx?photoid={photo.photoid}">{photo.title}</a>
</div></div>
<%/loop%>
</div>
<div class="ntforumpage" style="margin-left:45px;">
{pagenumbers}
</div>
<%else%>
<%template _photomsgbox%>
<%/if%>
</div>
<%else%>
<div class="modulebox">
<div class="forumtitle">
<h2>此相冊已被設置密碼</h2>
</div>
<div class="forumpassword">
<form id="enteralbum" name="enteralbum" method="post" action="">
<label for="password">請輸入密碼:</label><input name="albumpassword" type="password" id="albumpassword" size="20" class="colorblue" onfocus="this.className='colorfocus';" onblur="this.className='colorblue';" />
<p><input type="submit" value="確定" class="lightbutton"/></p>
</form>
</div>
</div>
<%/if%>
</div>
<%else%>
<%template _photoerrmsgbox%>
<%/if%>
<%template _copyright%>
<%template _footer%>
这样便Ok了.. 感觉discuz NT改界面还是蛮方便的..^_^..
本文标签:
很赞哦! ()
相关教程
图文教程
小白安装Discuz开源论坛手把手教
添加mysql普通用户接着上篇的lamp这篇安装Discuz配置虚拟主机1、打开虚拟主机配置2、配置虚拟主机3、创建DocumentRoot路径
jsp应用系统整合discuz论坛用户系统
关键代码,整合函数,调用方法:login.jsp,logout.jsp,
打通Discuz!NT类VS2005代码实例
本C#程序用于打通 Discuz!NT 2.1.202主要功能如下:1、自动论坛注册2、前台用户同步登陆,并同步密码3、前台用户同步退出4、后台管理员同步登陆5、后台管理员同步退出
discuz!x2.5修改您的面板已经锁定!请在1797秒以后重新访问管理中
登录管理中心时四次书错密码会看见这个访问管理中心“您的管理面板已经锁定!请在1797秒以后重新访问管理中心”在哪里控制这呢?
相关源码
-
(自适应响应式)高端家用办公家具家居桌椅pbootcms模板下载为办公家具企业设计的响应式网站模板,涵盖产品展示、案例呈现、企业介绍等核心模块。通过可视化后台可快速发布实木桌椅、系统家具、办公屏风等产品信息,帮助客户直观了解材质参数与空间搭配方案。查看源码 -
(自适应HTML5)响应式智能设备人工智能机器pbootcms源码免费下载这款基于PbootCMS开发的网站模板为人工智能和智能设备行业设计,采用现代化科技风格,突出产品的智能特性和技术创新。模板架构合理,功能完善,能够有效展示各类智能产品的核心功能和解决方案。查看源码 -
(PC+WAP)高端餐饮美食小吃加盟网站模板下载pbootcms本模板基于PbootCMS内核开发,为餐饮美食品牌加盟、小吃连锁企业量身打造。通过精致的美食视觉呈现与加盟业务流程展示,帮助餐饮企业建立专业线上门户,实现品牌形象与加盟业务的双重展示。查看源码 -
(自适应)黑色摄影作品工作室pbootcms模板网站源码下载为风景摄影、个人工作室打造的高端网站模板,基于PbootCMS开源内核开发,采用HTML5自适应架构,PC与移动端实时数据同步,适配各类拍摄作品展示需求。查看源码 -
(自适应响应式)蓝色外贸英文产品介绍展示网站模板本模板采用手工编写的DIV+CSS架构,代码精简高效。适配手机端浏览,数据实时同步更新。内置SEO优化框架,支持独立设置各页面标题、关键词及描述。开源代码结构清晰,便于二次开发。查看源码 -
(自适应)大气办公用品耗材供应打印机产品维修网站模板下载基于PbootCMS系统开发的响应式网站模板,为营销技术博主、数字产品评测者设计。采用前沿的响应式技术,确保内容在手机端和桌面端都能获得较佳阅读体验,帮助用户高效展示技术文章和产品分析。查看源码
| 分享笔记 (共有 篇笔记) |
