当前位置: 首页>>代码示例>>PHP>>正文


PHP page::template方法代码示例

本文整理汇总了PHP中page::template方法的典型用法代码示例。如果您正苦于以下问题:PHP page::template方法的具体用法?PHP page::template怎么用?PHP page::template使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在page的用法示例。


在下文中一共展示了page::template方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: showBar

 function showBar()
 {
     $page = new page();
     $cookie = md5(100000 * $this->rnd());
     if (!$_COOKIE["voteID"][$this->id]) {
         setcookie("voteID[" . $this->id . "]", $cookie, time() + 60 * 60 * 24 * 90, "/");
     }
     for ($i = $this->grade["min"]; $i <= $this->grade["max"]; $i++) {
         eval('$bar.="' . $page->template("modules/voteTr") . '";');
     }
     $color = $this->color;
     eval('$vote.="' . $page->template("modules/voteMain") . '";');
     return $vote;
 }
开发者ID:BackupTheBerlios,项目名称:sitexs,代码行数:14,代码来源:vote.class.php

示例2: content

 function content()
 {
     $db = new sql();
     $db->connect();
     if (time() < 1098388800) {
         $res = $db->query("select projects.id, name, company, category, sum(IF(grade is null,0, grade))/count(IF(grade is null,0, grade)) as gsum, count(grade) as gcount FROM projects left join votes on projects.id=votes.id group by projects.id, name, company, category order by gsum desc");
     } else {
         $res = $db->query("select projects.id, name, company, category, sum(IF(grade is null,0, grade))/count(IF(grade is null,0, grade)) as gsum, count(grade) as gcount FROM projects left join votes on projects.id=votes.id where grade>0 group by projects.id, name, company, category order by gsum desc");
     }
     $cats = array(1 => "A", "C", "Y");
     $tr = "";
     while ($data = $db->fetch_array($res)) {
         $res1 = $db->query("select * from categories where category_id={$data['category']}");
         $data1 = $db->fetch_array($res1);
         $url = "/projects/" . $cats[$data1["category_id"]] . "/";
         eval('$tr.="' . page::template("modules/resultTR") . '";');
     }
     if (!$tr) {
         $tr = "<p style=\"font-size: 0.85em;\">В настоящее время в данной номинации заявок не подано.</p><p style=\"font-size: 0.85em;\"><a href=\"/request/\">Заявки</a> принимаются до 15 октября 2004 года</p>";
     }
     $resultTr .= $tr;
     if ($resultTr) {
         eval('$projectsMain.="' . page::template("modules/resultMain") . '";');
     }
     $resultTr = "";
     if (time() < 1098388800) {
         $text = "<p>Здесь размещены текущие результаты голосования, обновляющиеся в режиме реального времени.</p><p>Для того, чтобы проголосовать за проект надо перейти на его страницу.</p><p>Вы можете поставить свою оценку каждому из 22 представленных проектов, но можете сделать это только 1 раз за весь период голосования.</p><p>Голосование открыто до 0:00 22 октября 2004 года.</p>";
     } else {
         $text = "<h3>Голование закрыто в&nbsp;0:00 22&nbsp;октября 2004&nbsp;года.</h3><p><i>При анализе хода голосования за&nbsp;проекты в&nbsp;интернете, Оргкомитет конкурса М2.&nbsp;Новый&nbsp;Дом&nbsp;2004. обнаружил многочисленные случаи злоупотребления при выставлении оценки 0&nbsp;баллов. В&nbsp;целях повышения релевантности итогов голосования, Оргкомитет принял решение не&nbsp;учитывать оценки 0&nbsp;баллов, выставленные за&nbsp;весь период голосования в&nbsp;интернете.</i></p>";
     }
     $this->elements["content"] = $text . $projectsMain;
 }
开发者ID:BackupTheBerlios,项目名称:sitexs,代码行数:32,代码来源:votelist.class.php

示例3: getenv

<?php

$dr = preg_replace("'/\$'", "", getenv("DOCUMENT_ROOT"));
include_once $dr . "/lib/streams.php";
include_once $dr . "/lib/gettext.php";
include_once $dr . "/lib/l10n.php";
include_once $dr . "/lib/db.conf.php";
include_once $dr . "/lib/mysql.class.php";
include_once $dr . "/lib/page.class.php";
$page = new page();
$page->parseURI();
$page->findPath();
$page->sendHeader();
$page->getElements();
$page->getConfig();
if ($page->get["version"] == "forprint") {
    $template_name = "mainPr";
} elseif ($page->dirs["id"][$page->dirs["count"] - 1] != 1) {
    $template_name = "second";
} else {
    $template_name = "main";
}
$main = $page->template($template_name, $page);
echo $main;
开发者ID:BackupTheBerlios,项目名称:sitexs,代码行数:24,代码来源:index.php

