注册
忘记密码
用户名
密码
加入收藏
设财股网为首页
网站地图
财股网导航
商务合作
财经
股票
资讯综合门户
财股网
(Caiguu.com)是
中国财经股票资讯综合门户
,为您提供涵盖
股票
、
财经
、
理财
、A股、
港股
、
市场
、
大盘
、
主力
、
行业
等财经股票领域资讯。并以股票为专注,提供
股票行情
、
股票查询
、
股票分析
、
股票知识
、
股票投资
等综合性服务。
重点推荐栏目:
今日股票行情
、
股票入门基础知识
、
免费推荐股票
、
个股
、
理财工具
。
股票
市场
个股
主力
行业
新股
公司
机构
板块
学院
大盘
聚焦
提示
视点
数据
交易
精华
测评
研究
潜股
要闻
股指
权证
B股
三板
领涨
创业板
中小板
港股
全球
财经
新闻
国内
国外
宏观
资本
商业
产业
评论
专家
观察
讲堂
理财
黄金
外汇
债券
基金
银行
保险
信托
综合
财股
消息
技巧
首页
热门专栏:
富爸爸穷爸爸
股票软件
概念股
股票估值
\r\n"; $row = $dsql->GetOne("SELECT tagid FROM #@__arcmulti WHERE tagid='$tagid'"); $uptime = time(); $attstr = addslashes(serialize($attarray)); $innertext = addslashes($innertext); if(!is_array($row)) { $query = " INSERT INTO #@__arcmulti(tagid,uptime,innertext,pagesize,arcids,ordersql,addfieldsSql,addfieldsSqlJoin,attstr) VALUES('$tagid','$uptime','$innertext','$pagesize','$idsstr','$ordersql','$addfieldsSql','$addfieldsSqlJoin','$attstr'); "; $dsql->ExecuteNoneQuery($query); } else { $query = "UPDATE `#@__arcmulti` SET uptime='$uptime', innertext='$innertext', pagesize='$pagesize', arcids='$idsstr', ordersql='$ordersql', addfieldsSql='$addfieldsSql', addfieldsSqlJoin='$addfieldsSqlJoin', attstr='$attstr' WHERE tagid='$tagid' "; $dsql->ExecuteNoneQuery($query); } } //淇濆瓨ID缂撳瓨 if($needSaveCache) { if($idsstr=='') $idsstr = '0'; if($cfg_cache_type=='content' && $idsstr!='0') { $idsstr = addslashes($artlist); } $inquery = "INSERT INTO `#@__arccache`(`md5hash`,`uptime`,`cachedata`) VALUES ('".$taghash."','".time()."', '$idsstr'); "; $dsql->ExecuteNoneQuery("DELETE FROM `#@__arccache` WHERE md5hash='".$taghash."' "); $dsql->ExecuteNoneQuery($inquery); } return $artlist; } /** * 鏌ヨ缂撳瓨 * * @access public * @param string $md5hash 鍞竴璇嗗埆hash * @return string */ function GetArclistCache($md5hash) { global $dsql,$envs,$cfg_makesign_cache,$cfg_index_cache,$cfg_cache_type; if($cfg_index_cache <= 0) return ''; if(isset($envs['makesign']) && $cfg_makesign_cache=='N') return ''; $mintime = time() - $cfg_index_cache; $arr = $dsql->GetOne("SELECT cachedata,uptime FROM `#@__arccache` WHERE md5hash = '$md5hash' "); if(!is_array($arr)) { return ''; } else if($arr['uptime'] < $mintime) { return ''; } else { return $arr['cachedata']; } } /** * 鑾峰彇鑷姩棰戦亾ID * * @access public * @param string $sortid * @param string $topid * @return string */ function lib_GetAutoChannelID($sortid, $topid) { global $dsql; if(empty($sortid)) $sortid = 1; $getstart = $sortid - 1; $row = $dsql->GetOne("SELECT id,typename FROM #@__arctype WHERE reid='{$topid}' And ispart<2 And ishidden<>'1' ORDER BY sortrank asc limit $getstart,1"); if(!is_array($row)) return 0; else return $row['id']; } /** * 瀵规煡璇㈢粨鏋滈泦杩涜鎺掑簭 * * @access public * @param array $list 鏌ヨ缁撴灉 * @param string $field 鎺掑簭鐨勫瓧娈靛悕 * @param array $sortby 鎺掑簭绫诲瀷 * asc姝e悜鎺掑簭 desc閫嗗悜鎺掑簭 nat鑷劧鎺掑簭 * @return array */ function list_sort_by($list, $field, $sortby='asc') { if(is_array($list)){ $refer = $resultSet = array(); foreach ($list as $i => $data) $refer[$i] = &$data[$field]; switch ($sortby) { case 'asc': // 姝e悜鎺掑簭 asort($refer); break; case 'desc':// 閫嗗悜鎺掑簭 arsort($refer); break; case 'nat': // 鑷劧鎺掑簭 natcasesort($refer); break; } foreach ( $refer as $key=> $val) $resultSet[] = &$list[$key]; return $resultSet; } return false; } >dede>>
鐙珛鍗曡〃妯″瀷鍒楄〃
鍏ㄥ眬鏍囪
V55,V56,V57
鍗曡〃鐙珛妯″瀷鐨勬枃妗e垪琛ㄨ皟鐢ㄦ爣璁?/description>
{dede:arclistsg flag='h' typeid='' row='' col='' titlelen='' orderway='' keyword='' limit='0,1'}
[field:title/]
{/dede:arclistsg}
row:杩斿洖鏂囨。鍒楄〃鎬绘暟
typeid:鏍忕洰ID,鍦ㄥ垪琛ㄦā鏉垮拰妗f妯℃澘涓竴鑸笉闇瑕佹寚瀹氾紝鍦ㄥ皝闈㈡ā鏉夸腑鍏佽鐢?,"鍒嗗紑琛ㄧず澶氫釜鏍忕洰
titlelen:鏍囬闀垮害 绛夊悓浜巘itlelength
orderwey:鎺掑簭鏂瑰悜
keyword:鍚湁鎸囧畾鍏抽敭瀛楃殑鏂囨。鍒楄〃锛屽涓叧閿瓧鐢?,"鍒?/iterm>
innertext:鍗曟潯璁板綍鏍峰紡(innertext鏄斁鍦ㄦ爣绛句箣闂寸殑浠g爜)
arcid:鎸囧畾鏂囨。ID
idlist:鎻愬彇鐗瑰畾鏂囨。锛堟枃妗D锛?/iterm>
channelid: 棰戦亾ID
limit:琛ㄧず闄愬畾鐨勮褰曡寖鍥?/iterm>
flag:鑷畾涔夊睘鎬у硷細澶存潯[h]鎺ㄨ崘[c]鍥剧墖[p]骞荤伅[f]婊氬姩[s]璺宠浆[j]鍥炬枃[a]鍔犵矖[b]
subday:琛ㄧず鍦ㄥ灏戝ぉ浠ュ唴鐨勬枃妗?/iterm>
>>dede>>*/ function lib_arclistsg(&$ctag,&$refObj) { global $dsql,$PubFields,$cfg_keyword_like,$cfg_index_cache,$_arclistEnv,$envs,$_sys_globals; //灞炴у鐞? $attlist="typeid|0,row|10,col|1,flag|,titlelen|30,sort|default,keyword|,innertext|,arcid|0,idlist|,channelid|0,limit|,orderway|desc,subday|0"; FillAttsDefault($ctag->CAttribute->Items,$attlist); extract($ctag->CAttribute->Items, EXTR_SKIP); $line = $row; $orderby=strtolower($sort); if($col=='') $col = 1; if(empty($imgwidth)) $imgwidth = ""; if(empty($imgheight)) $imgheight = ""; $innertext = trim($ctag->GetInnerText()); if($innertext=='') $innertext = GetSysTemplets("part_arclistsg.htm"); if(empty($channelid) && isset($GLOBALS['envs']['channelid'])) { $channelid = $GLOBALS['envs']['channelid']; } if(empty($typeid) && !empty($envs['typeid'])) { $typeid = $envs['typeid']; } if(empty($typeid) && empty($channelid)) { return "No channel info!"; } if(!empty($channelid)) $gquery = "SELECT addtable,listfields FROM `#@__channeltype` WHERE id='$channelid' "; else $gquery = "SELECT ch.addtable,listfields FROM `#@__arctype` tp LEFT JOIN `#@__channeltype` ch ON ch.id=tp.channeltype WHERE id='$typeid'"; $row = $dsql->GetOne($gquery); $orwheres = array(); $maintable = trim($row['addtable']); if($maintable=='') { return "No addtable info!"; } //鍒楄〃璋冪敤瀛楁 $listarcs = array('aid', 'typeid'); if(!empty($row['listfields'])) { $listfields = explode(',', $row['listfields']); foreach($listfields as $v) { if(!in_array($v, $listarcs)) $listarcs[] = $v; } } $arclistquery = join(',', $listarcs); $arclistquery .= ",arc.aid AS id,arc.senddate AS pubdate"; //鎸変笉鍚屾儏鍐佃瀹歋QL鏉′欢 鎺掑簭鏂瑰紡 if($idlist=='') { if($orderby=='near' && $cfg_keyword_like=='N'){ $keyword=''; } //鏃堕棿闄愬埗(鐢ㄤ簬璋冪敤鏈杩戠儹闂ㄦ枃绔犮佺儹闂ㄨ瘎璁轰箣绫? if($subday>0) { //杩欓噷鐨勬椂闂村彧鑳借绠楀埌澶╋紝鍚﹀垯缂撳瓨鍔熻兘灏嗘棤鏁? $ntime = gmmktime(0, 0, 0, gmdate('m'), gmdate('d'), gmdate('Y')); $limitday = $ntime - ($subday * 24 * 3600); $orwheres[] = " arc.senddate > $limitday "; } if($flag!='') { $flags = explode(',',$flag); for($i=0;isset($flags[$i]);$i++) $orwheres[] = " FIND_IN_SET('{$flags[$i]}',flag)>0 "; } if(!empty($typeid)) { //鎸囧畾浜嗗涓爮鐩椂锛屼笉鍐嶈幏鍙栧瓙绫荤殑id if(preg_match('#,#',$typeid)) $orwheres[] = " typeid IN ($typeid) "; else { //澶勭悊浜ゅ弶鏍忕洰 $CrossID = ''; if((isset($envs['cross']) || $ctag->GetAtt('cross')=='1' ) && $ctag->GetAtt('nocross')!='1') { $arr = $dsql->GetOne("SELECT `id`,`topid`,`cross`,`crossid`,`ispart`,`typename` FROM `#@__arctype` WHERE id='$typeid' "); if($arr['cross']==0 || ($arr['cross']==2 && trim($arr['crossid']==''))) $orwheres[] = ' typeid IN ('.GetSonIds($typeid).')'; else { $selquery = ''; if($arr['cross']==1) { $selquery = "SELECT id,topid FROM `#@__arctype` WHERE typename like '{$arr['typename']}' AND id<>'{$typeid}' AND topid<>'{$typeid}' "; } else { $arr['crossid'] = preg_replace('#[^0-9,]#', '', trim($arr['crossid'])); if($arr['crossid']!='') $selquery = "SELECT id,topid FROM `#@__arctype` WHERE id IN('{$arr['crossid']}') AND id<>'{$typeid}' AND topid<>'{$typeid}' "; } if($selquery!='') { $dsql->SetQuery($selquery); $dsql->Execute(); while($arr = $dsql->GetArray()) { $CrossID .= ($CrossID=='' ? $arr['id'] : ','.$arr['id']); } } } } if($CrossID=='') $orwheres[] = ' typeid IN ('.GetSonIds($typeid).')'; else $orwheres[] = ' typeid IN ('.GetSonIds($typeid).','.$CrossID.')'; } } //棰戦亾ID if(!empty($channelid)) $orwheres[] = " AND arc.channel = '$channelid' "; //鐢变簬杩欎釜鏉′欢浼氬鑷寸紦瀛樺姛鑳藉け鍘绘剰涔夛紝鍥犳鍙栨秷 //if($arcid!=0) $orwheres[] = " arc.id<>'$arcid' "; } //鏂囨。鎺掑簭鐨勬柟寮? $ordersql = ''; if($orderby=='hot'||$orderby=='click') $ordersql = " ORDER BY arc.click $orderway"; else if($orderby=='id') $ordersql = " ORDER BY arc.aid $orderway"; else if($orderby=='near') $ordersql = " ORDER BY ABS(arc.id - ".$arcid.")"; else if($orderby=='rand') $ordersql = " ORDER BY rand()"; else $ordersql=" ORDER BY arc.aid $orderway"; //limit鏉′欢 $limit = trim(preg_replace('#limit#i', '', $limit)); if($limit!='') $limitsql = " LIMIT $limit "; else $limitsql = " LIMIT 0,$line "; $orwhere = ''; if(isset($orwheres[0])) { $orwhere = join(' AND ',$orwheres); $orwhere = preg_replace("#^ AND#i", '', $orwhere); $orwhere = preg_replace("#AND[ ]{1,}AND#i", 'AND ', $orwhere); } if($orwhere!='') $orwhere = " WHERE $orwhere "; $query = "SELECT $arclistquery,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule, tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath FROM `$maintable` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id $orwhere AND arc.arcrank > -1 $ordersql $limitsql"; $md5hash = md5($query); $needcache = TRUE; if($idlist!='') $needcache = FALSE; else{ $idlist = GetArclistSgCache($md5hash); if($idlist!='') $needcache = FALSE; } //鎸囧畾浜唅d鎴栦娇鐢ㄧ紦瀛樹腑鐨刬d if($idlist!='' && $_arclistEnv != 'index') { $query = "SELECT $arclistquery,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart, tp.moresite,tp.siteurl,tp.sitepath FROM `$maintable` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id WHERE arc.aid IN($idlist) $ordersql $limitsql"; } $dsql->SetQuery($query); $dsql->Execute("al"); $artlist = ""; $dtp2 = new DedeTagParse(); $dtp2->SetNameSpace("field","[","]"); $dtp2->LoadString($innertext); $GLOBALS['autoindex'] = 0; $ids = array(); for($i=0;$i<$line;$i++) { for($j=0;$j<$col;$j++) { if($col>1) $artlist .= "
\r\n"; if($row = $dsql->GetArray("al")) { $ids[] = $row['aid']; $row['filename'] = $row['arcurl'] = GetFileUrl($row['id'],$row['typeid'],$row['senddate'],$row['title'],1, 0,$row['namerule'],$row['typedir'],0,'',$row['moresite'],$row['siteurl'],$row['sitepath']); $row['typeurl'] = GetTypeUrl($row['typeid'],$row['typedir'],$row['isdefault'],$row['defaultname'],$row['ispart'], $row['namerule2'],$row['moresite'],$row['siteurl'],$row['sitepath']); if($row['litpic'] == '-' || $row['litpic'] == '') { $row['litpic'] = $GLOBALS['cfg_cmspath'].'/images/defaultpic.gif'; } if(!preg_match("#^http:\/\/#i", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') { $row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic']; } $row['picname'] = $row['litpic']; $row['image'] = "
<]#", "", $row['title'])."' />"; $row['imglink'] = "
".$row['image']."
"; $row['stime'] = GetDateMK($row['pubdate']); $row['typelink'] = "
".$row['typename']."
"; $row['fulltitle'] = $row['title']; $row['title'] = cn_substr($row['title'],$titlelen); $row['textlink'] = "
".$row['title']."
"; $row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl']; $row['memberurl'] = $GLOBALS['cfg_memberurl']; $row['templeturl'] = $GLOBALS['cfg_templeturl']; if(is_array($dtp2->CTags)) { foreach($dtp2->CTags as $k=>$ctag) { if($ctag->GetName()=='array') { //浼犻掓暣涓暟缁勶紝鍦╮unphp妯″紡涓湁鐗规畩浣滅敤 $dtp2->Assign($k,$row); } else { if(isset($row[$ctag->GetName()])) $dtp2->Assign($k,$row[$ctag->GetName()]); else $dtp2->Assign($k,''); } } $GLOBALS['autoindex']++; } $artlist .= $dtp2->GetResult()."\r\n"; }//if hasRow else{ $artlist .= ''; } if($col>1) $artlist .= "
\r\n"; }//Loop Col if($col>1) $i += $cn/" target="_blank" rel="nofollow">