您现在的位置是:首页 > 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网站HTML5模板本模板基于PbootCMS内核开发,为高新技术、科技研发、能源技术等科技型企业设计。采用HTML5+CSS3前沿技术,具备完善的响应式布局,能够自动适配手机、平板和电脑等多种终端设备。模板设计风格简约大气查看源码
  • (自适应)工商代理公司注册财务会计pbootcms模板免费下载为工商代理、财务会计服务企业设计的网站模板,基于PbootCMS开发,充分考虑了企业服务行业的展示需求与客户转化路径。设计风格专业严谨,布局清晰合理,呈现企业服务内容与专业优势。查看源码
  • (PC+WAP)红色厨具厨房用品设备pbootcms模板源码下载为厨具设备企业设计的响应式网站模板,采用PbootCMS内核开发,适用于商用厨房设备、家用厨具、厨房用品等企业展示。模板包含产品展示、新闻动态、案例中心等标准模块,助您快速搭建专业级行业网站。查看源码
  • 蓝色工业机械五金设备pbootcms模板源码下载(PC+WAP)为机械制造与五金设备企业设计的响应式网站模板,基于PbootCMS内核开发。采用蓝色工业风格强化行业属性,宽屏布局突出设备细节展示,支持PC与WAP端自适应查看源码
  • (PC+WAP)货运物流快递仓储货架pbootcms网站模板下载本模板基于PbootCMS开发,为货运物流、快递配送、仓储货架等行业设计,支持PC+WAP自适应,确保在电脑、手机、平板等设备上均能流畅访问。适用于物流公司、仓储企业查看源码
分享笔记 (共有 篇笔记)
验证码:

本栏推荐