• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP pb_get_attachmenturl函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中pb_get_attachmenturl函数的典型用法代码示例。如果您正苦于以下问题:PHP pb_get_attachmenturl函数的具体用法?PHP pb_get_attachmenturl怎么用?PHP pb_get_attachmenturl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了pb_get_attachmenturl函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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");
 }
开发者ID:reboxhost,项目名称:phpb2b,代码行数:29,代码来源:brand_controller.php


示例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;
}
开发者ID:renduples,项目名称:alibtob,代码行数:18,代码来源:function.the_attachment.php


示例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;
 }
开发者ID:renduples,项目名称:alibtob,代码行数:13,代码来源:market.php


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


示例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;
 }
开发者ID:renduples,项目名称:alibtob,代码行数:14,代码来源:expo.php


示例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;
     }
 }
开发者ID:reboxhost,项目名称:phpb2b,代码行数:16,代码来源:brand.php


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


示例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;
 }
开发者ID:reboxhost,项目名称:phpb2b,代码行数:22,代码来源:news.php


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


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


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


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


示例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;
 }
开发者ID:renduples,项目名称:alibtob,代码行数:37,代码来源:company.php


示例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();
    }
}
开发者ID:renduples,项目名称:alibtob,代码行数:91,代码来源:block.topic.php


示例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");
开发者ID:reboxhost,项目名称:phpb2b,代码行数:31,代码来源:personal.php


示例16: lists

 function lists()
 {
     global $viewhelper;
     $conditions = array();
     $viewhelper->setPosition(L("sub_special", "tpl"), "index.php?do=topic");
     $viewhelper->setTitle(L("sub_special", "tpl"));
     $types = cache_read("type");
     $result = $this->topic->findAll("*", null, $conditions, "id DESC");
     if (!empty($result)) {
         for ($i = 0; $i < count($result); $i++) {
             if (!empty($result[$i]['created'])) {
                 $result[$i]['pubdate'] = date("Y-m-d", $result[$i]['created']);
                 $result[$i]['image'] = pb_get_attachmenturl($result[$i]['picture'], '', 'small');
             }
         }
         setvar("module", strtolower(get_class($this)));
         setvar("items", $result);
     }
     render("list.default");
 }
开发者ID:reboxhost,项目名称:phpb2b,代码行数:20,代码来源:topic_controller.php


示例17: smarty_function_get

/**
 *      [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: 2124 $
 */
function smarty_function_get($params, &$smarty)
{
    extract($params);
    global $tb_prefix, $pdb;
    if (empty($var)) {
        $var = "item";
    }
    //depth
    if (class_exists("Industries")) {
        $industry = new Industries();
        $obj_controller = new Industry();
    } else {
        uses("industry");
        $industry = new Industries();
        $obj_controller = new Industry();
    }
    switch ($from) {
        case "market":
            $latest_commend_markets = $industry->GetArray("SELECT * FROM " . $tb_prefix . "markets WHERE if_commend='1' AND status='1' AND picture!='' ORDER BY id DESC LIMIT 0,10");
            $urls = $infos = $images = array();
            if (!empty($latest_commend_markets)) {
                while (list($key, $val) = each($latest_commend_markets)) {
                    $urls[] = $industry->getPermaLink($val['id'], null, 'market');
                    $infos[] = $val['name'];
                    $images[] = pb_get_attachmenturl($val['picture'], '', $size);
                }
                $items['url'] = implode("|", $urls);
                $items['info'] = implode("|", $infos);
                $items['image'] = implode("|", $images);
                $return = $items;
            }
            break;
        case "area":
            if (class_exists("Areas")) {
                $area = new Areas();
            } else {
                uses("area");
                $area = new Areas();
            }
            $return = $area->getLevelAreas();
            break;
        case "industry":
            $return = $industry->getCacheIndustry();
            break;
        case "type":
            if (!empty($name)) {
                $name = $obj_controller->pluralize($name);
                $industry->findIt($name);
                $return = $industry->params['data'][1];
                if (isset($multi)) {
                    $return = $obj_controller->flatten_array($return);
                }
                if (empty($var)) {
                    $var = "Items";
                }
            }
            break;
        default:
            $return = cache_read($name, $key);
            break;
    }
    if (!empty($sql)) {
        //replace table prefix
        $pdb->setFetchMode(ADODB_FETCH_ASSOC);
        $sql = str_replace("pb_", $tb_prefix, $sql);
        //for secure
        if (eregi('insert|update|delete|union|into|load_file|outfile|replace', $sql)) {
            trigger_error('no supported sql.');
        }
        //mysql_escape_string()
        $return = $industry->GetArray($sql);
    }
    $smarty->assign($var, $return);
    unset($return, $from, $item);
}
开发者ID:renduples,项目名称:alibtob,代码行数:81,代码来源:function.get.php


