您现在的位置是:首页 > 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改界面还是蛮方便的..^_^..
本文标签:
很赞哦! ()
相关教程
- Printable Paper
- Node.js LTS与Current版本区别:发布节奏、支持周期与生产选型依据
- Node.js trace_events.createTracing用法:分类追踪对象与enable/disable生命周期
- Node.js http.globalAgent用法:默认Agent连接池配置与keepAlive版本差异
- Node.js setSocketKeepAlive用法:ClientRequestTCP保活配置与socket.setKeepAlive区别
- Node.js fs.Dirent.isBlockDevice()方法详解:目录项块设备类型判断
- Node.js crypto.randomInt()加密安全随机整数生成方法详解
- Node.js Buffer.readBigInt64BE用法详解:大端序有符号64位整数读取与边界处理
- Node.js vm.runInContext()上下文执行方法详解:隔离边界、性能代价与安全边界认知
- Node.js util.types.isInt32Array()类型判定方法详解:从instanceof陷阱到跨realm安全检测
- Node.js util.types.isUint8ClampedArray()类型守卫:从图像像素校验到生产级防御编程
- Node.js Buffer.readUInt32BE() :大端无符号32位整数的读取边界与工程实践
图文教程
LR实战Discuz开源论坛网页细分图结果分析
续LR实战之Discuz开源论坛项目,之前一直是创建虚拟用户脚本(Virtual User Generator)和场景(Controller),现在,终于到了LoadRunner性能测试结果分析(Analysis)这部分了。
Discuz!7.2 common.inc.php文件分析
//set_magic_quotes_runtime:所有的溢出字符,当遇到反斜杆、单引号,将会自动加上一个反斜杆,保护系统和数据库
discuz_style_default.xml修改方法
首先我们需要在template/文件夹下新建一个yourstyle文件夹放置模板文件,然后复制default下的discuz_style_default.xml
discuz模板做语法高亮的/vs code/textmate方法
本人一直做ASP.NET开发,近期接到任务要用Discuz开发一个社区,第一次接触PHP,PHP灵活的语法,天生的模块化,各种语法糖深深的震惊了我
相关源码
-
(自适应)五金配件机械加工设备pbootcms模板免费下载这款基于PbootCMS开发的网站模板为五金配件和机械加工行业设计,采用简洁有力的设计风格,突出工业产品的专业性和可靠性。模板结构清晰,功能完善,能够有效展示各类工业产品的技术参数和应用场景。查看源码 -
(自适应响应式)pbootcms紫色美容整形机构企业模板下载基于PbootCMS内核开发的响应式网站模板,为医疗美容机构、整形医院等企业设计,提供完整的线上展示平台采用紫色系配色方案,整体风格专业大气。模板包含首页轮播、服务项目、专家团队、案例展示等核心模块,能够充分展示医疗美容机构的专业服务和特色优势。查看源码 -
(自适应响应式)环保净化器家用电器网站免费模板针对环保设备、环境监测等领域的PbootCMS响应式模板,通过模块化设计清晰展示污水处理技术、空气净化系统等解决方案。移动端呈现环保数据可视化图表,后端统一管理确保项目案例、技术等资料多端同步。查看源码 -
WordPress个人博客主题 - wp-Concise-v1.0免费下载wp-Concise-v1.0是一款专为个人博客设计的简约风格主题,采用全宽排版设计理念,注重内容呈现效果。该模板适用于个人随笔、技术分享、生活记录等博客场景,帮助用户打造专业的内容展示空间。查看源码 -
(自适应)品牌创意设计作品工作室pbootcms模板下载该模板适用于品牌策划、艺术设计、广告创意公司官网,亦可通过替换图文快速适配其他行;高端创意设计公司工作室网站源码极简代码架构、艺术化视觉布局、企业级功能扩展性。查看源码 -
(自适应手机端)seo博客网站模板新闻资讯网站源码下载本模板为SEO博客及新闻资讯类平台深度定制,采用PbootCMS内核开发。通过模块化设计实现多行业快速适配,仅需替换图文内容即可转型为医疗、教育、科技等领域网站。响应式布局确保在手机、平板等设备上获得一致浏览体验。查看源码
| 分享笔记 (共有 篇笔记) |
