织梦文章内容页调用同栏目下的其它文章图片的方法

			{dede:field.aid runphp='yes'}
			$aid = @me;
			$sql = "select * from dede_archives where id =".$aid." limit 1";
			$query = mysql_query($sql);
			$row = mysql_fetch_array($query);
			$typeid = $row["typeid"];
			$sql = "SELECT * FROM dede_archives where id<>".$aid." and typeid =".$typeid." order by id desc limit 4";
			$query = mysql_query($sql);
			@me = "";
			while($row = mysql_fetch_array($query)){
					 $id = $row["id"];
					 $title = cn_substr($row["title"],70,0);
					 $urlarray = GetOneArchive($id);
					 $url = $urlarray['arcurl'];
					 $time = strftime("%Y-%m-%d",$row["sortrank"]);
					 $imgurl = $urlarray['litpic'];
					 @me.= '<li><a href="'.$url.'" title="'.$title.'"  target="_blank"><img src="'.$imgurl.'"  />a>li>';
			}
			{/dede:field.aid}

你可能感兴趣的:(织梦)