当前位置: 首页>>代码示例>>PHP>>正文


PHP AttachmentFile::generateDownloadUrl方法代码示例

本文整理汇总了PHP中AttachmentFile::generateDownloadUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP AttachmentFile::generateDownloadUrl方法的具体用法?PHP AttachmentFile::generateDownloadUrl怎么用?PHP AttachmentFile::generateDownloadUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AttachmentFile的用法示例。


在下文中一共展示了AttachmentFile::generateDownloadUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getAttachments

 function getAttachments()
 {
     if ($this->attachments) {
         return $this->attachments;
     }
     //XXX: inner join the file table instead?
     $sql = 'SELECT a.attach_id, f.id as file_id, f.size, lower(f.`key`) as file_hash, f.`signature` as file_sig, f.name, a.inline ' . ' FROM ' . FILE_TABLE . ' f ' . ' INNER JOIN ' . TICKET_ATTACHMENT_TABLE . ' a ON(f.id=a.file_id) ' . ' WHERE a.ticket_id=' . db_input($this->getTicketId()) . ' AND a.ref_id=' . db_input($this->getId());
     $this->attachments = array();
     if (($res = db_query($sql)) && db_num_rows($res)) {
         while ($rec = db_fetch_array($res)) {
             $rec['download_url'] = AttachmentFile::generateDownloadUrl($rec['file_id'], $rec['file_hash'], $rec['file_sig']);
             $this->attachments[] = $rec;
         }
     }
     return $this->attachments;
 }
开发者ID:jmangarret,项目名称:ostickets,代码行数:16,代码来源:class.thread.php

示例2: _getList

 function _getList($separate = false, $inlines = false)
 {
     if (!isset($this->attachments)) {
         $this->attachments = array();
         $sql = 'SELECT f.id, f.size, f.`key`, f.signature, f.name, a.inline ' . ' FROM ' . FILE_TABLE . ' f ' . ' INNER JOIN ' . ATTACHMENT_TABLE . ' a ON(f.id=a.file_id) ' . ' WHERE a.`type`=' . db_input($this->getType()) . ' AND a.object_id=' . db_input($this->getId());
         if (($res = db_query($sql)) && db_num_rows($res)) {
             while ($rec = db_fetch_array($res)) {
                 $rec['download_url'] = AttachmentFile::generateDownloadUrl($rec['id'], $rec['key'], $rec['signature']);
                 $this->attachments[] = $rec;
             }
         }
     }
     $attachments = array();
     foreach ($this->attachments as $a) {
         if ($a['inline'] != $separate || $a['inline'] == $inlines) {
             $a['file_id'] = $a['id'];
             $a['hash'] = md5($a['file_id'] . session_id() . strtolower($a['key']));
             $attachments[] = $a;
         }
     }
     return $attachments;
 }
开发者ID:KingsleyGU,项目名称:osticket,代码行数:22,代码来源:class.attachment.php


注:本文中的AttachmentFile::generateDownloadUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。