本文整理汇总了PHP中Attachments::findCount方法的典型用法代码示例。如果您正苦于以下问题:PHP Attachments::findCount方法的具体用法?PHP Attachments::findCount怎么用?PHP Attachments::findCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Attachments
的用法示例。
在下文中一共展示了Attachments::findCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Attachment
uses("attachment", "album");
check_permission("album");
$attachment_controller = new Attachment('pic');
$attachment = new Attachments();
$album = new Albums();
$tpl_file = "album";
$page = new Pages();
if (empty($companyinfo)) {
flash("pls_complete_company_info", "company.php", 0);
}
if (isset($_POST['do'])) {
pb_submit_check('album');
$vals = $_POST['album'];
$vals['title'] = $title = trim($vals['title']);
$vals['description'] = $description = trim($vals['description']);
$now_album_amount = $attachment->findCount(null, "created>" . $today_start . " AND member_id=" . $_SESSION['MemberID']);
if (!empty($_FILES['pic']['name'])) {
$type_id = 1;
$attach_id = empty($id) ? "album-" . $_SESSION['MemberID'] . "-" . ($album->getMaxId() + 1) : "album-" . $_SESSION['MemberID'] . "-" . $id;
$attachment_controller->title = $title;
$attachment_controller->description = $description;
$attachment_controller->rename_file = $attach_id;
$attachment_controller->upload_process($type_id);
}
if (!empty($id)) {
if (empty($attachment_controller->id)) {
$attachment_id = $pdb->GetOne("SELECT attachment_id FROM {$tb_prefix}albums WHERE id=" . $id);
} else {
$attachment_id = $attachment_controller->id;
}
$sql = "UPDATE {$tb_prefix}attachments a,{$tb_prefix}albums ab SET a.title='" . $title . "',a.description='" . $description . "',ab.attachment_id={$attachment_id},type_id='" . $vals['type_id'] . "' WHERE ab.id={$id} AND a.id=" . $attachment_id;
示例2: Attachment
uses("attachment", "album");
check_permission("album");
$attachment_controller = new Attachment('pic');
$attachment = new Attachments();
$album = new Albums();
$tpl_file = "album";
$page = new Pages();
if (!$company->Validate($companyinfo)) {
flash("pls_complete_company_info", "company.php", 0);
}
if (isset($_POST['do'])) {
pb_submit_check('album');
$vals = $_POST['album'];
$vals['title'] = $title = trim($vals['title']);
$vals['description'] = $description = trim($vals['description']);
$now_album_amount = $attachment->findCount(null, "created>" . $today_start . " AND member_id=" . $the_memberid);
$id = intval($_POST['id']);
if (!empty($_FILES['pic']['name'])) {
$type_id = 1;
$attach_id = empty($id) ? "album-" . $the_memberid . "-" . ($album->getMaxId() + 1) : "album-" . $the_memberid . "-" . $id;
$attachment_controller->title = $title;
$attachment_controller->description = $description;
$attachment_controller->rename_file = $attach_id;
$attachment_controller->upload_process($type_id);
}
if (!empty($id)) {
if (empty($attachment_controller->id)) {
$attachment_id = $pdb->GetOne("SELECT attachment_id FROM {$tb_prefix}albums WHERE id=" . $id);
} else {
$attachment_id = $attachment_controller->id;
}