0 and (senddate>{$start_datetime} or pubdate>{$start_datetime})";
$dsql->SetQuery($sql);
$dsql->Execute();
$list = [];
while($row = $dsql->GetArray()) array_push($list, $row);
foreach($list as $row){
$tag = $row['tag'];
$content = get_tags_html( urlencode($tag) );
$pos = strpos($content, 'convert($tags_name);
$file_name = implode('',$py).'.html';
return '/zx/tags/'.$file_name;
},
$content);
$content = preg_replace("/您现在的位置是:主页<\/a> > (.+?)<\/a> > /","您现在的位置是:主页 > $2 > ",$content);
$py = $pinyin->convert($tag);
$file_name = implode('',$py);
$path = dirname(__FILE__).'/../tags/'.$file_name.'.html';
$result = file_put_contents($path,$content);
if(false===$result){
var_dump($result, $path, $content);
die;
}
output("生成 {$tag} 标签页成功!");
}
echo('生成最近三天的标签页成功!');
}
function output($content, $is_exit=false){
echo($content."
");
if($is_exit) exit();
}
/**
* curl获取数据
*/
function curl_http($url, $post_data=array()){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data));
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
function get_tags_html($tag, $pageNo=1){
$tag = FilterSearch(urldecode($tag));
if($tag != addslashes($tag)) $tag = '';
if($tag == '')
$dlist = new TagList($tag, 'tag.htm');
else
$dlist = new TagList($tag, 'taglist.htm');
$result = $dlist->getDisplay();
return $result;
}