博主资料

留言短消息 加为好友 收藏

用户ID:  132
昵称:  东升
来自:  广西 南宁

日历

2006 - 1
1234567
891011121314
15161718192021
22232425262728
293031    
«» 2006 - 1 «»

日志分类

最新评论

日志文章列表

2006年01月30日 15:18:15

[原创]借新浪的滚动焦点图flash,用程序自动调用论坛中的图片

适合于本论坛的情况,本人不对此程序作技术支持,谢谢您的观看,欢迎批评指正!

演示:http://www.laxjyj.com

首先说明,本站首页的图片仅调用“教育简讯”中主题贴中的图片,该栏目需要验证后主题方可显示!

新浪滚动焦点图的flash见:
http://sports.sina.com.cn/

flash下载地址:http://image2.sina.com.cn/bj/zonghe/pixviewer.swf
(可以将此文件放到自己的空间,不过一般来说,我们自己的空间比新浪更容易崩。除非新浪将此文件修改或放到其他目录中)

修改方法:

1、在首页适当的位置加入以下代码:

Copy code
  <script type="text/javascript">
  <!--
          var focus_width=260
          var focus_height=182
          var text_height=25
          var swf_height = focus_height+text_height
  var swf_height = focus_height+text_height
 
  var pics="$pics"
  var links="$links"
  var texts="$texts"
 
  document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="[url]http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6[/url],0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
  document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="[url]http://image2.sina.com.cn/bj/zonghe/pixviewer.swf[/url]"><param name="quality" value="high"><param name="bgcolor" value="#DADADA">');
  document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
  document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
  document.write('<embed src="[url]http://image2.sina.com.cn/bj/zonghe/pixviewer.swf[/url]" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#DADADA" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="[url]http://www.macromedia.com/go/getflashplayer[/url]" />');
  document.write('</object>');
 
  //-->
  </script>


