$contents = str_replace("{special_url3}", $special_url3, $contents); $contents = str_replace("{special_url4}", $special_url4, $contents); $contents = str_replace("{special_url5}", $special_url5, $contents); $contents = str_replace("{special_html}", SITE_URL . SPECIALURL . $html, $contents); //各个超链接 $MyArticle = new Article(); $MyArticle->Flag = 1; $MyArticle->Count = 100; $MyArticle->TitleCount = 100; //顶部链接 $MyArticle->CateId = TOPURL; $topurl = $MyArticle->getArticleList(); $MyArticle->CateId = FOOT01; //底部链接01 $foot01 = $MyArticle->getArticleList(); $foot01_title = $MyArticle->getCateTitle(); $MyArticle->CateId = FOOT02; //底部链接02 $foot02 = $MyArticle->getArticleList(); $foot02_title = $MyArticle->getCateTitle(); $MyArticle->CateId = FOOT03; //底部链接03 $foot03 = $MyArticle->getArticleList(); $foot03_title = $MyArticle->getCateTitle(); $MyArticle->CateId = FOOT04; //底部链接04 $foot04 = $MyArticle->getArticleList(); $foot04_title = $MyArticle->getCateTitle(); //顶部链接 $contents = str_replace("{topurl}", $topurl, $contents); //底部连接01-04
/** * 替换掉通用链接 * * @param $contents 内容 * @return String */ function ReplaceCommonUrl($contents) { //各个超链接 $MyArticle = new Article(); $MyArticle->Flag = 1; $MyArticle->Count = 100; $MyArticle->TitleCount = 100; $MyArticle->OrderBy = 'order'; $MyArticle->OrderSort = 'ASC'; //顶部链接 $MyArticle->CateId = TOPURL; $topurl = $MyArticle->getArticleList(); $MyArticle->CateId = FOOT01; //底部链接01 $foot01 = $MyArticle->getArticleList(); $foot01_title = $MyArticle->getCateTitle(); $MyArticle->CateId = FOOT02; //底部链接02 $foot02 = $MyArticle->getArticleList(); $foot02_title = $MyArticle->getCateTitle(); $MyArticle->CateId = FOOT03; //底部链接03 $foot03 = $MyArticle->getArticleList(); $foot03_title = $MyArticle->getCateTitle(); $MyArticle->CateId = FOOT04; //底部链接04 $foot04 = $MyArticle->getArticleList(); $foot04_title = $MyArticle->getCateTitle(); //顶部链接 $contents = str_replace("{topurl}", $topurl, $contents); //底部连接01-04 $contents = str_replace("{foot01}", $foot01, $contents); $contents = str_replace("{foot01_title}", $foot01_title, $contents); $contents = str_replace("{foot02}", $foot02, $contents); $contents = str_replace("{foot02_title}", $foot02_title, $contents); $contents = str_replace("{foot03}", $foot03, $contents); $contents = str_replace("{foot03_title}", $foot03_title, $contents); $contents = str_replace("{foot04}", $foot04, $contents); $contents = str_replace("{foot04_title}", $foot04_title, $contents); return $contents; }