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


PHP Attachments::findAll方法代码示例

本文整理汇总了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));
 }
开发者ID:ph7pal,项目名称:mei,代码行数:16,代码来源:AttachmentsController.php

示例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);
开发者ID:vuong93st,项目名称:w-game,代码行数:31,代码来源:album.php

示例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");
开发者ID:renduples,项目名称:alibtob,代码行数:23,代码来源:honour.inc.php


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