本文整理汇总了PHP中AttachmentFile::getDownloadForIdAndKey方法的典型用法代码示例。如果您正苦于以下问题:PHP AttachmentFile::getDownloadForIdAndKey方法的具体用法?PHP AttachmentFile::getDownloadForIdAndKey怎么用?PHP AttachmentFile::getDownloadForIdAndKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AttachmentFile
的用法示例。
在下文中一共展示了AttachmentFile::getDownloadForIdAndKey方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getList
function _getList($separate = false, $inlines = false)
{
if (!isset($this->attachments)) {
$this->attachments = array();
$sql = 'SELECT f.id, f.size, f.`key`, 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'] = AttachmentFile::getDownloadForIdAndKey($rec['id'], $rec['key']);
$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;
}