示例4: content

 function content()
 {
     if ($this->url) {
         $this->db->connect();
         if ($this->dirs[1]) {
             $where = " and DATE_FORMAT(FROM_UNIXTIME(time),\"%c\")='" . $this->dirs[1] . "'";
         }
         $res = $this->db->query("select * from (events left join events_types on events.type=events_types.type_id) left join events_formats on events.format=events_formats.format_id where DATE_FORMAT(FROM_UNIXTIME(time),\"%Y\")='" . $this->dirs[0] . "'{$where} order by time desc");
         while ($data = $this->db->fetch_array($res)) {
             $count = !$count;
             if ($count) {
                 $color = "#F0F0F0";
             } else {
                 $color = "#FFFFFF";
             }
             $data["date"] = date("d.m.Y", $data["time"]);
             eval('$eventsTR.="' . page::template("modules/eventsTR") . '";');
             $data1 = $data;
         }
         $this->properties["year"] = $data1["year"];
         if ($this->dirs[1]) {
             $this->properties["month"] = $data1["month"];
             $this->properties["ruMonth"] = $this->ruMonths[$data1["month"]];
         }
     } elseif ($this->query) {
         parse_str($this->query, $query);
         if ($query["action"] == "edit") {
             $eventsTR = "<tr><td>!</td></tr>";
         }
     } else {
         $this->db->connect();
         $res = $this->db->query("select * from (events left join events_types on events.type=events_types.type_id) left join events_formats on events.format=events_formats.format_id order by time desc");
         while ($data = $this->db->fetch_array($res)) {
             $count = !$count;
             if ($count) {
                 $color = "#F0F0F0";
             } else {
                 $color = "#FFFFFF";
             }
             $data["date"] = date("d.m.Y", $data["time"]);
             eval('$eventsTR.="' . page::template("modules/eventsTR") . '";');
         }
     }
     $_SESSION["HTTP_REFERER"] = "";
     if ($query["action"] == "edit") {
         $header = "–едактирование";
         $_SESSION["HTTP_REFERER"] = $_SERVER["HTTP_REFERER"];
         $action = "edit";
         $this->db->connect();
         $res = $this->db->query("select * from events where id={$query['id']}");
         $data = $this->db->fetch_array($res);
         $data["date"] = date("d.m.Y H:i", $data["time"]);
         if ($data["time_end"] > 0) {
             $data["date_end"] = date("d.m.Y H:i", $data["time_end"]);
         }
         $res_type = $this->db->query("select * from events_types order by type_name");
         while ($type = $this->db->fetch_array($res_type)) {
             $select_type .= "<option value=\"" . $type["type_id"] . "\"" . ($data["type"] == $type["type_id"] ? " selected" : "") . ">" . $type["type_name"] . "</option>";
         }
         $res_format = $this->db->query("select * from events_formats order by format_name");
         while ($format = $this->db->fetch_array($res_format)) {
             $select_format .= "<option value=\"" . $format["format_id"] . "\"" . ($data["format"] == $format["format_id"] ? " selected" : "") . ">" . $format["format_name"] . "</option>";
         }
         $data["text"] = str_replace("<br>", "\r", $data["text"]);
         $data["place"] = str_replace("<br>", "\r", $data["place"]);
         eval('$content="' . page::template("modules/eventsAdd") . '";');
     } elseif ($query["action"] == "add") {
         $header = "ƒобавление";
         $_SESSION["HTTP_REFERER"] = $_SERVER["HTTP_REFERER"];
         $action = "add";
         $this->db->connect();
         $data["date"] = date("d.m.Y H:i:s", time());
         $res_type = $this->db->query("select * from events_types order by type_name");
         while ($type = $this->db->fetch_array($res_type)) {
             $select_type .= "<option value=\"" . $type["type_id"] . "\"" . ($data["type"] == $type["type_id"] ? " selected" : "") . ">" . $type["type_name"] . "</option>";
         }
         $res_format = $this->db->query("select * from events_formats order by format_name");
         while ($format = $this->db->fetch_array($res_format)) {
             $select_format .= "<option value=\"" . $format["format_id"] . "\"" . ($data["format"] == $format["format_id"] ? " selected" : "") . ">" . $format["format_name"] . "</option>";
         }
         $data["add_person"] = $_SESSION["user"];
         eval('$content="' . page::template("modules/eventsAdd", "FORMPOST", array("fields[name]" => "EXISTS")) . '";');
     } else {
         eval('$content="' . page::template("modules/eventsMain") . '";');
     }
     $this->elements["content"] = $content;
 }
开发者ID:BackupTheBerlios,项目名称:sitexs,代码行数:87,代码来源:events.class.php


注:本文中的page::template方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。