示例#1
0
        //Assigns date
        $hdlTpl->setVariable("title", substr($value["newstitle"], 0, 20) . "...");
        //Assigns title
        $hdlTpl->setVariable("news_desc", substr(strip_tags($value["content"]), 0, 200) . "...");
        //Assigns description
        $hdlTpl->setVariable("id", $value["id"]);
        //Assigns id
        //$strurl = ereg_replace(" ","_",$value["newstitle"]);
        $strurl = preg_replace('/[^a-z0-9]/i', '_', $value["newstitle"]);
        $hdlTpl->setVariable("site_name", SITE_NAME);
        $hdlTpl->setVariable("news_url", $strurl);
        //Assigns url
        $hdlTpl->parse("NEWS");
    }
}
$arrWebtech = $hldGlobal->fnGetWebTechniques();
if (is_array($arrWebtech) && count($arrWebtech) > 0) {
    foreach ($arrWebtech as $key => $value) {
        if (trim($value["img"]) != "") {
            $hdlTpl->setVariable("img1", $value["img"]);
            $hdlTpl->setVariable("site_name", SITE_NAME);
            $hdlTpl->parse("web_technique_image");
        }
        $hdlTpl->setVariable("page_title", $value["title"]);
        $hdlTpl->setVariable("shot_desc", $value["sdesc"]);
        $hdlTpl->parse("web_technique");
    }
}
$hdlTpl->setVariable("site_name", SITE_NAME);
$hdlTpl->parse("INDEX_PAGE");
echo $hdlTpl->get();