本文整理汇总了PHP中DedeTagParse::GetResult方法的典型用法代码示例。如果您正苦于以下问题:PHP DedeTagParse::GetResult方法的具体用法?PHP DedeTagParse::GetResult怎么用?PHP DedeTagParse::GetResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DedeTagParse
的用法示例。
在下文中一共展示了DedeTagParse::GetResult方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: lib_infoguide
function lib_infoguide(&$ctag, &$refObj)
{
global $dsql, $nativeplace, $infotype, $hasSetEnumJs, $cfg_cmspath, $cfg_mainsite;
//属性处理
//$attlist="row|12,titlelen|24";
//FillAttsDefault($ctag->CAttribute->Items,$attlist);
//extract($ctag->CAttribute->Items, EXTR_SKIP);
$cmspath = empty($cfg_cmspath) || preg_match('#[/$]#', $cfg_cmspath) ? $cfg_cmspath . '/' : $cfg_cmspath;
if (empty($refObj->Fields['typeid'])) {
$row = $dsql->GetOne("SELECT id FROM `#@__arctype` WHERE channeltype='-8' And reid = '0' ");
$typeid = is_array($row) ? $row['id'] : 0;
if (empty($typeid)) {
return '请指定一个栏目类型为“分类信息”,否则无法使用这个搜索表单!';
}
} else {
$typeid = $refObj->Fields['typeid'];
}
$innerText = trim($ctag->GetInnerText());
if (empty($innerText)) {
$innerText = GetSysTemplets("info_guide.htm");
}
$ctp = new DedeTagParse();
$ctp->SetNameSpace('field', '[', ']');
$ctp->LoadSource($innerText);
$revalue = $seli = '';
$fields = array('nativeplace' => '', 'infotype' => '', 'typeid' => $typeid);
if ($hasSetEnumJs != 'has') {
$revalue .= '<script language="javascript" type="text/javascript" src="' . $cfg_mainsite . $cmspath . 'images/enums.js"></script>' . "\r\n";
$GLOBALS['hasSetEnumJs'] = 'hasset';
}
$fields['nativeplace'] = $fields['infotype'] = '';
if (empty($nativeplace)) {
$nativeplace = 0;
}
if (empty($infotype)) {
$infotype = 0;
}
$fields['nativeplace'] .= "<input type='hidden' id='hidden_nativeplace' name='nativeplace' value='{$nativeplace}' />\r\n";
$fields['nativeplace'] .= "<span class='infosearchtxt'>地区:</span><span id='span_nativeplace'></span>\r\n";
$fields['nativeplace'] .= "<span id='span_nativeplace_son'></span>\r\n<span id='span_nativeplace_sec'></span><br />\r\n";
$fields['nativeplace'] .= "<script language='javascript' type='text/javascript' src='{$cfg_mainsite}{$cmspath}data/enums/nativeplace.js'></script>\r\n";
$fields['nativeplace'] .= '<script language="javascript">MakeTopSelect("nativeplace", ' . $nativeplace . ');</script>' . "\r\n";
$fields['infotype'] .= "<input type='hidden' id='hidden_infotype' name='infotype' value='{$infotype}' />\r\n";
$fields['infotype'] .= "<span class='infosearchtxt'>类型:</span><span id='span_infotype'></span>\r\n";
$fields['infotype'] .= "<span id='span_infotype_son'></span><span id='span_infotype_sec'></span><br />\r\n";
$fields['infotype'] .= "<script language='javascript' type='text/javascript' src='{$cfg_mainsite}{$cmspath}data/enums/infotype.js'></script>\r\n";
$fields['infotype'] .= '<script language="javascript">MakeTopSelect("infotype", ' . $infotype . ');</script>' . "\r\n";
if (is_array($ctp->CTags)) {
foreach ($ctp->CTags as $tagid => $ctag) {
if (isset($fields[$ctag->GetName()])) {
$ctp->Assign($tagid, $fields[$ctag->GetName()]);
}
}
$revalue .= $ctp->GetResult();
}
return $revalue;
}
示例6: lib_sonchannel
function lib_sonchannel(&$ctag, &$refObj)
{
global $_sys_globals, $dsql;
$attlist = "row|100,nosonmsg|,col|1";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
$innertext = $ctag->GetInnerText();
$typeid = $_sys_globals['typeid'];
if (empty($typeid)) {
return $ctag->GetAtt('nosonmsg');
}
$sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath\r\n FROM `#@__arctype` WHERE reid='{$typeid}' AND ishidden<>1 ORDER BY sortrank ASC LIMIT 0,{$row}";
//And id<>'$typeid'
$dtp2 = new DedeTagParse();
$dtp2->SetNameSpace("field", "[", "]");
$dtp2->LoadSource($innertext);
$dsql->SetQuery($sql);
$dsql->Execute();
$line = $row;
$GLOBALS['autoindex'] = 0;
$likeType = '';
for ($i = 0; $i < $line; $i++) {
if ($col > 1) {
$likeType .= "<dl>\r\n";
}
for ($j = 0; $j < $col; $j++) {
if ($col > 1) {
$likeType .= "<dd>\r\n";
}
if ($row = $dsql->GetArray()) {
$row['typelink'] = $row['typeurl'] = GetOneTypeUrlA($row);
if (is_array($dtp2->CTags)) {
foreach ($dtp2->CTags as $tagid => $ctag) {
if (isset($row[$ctag->GetName()])) {
$dtp2->Assign($tagid, $row[$ctag->GetName()]);
}
}
}
$likeType .= $dtp2->GetResult();
}
if ($col > 1) {
$likeType .= "</dd>\r\n";
}
$GLOBALS['autoindex']++;
}
//Loop Col
if ($col > 1) {
$i += $col - 1;
$likeType .= " </dl>\r\n";
}
}
//Loop for $i
$dsql->FreeResult();
return $likeType;
}
示例7: lib_flinktype
function lib_flinktype(&$ctag, &$refObj)
{
global $dsql;
$attlist = "row|24,titlelen|24";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
$totalrow = $row;
$revalue = '';
$equery = "SELECT * FROM #@__flinktype order by id asc limit 0,{$totalrow}";
if (trim($ctag->GetInnerText()) == '') {
$innertext = "<li>[field:typename /]</li>";
} else {
$innertext = $ctag->GetInnerText();
}
if (!isset($type)) {
$type = '';
}
$dtp = new DedeTagParse();
$dtp->SetNameSpace("dede", "{", "}");
$dtp->LoadString($innertext);
$dsql->SetQuery($equery);
$dsql->Execute();
$rs = '';
$row = array();
while ($dbrow = $dsql->GetObject()) {
$row[] = $dbrow;
}
$dedecms = false;
$dedecms->id = 999;
$dedecms->typename = '织梦链';
if ($type == 'dedecms') {
$row[] = $dedecms;
}
foreach ($row as $key => $value) {
if (is_array($dtp->CTags)) {
$GLOBALS['envs']['flinkid'] = $value->id;
foreach ($dtp->CTags as $tagid => $ctag) {
$tagname = $ctag->GetName();
if ($tagname == "flink") {
$dtp->Assign($tagid, lib_flink($ctag, $refObj));
}
}
}
$rs = $dtp->GetResult();
$rs = preg_replace("/\\[field:id([\\/\\s]{0,})\\]/isU", $value->id, $rs);
$rs = preg_replace("/\\[field:typename([\\/\\s]{0,})\\]/isU", $value->typename, $rs);
$revalue .= $rs;
}
return $revalue;
}
示例8: lib_asktype
/**
* 问答调用标签
*
* @version $Id: ask.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_asktype(&$ctag, &$refObj)
{
global $dsql, $envs, $cfg_dbprefix, $cfg_cmsurl, $cfg_ask_directory, $cfg_ask_isdomain, $cfg_ask_domain;
//属性处理
$attlist = "tid|0,reid|0,name|24";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
if (!$dsql->IsTable("{$cfg_dbprefix}ask")) {
return '没安装问答模块';
}
//启用二级域名
if ($cfg_ask_isdomain == 'Y') {
$weburl = $cfg_ask_domain . '/';
} else {
$weburl = $cfg_ask_directory . '/';
}
$innertext = $ctag->GetInnerText();
if (trim($innertext) == '') {
$innertext = GetSysTemplets("asks.htm");
}
if ($tid > 0) {
$qtypeQuery = "WHERE reid={$tid} ";
} else {
$qtypeQuery = '';
}
if ($reid > 0) {
$qtypeQuery = "WHERE reid > 0 ";
}
$ctp = new DedeTagParse();
$ctp->SetNameSpace('field', '[', ']');
$solvingask = '';
$query = "SELECT id,name,reid FROM `#@__asktype` {$qtypeQuery}";
$dsql->Execute('me', $query);
while ($rs = $dsql->GetArray('me')) {
$ctp->LoadSource($innertext);
if ($rs['reid'] != '') {
$rs['typeurl'] = $weburl . "?ct=browser&tid2=" . $rs['id'];
} else {
$rs['typeurl'] = $weburl . "?ct=browser&tid=" . $rs['id'];
}
foreach ($ctp->CTags as $tagid => $ctag) {
if (!empty($rs[strtolower($ctag->GetName())])) {
$ctp->Assign($tagid, $rs[$ctag->GetName()]);
}
}
$solvingask .= $ctp->GetResult();
}
return $solvingask;
}
示例9: lib_groupthread
function lib_groupthread(&$ctag, &$refObj)
{
global $dsql, $envs, $cfg_dbprefix, $cfg_cmsurl;
//属性处理
$attlist = "gid|0,orderby|dateline,orderway|desc,row|12,titlelen|30";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
if (!$dsql->IsTable("{$cfg_dbprefix}groups")) {
return '没安装圈子模块';
}
if (!preg_match("#\\/\$#", $cfg_cmsurl)) {
$cfg_group_url = $cfg_cmsurl . "/group";
} else {
$cfg_group_url = $cfg_cmsurl . "group";
}
$innertext = $ctag->GetInnerText();
if (trim($innertext) == '') {
$innertext = GetSysTemplets('groupthreads.htm');
}
$WhereSql = " WHERE t.closed=0 ";
$orderby = 't.' . $orderby;
if ($gid > 0) {
$WhereSql .= " AND t.gid='{$gid}' ";
}
$query = "SELECT t.subject,t.gid,t.tid,t.lastpost,g.groupname FROM `#@__group_threads` t \r\n LEFT JOIN `#@__groups` g ON g.groupid=t.gid\r\n {$WhereSql} ORDER BY {$orderby} {$orderway} LIMIT 0,{$row}";
$dsql->SetQuery($query);
$dsql->Execute();
$ctp = new DedeTagParse();
$ctp->SetNameSpace('field', '[', ']');
if (!isset($list)) {
$list = '';
}
while ($rs = $dsql->GetArray()) {
$ctp->LoadSource($innertext);
$rs['subject'] = cn_substr($rs['subject'], $titlelen);
$rs['url'] = $cfg_group_url . "/viewthread.php?id={$rs['gid']}&tid={$rs['tid']}";
$rs['groupurl'] = $cfg_group_url . "/group.php?id={$rs['gid']}";
foreach ($ctp->CTags as $tagid => $ctag) {
if (!empty($rs[strtolower($ctag->GetName())])) {
$ctp->Assign($tagid, $rs[$ctag->GetName()]);
}
}
$list .= $ctp->GetResult();
}
return $list;
}
示例10: lib_sql
function lib_sql(&$ctag, &$refObj)
{
global $dsql, $sqlCt;
$attlist = "sql|";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
//传递环境参数
preg_match_all("/~([A-Za-z0-9]+)~/s", $sql, $conditions);
if (is_array($conditions)) {
foreach ($conditions[1] as $key => $value) {
if (isset($refObj->Fields[$value])) {
$sql = str_replace($conditions[0][$key], "'" . addslashes($refObj->Fields[$value]) . "'", $sql);
}
}
}
$revalue = '';
$Innertext = trim($ctag->GetInnerText());
if ($sql == '' || $Innertext == '') {
return '';
}
if (empty($sqlCt)) {
$sqlCt = 0;
}
$ctp = new DedeTagParse();
$ctp->SetNameSpace('field', '[', ']');
$ctp->LoadSource($Innertext);
$thisrs = 'sq' . $sqlCt;
$dsql->Execute($thisrs, $sql);
$GLOBALS['autoindex'] = 0;
while ($row = $dsql->GetArray($thisrs)) {
$sqlCt++;
$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;
}
示例11: lib_loop
function lib_loop(&$ctag, &$refObj)
{
global $dsql;
$attlist = "table|,tablename|,row|8,sort|,if|,ifcase|,orderway|desc";
//(2011.7.22 增加loop标签orderway属性 by:织梦的鱼)
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
$innertext = trim($ctag->GetInnertext());
$revalue = '';
if (!empty($table)) {
$tablename = $table;
}
if ($tablename == '' || $innertext == '') {
return '';
}
if ($if != '') {
$ifcase = $if;
}
if ($sort != '') {
$sort = " ORDER BY {$sort} {$orderway} ";
}
if ($ifcase != '') {
$ifcase = " WHERE {$ifcase} ";
}
$dsql->SetQuery("SELECT * FROM {$tablename} {$ifcase} {$sort} LIMIT 0,{$row}");
$dsql->Execute();
$ctp = new DedeTagParse();
$ctp->SetNameSpace("field", "[", "]");
$ctp->LoadSource($innertext);
$GLOBALS['autoindex'] = 0;
while ($row = $dsql->GetArray()) {
$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;
}
示例12: lib_json
function lib_json(&$ctag, &$refObj)
{
global $dsql, $sqlCt, $cfg_soft_lang;
$attlist = "url|";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
$Innertext = trim($ctag->GetInnerText());
if ($url == '' || $Innertext == '') {
return '';
}
$ctp = new DedeTagParse();
$ctp->SetNameSpace('field', '[', ']');
$ctp->LoadSource($Innertext);
$mcache = new MiniCache();
$GLOBALS['autoindex'] = 0;
$chash = md5($url);
if (!($row = $mcache->Get($chash))) {
$content = @file_get_contents($url);
$json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
$row = $json->decode($content);
if ($cfg_soft_lang != 'utf-8') {
$row = AutoCharset($row, 'utf-8', 'gb2312');
}
$mcache->Save($chash, $row, $cache);
}
$revalue = "";
foreach ($row as $key => $value) {
$GLOBALS['autoindex']++;
foreach ($ctp->CTags as $tagid => $ctag) {
if ($ctag->GetName() == 'array') {
$ctp->Assign($tagid, $value);
} else {
if (!empty($value[$ctag->GetName()])) {
$ctp->Assign($tagid, $value[$ctag->GetName()]);
} else {
$ctp->Assign($tagid, "");
}
}
}
$revalue .= $ctp->GetResult();
}
return $revalue;
}
示例13: lib_productimagelist
/**
*
*
* @version $Id: productimagelist.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_productimagelist(&$ctag, &$refObj)
{
global $dsql, $sqlCt;
$attlist = "desclen|80";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
if (!isset($refObj->addTableRow['imgurls'])) {
return;
}
$revalue = '';
$innerText = trim($ctag->GetInnerText());
if (empty($innerText)) {
$innerText = GetSysTemplets('productimagelist.htm');
}
$dtp = new DedeTagParse();
$dtp->LoadSource($refObj->addTableRow['imgurls']);
$images = array();
if (is_array($dtp->CTags)) {
foreach ($dtp->CTags as $ctag) {
if ($ctag->GetName() == "img") {
$row = array();
$row['imgsrc'] = trim($ctag->GetInnerText());
$row['text'] = $ctag->GetAtt('text');
$images[] = $row;
}
}
}
$dtp->Clear();
$revalue = '';
$ctp = new DedeTagParse();
$ctp->SetNameSpace('field', '[', ']');
$ctp->LoadSource($innerText);
foreach ($images as $row) {
foreach ($ctp->CTags as $tagid => $ctag) {
if (isset($row[$ctag->GetName()])) {
$ctp->Assign($tagid, $row[$ctag->GetName()]);
}
}
$revalue .= $ctp->GetResult();
}
return $revalue;
}
示例14: lib_memberinfos
function lib_memberinfos(&$ctag, &$refObj)
{
global $dsql, $sqlCt;
$attlist = "mid|0";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
if (empty($mid)) {
if (!empty($refObj->Fields['mid'])) {
$mid = $refObj->Fields['mid'];
} else {
$mid = 1;
}
} else {
$mid = intval($mid);
}
$revalue = '';
$innerText = trim($ctag->GetInnerText());
if (empty($innerText)) {
$innerText = GetSysTemplets('memberinfos.htm');
}
$sql = "SELECT mb.*,ms.spacename,ms.sign,ar.membername as rankname FROM `#@__member` mb\r\n LEFT JOIN `#@__member_space` ms ON ms.mid = mb.mid \r\n LEFT JOIN `#@__arcrank` ar ON ar.rank = mb.rank\r\n WHERE mb.mid='{$mid}' LIMIT 0,1 ";
$ctp = new DedeTagParse();
$ctp->SetNameSpace('field', '[', ']');
$ctp->LoadSource($innerText);
$dsql->Execute('mb', $sql);
while ($row = $dsql->GetArray('mb')) {
if ($row['matt'] == 10) {
return '';
}
$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;
}
示例15: lib_group
function lib_group(&$ctag, &$refObj)
{
global $dsql, $envs, $cfg_dbprefix, $cfg_cmsurl;
//属性处理
$attlist = "row|6,orderby|threads,titlelen|30";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
if (!$dsql->IsTable("{$cfg_dbprefix}groups")) {
return '没安装圈子模块';
}
if (!preg("#\\/\$#", $cfg_cmsurl)) {
$cfg_group_url = $cfg_cmsurl . '/group';
} else {
$cfg_group_url = $cfg_cmsurl . 'group';
}
$innertext = $ctag->GetInnerText();
if (trim($innertext) == '') {
$innertext = GetSysTemplets("groups.htm");
}
$list = '';
$dsql->SetQuery("SELECT groupimg,groupid,groupname FROM `#@__groups` WHERE ishidden=0 ORDER BY {$orderby} DESC LIMIT 0,{$row}");
$dsql->Execute();
$ctp = new DedeTagParse();
$ctp->SetNameSpace('field', '[', ']');
while ($rs = $dsql->GetArray()) {
$ctp->LoadSource($innertext);
$rs['groupname'] = cn_substr($rs['groupname'], $titlelen);
$rs['url'] = $cfg_group_url . "/group.php?id={$rs['groupid']}";
$rs['icon'] = $rs['groupimg'];
foreach ($ctp->CTags as $tagid => $ctag) {
if (!empty($rs[strtolower($ctag->GetName())])) {
$ctp->Assign($tagid, $rs[$ctag->GetName()]);
}
}
$list .= $ctp->GetResult();
}
return $list;
}