我有一个使用 PHP 生成的站点地图,实际上它只调用表零售商,如下所示:
$query = "select * from retailers WHERE status='active' ORDER BY added DESC";
并构造为:
while ($row = mysql_fetch_array($result))
{
$i_url = SITE_URL.'loja/'.$row['slug_title'];
$year = substr($row['added'],0,4);
$month = substr($row['added'],5,2);
$day = substr($row['added'],8,2);
$i_date = ''.$year.'-'.$month.'-'.$day.'';
// you can assign whatever changefreq and priority you like
// changefreg - optional
// priority - optional
echo
'
<url>
<loc>'.$i_url.'</loc>
<lastmod>'.$i_date.'</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
';
}
问题是,只有零售商页它的到来,我需要获得更多 3 个表,但我想不出一种在其中调用和构造更多东西的方法,也许是 PHP 条件?
感谢大家的时间!