예제 #1
0
 public function renderDefault()
 {
     $album = new Albums();
     $this->template->albums = $album->findAll()->orderBy('artist')->orderBy('title');
 }
예제 #2
0
파일: album.php 프로젝트: renduples/alibtob
        $album_info = $pdb->GetRow("SELECT * FROM {$tb_prefix}albums ab WHERE ab.member_id=" . $the_memberid . " AND ab.id={$id}");
        $attachment->del($album_info['attachment_id'], "member_id=" . $the_memberid);
        $result = $album->del(intval($id), "member_id=" . $the_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}attachments a  LEFT JOIN {$tb_prefix}albums ab ON a.id=ab.attachment_id WHERE a.member_id=" . $the_memberid . " AND a.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}attachments Attachment ON Album.attachment_id=Attachment.id";
$conditions[] = "Attachment.member_id=" . $the_memberid . " AND Attachment.attachmenttype_id=1";
$amount = $album->findCount($joins, $conditions, "Album.id");
$page->setPagenav($amount);
$res = $pdb->GetAll("SELECT * from {$tb_prefix}albums");
$result = $album->findAll("Album.attachment_id,Attachment.title,Attachment.description,Attachment.attachment,Album.id", $joins, $conditions, "Album.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);
 public function actionIndex($p)
 {
     $this->bag->albums = $this->albums->findAll();
     $this->renderAction('albums');
 }
예제 #4
0
<?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("album");
$album = new Albums();
$joins[] = "LEFT JOIN {$tb_prefix}attachments a ON a.id=Album.attachment_id";
$result = $album->findAll("a.title,a.description,Album.id,a.attachment as thumb", $joins, "Album.member_id='" . $member->info['id'] . "'", "Album.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("album");