效果预览图:
点击后效果:
highslide + EXIF信息显示效果显示效果:http://bbs.zqlife.com/bbs/showtopic-12673.aspx安装:JS文件放在INDEX.ASPX位置.
highslide 样式表 放在 INDEX.ASPX位置.
CS放倒Discuz.FORUM目录里面
调用://数组参数: 每3个1组(1:显示名称;2:EXIF16位代码;3:显示的值)
//EXIF16位代码详细请看CS代码最后附件
string[] PhotoView = { "摄像机品牌", "10f", "暂无", "摄像机型号", "110", "暂无", "相片拍摄时间", "9003", "暂无", "曝光时间", "829a", "暂无", "快门速度", "9201", "暂无", "创建软件", "131", "暂无", "暴光模式", "9207", "暂无", "光圈数", "829d", "暂无", "最大光圈值", "9205", "暂无", "ISO感光度", "8827", "暂无", "焦距", "920a", "暂无", "压缩比率", "9102" ,"暂无"};
ImgExif em = new ImgExif();
PhotoView = em.GetEXIFMetaData(System.Web.HttpContext.Current.Server.MapPath(forumPath + "upload/" + drAttach["filename"].ToString()), PhotoView);结合highslide图片显示:
修改PostFactory.cs(Fourm里面) GetMessageWithAttachInfo函数 估计到651行
if (_postpramsinfo.Showattachmentpath == 1)
{
replacement = "<img src=\"" + forumPath + "upload/" + drAttach["filename"].ToString() + "\" onload=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='点击在新窗口浏览图片 CTRL+鼠标滚轮可放大/缩小';}\" onmouseover=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='点击在新窗口浏览图片 CTRL+Mouse 滚轮可放大/缩小';}\" onclick=\"if(!this.resized) { return true; } else { window.open(this.src); }\" onmousewheel=\"return imgzoom(this);\" />";
}
else
{
这里显示图片代码(我这里修改了,不记得是什么内容)
}在ELSE后修改为:
//设置显示内容(可自行修改)
string[] PhotoView = { "摄像机品牌", "10f", "暂无", "摄像机型号", "110", "暂无", "相片拍摄时间", "9003", "暂无", "曝光时间", "829a", "暂无", "快门速度", "9201", "暂无", "创建软件", "131", "暂无", "暴光模式", "9207", "暂无", "光圈数", "829d", "暂无", "最大光圈值", "9205", "暂无", "ISO感光度", "8827", "暂无", "焦距", "920a", "暂无", "压缩比率", "9102" ,"暂无"};
ImgExif em = new ImgExif();
//将EXIF信息赋值到PhotoView 数组内
PhotoView = em.GetEXIFMetaData(System.Web.HttpContext.Current.Server.MapPath(forumPath + "upload/" + drAttach["filename"].ToString()), PhotoView);
//判断是否有EXIF信息
if (PhotoView[2].ToString() != "暂无")
{
replacement = "<div>
<a href=\"" + forumPath + "attachment.aspx?attachmentid=" + drAttach["aid"].ToString() + "\" onclick=\"return hs.expand(this, { captionId: 'caption" + drAttach["aid"].ToString() + "' } )\" class=\"highslide\" title=\"相机型号:" + PhotoView[2].ToString() + " - " + PhotoView[5].ToString() + "(点我看详细资料)\"><img src=\"" + forumPath + "attachment.aspx?attachmentid=" + drAttach["aid"].ToString() + "\" onload=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='点击在新窗口浏览图片 CTRL+鼠标滚轮可放大/缩小';}\" onmouseover=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='点击在新窗口浏览图片 CTRL+Mouse 滚轮可放大/缩小';}\" onclick=\"if(!this.resized) { return true; } else { window.open(this.src); }\" onmousewheel=\"return imgzoom(this);\"
class=\"borderwhite\" /></a>";
//此区点击前隐藏
replacement += "<div class='highslide-caption' id='caption" + drAttach["aid"].ToString() + "'>";
int exi;
string reStr = "";
for (exi = 0; exi < PhotoView.Length / 3; exi++)
{
//现还显示EXIF信息
reStr = "<b>" + PhotoView[exi * 3].ToString() + "</b>:";
reStr += PhotoView[exi * 3 + 2].ToString();
if (exi % 2 == 1)
{
replacement += "<div style='float:left;width:50%'>\n";
replacement += reStr;
replacement += "</div>\n";
replacement += "</div>\n";
}
else
{
replacement += "<div>";
replacement += "<div style='float:left;width:50%'>\n";
replacement += reStr;
replacement += "</div>";
}
}
//if (exi % 2 != 1) replacement += "</div>";
replacement += "</div>";
replacement += "</div>";
}
else
{
replacement = "<a href=\"" + forumPath + "attachment.aspx?attachmentid=" + drAttach["aid"].ToString() + "\" onclick=\"return hs.expand(this)\" class=\"highslide\"><img src=\"" + forumPath + "attachment.aspx?attachmentid=" + drAttach["aid"].ToString() + "\" onload=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='点击在新窗口浏览图片 CTRL+鼠标滚轮可放大/缩小';}\" onmouseover=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='点击在新窗口浏览图片 CTRL+Mouse 滚轮可放大/缩小';}\" onclick=\"if(!this.resized) { return true; } else { window.open(this.src); }\" onmousewheel=\"return imgzoom(this);\" class=\"borderwhite\" /></a>";
}
生成.....OK~