Discuz!NT 2.5 正式版 下载
beta、RC版升级补丁
Comsenz 招聘信息
首届Discuz!NT 模板大赛圆满结束
著名音乐网站SoGua网、分贝网
采用Discuz!NT搭建社区
FIFA Online2官网论坛使用Discuz!NT
游戏城寨论坛使用Discuz!NT搭建
第二届优秀版主评选揭晓
Discuz!NT 2.5正式开源 Discuz!NT文档中心
用户整合说明文档
Discuz!NT亮相微软Tech-Ed 2007
Discuz!NT情景搞笑短片抢先看
1/2页12 跳转到查看:8217
发新话题 回复该主题

[使用] EXIF信息修改版~

EXIF信息修改版~

效果预览图:

点击后效果:


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~

附件

js.rar ()

2007-7-29 10:49:47


ImageEXIF.rar ()

2007-7-29 10:49:47


hastside.rar ()

2007-7-29 10:49:47


最后编辑yugu91 最后编辑于 2007-07-29 11:00:29
http://www.zqlife.com

TOP

 

回复:EXIF信息修改版~

不错,给楼主加精

此外提前告诉楼主,2.0里将支持不同附件类型的扩展信息插件功能,也就是说单独为某种附件类型可以开发插件dll,来显示该类型附件的扩展信息。
最后编辑雪人 最后编辑于 2007-07-30 09:08:05
常见问题请先参看各版块置顶贴, 或参阅文档中心相关内容:  点击查看
提问问题请尽量在标题中说明大概
欢迎提意见建议
为了不耽误您的问题尽快解决,请勿发送短消息

TOP

 

回复:EXIF信息修改版~

:lol 老大加精,我再加个亮.LZ是人才.你的论坛很不错.

TOP

 

回复:EXIF信息修改版~

Discuz.FORUM 不知道在哪里?
我的qq:157868,欢迎交流。
欢迎访问我的摄影网站:徽州摄影网

TOP

 

回复:EXIF信息修改版~

这个插件具体如何安装,请给个具体的步骤.。谢谢
我的qq:157868,欢迎交流。
欢迎访问我的摄影网站:徽州摄影网

TOP

 

回复:EXIF信息修改版~(需要支持)

需要支持
我的qq:157868,欢迎交流。
欢迎访问我的摄影网站:徽州摄影网

TOP

 

回复: EXIF信息修改版~

.NET 2.0架构.配上已生成的Discuz.Forum.DLL文件,直接复制到BIN目录即可,第1,第二步可步操作可免 ,附件看最下,其他文件下载看1楼.

1.在DISCUZ.FORUM增加ImageEXIF.cs文件
打开项目,找到DISCUZ.FORUM类


将ImageEXIF.cs复制进去(可自己新建一个ImageEXIF.cs,将代码复制进去)

2.修改帖子图片显示方式:
找到DISCUZ.FORUM类里面的PostFactory.cs(代码大概在650行

将:
                        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
                        {
                            replacement = "<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);\" />";
                        }

红字部分,替换成:
//设置显示格式3个为1组(1.显示名称;2.图片16位代码;3.显示值)
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);

//判断是否有图片参数
                            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++)
                                {
                                    reStr = "<b>" + PhotoView[exi * 3].ToString() + "</b>:";
                                    reStr += PhotoView[exi * 3 + 2].ToString();

                                  //已2列方式显示
                                    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>";
                                    }
                                }

                                //如果显示个数为单数,需要加</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>";
                            }


3.配置highslide预览图
将文件:下载的highslide.JS文件和PIC文件夹复制到BBS目录下JS/里面
再将文件:hastside.css复制到论坛目录下

4.生成DISCUZ.FORUM  OK~~~

附件

Discuz.Forum.rar ()

2007-7-30 10:39:24


最后编辑yugu91 最后编辑于 2007-07-30 10:41:43
http://www.zqlife.com

TOP

 

回复:EXIF信息修改版~

没什么好说的,对于这类强帖只能顶

TOP

 

回复: EXIF信息修改版~

小声说一句,LZ你用的是DNT呀,为什么版权会显示成这样

TOP

 

回复:EXIF信息修改版~

很棒!楼主是肇庆人啊!

TOP

 
1/2页12 跳转到
发表新主题 回复该主题