function lib_getarctaglist(&$ctag, &$refObj) { global $dsql, $sys_webid; $attlist = "row|8"; FillAttsDefault($ctag->CAttribute->Items, $attlist); extract($ctag->CAttribute->Items, EXTR_SKIP); $tagword = isset($refObj->Fields['tagword']) ? $refObj->Fields['tagword'] : ''; if ($tagword == '') { return ''; } $tagword = RemoveEmpty(explode(",", $tagword)); $i = 1; $where = ''; foreach ($tagword as $key => $value) { if ($i == 1) { $where .= "tagword like '%{$value}%'"; } else { $where .= " or tagword like '%{$value}%'"; } $i++; } $innertext = trim($ctag->GetInnertext()); $revalue = ''; $sql = "select aid,title,shownum,attrid,webid from #@__article where {$where} limit 0,{$row}"; $dsql->SetQuery($sql); $dsql->Execute(); $ctp = new STTagParse(); $ctp->SetNameSpace("field", "[", "]"); $ctp->LoadSource($innertext); $GLOBALS['autoindex'] = 0; while ($row = $dsql->GetArray()) { $weburl = GetWebURLByWebid($row['webid']); if ($row['webid'] == 0) { $row['url'] = $GLOBALS['cfg_cmsurl'] . "/raiders/show_{$row['aid']}.html"; $row['litpic'] = !empty($row['litpic']) ? $GLOBALS['cfg_cmsurl'] . $row['litpic'] : $GLOBALS['cfg_cmsurl'] . "/templets/default/images/pic_tem.gif"; } else { $row['url'] = GetWebURLByWebid($row['webid']) . "/raider/show_{$row['aid']}.html"; $row['litpic'] = !empty($row['litpic']) ? $weburl . $row['litpic'] : $GLOBALS['cfg_cmsurl'] . "/templets/default/images/pic_tem.gif"; } $row['title'] = $row['title']; $row['attrname'] = Getarctype($row['attrid']); 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(); $GLOBALS['autoindex']++; } return $revalue; }
function getHotelPic($hotelinfo, $type = 'big') { $picarr = RemoveEmpty(explode(',', $hotelinfo['piclist'])); $url = GetWebURLByWebid($hotelinfo['webid']) . '/hotels/show_' . $hotelinfo['aid'] . '.html'; $k = 1; $out = ''; foreach ($picarr as $pic) { $p = explode('||', $pic); $picname = !isset($p[1]) ? $p[1] : $hotelinfo['title']; //图片名称 $litpic = getUploadFileUrl($p[0]); //图片地址 if ($type == 'big') { $class = $k == 1 ? 'liSelected' : ''; $out .= ' <li class="' . $class . '"><span class="sPic"><i class="iBigPic"><a href="javascript:;" target="_blank" ><img width="485" height="325" src="' . $litpic . '" /></a></i></span></li>'; } else { if ($type == 'thumb') { $thumb = str_replace('litimg', 'lit160', $litpic); $out .= ' <li class="' . $class . '"><span class="sPic"><img src="' . $thumb . '" width="65" height="50" /></span></li>'; } } $k++; } return $out; }
public function GetRequestInfo($requestResource) { $requestResource = strtolower($requestResource); $requestInfo = RemoveEmpty(explode('/', $requestResource)); return $requestInfo; }
public static function getAttrList($attrid) { global $dsql; $out = ''; $arr = RemoveEmpty(explode(',', $attrid)); foreach ($arr as $atid) { $sql = "select attrname from sline_jieban_attr where id='{$atid}'"; $row = $dsql->GetOne($sql); $out .= "<span>{$row['attrname']}</span>"; } return $out; }