2、在适当的论坛PHP文件中加入以下代码:(本站将程序加入到验证主题的操作中)
Copy code
$query=$db->query("
SELECT tm.tid,tm.fid,tm.subject,t.attachurl FROM pw_threads tm
LEFT JOIN pw_attachs t ON t.tid = tm.tid
WHERE tm.fid =18 and t.type='img' and ifcheck='1'
ORDER BY postdate DESC
LIMIT 30
");//LIMIT 30 可以根据需要调整,我这里是估算每个主题有6张图片的情况下。

$imgcontent="<?php\n";
$pics=$links=$texts="";
$rs_i=0;
while ($imginfo = $db->fetch_array($query) and $rs_i<5) {//i只调用5张图片
  if($rs_tid!=$imginfo[tid]){
    $pics.=$db_bbsurl."/".$attachpath."/".$imginfo[attachurl]."|";
    $links.=$db_bbsurl."/read.php?tid=".$imginfo[tid]."|";
    $texts.=$imginfo[subject]."|";
    $rs_i++;//同一主题的只要最后上传的那张图片
  }
  $rs_tid=$imginfo[tid];
}

$pics=substr($pics,0,-1);
$links=substr($links,0,-1);
$texts=substr($texts,0,-1);

$pics='$pics="'.$pics.'";';
$links='$links="'.$links.'";';
$texts='$texts="'.$texts.'";';

$imgcontent = $imgcontent.$pics."\n".$links."\n".$texts."\n?>";

writeover("data/bbscache/newspoto.php",$imgcontent);


注意:
调用的图片大小如果尺寸不合适,将造成部分文字显示不正常。以上这个新浪网页的图片大小均为:258×180。当然如果你取消文字部分那就没什么问题了。

类别: 无分类 |  评论(0) |  浏览(2646) |  收藏
2006年01月27日 21:24:28

修改官方的首页调用工具new.php使它支持主题颜色调用!


修改官方的首页调用工具new.php,让它也能支持调用原主题的标题颜色。

修改方法如下:

1、将

Copy code
$query   = $db->query("SELECT tid,fid,author,authorid,subject,postdate,hits,replies FROM pw_threads WHERE $sqladd ORDER BY $orderby DESC LIMIT 0, $num");

替换为:
Copy code
$query   = $db->query("SELECT tid,fid,titlefont,author,authorid,subject,postdate,hits,replies FROM pw_threads WHERE $sqladd ORDER BY $orderby DESC LIMIT 0, $num");//增加,titlefont


2、在
Copy code
$threads['subject'] = substrs($threads['subject'], $length);

的后面添上:
Copy code
//以下调用原主题的颜色样式 by www.laxjyj.com
    if ($threads['titlefont']){
    $titledetail=explode("~",$threads['titlefont']);
    if($titledetail[0])$threads['subject']="<font color=$titledetail[0]>$threads[subject]</font>";
    if($titledetail[1])$threads['subject']="<b>$threads[subject]</b>";
    if($titledetail[2])$threads['subject']="<i>$threads[subject]</i>";
    if($titledetail[3])$threads['subject']="<u>$threads[subject]</u>";
    }
//以上调用原主题的颜色样式 by www.laxjyj.com


以上即可完成对new.php的修改。
===========================================================
以下是修改原首页排行榜插件:http://www.phpwind.net/read.php?tid=62832的方法
1、将原贴中的
Copy code
$query = $db->query("SELECT tid,author,subject,postdate FROM pw_threads order by postdate desc limit 0,$listnum");

改成:
Copy code
$query = $db->query("SELECT tid,author,titlefont,subject,postdate FROM pw_threads order by postdate desc limit 0,$listnum");


2、在原贴的
Copy code
$threads[subject]=substrs($threads[subject],$listlength);

下面添加:

Copy code
    if ($threads['titlefont']){
    $titledetail=explode("~",$threads['titlefont']);
    if($titledetail[0])$threads['subject']="<font color=$titledetail[0]>$threads[subject]</font>";
    if($titledetail[1])$threads['subject']="<b>$threads[subject]</b>";
    if($titledetail[2])$threads['subject']="<i>$threads[subject]</i>";
    if($titledetail[3])$threads['subject']="<u>$threads[subject]</u>";
    }


以上两步仅能完成一类排行的颜色调用功能,其他类的排行类似。

类别: 无分类 |  评论(0) |  浏览(2443) |  收藏
2006年01月05日 07:55:04

[插件][修改自DZ]突破相册的图片防盗链功能 for PW

适用版本:所有PW版本,本贴以PW4为例
插件作者:原作者t1000,修改:东升
最后更新:2006-01-05
修改文件:bbscode.php
修改模版:read.htm、readtpl.htm、editor.htm、data\wind_editor.js

添加模板:无
安装难易:中

说明:
  安装后使用[simg]来显示图片,即使对方服务器采用了防盗链技术,也可以正常显示。
不生成任何临时文件。
  基本上php程序部分只负责获取图片,能转移的工作已经转移到客户端。所以,性能是可以接受的。另外,php部分不要求放在本机,放在免费空间也是不错的办法。

演示地址:http://bbs.laxjyj.com/read.php?tid=9578

备注:本插件在发表前已经得原作者同意!

安装方法:

1、上传压缩包中的getimg.php到主机空间,任意空间即可,假设地址为:http://site.com/getimg.php

2、修改bbscode.php
在if ($allow['pic']){
后面添加

Copy code
if(strpos($message,'[/simg]')!==false || strpos($message,'[/simg]')!==false){
  $message = preg_replace("/\[simg\](.+?)\[\/simg\]/is","<script language='javascript'>GetProtectImg('\\1');</script>",$message);
}

3、修改read.htm
在<!--<?php
$votedb && require_once PrintEot('vote');
print <<<EOT
-->
后面添加
Copy code
<script language=JavaScript>
function GetProtectImg(u){
var getu="http://site.com/getimg.php";//注意:其中getu的值要与getimg.php所在的地址一致。
var str_a;
var h;
var p;
var path;
var temp;
str_a=u.split("http://");
str_a=str_a[1].split("/");
h=str_a.shift();
path='/'+str_a.join('/');
temp=h.split(':');
h=temp[0];
p=(temp[1]!=null) ? temp[1] : 80;
getu+='?host='+h+'&port='+p+'&path='+path;
document.write('<img src='+getu+' border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\'Click here to open new window\';}" onmouseover="if(this.resized) this.style.cursor=\'hand\';" onclick="if(this.resized) {window.open(this.src);}">');
}
</script>

如果论坛用到静态网页,还需要在readtpl.htm模板<body vlink='#333333' link='#333333'>
的后面添加上面的那段代码。

4、添加simg标签

 a、修改editor.htm模板

<img onClick=image() alt='插入图片' src='$imgpath/post/editor/image.gif' >
后面添加
<img onClick=simg() alt='插入相册图片' src='$imgpath/post/editor/simg.gif' >
 b、修改data\wind_editor.js文件

function image() {
前面添加
Copy code
function simg(){
  if (helpmode){
    alert('相册图片标记\n插入相册图片\n用法: [simg]http://www.phpwind.net/image/php.gif[/simg]');
  } else if (nomode || document.selection && document.selection.type == "Text") {
    AddTxt="[simg]"+text+"[/simg]";
    AddText(AddTxt);
  } else {
    txt=prompt('相册图片地址',"http://");
    if(txt!=null) {
        AddTxt="[simg]"+txt;
        AddText(AddTxt);
        AddTxt="[/simg]";
        AddText(AddTxt);
    }
  }
}

 c、上传标签用到的图片simg.gif到\image\post\editor目录下。

类别: 无分类 |  评论(0) |  浏览(2466) |  收藏