Example #1
0
<div class="blank30"></div>
<?php 
}
?>


<!--自动调用自定义字段-->
<?php 
echo $archive['my_fields'];
?>

<div class="blank20"></div>


<?php 
if (archive_attachment($archive['aid'], 'id')) {
    ?>
<!-- 附件 -->
<p>
<?php 
    echo lang(attachment);
    ?>
:<?php 
    echo attachment_js($archive['aid']);
    ?>
</p>
<?php 
}
?>
<div class="blank30"></div>
Example #2
0
"  class="input" />
            附件名称:<input type="text" name="attachment_intro"  id="attachment_intro" value="<?php 
echo archive_attachment(@$data['aid'], 'intro');
?>
" class="input" />

<span class="hotspot" onmouseover="tooltip.show('填附件的下载提示名称!');" onmouseout="tooltip.hide();">
<img src="<?php 
echo $skin_path;
?>
/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;">
</span>
<div class="blank10"></div>

            <span style="float:left;">保存地址:<span id="attachment_path_i"><?php 
echo archive_attachment(@$data['aid'], 'path');
?>
</span></span><input style="float:left;" type="button" name="delbutton"  class="a_del" onclick="attachment_delect(get('attachment_id').value)" />
<div class="blank10"></div>
<?php 
if (front::$act == 'edit' && $data['attachment_id']) {
    ?>
更改:<?php 
}
?>

            上传:<input type="file" name="fileupload" id="fileupload" style="width:400px" />
            <div class="blank10"></div>

<input type="button"  name="filebuttonUpload"  id="filebuttonUpload" onclick="return ajaxFileUpload('fileupload','<?php 
echo url("tool/uploadfile", false);
 function down_action() {
     if(config::get('verifycode')) {
         if(cookie::get('allowdown')!=md5(url::create('attachment/downfile/aid/'.front::get('aid').'/v/ce'))) {
             header("Location: index.php?case=attachment&act=downfile&aid=".front::get('aid')."&v=ce");
         }
     }
     front::check_type(front::get('aid'));
     if(!rank::arcget(front::get('aid'),$this->view->usergroupid,'down')) {
         $link="<script>alert(\"未取得授权,无法下载!\");</script>";
         exit($link);
     }
     if(strtolower(substr(archive_attachment(front::get('aid'),'path'),0,4)) == 'http'){
         echo "<script>window.location.href='".archive_attachment(front::get('aid'),'path')."';</script>";
         exit;
     }
     $path=ROOT.'/'.archive_attachment(front::get('aid'),'path');
     $path=iconv('utf-8','gbk//ignore',$path);
     if (!is_readable($path)) {
         header("HTTP/1.1 404 Not Found");
         exit;
     }
     $size=filesize($path);
     $content=file_get_contents($path);
     $size=strlen($content);
     $name=preg_replace('%(.*)[\\\\\/](.*)_\d+(\.[a-z]+)$%i','$2$3',$path);
     $name=substr($name,-7,7);
     $name='CmsEasy_file_'.$name;
     header('Content-Type: application/octet-stream');
     header("Content-Length: $size");
     header("Content-Disposition: attachment; filename=\"$name\"");
     header("Content-Transfer-Encoding: binary");
     header('Expires: 0');
     header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
     header('Pragma: public');
     echo  $content;
     exit;
 }