- <metahttp-equiv='content-type'content='text/html;charset=utf-8'><?phpinclude'snoopy/Snoopy.class.php';$snoopy=newSnoopy();$sourceURL="xxxxx";$snoopy->fetchlinks($sourceURL);$a=$snoopy->results;$re="/\d+\.html$/";//过滤获取指定的文件地址请求foreach($aas$tmp){if(preg_match($re,$tmp)){getImgURL($tmp);}}functiongetImgURL($siteName){$snoopy=newSnoopy();$snoopy->fetch($siteName);$fileContent=$snoopy->results;//匹配图片的正则表达式$reTag="/<img[^s]+src=\"(http:\/\/[^\"]+).(jpg|png|gif|jpeg)\"[^\/]*\/>/i";if(preg_match($reTag,$fileContent)){$ret=preg_match_all($reTag,$fileContent,$matchResult);for($i=0,$len=count($matchResult[1]);$i<$len;++$i){saveImgURL($matchResult[1][$i],$matchResult[2][$i]);}}}functionsaveImgURL($name,$suffix){$url=$name.".".$suffix;echo"请求的图片地址:".$url."<br/>";$imgSavePath="E:/xxx/style/images/";$imgId=preg_replace("/^.+\/(\d+)$/","\\1",$name);if($suffix=="gif"){$imgSavePath.="emotion";}else{$imgSavePath.="topic";}$imgSavePath.=("/".$imgId.".".$suffix);if(is_file($imgSavePath)){unlink($imgSavePath);echo"<pstyle='color:#f00;'>文件".$imgSavePath."已存在,将被删除</p>";}$imgFile=file_get_contents($url);$flag=file_put_contents($imgSavePath,$imgFile);if($flag){echo"<p>文件".$imgSavePath."保存成功</p>";}}?>
- $(function(){$("code").each(function(){$(this).html("<ulid=\'codeblock'><li>"+$(this).html().replace(/\n/g,"\n</li><li>")+"\n</li></ul>");});});
- config.extraPlugins='etranfile,etranmedia,etranmore,autoformat,ecleanalltext,einsertbr,einsertpage,einserttime,equotetext,codesnippet';config.toolbar='full';config.codeSnippet_theme='foundation';
转载请注明:范的资源库 » 帝国cms实现代码高亮方法三