您现在的位置是:首页 > 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.里面的脚本代码如下:
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改界面还是蛮方便的..^_^..

本文标签:

很赞哦! ()

相关源码

  • (自适应响应式)pbootcms紫色美容整形机构企业模板下载基于PbootCMS内核开发的响应式网站模板,为医疗美容机构、整形医院等企业设计,提供完整的线上展示平台采用紫色系配色方案,整体风格专业大气。模板包含首页轮播、服务项目、专家团队、案例展示等核心模块,能够充分展示医疗美容机构的专业服务和特色优势。查看源码
  • (自适应)双语网络电子摄像头设备pbootcms网站模板下载核心功能定位:基于PbootCMS开发的双语摄像头企业官网模板,深度适配产品规格书展示、实时监控演示、解决方案呈现等业务场景,支持中英文内容一键切换。查看源码
  • (pc+wap)pbootcms网站模板蓝色小程序网站开发公司基于PbootCMS内核开发的营销型门户模板,为小程序开发公司、电商软件企业打造。采用HTML5自适应架构,实现PC与手机端数据实时同步展示查看源码
  • (PC+WAP)蓝色五金机械设备营销型网站源码下载基于PbootCMS内核开发的营销型企业网站模板,为五金机械设备类企业打造,通过标准化数字展示提升客户转化率。模板采用模块化设计,可快速适配机床工具、建筑五金、阀门管件等细分领域。查看源码
  • (自适应响应式)个人作品技术文章博客网站模板下载基于PbootCMS内核开发的响应式博客模板,为数字营销、技术分享类内容打造。采用前沿设计理念,兼顾内容展示与阅读体验,适配各类终端设备。通过本模板可快速构建专业级行业博客,有效传播专业知识与案例成果。查看源码
  • 帝国CMS7.5养生生活健康网模板完整带会员中心可封装APP本套模板为生活服务类网站设计,适用于两性健康、减肥瘦身、生活资讯等领域。采用帝国CMS7.5核心开发,结构清晰合理,视觉体验舒适,能够有效满足相关行业的建站需求。查看源码
分享笔记 (共有 篇笔记)
验证码:

本栏推荐