<?php
if( !defined('ISDVBBS') ){
	header('HTTP/1.0 404 Not Found');
	exit;
}
global $imgurl;
	if(!empty($info_list)){
		if(is_array($info_list)){
			foreach($info_list as $info_vol){
				$f_userid=$info_vol['f_userid'];
				$f_username=$info_vol['f_username'];
				$f_info=explode("||",$lang['dvbbs.lanstr5']);
				if(strpos($info_vol['f_filename'],":")!==false or strpos($info_vol['f_filename'],"//")!==false){//判断是不是本论坛的信息;
					if($info_vol['f_filetype']=="gif" or $info_vol['f_filetype']=="jpg" or $info_vol['f_filetype']=="bmp" or $info_vol['f_filetype']=="png"){
						$showfile="<a href=".$info_vol['f_filename']."><img border=0 src=".$info_vol['f_filename']."></a>";
					}else{
						$showfile="<a href=".$info_vol['f_filename'].">".$info_vol['f_filename']."</a>";
					}
				}
				else{
					if($info_vol['f_type']==0){//文件集;
						$f_typename=$f_info[0];
						if($info_vol['f_filetype']=="zip_"){
							$showfile="<img border=0 src=".$lang['template.pic5']."><a href=viewfile.php?boardid=".$info_vol['f_boardid']."&id=".$info_vol['f_id']." target=_blank>".$lang['template.viewfile']."</a>";
						}
						elseif($info_vol['f_filetype']=="rar_"){
							$showfile="<img border=0 src=".$lang['template.pic3']."><a href=viewfile.php?boardid=".$info_vol['f_boardid']."&id=".$info_vol['f_id']." target=_blank>".$lang['template.viewfile']."</a>";
						}
						elseif($info_vol['f_filetype']=="txt_"){
							$showfile="<img border=0 src=".$lang['template.pic4']."><a href=viewfile.php?boardid=".$info_vol['f_boardid']."&id=".$info_vol['f_id']." target=_blank>".$lang['template.viewfile']."</a>";
						}
					}
					elseif($info_vol['f_type']==1){//图片集;
						$f_typename=$f_info[1];
						$showfile="<a href=".$upload_url.$info_vol['f_filename']." target=\"_blank\"><img border=0 src=".$upload_url.$info_vol['f_filename']."></a>";
					}
					elseif($info_vol['f_type']==2){//flash集;
						$f_typename=$f_info[2];
						$showfile="<a href=".$upload_url.$info_vol['f_filename'].">".$upload_url.$info_vol['f_filename']."</a>";
					}
					elseif($info_vol['f_type']==3){//音乐集;
						$f_typename=$f_info[3];
						$showfile="<a href=".$upload_url.$info_vol['f_filename'].">".$upload_url.$info_vol['f_filename']."</a>";
					}
					elseif($info_vol['f_type']==4){//电影集;
						$f_typename=$f_info[4];
						$showfile="<a href=".$upload_url.$info_vol['f_filename']."><img border=0 src=".$lang['template.pic6'].">".$upload_url.$info_vol['f_filename']."</a>";
					}
				}
				$f_typename=$f_typename;
				$f_filesize=$info_vol['f_filesize'];
				$f_viewnum=$info_vol['f_viewnum'];
				$f_downnum=$info_vol['f_downnum'];
				$f_addtime=$info_vol['f_addtime'];
				$f_readme=$info_vol['f_readme'];
				if(strpos($info_vol['f_announceid'],'|')!==false){
					$idarr=explode('|',$info_vol['f_announceid']);
					$linkfid=$idarr[0];
				}
				else{
					$linkfid=$info_vol['f_announceid'];
				}
				$golist="<a href=dispbbs.php?boardid=".$info_vol['f_boardid']."&id=".$linkfid."&skin=1>".$lang['template2']."</a>";
			
				//认证管理员，版主，超级管理员，用户自己;
				if($vipuser or $boardmaster or $superboardmaster or $master){
					$edit="<a href=myfile.php?action=edit&editid=".$info_vol['f_id']." title=".$lang['tpl.str2']."><img src=".$imgurl."editfile.gif border=0 width=10 height=10></a>&nbsp;<a href=myfile.php?action=fdel&delid=".$info_vol['f_id']." title=".$lang['tpl.str1']."><img src=templates/default/images/delete.gif border=0 width=10 height=10></a>";
				}
				elseif($userid==$membername){
					$edit="<a href=myfile.php?action=edit&editid=".$info_vol['f_id']." title=".$lang['tpl.str2']."><img src=".$imgurl."editfile.gif border=0 width=10 height=10></a>&nbsp;<a href=myfile.php?action=fdel&delid=".$info_vol['f_id']." title=".$lang['tpl.str1']."><img src=".$imgurl."delete.gif  border=0 width=10 height=10></a>";
				}
				else{
					$edit="";
				}
if($action!="send"){
	$csend="<a href=fileshow.php?action=send&id=".$info_vol['f_id']."><img border=0 width=28 height=11 src=".$imgurl.$lang['template.pic1'].">";
?>
<!--fileshow.asp##显示主体页面-->
<table class="mainbox tableborder" cellSpacing="0" cellPadding="0" align="center">
    <tr>
      <th align="middle" height="25"><?=$lang['tmp.info1']?></th>
    </tr>
    <tr>
      <td class="tablebody1" align="middle" height="*"><?=$lang['tmp.info2']?><a href="dispuser.php?id=<?=$f_userid?>"><?=$f_username?></a><?=$lang['tmp.info3']?>
        <hr width="80%" SIZE="1">
        <br>
        <?=$showfile?><br>
        <table cellSpacing="0" cellPadding="0" width="100%" border="0">
            <tr>
              <td align="left" width="*"><?=$edit?></td>
              <td align="right" width="20"><?=$csend?></td>
            </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td class="tableBorder2" vAlign="top" align="left" height="150">
        <table class="mainbox tableborder" cellSpacing="0" cellPadding="0" width="100%" align="center">
            <tr>
              <td class="tablebody1" align="right" width="20%"><?=$lang['tmp.info4']?></td>
              <td class="tablebody1" width="80%"><a href="dispuser.php?id=<?=$f_userid?>"><?=$f_username?></a></td>
            </tr>
            <tr>
              <td class="tablebody2" align="right" width="20%"><?=$lang['tmp.info5']?></td>
              <td width="80%"><?=$f_typename?></td>
            </tr>
            <tr>
              <td class="tablebody1" align="right" width="20%"><?=$lang['tmp.info6']?></td>
              <td class="tablebody1" width="80%"><?=$f_filesize?><?=$lang['tmp.info7']?></td>
            </tr>
            <tr>
              <td class="tablebody2" align="right" width="20%"><?=$lang['tmp.info8']?></td>
              <td width="80%"><font color="#ff0000"><?if(intval($f_viewnum)==0 or empty($f_viewnum))echo "0";else echo ($f_viewnum+1);?></font><?=$lang['tmp.info9']?></td>
            </tr>
            <tr>
              <td class="tablebody1" align="right" width="20%"><?=$lang['tmp.info10']?></td>
              <td class="tablebody1" width="80%"><?if(intval($f_downnum)==0 or empty($f_downnum))echo "0";else echo ($f_downnum+1);?><?=$lang['tmp.info9']?></td>
            </tr>
            <tr>
              <td class="tablebody1" align="right" width="20%"><?=$lang['tmp.info11']?></td>
              <td class="tablebody1" width="80%"><?=gmdate('Y-m-d H:i:s', $f_addtime+getUserTimeZoneOffset())?></td>
            </tr>
            <tr>
              <td class="tablebody2" align="right" width="20%"><?=$lang['tmp.info12']?></td>
              <td width="80%"><?=$golist?></td>
            </tr>
            <tr>
              <td class="tablebody1" align="right" width="20%" height="20"><?=$lang['tmp.info13']?></td>
              <td class="tablebody1" width="80%"><?=$f_readme?></td>
            </tr>
        </table>
      </td>
    </tr>
</table>
<?
	}else{
		if($action=='send'){//发信认证;
			if($vipuser or $boardmaster or $superboardmaster or $master){
				if($info_vol['f_type']==1 or $info_vol['f_type']==2 ){
					$csend='<a href="fileshow.php?action=send&id='.$info_vol['f_id'].'"><img border=0 width=28 height=11 src='.$imgurl.$lang['template.pic1'].'>';
				}
				else{
					showmsg($lang['template.nosend']);
				}
			}
		}
?>
<!--fileshow.asp##发送贺卡页面-->
<link rel="STYLESHEET" type="text/css" href="images/post/edit.css">
<Script Src="templates/lang/<?=$GLOBALS['fsetting']['lang']?>/js/post/reply_sub.js"></Script>
<script language = "JavaScript" src = "templates/lang/<?=$GLOBALS['fsetting']['lang']?>/js/post/post.js"></script>
<table class="mainbox tableborder" cellSpacing="0" cellPadding="0" align="center">
    <tr>
      <th align="middle" height="25"><?=$lang['tmp.info14']?></th>
    </tr>
    <tr>
      <td class="tablebody1" align="middle" height="*"><?=$lang['tmp.info15']?>
        <hr width="80%" SIZE="1">
        <br>
        <?=$showfile?><br>
      </td>
    </tr>
    <tr>
      <td class="tablebody1" vAlign="top" align="left" height="150">
		<div onkeydown="ctlent();" >
        <table class="mainbox tableborder" cellSpacing="0" cellPadding="0" align="left">
          <form name="Dvform" action="?action=save" method="post" onSubmit="Dvbbs_CopyData('Body');">
              <input type=hidden id="Body" name="Body" value="">
              <tr>
                <td class="tablebody2" align="right" width="100"><?=$lang['tmp.info16']?></td>
                <td class="tablebody1" width="*"><input size="60" name="title"></td>
              </tr>
              <tr>
                <td class="tablebody2" align="right" width="100"><?=$lang['tmp.info17']?></td>
                <td class="tablebody1" width="*"><input size="60" name="subject">
				<select onchange="DoTitle(this.options[this.selectedIndex].value)" name="font">
                    <option value selected><?=$lang['tmp.info18']?></option>
					<?
						if(!empty($friend_list)){
							if(is_array($friend_list)){
								foreach($friend_list as $fri_list){
									$ext=explode(',',$userinfo);
									if($f_mod==$ext[1]){
										$friend=$fri_list['f_friend'];
					?>
					<option value="<?=$friend?>"><?=$friend?></option>
					<?
									}
								}
							}
						}
					?> 
				</select></td>
              </tr>
              <tr>
                <td class="tablebody2" align="right" width="100"><?=$lang['tmp.info19']?></td>
                <td class="tablebody1" width="*">
				<img onclick="Dv_ubb('B')" src="images/ubb/bold.gif" alt="<?=$lang['tpl.str3']?>" border="0" style="cursor:pointer;"/>
				<img onclick="Dv_ubb('I')" src="images/ubb/italicize.gif" alt="<?=$lang['tpl.str4']?>" border="0" style="cursor:pointer;"/>
				<img onclick="Dv_ubb('U')" src="images/ubb/underline.gif" alt="<?=$lang['tpl.str5']?>" border="0" style="cursor:pointer;"/>
				<img onclick="Dv_ubb('center')" src="images/ubb/center.gif" alt="<?=$lang['tpl.str6']?>" border="0" style="cursor:pointer;"/>
				<img onclick="Curl()" src="images/ubb/url1.gif" alt="<?=$lang['tpl.str7']?>" border="0" style="cursor:pointer;"/>
				<img onclick="Dv_Signal('EMAIL')" src="images/ubb/email1.gif" alt="<?=$lang['tpl.str8']?>" border="0" style="cursor:pointer;"/>
				<img onclick="Dv_Signal('IMG')" src="images/ubb/image.gif" alt="<?=$lang['tpl.str9']?>" border="0" style="cursor:pointer;"/>
				<img onclick="Cswf()" src="images/ubb/swf.gif" alt="<?=$lang['tpl.str10']?>" border="0" style="cursor:pointer;"/>
				<img onclick="Cdir()" src="images/ubb/shockwave.gif" alt="<?=$lang['tpl.str11']?>" border="0" style="cursor:pointer;"/>
				<img onclick="Crm()" src="images/ubb/rm.gif" alt="realplay<?=$lang['tpl.str12']?>" border="0" style="cursor:pointer;"/>
				<img onclick="Cwmv()" src="/images/ubb/rm.gif" alt="Media Player<?=$lang['tpl.str12']?>" border="0" style="cursor:pointer;"/>
				<img onclick="Cmov()" src="images/ubb/mp.gif" alt="QuickTime<?=$lang['tpl.str12']?>" border="0" style="cursor:pointer;"/>
				<img onclick="Dv_ubb('QUOTE')" src="images/ubb/qt.gif" alt="<?=$lang['tpl.str13']?>" border="0" style="cursor:pointer;"/>
				<img onclick="Dv_ubb('fly')" src="images/ubb/fly.gif" alt="<?=$lang['tpl.str14']?>" border="0" style="cursor:pointer;"/>
				<img onclick="Dv_ubb('move')" src="images/ubb/move.gif" alt="<?=$lang['tpl.str15']?>" border="0" style="cursor:pointer;"/>
				<img onclick="Cguang()" src="images/ubb/glow.gif" alt="<?=$lang['tpl.str16']?>" border="0" style="cursor:pointer;"/>
				<img onclick="Cying()" src="images/ubb/shadow.gif" alt="<?=$lang['tpl.str17']?>" border="0" style="cursor:pointer;"/>
				<img onclick="Dv_Signal('SOUND')" src="images/ubb/csound.gif" alt="<?=$lang['tpl.str18']?>" border="0" style="cursor:pointer;"/>			</td>
              </tr>
              <tr>
                <td class="tablebody2" align="right" height="128"><?=$lang['tmp.info20']?></td>
                <td class="tablebody1"><iframe class="Dvbbs_Reply" ID="Dvbbs_Composition" MARGINHEIGHT="5" MARGINWIDTH="5" width="550" height="200" ></iframe></td>
                <input type="hidden" value="<?=$sname?>" name="sname"><input type="hidden" value="<?=$sid?>" name="saveid">
              </tr>
              <tr>
                <th align="middle" colSpan="2" height="23"><button onMousemove="button_move(this)" onMouseout="button_out(this)"  type="submit" name="Submit"><?=$lang['tmp.info21']?></button>&nbsp;&nbsp;&nbsp;<button onMousemove="button_move(this)" onMouseout="button_out(this)"  type="reset" name="Submit"  onclick="ClearReset()"><?=$lang['tmp.info22']?></button></th>
              </tr>
              </FORM>
          </table>
		</div>
        </td>
      </tr>
  </table>
<script language="javascript">
var Dvbbs_bIsIE5=document.all
if (Dvbbs_bIsIE5)
{var IframeID=frames["Dvbbs_Composition"];}
else
{
var IframeID=document.getElementById("Dvbbs_Composition").contentWindow;
}
var aaaa;
aaaa="";
function DoTitle(addTitle) {  
 var revisedTitle;  
 var currentTitle = document.Dvform.subject.value;
 if(currentTitle=="") revisedTitle = addTitle; 
 else { 
  var arr = currentTitle.split(","); 
  for (var i=0; i < arr.length; i++) { 
   if( addTitle.indexOf(arr[i]) >=0 && arr[i].length==addTitle.length ) return; 
  } 
  revisedTitle = currentTitle+","+addTitle; 
 } 
 document.Dvform.subject.value=revisedTitle;  
 document.Dvform.subject.focus(); 
 return; 
}
Dvbbs_InitDocument('Body','gb2312');
</script>
<?
				}
			}
		}
	}
?>