示例18: detail

 function detail()
 {
     global $viewhelper;
     using("tag", "meta");
     $tag = new Tags();
     $meta = new Metas();
     $conditions = array();
     $viewhelper->setTitle(L("info", "tpl"));
     $viewhelper->setPosition(L("info", "tpl"), "index.php?do=news");
     if (isset($_GET['title'])) {
         $title = trim($_GET['title']);
         $res = $this->news->findByTitle($title);
         $id = $res['id'];
     }
     if (isset($_GET['id'])) {
         $id = intval($_GET['id']);
     }
     if (!empty($id)) {
         $_PB_CACHE['newstype'] = cache_read("type", "newstype");
         $this->news->clicked($id);
         $info = $this->news->read("*", $id);
         if (empty($info) or !$info) {
             flash("data_not_exists", '', 0);
         }
         if (!empty($info['tag_ids'])) {
             $the_tags = $tag->getTagsByIds($info['tag_ids'], true);
             $tmp = null;
             $info['tag'] = $tag->tag;
             foreach ($the_tags as $key => $val) {
                 $tmp .= "<a href='" . $this->url(array("module" => "search", "do" => "news", "q" => urlencode($val))) . "'>" . $val . "</a> ";
             }
             $info['tag_link'] = $tmp;
         }
         if (!empty($info['picture'])) {
             $info['image'] = pb_get_attachmenturl($info['picture'], '', 'small');
         }
         $info['pubdate'] = df($info['created']);
         $info['typename'] = $_PB_CACHE['newstype'][$info['type_id']];
         $viewhelper->setTitle($info['typename']);
         $viewhelper->setPosition($info['typename'], $this->url(array("module" => "search", "do" => "news", "typeid" => $info['type_id'])));
         //seo info
         $meta_info = $meta->getSEOById($id, 'news', false);
         empty($meta_info['title']) ? $viewhelper->setTitle($info['title']) : $viewhelper->setTitle($meta_info['title']);
         empty($meta_info['description']) ? $viewhelper->setMetaDescription($info['content']) : $viewhelper->setMetaDescription($meta_info['description']);
         if (isset($meta_info['keyword'])) {
             $viewhelper->setMetaKeyword($meta_info['keyword']);
         }
         $viewhelper->setPosition($info['title']);
         if (!empty($info['require_membertype'])) {
             $require_ids = explode(",", $info['require_membertype']);
             if (!empty($pb_userinfo['pb_userid'])) {
                 $membertype_id = $this->news->dbstuff->GetOne("SELECT membertype_id FROM {$tb_prefix}members WHERE id='" . $pb_user['pb_userid'] . "'");
                 if (!in_array($membertype_id, $require_ids)) {
                     $info['content'] = L("news_membertype_not_allowed", "tpl");
                 }
             } else {
                 $info['content'] = L("news_membertype_not_allowed", "tpl");
             }
         }
         if ($info['type'] == 1) {
             $info['source'] = L("company_news", "tpl");
             $info['content'] = "<a href='" . $info['content'] . "'>" . $info['content'] . "</a>";
         }
         if (!empty($info['picture'])) {
             $info['image_url'] = pb_get_attachmenturl($info['picture']);
         }
         $neighbour_info = $this->news->getNeighbour($id, "id,title");
         if (!empty($neighbour_info['prev'])) {
             $title = pb_lang_split($neighbour_info['prev']['title']);
             $info['prev_link'] = "<a href='" . $this->url(array("module" => "news", "id" => $neighbour_info['prev']['id'])) . "'>" . $title . "</a>";
             $info['prev_title'] = $title;
         } else {
             $info['prev_link'] = L("nothing", "tpl");
         }
         if (!empty($neighbour_info['next'])) {
             $title = pb_lang_split($neighbour_info['next']['title']);
             $info['next_link'] = "<a href='" . $this->url(array("module" => "news", "id" => $neighbour_info['next']['id'])) . "'>" . $title . "</a>";
             $info['next_title'] = $title;
         } else {
             $info['next_link'] = L("nothing", "tpl");
         }
         setvar("item", pb_lang_split_recursive($info));
     } else {
         flash();
     }
     setvar("Newstypes", $_PB_CACHE['newstype']);
     render("detail.default");
 }
开发者ID:reboxhost,项目名称:phpb2b,代码行数:88,代码来源:news_controller.php


