本文整理汇总了PHP中clsTemplate::SetBlockVar方法的典型用法代码示例。如果您正苦于以下问题:PHP clsTemplate::SetBlockVar方法的具体用法?PHP clsTemplate::SetBlockVar怎么用?PHP clsTemplate::SetBlockVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类clsTemplate
的用法示例。
在下文中一共展示了clsTemplate::SetBlockVar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CCGetEvent
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow");
if ($_GET["id"] && !$_GET["submit"]){
$db = new clsDBNetConnect;
$query = "select * from feedback where `counter` = '" . $_GET["id"] . "'";
$db->query($query);
if (!$db->next_record()){
$query = "select * from feedback where id = '" . $_GET["id"] . "' and being_rated = '" . CCGetUserID() . "'";
$db->query($query);
if ($db->next_record()){
if ($db->f("rating") == 1)
$ratetext = "Positive";
if ($db->f("rating") == 0)
$ratetext = "Neutral";
if ($db->f("rating") == -1)
$ratetext = "Negative";
$Tpl->SetBlockVar("rate", "");
$Tpl->setVar("ItemNum", $db->f("ItemNum"));
$Tpl->setVar("usercomment", stripslashes($db->f("comment")));
$Tpl->setVar("rated_you", $ratetext);
$Tpl->setVar("id", $db->f("id"));
$query = "select * from purchases where id = '" . $db->f("purchase_id") . "'";
$db->query($query);
$db->next_record();
$Tpl->setVar("title", $db->f("title"));
$Tpl->Parse("counter", True);
}
else {
$Tpl->Parse("Error", True);
}
}
else {
示例2: CCGetEvent
//Go to destination page @1-BEB91355
if ($Redirect) {
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
header("Location: " . $Redirect);
exit;
}
//End Go to destination page
//Initialize HTML Template @1-A0111C9D
$CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView");
$Tpl = new clsTemplate();
include './Lang/lang_class.php';
$Tpl->LoadTemplate(TemplatePath . $TemplateFileName, "main");
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow");
//End Initialize HTML Template
if ($error) {
$Tpl->SetBlockVar("Error", "");
$Tpl->parse("Error", "");
}
$db = new clsDBNetConnect();
$query = "select sum(rating) from feedback where being_rated = '" . $_GET["user_id"] . "' and `counter` IS NULL";
$db->query($query);
if ($db->next_record()) {
$rating = $db->f("sum(rating)");
} else {
$rating = 0;
}
$query = "select count(rating) from feedback where being_rated = '" . $_GET["user_id"] . "' and `counter` IS NULL";
$db->query($query);
if ($db->next_record()) {
$total = $db->f("count(rating)");
} else {
示例3: clsDBNetConnect
} else {
$cats .= ")";
}
} else {
$cats .= ")";
}
} else {
$cats .= ")";
}
} else {
$cats .= ")";
}
/////////////////////////////////
//Custom Text Area Fields////////
/////////////////////////////////
$Tpl->SetBlockVar("Custom_TextArea", "");
$custtxt = new clsDBNetConnect();
$query = "select * from custom_textarea where {$cats} and `searchable` = '1'";
$custtxt->query($query);
if ($custtxt->next_record()) {
$custtxt->seek();
$queryfields = "(";
$count = 0;
while ($custtxt->next_record()) {
if ($count > 0) {
$queryfields .= " or ";
}
$queryfields .= "field_id='" . $custtxt->f("id") . "'";
$textvar[$custtxt->f("id")] = $custtxt->f("template_var");
$textdesc[$custtxt->f("id")] = $custtxt->f("description");
$textname[$custtxt->f("id")] = $custtxt->f("name");