ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 6895


Ignore:
Timestamp:
May 1, 2008, 4:35:51 AM (11 years ago)
Author:
ebihara
Message:

アップロード画像リスト用関数もOpenPNE_Img_Storageに移動

Location:
OpenPNE/branches/work/ebihara/prj_renew_OpenPNE_Img/webapp/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/work/ebihara/prj_renew_OpenPNE_Img/webapp/lib/OpenPNE/Img/Storage.php

    r6894 r6895  
    7676    }
    7777
     78    function getImageList($page, $page_size)
     79    {
     80        $sql = 'SELECT c_image_id FROM c_image ORDER BY c_image_id DESC';
     81        $id_list = $this->db->get_col_page($sql, $page, $page_size);
     82
     83        $c_image_list = array();
     84        foreach ($id_list as $c_image_id) {
     85            $sql = 'SELECT c_image_id, filename, r_datetime FROM c_image WHERE c_image_id = ?';
     86            $params = array(intval($c_image_id));
     87            $c_image_list[] = $this->db->get_row($sql, $params);
     88        }
     89
     90        return $c_image_list;
     91    }
     92
     93    function getTotalImageCount()
     94    {
     95        $sql = 'SELECT COUNT(*) FROM c_image';
     96        return $this->db->get_one($sql);
     97    }
     98
    7899    function isImageExists($filename)
    79100    {
  • OpenPNE/branches/work/ebihara/prj_renew_OpenPNE_Img/webapp/lib/db/image.php

    r6893 r6895  
    2323function db_image_c_image_list($page, $page_size, &$pager)
    2424{
    25     $db =& db_get_instance('image');
     25    require_once 'OpenPNE/Img.php';
     26    $img =& new OpenPNE_Img();
     27    $c_image_list = $img->storage->getImageList($page, $page_size);
    2628
    27     $sql = 'SELECT c_image_id FROM c_image ORDER BY c_image_id DESC';
    28     $id_list = $db->get_col_page($sql, $page, $page_size);
    29 
    30     $c_image_list = array();
    31     foreach ($id_list as $c_image_id) {
    32         $sql = 'SELECT c_image_id, filename, r_datetime FROM c_image WHERE c_image_id = ?';
    33         $params = array(intval($c_image_id));
    34         $c_image_list[] = $db->get_row($sql, $params);
    35     }
    36 
    37     $sql = 'SELECT COUNT(*) FROM c_image';
    38     $total_num = $db->get_one($sql);
     29    $total_num = $img->storage->getTotalImageCount();
    3930
    4031    $pager = admin_make_pager($page, $page_size, $total_num);
Note: See TracChangeset for help on using the changeset viewer.