示例19: getFocus

 function getFocus($params)
 {
     $focus_lists = array();
     $target = '';
     $width = 220;
     $height = 160;
     $flash_src = STATICURL . "images/focus.swf";
     if (isset($params['target'])) {
         $target = trim($params['target']);
     }
     if (isset($params['table'])) {
         $target = trim($params['table']);
     }
     if (isset($params['from'])) {
         $target = trim($params['from']);
     }
     switch ($target) {
         case "fair":
             $table = "expos";
             $fields = "id,name AS title,picture,picture AS image";
             $url = "index.php?do=fair&action=detail&id=";
             break;
         default:
             $table = "newses";
             $fields = "id,title,picture,picture AS image";
             $url = "index.php?do=news&action=detail&id=";
             break;
     }
     $sql = "SELECT " . $fields . " FROM " . $this->table_prefix . $table . " WHERE status='1' AND picture!='' ORDER BY id desc LIMIT 0,6";
     $tmp_arr = $this->dbstuff->GetArray($sql);
     if (!empty($tmp_arr)) {
         foreach ($tmp_arr as $key => $val) {
             $focus_lists['pics'][] = pb_get_attachmenturl($val['picture']);
             $focus_lists['links'][] = $url . $val['id'];
             $focus_lists['texts'][] = pb_lang_split($val['title']);
         }
     }
     $pics = implode("|", $focus_lists['pics']);
     $links = implode("|", $focus_lists['links']);
     $texts = implode("|", $focus_lists['texts']);
     return "<script type=\"text/javascript\">\n\t\t\tvar focus_width={$width};\n\t\t\tvar focus_height={$height};\n\t\t\tvar text_height=30;\n\t\t\tvar swf_height = focus_height+text_height;\n\t\t\tvar pics ='{$pics}';\n\t\t\tvar links='{$links}';\n\t\t\tvar texts='{$texts}';\n\t\t\tdocument.write('<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\"'+ focus_width +'\" height=\"'+ swf_height +'\">');\n\t\t\tdocument.write('<param name=\"allowScriptAccess\" value=\"sameDomain\"><param name=\"movie\" value=\"{$flash_src}\"><param name=\"quality\" value=\"high\"><param name=\"bgcolor\" value=\"#F0F0F0\">');\n\t\t\tdocument.write('<param name=\"menu\" value=\"false\"><param name=wmode value=\"opaque\">');\n\t\t\tdocument.write('<param name=\"FlashVars\" value=\"pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'\">');\n\t\t\tdocument.write('<embed src=\"{$flash_src}\" wmode=\"opaque\" FlashVars=\"pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'\" menu=\"false\" bgcolor=\"#F0F0F0\" quality=\"high\" width=\"'+ focus_width +'\" height=\"'+ focus_height +'\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />');  \n\t\t\tdocument.write('</object>');\n\t\t\t</script>";
 }
开发者ID:reboxhost,项目名称:phpb2b,代码行数:42,代码来源:ad.php


示例20: df

        $viewhelper->setPosition($tmp_info['name'], "fair/list.php?areaid=" . $tmp_info['id']);
    }
}
$amount = $expo->findCount(null, $conditions);
$result = $expo->findAll("*", null, $conditions, "id desc", $pos, $limit);
if (!empty($result)) {
    for ($i = 0; $i < count($result); $i++) {
        if ($result[$i]['begin_time']) {
            $result[$i]['begin_date'] = df($result[$i]['begin_time']);
        }
        if ($result[$i]['end_time']) {
            $result[$i]['end_date'] = df($result[$i]['end_time']);
        }
        $result[$i]['description'] = mb_substr(strip_tags(trim($result[$i]['description'])), 0, 100);
        $result[$i]['typename'] = $_PB_CACHE['expotype'][$result[$i]['expotype_id']];
        $result[$i]['title'] = $result[$i]['name'];
        if (isset($result[$i]['picture'])) {
            $result[$i]['image'] = pb_get_attachmenturl($result[$i]['picture'], '', 'small');
        }
        if (!empty($result[$i]['area_id'])) {
            $result[$i]['area'] = "(" . $_PB_CACHE['area'][1][$result[$i]['area_id']] . ")";
        }
    }
    setvar("items", $result);
}
setvar("Areas", $_PB_CACHE['area']);
setvar("Type", $_PB_CACHE['expotype']);
$viewhelper->setTitle(L("search", "tpl"));
$viewhelper->setPosition(L("search", "tpl"));
setvar("paging", array('total' => $amount));
render("fair/list");
开发者ID:renduples,项目名称:alibtob,代码行数:31,代码来源:list.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP pb_getenv函数代码示例发布时间:2022-05-15
下一篇:
PHP payment_paid函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap