当前位置: 首页>>代码示例>>PHP>>正文


PHP FillAttsDefault函数代码示例

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


在下文中一共展示了FillAttsDefault函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: lib_getlinesuit

/**
 * 线路套餐调用标签
 *
 * @version        $Id: getlinesuit.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2014, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_getlinesuit(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|10,lineid|0";
    $webid = 0;
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $lineid = $lineid ? $lineid : $refObj->Fields['id'];
    //线路id
    $sql = "select a.* from #@__line_suit a where a.lineid='{$lineid}' order by a.displayorder asc";
    $innertext = trim($ctag->GetInnertext());
    $dsql->SetQuery($sql);
    $dsql->Execute();
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    $revalue = '';
    while ($row = $dsql->GetArray()) {
        $GLOBALS['autoindex']++;
        $row['title'] = $row['suitname'];
        //价格名称.
        foreach ($ctp->CTags as $tagid => $ctag) {
            if ($ctag->GetName() == 'array') {
                $ctp->Assign($tagid, $row);
            } else {
                if (!empty($row[$ctag->GetName()])) {
                    $ctp->Assign($tagid, $row[$ctag->GetName()]);
                }
            }
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
开发者ID:lz1988,项目名称:stourwebcms,代码行数:43,代码来源:getlinesuit.lib.php

示例2: lib_feedback

/**
 * 调用最新评论
 *
 * @param int row 12
 * int infolen 10
 * @param int titlelen 100
 * @return unknown
 */
function lib_feedback(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|12,titlelen|24,infolen|100";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnerText());
    $totalrow = $row;
    $revalue = '';
    if (empty($innertext)) {
        $innertext = GetSysTemplets('tag_feedback.htm');
    }
    $wsql = " where ischeck=1 ";
    $equery = "SELECT * FROM `#@__feedback` {$wsql} ORDER BY id DESC LIMIT 0 , {$totalrow}";
    $ctp = new DedeTagParse();
    $ctp->SetNameSpace('field', '[', ']');
    $ctp->LoadSource($innertext);
    $dsql->Execute('fb', $equery);
    while ($arr = $dsql->GetArray('fb')) {
        $arr['title'] = cn_substr($arr['arctitle'], $titlelen);
        $arr['msg'] = jstrim($arr['msg'], $infolen);
        foreach ($ctp->CTags as $tagid => $ctag) {
            if (!empty($arr[$ctag->GetName()])) {
                $ctp->Assign($tagid, $arr[$ctag->GetName()]);
            }
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
开发者ID:klr2003,项目名称:sourceread,代码行数:38,代码来源:feedback.lib.php

示例3: lib_getslidenavbyid

function lib_getslidenavbyid(&$ctag, &$refObj)
{
    global $dsql, $outlist;
    include SLINEDATA . "/webinfo.php";
    $attlist = "row|8,kindid|0,";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $sql = "select id,kindname as categoryname,linkurl as url,color from #@__plugin_leftnav where pid='{$kindid}' and isopen=1 order by displayorder asc limit 0,{$row}";
    $arr = $dsql->getAll($sql);
    for ($i = 0; isset($arr[$i]); $i++) {
        $row = $arr[$i];
        $ctp = new STTagParse();
        $ctp->SetNameSpace("field", "[", "]");
        $ctp->LoadSource($innertext);
        $outlist = '';
        foreach ($ctp->CTags as $tagid => $ctag) {
            if ($ctag->GetName() == 'array') {
                $ctp->Assign($tagid, $row);
            } else {
                if (!empty($row[$ctag->GetName()])) {
                    $ctp->Assign($tagid, $row[$ctag->GetName()]);
                }
            }
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
开发者ID:lz1988,项目名称:stourwebcms,代码行数:30,代码来源:getslidenavbyid.lib.php

示例4: lib_arcpagelist

/**
 *
 * @version        $Id: arcpagelist.lib.php 1 9:29 2010年7月6日Z tianya $
 * @package        DedeCMS.Taglib
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
function lib_arcpagelist(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "tagid|,style|1";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $row = $dsql->GetOne("SELECT * FROM #@__arcmulti WHERE tagid='{$tagid}'");
    if (is_array($row)) {
        $ids = explode(',', $row['arcids']);
        $totalnum = count($ids);
        $pagestr = '<div id="page_' . $tagid . '">';
        if ($row['pagesize'] < $totalnum) {
            $pagestr .= multipage($totalnum, 1, $row['pagesize'], $tagid);
        } else {
            $pagestr .= '共1页';
        }
        $pagestr .= '</div>';
        return $pagestr;
    } else {
        $pagestr = '<div id="page_' . $tagid . '">';
        $pagestr .= '没有检索到对应分页';
        $pagestr .= '</div>';
        return $pagestr;
    }
}
开发者ID:hensonvip,项目名称:ymroad,代码行数:33,代码来源:arcpagelist.lib.php

示例5: lib_cattree

function lib_cattree(&$ctag, &$refObj)
{
    global $dsql;
    //属性处理
    //属性 showall 在空或不存在时,强制用产品模型id;如果是 yes 刚显示整个语言区栏目树;为其它数字则是这个数字的模型的id
    //typeid 指定顶级树 id ,指定后,前一个属性将无效
    $attlist = "showall|,catid|0";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $revalue = '';
    if (empty($typeid)) {
        if (isset($refObj->TypeLink->TypeInfos['id'])) {
            $typeid = $refObj->TypeLink->TypeInfos['id'];
            $reid = $refObj->TypeLink->TypeInfos['reid'];
            $topid = $refObj->TypeLink->TypeInfos['topid'];
            $channeltype = $refObj->TypeLink->TypeInfos['channeltype'];
            $ispart = $refObj->TypeLink->TypeInfos['ispart'];
            if ($reid == 0) {
                $topid = $typeid;
            }
        } else {
            $typeid = $reid = $topid = $channeltype = $ispart = 0;
        }
    } else {
        $row = $dsql->GetOne("Select reid,topid,channeltype,ispart From `#@__arctype` where id='{$typeid}' ");
        if (!is_array($row)) {
            $typeid = $reid = $topid = $channeltype = $ispart = 0;
        } else {
            $reid = $row['reid'];
            $topid = $row['topid'];
            $channeltype = $row['channeltype'];
            $ispart = $row['ispart'];
        }
    }
    if (!empty($catid)) {
        $topQuery = "Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath From `#@__arctype` where reid='{$catid}' And ishidden<>1 ";
    } else {
        if ($showall == "yes") {
            $topQuery = "Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath From `#@__arctype` where reid='{$topid}' ";
        } else {
            if ($showall == '') {
                if ($ispart < 2 && !empty($channeltype)) {
                    $showall = $channeltype;
                } else {
                    $showall = 6;
                }
            }
            $topQuery = "Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath From `#@__arctype` where reid='{$topid}' And channeltype='{$showall}' And ispart<2 And ishidden<>1 ";
        }
    }
    $dsql->Execute('t', $topQuery);
    while ($row = $dsql->GetArray('t')) {
        $row['typelink'] = GetOneTypeUrlA($row);
        $revalue .= "<dl class='cattree'>\n";
        $revalue .= "<dt><a href='{$row['typelink']}'>{$row['typename']}</a></dt>\n";
        cattreeListSon($row['id'], $revalue);
        $revalue .= "</dl>\n";
    }
    return $revalue;
}
开发者ID:klr2003,项目名称:sourceread,代码行数:60,代码来源:cattree.lib.php

示例6: lib_gettongyonglist

/**
 * 通用模块产品调用标签
 *
 * @version        $Id: gettongyongsuit.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2015, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_gettongyonglist(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|10,pinyin|0,limit|0,type|byorder";
    $webid = 0;
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    if (empty($pinyin)) {
        return '';
    }
    $sql = "select id as typeid,addtable from sline_model where pinyin='{$pinyin}'";
    $ar = $dsql->GetOne($sql);
    $sql = '';
    if (!empty($ar['typeid'])) {
        $addtable = 'sline_' . $ar['addtable'];
        $typeid = $ar['typeid'];
        if ($type == 'byorder') {
            $sql = "select a.id as realid,a.*,b.* from sline_model_archive a left join {$addtable} b on(a.id=b.productid)  left join sline_allorderlist c on(a.id=c.id and c.typeid={$typeid}) where a.typeid={$typeid} order by ifnull(c.displayorder,9999) asc,a.addtime desc limit {$limit},{$row} ";
        } else {
            if ($type == 'mdd') {
                $sonid = isset($definekind) ? $definekind : $refObj->Fields['kindid'];
                //这里增加子站的判断
                if ($GLOBALS['sys_child_webid'] != 0) {
                    $dest_id = $GLOBALS['sys_child_webid'];
                }
                $sonid = $sonid ? $sonid : $dest_id;
                $sql = "select a.id as realid,a.*,b.* from sline_model_archive a left join {$addtable} b on(a.id=b.productid)  left join sline_allorderlist c on(a.id=c.id and c.typeid={$typeid}) where a.typeid={$typeid} and FIND_IN_SET({$sonid},a.kindlist) order by ifnull(c.displayorder,9999) asc,a.addtime desc limit {$limit},{$row} ";
            }
        }
    }
    if (empty($sql)) {
        return '';
    }
    $innertext = trim($ctag->GetInnertext());
    $dsql->SetQuery($sql);
    $dsql->Execute();
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    $revalue = '';
    while ($row = $dsql->GetArray()) {
        $GLOBALS['autoindex']++;
        $row['url'] = $GLOBALS['cfg_basehost'] . '/' . $pinyin . '/' . 'show_' . $row['aid'] . '.html';
        $row['price'] = TagTongYong::getProductMinPrice($row['realid']);
        foreach ($ctp->CTags as $tagid => $ctag) {
            if ($ctag->GetName() == 'array') {
                $ctp->Assign($tagid, $row);
            } else {
                if (!empty($row[$ctag->GetName()])) {
                    $ctp->Assign($tagid, $row[$ctag->GetName()]);
                } else {
                    $ctp->Assign($tagid, '');
                }
            }
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
开发者ID:lz1988,项目名称:stourwebcms,代码行数:68,代码来源:gettongyonglist.lib.php

示例7: lib_leftnav

function lib_leftnav(&$ctag, &$refObj)
{
    global $dsql;
    include SLINEDATA . "/webinfo.php";
    $attlist = "row|20,";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $table = "#@__destinations";
    $sql = "select id,kindname,pinyin from {$table} where pid= 0 and isopen=1 order by displayorder asc";
    $kindnames = array();
    $ids = $pinyin = array();
    $arr = $dsql->getAll($sql);
    for ($i = 0; isset($arr[$i]['id']); $i++) {
        $ids[] = $arr[$i]['id'];
        $kindname[] = $arr[$i]['kindname'];
        $pinyin[] = $arr[$i]['pinyin'];
    }
    $GLOBALS['autoindex'] = 0;
    for ($k = 0; isset($ids[$k]); $k++) {
        $GLOBALS['autoindex']++;
        $pv = new View(0);
        $pv->Fields['kindname'] = $kindnames[$k];
        $pv->Fields['kindid'] = $ids[$k];
        $pv->Fields['pinyin'] = $pinyin[$k];
        $pv->SetTemplet($innertext, 'string');
        $revalue .= $pv->GetResult();
    }
    return $revalue;
}
开发者ID:lz1988,项目名称:stourwebcms,代码行数:31,代码来源:leftnav.lib.php

示例8: lib_singlead

/**
 * 单独广告调用
 *
 * @version        $Id: singlead.lib.php 1 9:29 2013.05.03 netman $
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2010, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_singlead(&$ctag, &$refObj)
{
    global $dsql, $sys_webid;
    $attlist = "typeid|0,name|,row|3";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    if ($name == '') {
        return '';
    }
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $webid = $GLOBALS['sys_child_webid'];
    //webid赋值
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $sql = "SELECT * FROM sline_advertise WHERE tagname = '{$name}' and webid='{$webid}' limit 1  ";
    $row = $dsql->GetOne($sql);
    //$row['picurl']=getUploadFileUrl($row['picurl']);
    if (is_array($row)) {
        foreach ($ctp->CTags as $tagid => $ctag) {
            if ($ctag->GetName() == 'array') {
                $ctp->Assign($tagid, $row);
            } else {
                if (!empty($row[$ctag->GetName()])) {
                    $ctp->Assign($tagid, $row[$ctag->GetName()]);
                }
            }
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
开发者ID:lz1988,项目名称:stourwebcms,代码行数:41,代码来源:singlead.lib.php

示例9: lib_gethistory

/**
 * 访问历史标签代码
 *
 * @version        $Id: gethistory.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2014, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_gethistory(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|6";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    if (isset($_COOKIE['St']['line'])) {
        $list = unserialize($_COOKIE['St']['line']);
        $arr = getLineList($list);
    } else {
        return;
    }
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    foreach ($arr as $row) {
        $GLOBALS['autoindex']++;
        foreach ($ctp->CTags as $tagid => $ctag) {
            if ($ctag->GetName() == 'array') {
                $ctp->Assign($tagid, $row);
            } else {
                if (!empty($row[$ctag->GetName()])) {
                    $ctp->Assign($tagid, $row[$ctag->GetName()]);
                }
            }
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
开发者ID:lz1988,项目名称:stourwebcms,代码行数:41,代码来源:gethistory.lib.php

示例10: lib_memberlist

function lib_memberlist(&$ctag, &$refObj)
{
    global $dsql, $sqlCt;
    $attlist = "row|6,iscommend|0,orderby|logintime,signlen|50";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $revalue = '';
    $innerText = trim($ctag->GetInnerText());
    if (empty($innerText)) {
        $innerText = GetSysTemplets('memberlist.htm');
    }
    $wheresql = ' WHERE mb.spacesta>-1 AND mb.matt<10 ';
    if ($iscommend > 0) {
        $wheresql .= " AND  mb.matt='{$iscommend}' ";
    }
    $sql = "SELECT mb.*,ms.spacename,ms.sign FROM `#@__member` mb\r\n        LEFT JOIN `#@__member_space` ms ON ms.mid = mb.mid\r\n        {$wheresql} order by mb.{$orderby} DESC LIMIT 0,{$row} ";
    $ctp = new DedeTagParse();
    $ctp->SetNameSpace('field', '[', ']');
    $ctp->LoadSource($innerText);
    $dsql->Execute('mb', $sql);
    while ($row = $dsql->GetArray('mb')) {
        $row['spaceurl'] = $GLOBALS['cfg_basehost'] . '/member/index.php?uid=' . $row['userid'];
        if (empty($row['face'])) {
            $row['face'] = $row['sex'] == '女' ? $GLOBALS['cfg_memberurl'] . '/templets/images/dfgirl.png' : $GLOBALS['cfg_memberurl'] . '/templets/images/dfboy.png';
        }
        foreach ($ctp->CTags as $tagid => $ctag) {
            if (isset($row[$ctag->GetName()])) {
                $ctp->Assign($tagid, $row[$ctag->GetName()]);
            }
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
开发者ID:iabing,项目名称:mzzyc,代码行数:34,代码来源:memberlist.lib.php

示例11: lib_likesgpage

function lib_likesgpage(&$ctag, &$refObj)
{
    global $dsql;
    //把属性转为变量,如果不想进行此步骤,也可以直接从 $ctag->CAttribute->Items 获得,这样也可以支持中文名
    $attlist = "row|8";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnerText());
    $aid = isset($refObj->Fields['aid']) ? $refObj->Fields['aid'] : 0;
    $revalue = '';
    if ($innertext == '') {
        $innertext = GetSysTemplets("part_likesgpage.htm");
    }
    $likeid = empty($refObj->Fields['likeid']) ? 'all' : $refObj->Fields['likeid'];
    $dsql->SetQuery("SELECT aid,title,filename FROM `#@__sgpage` WHERE likeid LIKE '{$likeid}' LIMIT 0,{$row}");
    $dsql->Execute();
    $ctp = new DedeTagParse();
    $ctp->SetNameSpace('field', '[', ']');
    $ctp->LoadSource($innertext);
    while ($row = $dsql->GetArray()) {
        if ($aid != $row['aid']) {
            $row['url'] = $GLOBALS['cfg_cmsurl'] . '/' . $row['filename'];
            foreach ($ctp->CTags as $tagid => $ctag) {
                if (!empty($row[$ctag->GetName()])) {
                    $ctp->Assign($tagid, $row[$ctag->GetName()]);
                }
            }
            $revalue .= $ctp->GetResult();
        } else {
            $revalue .= '<dd class="cur"><span>' . $row['title'] . '</span></dd>';
        }
    }
    return $revalue;
}
开发者ID:ahmatjan,项目名称:cmf2,代码行数:34,代码来源:likesgpage.lib.php

示例12: lib_hotwords

function lib_hotwords(&$ctag, &$refObj)
{
    global $cfg_phpurl, $dsql;
    $attlist = "num|6,subday|365,maxlength|16";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $nowtime = time();
    if (empty($subday)) {
        $subday = 365;
    }
    if (empty($num)) {
        $num = 6;
    }
    if (empty($maxlength)) {
        $maxlength = 20;
    }
    $maxlength = $maxlength + 1;
    $mintime = $nowtime - $subday * 24 * 3600;
    $dsql->SetQuery("Select keyword From `#@__search_keywords` where lasttime>{$mintime} And length(keyword)<{$maxlength} order by count desc limit 0,{$num}");
    $dsql->Execute('hw');
    $hotword = '';
    while ($row = $dsql->GetArray('hw')) {
        $hotword .= " <a href='" . $cfg_phpurl . "/search.php?keyword=" . urlencode($row['keyword']) . "'>" . $row['keyword'] . "</a> ";
    }
    return $hotword;
}
开发者ID:klr2003,项目名称:sourceread,代码行数:26,代码来源:hotwords.lib.php

示例13: lib_getdestbypid

/**
 * 调用分类标签(景点首页调用)
 *
 * @version        $Id: getcategory.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2011, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_getdestbypid(&$ctag, &$refObj)
{
    global $dsql, $outlist;
    include SLINEDATA . "/webinfo.php";
    $attlist = "row|8,pid|,limit|0,flag|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $kindid = $refObj->Fields['kindid'];
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    if ($flag == 'spot') {
        $sql = "select a.kindname,a.id,b.displayorder,a.jieshao,a.pinyin from #@__destinations a inner join #@__spot_kindlist as b on a.id=b.kindid and a.pid={$kindid} order by b.displayorder limit {$limit},{$row}";
    } else {
        $sql = "select id,kindname,pinyin from #@__destinations where pid={$kindid} and isopen=1 order by displayorder limit {$limit},{$row}";
    }
    $rows = $dsql->getAll($sql);
    foreach ($rows as $row) {
        $row['kindid'] = $row['id'];
        foreach ($ctp->CTags as $tagid => $ctag) {
            if ($ctag->GetName() == 'array') {
                $ctp->Assign($tagid, $row);
            } else {
                if (!empty($row[$ctag->GetName()])) {
                    $ctp->Assign($tagid, $row[$ctag->GetName()]);
                }
            }
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
开发者ID:lz1988,项目名称:stourwebcms,代码行数:42,代码来源:getdestbypid.lib.php

示例14: lib_mynews

function lib_mynews(&$ctag, &$refObj)
{
    global $dsql, $envs;
    //属性处理
    $attlist = "row|1,titlelen|24";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnerText());
    if (empty($row)) {
        $row = 1;
    }
    if (empty($titlelen)) {
        $titlelen = 30;
    }
    if (empty($innertext)) {
        $innertext = GetSysTemplets('mynews.htm');
    }
    $idsql = '';
    if ($envs['typeid'] > 0) {
        $idsql = " where typeid='" . GetTopid($this->TypeID) . "' ";
    }
    $dsql->SetQuery("Select * from #@__mynews {$idsql} order by senddate desc limit 0,{$row}");
    $dsql->Execute();
    $ctp = new DedeTagParse();
    $ctp->SetNameSpace('field', '[', ']');
    $ctp->LoadSource($innertext);
    $revalue = '';
    while ($row = $dsql->GetArray()) {
        foreach ($ctp->CTags as $tagid => $ctag) {
            @$ctp->Assign($tagid, $row[$ctag->GetName()]);
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
开发者ID:klr2003,项目名称:sourceread,代码行数:35,代码来源:mynews.lib.php

示例15: lib_changyan

function lib_changyan(&$ctag, &$refObj)
{
    global $dsql, $envs;
    //属性处理
    $attlist = "type|code,config|,class|_DEDECY,style|";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $reval = "";
    if (!$dsql->IsTable("#@__plus_changyan_setting")) {
        return '没安装畅言模块';
    }
    $client_id = changyan_get_setting('appid');
    if (empty($client_id)) {
        return '尚未注册畅言帐号,请到后台注册';
    }
    if ($type == 'code' or $type == 'code2') {
        $reval .= "<div class='{$class}' style='{$style}'>";
        $prefix = 'changyan';
        $key = 'code';
        $row = GetCache($prefix, $key);
        if (!is_array($row)) {
            $appid = changyan_get_setting('appid');
            $user = changyan_get_setting('user');
            $sign = changyan_gen_sign($user);
            $result = changyan_getcode(CHANGYAN_CLIENT_ID, $user, false, $sign, $appid);
            $row['reval'] = htmlspecialchars($result['code']);
            SetCache($prefix, $key, $row, 60 * 60 * 1);
        }
        if (!empty($config)) {
            $config_arr = array();
            $configs = explode(',', $config);
            if (count($configs) > 0) {
                foreach ($configs as $c) {
                    $item = explode(':', $c);
                    $config_arr[$item[0]] = $item[1];
                }
            }
            $config_str = json_encode($config_arr);
            $reval .= <<<EOT
<script>
    var_config={$config_str};
</script>
EOT;
        }
        $reval .= htmlspecialchars_decode($row['reval']);
        $reval = str_replace("id='SOHUCS'", "id='SOHUCS' sid='{$refObj->ArcID}'", $reval);
        if ($type == 'code2') {
            $reval = preg_replace("#window.SCS_NO_IFRAME[ ]?=[ ]?true;#i", "", $reval);
        }
        $reval = str_replace("<script>", "</div><script>", $reval);
    } elseif ($type == 'count') {
        if (!$GLOBALS['changyan_count_js']) {
            $reval .= "<script type=\"text/javascript\" src=\"http://assets.changyan.sohu.com/upload/plugins/plugins.count.js\"></script>";
        }
        $reval .= "<a href=\"#SOHUCS\" id=\"changyan_count_unit\"></a>";
        $GLOBALS['changyan_count_js'] = TRUE;
    }
    return $reval;
}
开发者ID:stonelf,项目名称:mcgmh,代码行数:59,代码来源:changyan.lib.php


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