Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[其他] 勇哥35风格整理

[复制链接]
kele9988 发表于 2007-7-2 03:26:48 | 显示全部楼层 |阅读模式
安装了勇哥的35风格,很漂亮,但首页调用数据太多,网站内容缺乏,好多地方是空的,看上去有点乱,于是稍微修改了下.修改了各个DIV层错落不齐的情况.去掉了GOOGLE广告,去掉了首页商品显示,左下角商家点评改为调用个人空间文件下载.改了顶部菜单下"今日焦点",即使头条是少于2行文字的图片资讯,也不会出现表格上缩而出现空白.右边兴趣圈等改为调用影音数据.http://elexuan.com

首页放上来了
templates.rar (20.34 KB, 下载次数: 261)


QQ截图未命名.gif
2.gif
4.gif
5.gif

[ 本帖最后由 kele9988 于 2007-7-2 20:53 编辑 ]
 楼主| kele9988 发表于 2007-7-2 03:41:33 | 显示全部楼层

FLASH免激活方法

继续修改去~
当鼠标放到FLASH幻灯片上时,就会在Flsh周围出现一个虚框,并提示你单击激活控件,激活后才能交互,才能点图片,个人空间用到FLASH特效的也是,很不爽,前几天网上查了资料修改了,安装新模板后还没来得及改.

(已修改)
找了好多,Flash都是通过脚本来写入的,要修改就要在每个插入FLASH的地方都改代码,工程很大而且有些容易出错,比如影音播放器.
在GOOGLE进行大海捞针似的搜索,终于找到了简便有效的方法~搽汗中..
解决方法:

打开include/js/ajax.js文件,在最后面加上以下代码:

  1. var ie = (document.defaultCharset && document.getElementById && !window.home);
  2. var opera9 = false;
  3. if (ie){
  4.         //Check for ie 5.5 and exclude it from the script
  5.         var ver=navigator.appVersion.split("MSIE")
  6.         ver=parseFloat(ver[1])
  7.         ie = (ver >=6)
  8. }else if (navigator.userAgent.indexOf("Opera")!=-1) {
  9.         //Check for Opera9 and include it in the ObjectSwap
  10.         var versionindex=navigator.userAgent.indexOf("Opera")+6
  11.         if (parseInt(navigator.userAgent.charAt(versionindex))>=9)
  12.         opera9 = true;
  13. }
  14. //Perform ObjectSwap if the browser is IE or Opera (if not just check flashVersion)
  15. var oswap = (ie || opera9)

  16. //Hide the object to prevent it from loading twice
  17. if (oswap){
  18.         document.write ("<style id='hideObject'> object{display:none;} </style>");
  19. }

  20. /*Replace all flash objects on the page with the same flash object,
  21. by rewriting the outerHTML values
  22. This bypasses the new IE ActiveX object activation issue*/
  23. objectSwap = function(){
  24.         if (!document.getElementsByTagName){
  25.                 return;
  26.         }
  27.         //An array of ids for flash detection
  28.         var stripQueue = [];
  29.         //Get a list of all ActiveX objects
  30.         var objects = document.getElementsByTagName('object');
  31.         for (var i=0; i<objects.length; i++){                       
  32.                 var o = objects[i];       
  33.                 var h = o.outerHTML;
  34.                 //The outer html omits the param tags, so we must retrieve and insert these separately
  35.                 var params = "";
  36.                 var hasFlash = true;
  37.                 for (var j = 0; j<o.childNodes.length; j++) {
  38.                         var p = o.childNodes[j];
  39.                         if (p.tagName == "PARAM"){
  40.                                 //Check for version first - applies to all browsers
  41.                                 //For this to work, a new param needs to be included in the object with the name "flashVersion" eg:
  42.                                 //<param name="flashVersion" value="7" />
  43.                                 if (p.name == "flashVersion"){
  44.                                         hasFlash = detectFlash(p.value);
  45.                                         if (!hasFlash){
  46.                                                 //Add the objects id to the list (create a new id if there's isn't one already)
  47.                                                 o.id = (o.id == "") ? ("stripFlash"+i) : o.id;
  48.                                                 stripQueue.push(o.id);
  49.                                                 break;
  50.                                         }
  51.                                 }
  52.                                 params += p.outerHTML;                       
  53.                         }
  54.                 }       
  55.                 if (!hasFlash){
  56.                         continue;
  57.                 }               
  58.                 //Only target internet explorer
  59.                 if (!oswap){
  60.                         continue;
  61.                 }
  62.                 //Avoid specified objects, marked with a "noswap" classname
  63.                 if (o.className.toLowerCase().indexOf ("noswap") != -1){
  64.                         continue;
  65.                 }               
  66.                 //Get the tag and attributes part of the outer html of the object
  67.                 var tag = h.split(">")[0] + ">";                       
  68.                 //Add up the various bits that comprise the object:
  69.                 //The tag with the attributes, the params and it's inner html
  70.                 var newObject = tag + params + o.innerHTML + " </OBJECT>";       
  71.                 //And rewrite the outer html of the tag
  72.                 o.outerHTML = newObject;
  73.         }
  74.         //Strip flash objects
  75.         if (stripQueue.length) {
  76.                 stripFlash(stripQueue)
  77.         }
  78.         //Make the objects visible again
  79.         if (oswap){
  80.                 document.getElementById("hideObject").disabled = true;
  81.         }
  82. }

  83. detectFlash = function(version){
  84.         if(navigator.plugins && navigator.plugins.length){
  85.                 //Non-IE flash detection.
  86.                 var plugin = navigator.plugins["Shockwave Flash"];
  87.                 if (plugin == undefined){
  88.                         return false;
  89.                 }
  90.                 var ver = navigator.plugins["Shockwave Flash"].description.split(" ")[2];
  91.                 return (Number(ver) >= Number(version))
  92.         } else if (ie && typeof (ActiveXObject) == "function"){
  93.         //IE flash detection.
  94.                 try{
  95.                         var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + version);
  96.                         return true;
  97.                 }
  98.                 catch(e){
  99.                         return false;
  100.                 }
  101.         }
  102.         //Catchall - skip detection
  103.         return true;
  104. }

  105. //Loop through an array of ids to strip
  106. //Replace the object by a div tag containing the same innerHTML.
  107. //To display an alternative image, message for the user or a link to the flash installation page, place it inside the object tag.  
  108. //For the usual object/embed pairs it needs to be enclosed in comments to hide from gecko based browsers.
  109. stripFlash = function (stripQueue){
  110.         if (!document.createElement){
  111.                 return;
  112.         }
  113.         for (var i=0; i<stripQueue.length; i++){
  114.                 var o = document.getElementById(stripQueue[i]);
  115.                 var newHTML = o.innerHTML;       
  116.                 //Strip the comments
  117.                 newHTML = newHTML.replace(/<!--\s/g, "");
  118.                 newHTML = newHTML.replace(/\s-->/g, "");
  119.                 //Neutralise the embed tag
  120.                 newHTML = newHTML.replace(/<embed/gi, "<span");               
  121.                 //Create a new div element with properties from the object
  122.                 var d = document.createElement("div");
  123.                 d.innerHTML = newHTML;
  124.                 d.className = o.className;
  125.                 d.id = o.id;
  126.                 //And swap the object with the new div
  127.                 o.parentNode.replaceChild(d, o);
  128.         }
  129. }

  130. //Initiate the function without conflicting with the window.onload event of any preceding scripts
  131. var tempFunc = window.onload;
  132. window.onload = function(){
  133.         if (typeof (tempFunc) == "function"){
  134.                 try{
  135.                         tempFunc();
  136.                 } catch(e){}
  137.         }
  138.         objectSwap();
  139. }

