存档
改了discuz的code代码,新建一个下载地址代码
php的东西实在是不懂,偷个懒,直接修改了dz的code代码,反正南审地带那个论坛也不需要code代码这么先进的东西…哈哈。
修改语言包
templates.lang.php,修改下列文件
'discuzcode_copyclipboard' => '下载地址(将上述地址复制到下载软件队列中即可下载!',
当然,也需要修改css
先来看下默认的code代码的css:
<div class="blockcode"><div id="code0"><ol><li>ftp://ftp.nau.edu.cn/sports/soccer/record/Italy/090822.Milan.vs.Siena/2.wmv<br />
<li>ftp://ftp.nau.edu.cn/sports/soccer/record/Italy/090822.Milan.vs.Siena/1.mpg</ol></div><em onclick="copycode($('code0'));">下载地址(将以下地址复制到下载软件队列中即可下载!</em></div>
改这个就好了嘛。
注意这个地方是在discuzcode.htm这个模板里面。找到红色部分,添加并修改为:
function tpl_codedisp($discuzcodes, $code) {
}--><!--{block return}--><br /><img src="http://bbs.nau.edu.cn/images/nauzone/down.gif" />下载地址(将以下地址复制到下载软件队列中即可下载!具体查看<a href="http://net.nau.edu.cn/resource/guide/how-to-download-ftp-file/">这里</a>):<div class="blockcode"><div id="code$discuzcodes[codecount]"><ol><li>$code</ol></div><em onclick="copycode($('code$discuzcodes[codecount]'));">{lang discuzcode_copyclipboard}</em></div><!--{/block}-->
<!--{eval return $return;}-->
<!--{eval
}
ps,为什么不新建一个discuz代码?因为默认后台新建的代码会解析url,那么你直接在代码里面输入url会造成代码出错。虽然定义很方便,但是以后每次都需要发帖的时候指定必须不解析url,更麻烦了。
应该有更好的方法,比如自定义一个新的代码,但是水平有限,就这样他凑合吧~~
一个js+css+div的幻灯特效
其实个人不是很喜欢js,主要是不熟悉,而且花里胡哨的兼容性问题也不少。不过既然需要,那就搞一个吧。声明:也是抄的,非原创!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | //幻灯片代码for jwzx function $(s){ return document.getElementById(s); } var B=BigNews={ current:0, next:0, scrollInterval:0, autoScroller:0 }; BigNews.turn=function(index){ clearInterval(BigNews.autoScroller); BigNews.scroll(index); } BigNews.scroll=function(index){ var count=0; var step=260; var duration=16; var b=BigNews; b.next=index; if(index!=b.current&&count>duration/8){ return; } clearInterval(b.scrollInterval); var items=$('iiiyx_hd_item').getElementsByTagName('li'); for(var i=0;i<5;i++){ items[i].className=''; } items[index].className='up'; var span=index-b.current; var begin_value=$('iiiyx_hd_img').scrollTop; var chang_in_value=span*step+(b.current*step-begin_value); b.scrollInterval=setInterval(function(){doit(begin_value,chang_in_value)},10); function doit(b,c){ $('iiiyx_hd_img').scrollTop=cpu(count,b,c,duration); count++; if(count==duration){ clearInterval(BigNews.scrollInterval); scrollInterval=0; count=0; $('iiiyx_hd_img').scrollTop=b+c; BigNews.current=index; } } function cpu(t,b,c,d) {return c*((t=t/d-1)*t*t+1)+b;}; } BigNews.auto=function(){ clearInterval(BigNews.scrollInterval); BigNews.autoScroller=setInterval(function(){ BigNews.scroll(BigNews.current==4?0:BigNews.current+1); },3000); } window.attachEvent('onload',BigNews.auto); |
下面是div代码
<div class="iiiyx_hd_go">
<div id="iiiyx_hd_img">
<a href="#" target="_blank"><img src="http://images.nau.edu.cn/jwzx/images/slide/logo_dev.jpg" /></a>
<a href="#" target="_blank"><img src="http://images.nau.edu.cn/jwzx/images/slide/logo_net.jpg" /></a>
<a href="#" target="_blank"><img src="http://images.nau.edu.cn/jwzx/images/slide/logo_cai.jpg" /></a>
<a href="#" target="_blank"><img src="http://images.nau.edu.cn/jwzx/images/slide/logo_camera.jpg" /></a>
<a href="#" target="_blank"><img src="http://images.nau.edu.cn/jwzx/images/slide/logo_classroom.jpg" /></a>
</div>
<div id="slidedescrip">部门职责</div>
<ul id="iiiyx_hd_item">
<li class="up" onmouseover="B.turn(0)" onmouseout="B.auto()"><img src="http://images.nau.edu.cn/jwzx/images//icons/icon_dev.gif" width="50" height="36" />
<dl>
<dt><a href="#" target="_blank">教学仪器设备</a>
<dd>设备采购与维修
</dd></dl>
<li onmouseover="B.turn(1)" onmouseout="B.auto()"><img src="http://images.nau.edu.cn/jwzx/images//icons/icon_net.gif" width="50" height="36" />
<dl>
<dt><a href="#" target="_blank">网络服务与建设</a>
<dd>空间、电子邮箱、网络帐号
</dd></dl>
<li onmouseover="B.turn(2)" onmouseout="B.auto()"><img src="http://images.nau.edu.cn/jwzx/images//icons/icon_cia.gif" width="50" height="36" />
<dl>
<dt><a href="#" target="_blank">网络教学</a>
<dd>电子课件,CIA
</dd></dl>
<li onmouseover="B.turn(3)" onmouseout="B.auto()"><img src="http://images.nau.edu.cn/jwzx/images//icons/icon_cam.gif" width="50" height="36" />
<dl>
<dt><a href="#" target="_blank">视频新闻制作</a>
<dd>视频新闻的摄录与制作
</dd></dl>
<li onmouseover="B.turn(4)" onmouseout="B.auto()"><img src="http://images.nau.edu.cn/jwzx/images//icons/icon_classroom.gif" width="50" height="36" />
<dl>
<dt><a href="#" target="_blank">教室电脑维护</a>
<dd>教室教学电脑的维护管理
</dd></dl>
</li></ul>
</div> |
PNG透明背景在IE6下显示灰色的解决方案
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | <script language="JavaScript"> function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6. { var arVersion = navigator.appVersion.split("MSIE") var version = parseFloat(arVersion[1]) if ((version >= 5.5) && (document.body.filters)) { for(var j=0; j<document.images.length; j++) { var img = document.images[j] var imgName = img.src.toUpperCase() if (imgName.substring(imgName.length-3, imgName.length) == "PNG") { var imgID = (img.id) ? "id='" + img.id + "' " : "" var imgClass = (img.className) ? "class='" + img.className + "' " : "" var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' " var imgStyle = "display:inline-block;" + img.style.cssText if (img.align == "left") imgStyle = "float:left;" + imgStyle if (img.align == "right") imgStyle = "float:right;" + imgStyle if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" img.outerHTML = strNewHTML j = j-1 } } } } window.attachEvent("onload", correctPNG); </script> |
Discuz!修改模板支持https登陆
服务器端的https登陆设置请看
http://baalchina.nau.edu.cn/2008/08/nginx-https-rewrite/
大概了解下用到的模板,包括header.htm,footer.htm,以及logging.htm。另外,登陆成功/失败使用的是showmessage.htm模板。
首先,以header.htm和footer.htm为基础,新建header_ssl.htm以及footer.htm,在logging.php中将相应引用模板的位置修改为引用新建的ssl模板。
接下来修改对应模板。这个稍有点复杂,需要一点点调试。去掉所有的外联的图片、外联的css以及js---通过将他们修改为文件内部引用。
其中:
common.js不需要。可以去掉。
css中,注意这个:
.mainbox
他引用了一个
{HEADERBGCODE};
变量。这个其实就是一个background的图片。所以需要把这个删除。否则还是会提示“存在不安全的内容”
其他的就不多说了。包括footer中的连接等。很多,需要自己一个个去调试。
另外是showmessage模板。这个用于登陆成功、失败之后的跳转页面。
首先修改global.func.php,找到showmessage这个函数,然后复制,将函数名改成showmessagessl,或者随便其他什么名字。
将函数中用到的模板修改为showmessgae_ssl
修改logging.php,将所有的showmessage修改为showmessagessl。
修改showmessage_ssl模板,将header和footer用前面的header_ssl和footer_ssl代替。
基本搞定。
现在还是有一个提示,这个提示是登陆成功、失败之后访问/uc/api.php造成的。这个问题还需要考虑下怎么做。感觉在服务器上处理比较方便。
新生注册的处理
首先是sql表的建立,以2008为例
1 2 3 4 5 6 7 8 9 | CREATE TABLE `cdb_students_2008` ( `id` mediumint(8) unsigned NOT NULL auto_increment, `zkzhm` varchar(20) NOT NULL, `xm` varchar(20) NOT NULL default '', `sfzhm` varchar(20) NOT NULL default '', `used` varchar(5) NOT NULL default '0', `nianji` varchar(4) NOT NULL default '2008', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=gbk COMMENT='2008' AUTO_INCREMENT=4932 ; |
然后是数据导入,多多利用excel以及ultraedit
1 2 | INSERT INTO `cdb_students_2007` (`id`, `zkzhm`, `xm`, `sfzhm`, `used`, `nianji`) VALUES (2, '07110101153058', '闫祎', '110101198903014010', '0', '2007'); |
Nginx下只针对logging.php进行https处理的重写规则
在https server下加入如下配置:
if ($uri !~* "/logging.php$") { rewrite ^/(.*)$ http://$host/$1 redirect; } |
在http server下加入如下配置:
if ($uri ~* "/logging.php$") { rewrite ^/(.*)$ https://$host/$1 redirect; } |
最后结果就是,用户会且只会在访问logging.php的情况下,才会通过https访问。有效地避免了arp欺骗、嗅探等方法盗取账号密码的行为。
感谢nginx作者的帮助。
http://marc.info/?l=nginx&m=121663148102512&w=2