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

 找回密码
 立即注册
搜索

[疑问] 弱弱的问一下`SS资讯附件序号变量咋写

[复制链接]
qin810326 发表于 2010-2-9 15:42:25 | 显示全部楼层 |阅读模式
弱弱的问一下`SS资讯附件序号变量咋写
这样的
  1. imag[1]="$attach[thumbpath]";
  2. link[1]="";
  3. text[1]=" ";
复制代码
生成如下
  1. imag[1]="$attach[thumbpath]";
  2. link[1]="";
  3. text[1]=" ";
  4. imag[2]="$attach[thumbpath]";
  5. link[2="";
  6. text[2]=" ";
  7. imag[3]="$attach[thumbpath]";
  8. link[3]="";
  9. text[3]=" ";
复制代码
回复

使用道具 举报

lidq.jingwu 发表于 2010-2-9 15:49:58 | 显示全部楼层
你的$attach变量是如何取来的,取附件的路径要根据不同的调用语句来写的。
把你的调用语句帖上来看一下。
回复

使用道具 举报

 楼主| qin810326 发表于 2010-2-9 16:00:45 | 显示全部楼层
  1. <!--查看开始-->
  2.                                 <!--{block name="spacenews" parameter="haveattach/2/order/i.dateline DESC/limit/0,4/cachetime/83400/subjectlen/40/subjectdot/0/cachename/hotnewspic"}-->
  3.                                 <div class="ad_pagebody super_notice_new">
  4.                                 <table width="960" cellspacing="0">
  5.                                 <tr><td width="414" height="90">
  6.                                 <script type=text/javascript>
  7.                                 var pic_width=410; //图片宽度
  8.                                 var pic_height=250; //图片高度
  9.                                 var button_pos=5; //按扭位置 1左 2右 3上 4下
  10.                                 var stop_time=3000; //图片停留时间(1000为1秒钟)
  11.                                 var show_text=0; //是否显示文字标签 1显示 0不显示
  12.                                 var txtcolor="000000"; //文字色
  13.                                 var bgcolor="DDDDDD"; //背景色
  14.                                 var imag=new Array();
  15.                                 var link=new Array();
  16.                                 var text=new Array();
  17.                                 <!--{if empty($multipage)}-->
  18.                                 <!--{loop $news['attacharr'] $attach}-->
  19.                                 <!--{if $attach['isimage']}-->
  20.                                 imag[1]="$attach[thumbpath]";
  21.                                 link[1]="";
  22.                                 text[1]=" ";
  23.                                 <!--{/if}-->
  24.                                 <!--{/loop}-->
  25.                                 <!--{/if}-->
  26.                                 //可编辑内容结束
  27.                                 var swf_height=show_text==1?pic_height+20:pic_height;
  28.                                 var pics="", links="", texts="";
  29.                                 for(var i=1; i<imag.length; i++){
  30.                                 pics=pics+("|"+imag[i]);
  31.                                 links=links+("|"+link[i]);
  32.                                 texts=texts+("|"+text[i]);
  33.                                 }
  34.                                 pics=pics.substring(1);
  35.                                 links=links.substring(1);
  36.                                 texts=texts.substring(1);
  37.                                 document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cabversion=6,0,0,0" width="'+ pic_width +'" height="'+ swf_height +'">');
  38.                                 document.write('<param name="movie" value="{S_URL}/templates/$_SCONFIG[template]/images/flash_new.swf">');
  39.                                 document.write('<param name="quality" value="high"><param name="wmode" value="opaque">');
  40.                                 document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&pic_width='+pic_width+'&pic_height='+pic_height+'&show_text='+show_text+'&txtcolor='+txtcolor+'&bgcolor='+bgcolor+'&button_pos='+button_pos+'&stop_time='+stop_time+'">');
  41.                                 document.write('<embed src="{S_URL}/templates/$_SCONFIG[template]/images/flash_new.swf" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&pic_width='+pic_width+'&pic_height='+pic_height+'&show_text='+show_text+'&txtcolor='+txtcolor+'&bgcolor='+bgcolor+'&button_pos='+button_pos+'&stop_time='+stop_time+'" quality="high" width="'+ pic_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
  42.                                 document.write('</object>');
  43.                                 </script>
  44.                                 </td>
  45.                                 <td height="245">
  46.                                 <!--{if !empty($ads3[viewinad])}-->
  47.                                 $ads3[viewinad]
  48.                                 <!--{/if}-->
  49.                                 </td></tr>
  50.                                 </table>
  51.                                 </div><!--查看完-->
复制代码
回复

使用道具 举报

 楼主| qin810326 发表于 2010-2-9 16:01:13 | 显示全部楼层
老大就是这个页面
就只能出来一张图
http://bj.eelou.com/?viewnews-1.html
回复

使用道具 举报

lidq.jingwu 发表于 2010-2-9 16:13:15 | 显示全部楼层

  1.                                 <!--{if empty($multipage)}-->

  2.                                 <!--{loop $news['attacharr'] $attach}-->

  3.                                 <!--{if $attach['isimage']}-->

  4.                                 imag[1]="$attach[thumbpath]";

  5.                                 link[1]="";

  6.                                 text[1]=" ";

  7.                                 <!--{/if}-->

  8.                                 <!--{/loop}-->

  9.                                 <!--{/if}-->
复制代码
这一段代码中是用的$news变量,是系统默认的,里面只有一条数据。
而上面的block标签中的变量你却没有用。
改成下面的一段试一下:

  1.                                 <!--{if empty($multipage)}-->

  2.                                 <!--{loop $_SBLOCK['hotnewspic'] $attach}-->

  3.                                 <!--{if $attach['isimage']}-->

  4.                                 imag[1]="$attach[thumbpath]";

  5.                                 link[1]="";

  6.                                 text[1]=" ";

  7.                                 <!--{/if}-->

  8.                                 <!--{/loop}-->

  9.                                 <!--{/if}-->
复制代码
回复

使用道具 举报

 楼主| qin810326 发表于 2010-2-9 16:18:31 | 显示全部楼层
老大不对呀```
回复

使用道具 举报

hnqdgyj 发表于 2010-2-9 16:19:22 | 显示全部楼层
不懂帮顶一下。噢噢
回复

使用道具 举报

 楼主| qin810326 发表于 2010-2-9 16:23:28 | 显示全部楼层
差一个变量``

   1. imag[变量]="$attach[thumbpath]";
   2. link[变量]="";
   3. text[变量]=" ";
   4. imag[变量]="$attach[thumbpath]";
   5. link[变量="";
   6. text[变量]=" ";
   7. imag[变量]="$attach[thumbpath]";
   8. link[变量]="";
   9. text[变量]=" ";
回复

使用道具 举报

 楼主| qin810326 发表于 2010-2-21 13:42:08 | 显示全部楼层
弄不出来哦``
回复

使用道具 举报

Alice.Girl 发表于 2010-2-21 14:51:06 | 显示全部楼层
回复 9# qin810326
如果我没有理解错的话:
  1.                                 <!--{if empty($multipage)}-->

  2.                                 <!--{loop $news['attacharr'] $attach}-->

  3.                                 <!--{if $attach['isimage']}-->

  4.                                 imag[1]="$attach[thumbpath]";

  5.                                 link[1]="";

  6.                                 text[1]=" ";

  7.                                 <!--{/if}-->

  8.                                 <!--{/loop}-->

  9.                                 <!--{/if}-->
复制代码
替换为:
  1.                                 <!--{if empty($multipage)}-->

  2.                                 <!--{eval $i = 1;}-->

  3.                                 <!--{loop $_SBLOCK['hotnewspic'] $attach}-->

  4.                                 <!--{if $attach['isimage']}-->

  5.                                 imag[$i]="$attach[thumbpath]";

  6.                                 link[$i]="";

  7.                                 text[$i]=" ";

  8.                                 <!--{/if}-->

  9.                                 <!--{eval $i++;}-->

  10.                                 <!--{/loop}-->

  11.                                 <!--{/if}-->
复制代码
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-9-15 00:49 , Processed in 0.125097 second(s), 14 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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