复制代码



保存,刷新后看看是不是不需要激活了~首页,个人空间等同时解决.同样这个脚本也可以用到其他地方,比如论坛LOGO是FLASH的,把上面的代码保存为**.JS文件,在需要的地方插入
<script src="**.js" type="text/javascript" language="javascript"></script>





1.jpg

2.jpg

[ 本帖最后由 kele9988 于 2007-7-2 04:35 编辑 ]
回复

使用道具 举报

 楼主| kele9988 发表于 2007-7-2 03:53:18 | 显示全部楼层
继续列出还需要修改的地方,有改好的就贴出来共享哦.
各分类查看页都是居中对齐,在文字内容很短的情况下看着很乱
1.jpg

2.jpg
回复

使用道具 举报

 楼主| kele9988 发表于 2007-7-2 04:30:05 | 显示全部楼层
自己先顶一个,再找问题~
回复

使用道具 举报

 楼主| kele9988 发表于 2007-7-2 04:34:44 | 显示全部楼层
才发现半夜夜黑风高时发很好抢沙发啊,好多人睡着了都掉地板上去了~
回复

使用道具 举报

mickly 发表于 2007-7-2 10:14:56 | 显示全部楼层
沙发哦
回复

使用道具 举报

辛勤de园丁 发表于 2007-7-2 10:22:39 | 显示全部楼层
呵呵
不错,期待你能放出来·纯友情支持!
回复

使用道具 举报

pcload 发表于 2007-7-2 10:30:14 | 显示全部楼层
可否吧首页文件共享出来啊?
回复

使用道具 举报

 楼主| kele9988 发表于 2007-7-2 11:08:38 | 显示全部楼层
原帖由 pcload 于 2007-7-2 10:30 发表
可否吧首页文件共享出来啊?


还有部分调用没搞上去,再修改下.有需要的话我发上来
回复

使用道具 举报

heheivy 发表于 2007-7-2 11:24:17 | 显示全部楼层

回复 #9 kele9988 的帖子

楼主把所有文件打个包放出来吧:)
谢谢哦:)
发我邮箱也行  wxivyer@gmail.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-9-28 06:22 , Processed in 0.660815 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表