$arrData = $rs->fetchAll(PDO::FETCH_COLUMN); foreach ($arrData as $key => $val) { $strDir = ceil($val / $arrGCache['cache_filenum']); if ($arrGWeb['URL_static']) { if ($arrGWeb['file_static']) { $strUrl = $domain . '/' . $arrGWeb['cache_url'] . '/' . $k . '-' . $strDir . '/' . $val . $arrGWeb['file_suffix']; } else { $strUrl = $domain . '/' . $k . '/detail/id-' . $val . $arrGWeb['file_suffix']; } } else { $strUrl = $domain . '/' . $k . '/detail.php?id=' . $val; } $smi = new google_sitemap_item($strUrl, $today, $_POST['content_changefreq'], $_POST['content_priority']); $sm->add_item($smi); } break; } } } $sm->build($sm_file); check::Alert('Google Sitemaps 生成成功,http://' . $arrGWeb['host'] . '/sitemap.xml'); } else { check::AlertExit("错误:文件 http://" . $arrGWeb['host'] . "/sitemap.xml 不可写!", -1); } } // 输出到模板 $arrMOutput["smarty_assign"]['strNav'] = 'Google Sitemaps'; $arrMOutput["template_file"] = "admin.html"; $arrMOutput["smarty_assign"]['MAIN'] = $arrGSmarty['admin_main_dir'] . 'seo/google_sitemap.htm'; $objWebInit->output($arrMOutput);