本文整理汇总了PHP中Attachments::findAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Attachments::findAll方法的具体用法?PHP Attachments::findAll怎么用?PHP Attachments::findAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Attachments
的用法示例。
在下文中一共展示了Attachments::findAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionIndex
/**
* Lists all models.
*/
public function actionIndex()
{
$criteria = new CDbCriteria();
$criteria->order = 'cTime DESC';
//$criteria->select = 'id,title';
$model = new Attachments();
$count = $model->count($criteria);
$pager = new CPagination($count);
$pager->pageSize = 100;
$pager->applyLimit($criteria);
$posts = $model->findAll($criteria);
$this->render('index', array('pages' => $pager, 'posts' => $posts));
}
示例2: intval
$id = intval($_GET['id']);
}
if ($do == "del" && !empty($id)) {
$result = $album->del(intval($id), "member_id=" . $_SESSION['MemberID']);
}
if ($do == "edit") {
if (!empty($id)) {
$album_info = $pdb->GetRow("SELECT a.title,a.description,ab.id,a.attachment,ab.type_id FROM {$tb_prefix}albums ab LEFT JOIN {$tb_prefix}attachments a ON a.id=ab.attachment_id WHERE ab.member_id=" . $_SESSION['MemberID'] . " AND ab.id={$id}");
if (!empty($album_info['attachment'])) {
$album_info['image'] = pb_get_attachmenturl($album_info['attachment'], "../");
}
setvar("item", $album_info);
}
$tpl_file = "album_edit";
template($tpl_file);
exit;
}
}
$joins[] = "LEFT JOIN {$tb_prefix}albums a ON a.attachment_id=Attachment.id";
$conditions[] = "Attachment.member_id=" . $_SESSION['MemberID'] . " AND Attachment.attachmenttype_id=1";
$amount = $attachment->findCount($joins, $conditions, "Attachment.id");
$page->setPagenav($amount);
$result = $attachment->findAll("Attachment.title,Attachment.description,Attachment.attachment,a.id", $joins, $conditions, "a.id DESC", $page->firstcount, $page->displaypg);
if (!empty($result)) {
for ($i = 0; $i < count($result); $i++) {
$result[$i]['image'] = pb_get_attachmenturl($result[$i]['attachment'], '../', "small");
}
setvar("Items", $result);
setvar("ByPages", $page->pagenav);
}
template($tpl_file);
示例3: exit
<?php
/**
* [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
* The contents of this file are subject to the License; you may not use this file except in compliance with the License.
*
* @version $Revision: 2048 $
*/
if (!defined('IN_PHPB2B')) {
exit('Not A Valid Entry Point');
}
uses("attachment");
$attach = new Attachments();
$result = $attach->findAll("id,thumb,remote,title", null, "member_id='" . $member->info['id'] . "'", "id desc");
if (!empty($result)) {
$count = count($result);
for ($i = 0; $i < $count; $i++) {
$result[$i]['image'] = URL . pb_get_attachmenturl($result[$i]['thumb'], '', 'small');
$result[$i]['middleimage'] = URL . pb_get_attachmenturl($result[$i]['thumb']);
}
}
setvar("Items", $result);
$space->render("honour");