本文整理汇总了PHP中pb_get_attachmenturl函数的典型用法代码示例。如果您正苦于以下问题:PHP pb_get_attachmenturl函数的具体用法?PHP pb_get_attachmenturl怎么用?PHP pb_get_attachmenturl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pb_get_attachmenturl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: detail
function detail()
{
global $viewhelper;
$condition = null;
$conditions = array();
$viewhelper->setPosition(L("brands", "tpl"), "index.php?do=brand");
if (isset($_GET['name'])) {
$brand_name = trim($_GET['name']);
$id = $this->brand->dbstuff->GetOne("SELECT id FROM {$brand->table_prefix}brands WHERE name='" . $brand_name . "'");
}
if (isset($_GET['id'])) {
$id = intval($_GET['id']);
}
if (!empty($id)) {
$result = $this->brand->dbstuff->GetRow("SELECT * FROM {$this->brand->table_prefix}brands WHERE id='" . $id . "'");
if (!empty($result)) {
$title = pb_lang_split($result['name']);
$result['img'] = pb_get_attachmenturl($result['picture']);
$result['title'] = $title;
$viewhelper->setPosition($this->brand->dbstuff->GetOne("SELECT name FROM " . $this->brand->table_prefix . "brandtypes WHERE id=" . $result['type_id']), "index.php?do=brand&action=lists&catid=" . $result['type_id']);
$viewhelper->setTitle($title);
$viewhelper->setPosition($title);
}
} else {
L("data_not_exists");
}
setvar("item", $result);
render("brand/detail");
}
示例2: smarty_function_the_attachment
/**
* [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: 2053 $
*/
function smarty_function_the_attachment($params)
{
extract($params);
if (!empty($name)) {
$return = pb_get_attachmenturl($name, '', $type);
$return = '<img src="' . $return . '" alt=""/>';
}
if (!empty($url)) {
$return = $url;
}
return $return;
}
示例3: Search
function Search($firstcount, $displaypg)
{
global $cache_types;
$result = $this->findAll("*,Market.name AS title", null, null, $this->orderby, $firstcount, $displaypg);
while (list($keys, $values) = each($result)) {
$result[$keys]['digest'] = $values['content'];
$result[$keys]['pubdate'] = df($values['created']);
$result[$keys]['typename'] = $cache_types['markettype'][$values['markettype_id']];
$result[$keys]['url'] = $this->getPermaLink($values['id']);
$result[$keys]['thumb'] = pb_get_attachmenturl($values['picture']);
}
return $result;
}
示例4: formatResult
function formatResult($result)
{
if (!empty($result)) {
$count = count($result);
for ($i = 0; $i < $count; $i++) {
$result[$i]['pubdate'] = @date("Y-m-d", $result[$i]['submit_time']);
$result[$i]['image'] = pb_get_attachmenturl($result[$i]['picture'], '', 'middle');
}
return $result;
} else {
return null;
}
}
示例5: Search
function Search($firstcount, $displaypg)
{
global $cache_types;
$result = $this->findAll("*,name AS title,description AS digest", null, null, $this->orderby, $firstcount, $displaypg);
while (list($keys, $values) = each($result)) {
$result[$keys]['pubdate'] = df($values['created']);
$result[$keys]['begin_date'] = df($values['begin_time']);
$result[$keys]['end_date'] = df($values['end_time']);
$result[$keys]['typename'] = $cache_types['expotype'][$values['expotype_id']];
$result[$keys]['thumb'] = pb_get_attachmenturl($values['picture'], '', 'small');
$result[$keys]['url'] = $this->getPermaLink($values['id'], "fair/detail");
}
return $result;
}
示例6: formatResult
function formatResult($result)
{
if (!empty($result)) {
$count = count($result);
for ($i = 0; $i < $count; $i++) {
$result[$i]['pubdate'] = '';
if (isset($result[$i]['submit_time'])) {
$result[$i]['pubdate'] = df($result[$i]['submit_time']);
}
$result[$i]['image'] = pb_get_attachmenturl($result[$i]['picture'], '', 'small');
}
return $result;
} else {
return null;
}
}
示例7: formatResultWap
function formatResultWap($result)
{
global $rewrite_able;
require CACHE_PATH . 'cache_membergroup.php';
if (!empty($result)) {
$count = count($result);
for ($i = 0; $i < $count; $i++) {
$result[$i]['transection_time'] = @date("Y-m-d h:m:s", $result[$i]['transection_time']);
$result[$i]['content'] = strip_tags($result[$i]['content']);
$result[$i]['image'] = "../" . pb_get_attachmenturl($result[$i]['picture']);
if ($result[$i]['status'] == 1) {
$result[$i]['status_des'] = "Đã mua thành công";
} else {
$result[$i]['status_des'] = "Chưa mua thành công";
}
}
return $result;
} else {
return null;
}
}
示例8: Search
function Search($firstcount, $displaypg)
{
global $cache_types;
if (empty($_GET['page'])) {
//array_unshift($this->condition,"id between 1000 and 2000");
}
$orderby = "id DESC";
if (isset($_GET['type'])) {
$type = trim($_GET['type']);
if ($type == "hot") {
$orderby = "News.clicked DESC";
}
}
$result = $this->findAll("*,content AS digest", null, null, $orderby, $firstcount, $displaypg);
while (list($keys, $values) = each($result)) {
$result[$keys]['pubdate'] = df($values['created']);
$result[$keys]['typename'] = $cache_types['newstype'][$values['type_id']];
$result[$keys]['thumb'] = pb_get_attachmenturl($values['picture'], '', 'small');
$result[$keys]['url'] = $this->url(array("do" => "news", "id" => $values['id']));
}
return $result;
}
示例9: define
define('CURSCRIPT', 'index');
require "../libraries/common.inc.php";
require "../share.inc.php";
require CACHE_PATH . "cache_industry.php";
require CACHE_PATH . 'cache_type.php';
$index_latest_industry_ids = 10;
$data = array();
uses("product", "industry");
$product = new Products();
$industry = new Industries();
$ProductSorts = $_PB_CACHE['productsort'];
$result = $product->GetArray($sql = "SELECT distinct industry_id AS iid FROM {$tb_prefix}products WHERE status=1 ORDER BY id DESC LIMIT 0,{$index_latest_industry_ids}");
if (!empty($result)) {
foreach ($result as $key => $val) {
$data[$val['iid']]['id'] = $val['iid'];
if (isset($_PB_CACHE['industry'][1][$val['iid']])) {
$data[$val['iid']]['name'] = $_PB_CACHE['industry'][1][$val['iid']];
}
$tmp_result = $pdb->GetArray("SELECT id,name,picture,sort_id,industry_id FROM {$tb_prefix}products WHERE status=1 AND industry_id=" . $val['iid'] . " ORDER BY id DESC LIMIT 0,5");
if (!empty($tmp_result)) {
foreach ($tmp_result as $key1 => $val1) {
$data[$val['iid']]['sub'][$val1['id']]['id'] = $val1['id'];
$data[$val['iid']]['sub'][$val1['id']]['name'] = $val1['name'];
$data[$val['iid']]['sub'][$val1['id']]['sort'] = $ProductSorts[$val1['sort_id']];
$data[$val['iid']]['sub'][$val1['id']]['image'] = pb_get_attachmenturl($val1['picture'], '', 'small');
}
}
}
setvar("IndustryProducts", $data);
}
render("product/index");
示例10: 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);
示例11: setvar
$news_info = null;
include CACHE_PATH . "cache_area.php";
include CACHE_PATH . "cache_industry.php";
setvar("CacheAreas", $_PB_CACHE['area']);
setvar("CacheIndustries", $_PB_CACHE['industry']);
$result = $membertype->findAll("id,name", null, $conditions, " id desc");
$user_types = array();
foreach ($result as $key => $val) {
$user_types[$val['id']] = $val['name'];
}
setvar("Membertypes", $user_types);
setvar("NewstypeOptions", $newstype->getTypeOptions());
if (!empty($id)) {
$item_info = $news->read("*", $id);
if ($item_info['picture']) {
$item_info['image'] = pb_get_attachmenturl($item_info['picture'], "../", 'small');
}
$tag->getTagsByIds($item_info['tag_ids'], true);
$item_info['tag'] = $tag->tag;
}
if ($action == "convert") {
if (!empty($_GET['companynewsid'])) {
$item_info['title'] = $pdb->GetOne("SELECT title FROM {$tb_prefix}companynewses WHERE id=" . intval($_GET['companynewsid']));
}
}
if (!empty($item_info)) {
setvar("item", $item_info);
}
$tpl_file = "news.edit";
template($tpl_file);
exit;
示例12: uaAssign
uaAssign(array("LastLogin" => date("Y-m-d H:i", $memberinfo['last_login'])));
$offer_count = $pdb->GetArray("SELECT count(id) AS amount,type_id AS typeid FROM {$tb_prefix}trades WHERE member_id=" . $the_memberid . " GROUP BY type_id");
$offer_stat = array();
$types = $trade->getTradeTypes();
if (!empty($offer_count)) {
foreach ($offer_count as $offer_key => $offer_val) {
$offer_stat[$types[$offer_val['typeid']]] = $offer_val['amount'];
}
setvar("items_offer", $offer_stat);
}
$pm_count = $pdb->GetArray("SELECT count(id) AS amount,type AS typename FROM {$tb_prefix}messages WHERE to_member_id=" . $the_memberid . " GROUP BY type");
if (!empty($pm_count)) {
$pm_result = array();
foreach ($pm_count as $pm_val) {
$pm_result[$pm_val['typename']] = intval($pm_val['amount']);
}
setvar("pm", $pm_result);
}
setvar("ServiceInfo", $service_info);
$memberinfo['start_date'] = df($memberinfo['service_start_date']);
$memberinfo['end_date'] = df($memberinfo['service_end_date']);
$memberinfo['gender_name'] = $_PB_CACHE['calls'][$memberinfo['gender']];
$memberinfo['avatar'] = !empty($memberinfo['photo']) ? pb_get_attachmenturl($memberinfo['photo'], "../", "small") : ($memberinfo['gender'] == 2 ? "images/female.png" : "images/male.png");
setvar("MemberInfo", $memberinfo);
$group['name'] = $g['name'];
$group['image'] = $g['avatar'];
setvar("group", $group);
template("index");
} else {
flash('invalid_user');
}
示例13: formatResult
function formatResult($result)
{
global $_PB_CACHE;
if (!class_exists('Space')) {
uses("space");
}
$space_controller = new Space();
if (!$result || empty($result)) {
return null;
}
if (!isset($_PB_CACHE['membergroup'])) {
require CACHE_PATH . "cache_membergroup.php";
}
if (!isset($_PB_CACHE['manage_type'])) {
require CACHE_PATH . "cache_typeoption.php";
}
$count = count($result);
for ($i = 0; $i < $count; $i++) {
$result[$i]['gradeimg'] = 'images/group/' . $_PB_CACHE['membergroup'][$result[$i]['cache_membergroupid']]['avatar'];
if (!empty($result[$i]['manage_type'])) {
$result[$i]['managetype'] = $_PB_CACHE['manage_type'][$result[$i]['manage_type']];
}
if (!empty($result[$i]['membergroup_id'])) {
$result[$i]['gradename'] = $_PB_CACHE['membergroup'][$result[$i]['membergroup_id']]['name'];
}
if (isset($result[$i]['space_name'])) {
$result[$i]['url'] = $space_controller->rewrite($result[$i]['space_name'], $result[$i]['id']);
} else {
$result[$i]['url'] = "javascript:;";
}
if (isset($result[$i]['picture'])) {
$result[$i]['logo'] = pb_get_attachmenturl($result[$i]['picture'], '', 'small');
$result[$i]['logosrc'] = '<img alt="' . $result[$i]['name'] . '" src="' . pb_get_attachmenturl($result[$i]['picture'], '', 'small') . '" />';
}
}
return $result;
}
示例14: smarty_block_topic
/**
* [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: 2075 $
*/
function smarty_block_topic($params, $content, &$smarty, &$repeat)
{
$conditions = array();
$param_count = count($smarty->_tag_stack);
if (empty($params['name'])) {
$params['name'] = "topic";
}
if (class_exists("Topics")) {
$topic = new Topics();
$topic_controller = new Topic();
} else {
uses("topic");
$topic = new Topics();
$topic_controller = new Topic();
}
if (isset($params['id'])) {
$conditions[] = "id=" . $params['id'];
}
if (isset($params['type'])) {
$type = explode(",", $params['type']);
$type = array_unique($type);
foreach ($type as $val) {
switch ($val) {
case 'image':
$conditions[] = "picture!=''";
break;
case 'news':
$url_fix = "news/list.php?";
default:
break;
}
}
}
$orderby = null;
if (isset($params['orderby'])) {
$orderby = " ORDER BY " . trim($params['orderby']) . " ";
} else {
$orderby = " ORDER BY id DESC";
}
$topic->setCondition($conditions);
$limit = $offset = 0;
if (isset($params['row'])) {
$limit = $params['row'];
}
if (isset($params['start'])) {
$offset = $params['start'];
}
$topic->setLimitOffset($offset, $limit);
$sql = "SELECT * FROM {$topic->table_prefix}topics " . $topic->getCondition() . "{$orderby}" . $topic->getLimitOffset() . "";
if (empty($smarty->blockvars[$param_count])) {
$smarty->blockvars[$param_count] = $topic->GetArray($sql);
if (!$smarty->blockvars[$param_count]) {
return $repeat = false;
}
}
if (!function_exists("smarty_function_the_url")) {
require "function.the_url.php";
}
if (list($key, $item) = each($smarty->blockvars[$param_count])) {
$repeat = true;
//Todo:news/topic/topic-name.html
//$item['url'] = $url_fix."topicid=".$item['id'];
if (!empty($item['alias_name'])) {
$name = trim($item['alias_name']);
} else {
$name = trim($item['title']);
}
$item['url'] = smarty_function_the_url(array("module" => "special", "type" => "topic", "name" => urlencode($name)));
if (isset($params['titlelen'])) {
$item['title'] = mb_substr(strip_tags($item['title']), 0, $params['titlelen']);
}
$item['thumb'] = $item['src'] = pb_get_attachmenturl($item['picture'], '', 'small');
$item['link'] = '<a title="' . $item['title'] . '" href="' . $item['url'] . '">' . $item['title'] . '</a>';
$smarty->assign($params['name'], $item);
} else {
$repeat = false;
reset($smarty->blockvars[$param_count]);
}
if (!is_null($content)) {
print $content;
}
if (!$repeat) {
$smarty->blockvars[$param_count] = array();
}
}
示例15: unset
$_POST['memberfield']['area_id'] = PbController::getMultiId($_POST['area']['id']);
unset($vals['created']);
unset($_POST['memberfield']['created']);
$result = $member->save($vals, "update", $the_memberid);
$memberfield->primaryKey = "member_id";
$result = $memberfield->save($_POST['memberfield'], "update", $the_memberid);
$member->clearCache($the_memberid);
$member->updateMemberCaches($the_memberid);
if (isset($_POST['personal']['resume_status'])) {
$result = $pdb->Execute("REPLACE INTO {$tb_prefix}personals (member_id,resume_status,max_education) VALUE (" . $the_memberid . ",'" . $_POST['personal']['resume_status'] . "','" . $_POST['personal']['max_education'] . "')");
}
if (!$result) {
flash('action_failed');
} else {
flash('success');
}
}
unset($G['typeoption']['gender'][-1]);
setvar("Genders", $G['typeoption']['gender']);
setvar("Educations", $G['typeoption']['education']);
setvar("OfficeRedirects", explode(",", L("office_redirects", "tpl")));
$personal = $pdb->GetRow("SELECT * FROM {$tb_prefix}personals WHERE member_id=" . $the_memberid);
setvar("resume_status", $personal['resume_status']);
setvar("max_education", $personal['max_education']);
if (!empty($memberinfo['photo'])) {
$memberinfo['image'] = pb_get_attachmenturl($memberinfo['photo'], "../", "small");
}
$r2 = $area->disSubOptions($memberinfo['area_id'], "area_");
$memberinfo = am($memberinfo, $r2);
setvar("item", $memberinfo);
vtemplate("personal");