function build() { try { if (!file_exists($this->_path . "widget.php")) { throw new Exception("Widget not found"); } $widget = new Template($this->_path); $widget->loadFile("widget.php"); $tpl = new Template(PATH_CMS . "templates/"); $tpl->content = $widget->buildVar(); $tpl->loadFile("widget.tpl.php"); return $tpl->buildVar(); } catch (Exception $e) { echo _t($e->getMessage()); } }
public function build() { $pref = new Pref("system"); $this->setMainTemplate($pref->template); $tpl = new Template(PATH_TEMPLATES); if (!USER_ID && !$this->isAllowed()) { header("location: " . page("user", "login")); } if (!USER_ID && $this->isAllowed()) { $tpl->login = true; } else { $tpl->login = false; } $tpl->loadFile("template.php"); $tpl->data = $this->data; $tpl->build(); }
} $this->setSidebar(true); $this->menu["System"] = page("admin", "settings", "system"); $this->menu["Time"] = page("admin", "settings", "time"); $this->menu["Members"] = page("admin", "settings", "members"); $this->menu["Cleanup"] = page("admin", "settings", "cleanup"); try { $acl = new Acl(USER_ID); if (!$acl->Access("z")) { throw new Exception("Access denied"); } $tpl = new Template(PATH_APPLICATIONS . "admin/tpl/settings/"); $action = isset($this->args["var_a"]) ? $this->args['var_a'] : ""; switch ($action) { default: $tpl->loadFile("system.php"); $this->setTitle("System Settings"); break; case 'time': $tpl->loadFile("time.php"); $this->setTitle("Time Settings"); break; case 'members': $tpl->loadFile("members.php"); $this->setTitle("Members Settings"); break; case 'cleanup': $tpl->loadFile("cleanup.php"); $this->setTitle("Cleanup Settings"); break; }
<?php /** * Copyright 2012, openTracker. (http://opentracker.nu) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @link http://opentracker.nu openTracker Project * @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @author Wuild * @package openTracker */ if (!defined("INCLUDED")) { die("Access denied"); } $this->setTitle("Admin - mySQL"); try { $acl = new Acl(USER_ID); if (!$acl->Access("z")) { throw new Exception("Access denied"); } $tpl = new Template(PATH_APPLICATIONS . "admin/tpl/mysql/"); $tpl->loadFile("query.php"); $tpl->build(); } catch (Exception $e) { echo error(_t($e->getMessage())); }
* Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @link http://opentracker.nu openTracker Project * @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @author Wuild * @package openTracker */ if (!defined("INCLUDED")) { die("Access denied"); } $this->setTitle("Torrent Details"); try { if (!isset($_GET['id'])) { throw new Exception("missing id"); } if (!intval($_GET['id'])) { throw new Exception("invalid id"); } $db = new DB("torrents_imdb"); $db->select("imdb_torrent = '" . $db->escape($_GET['id']) . "'"); $tpl = new Template(PATH_APPLICATIONS . "torrent/tpl/"); if ($db->numRows()) { $tpl->loadFile("details_imdb.php"); } else { $tpl->loadFile("details.php"); } $tpl->build(); } catch (Exception $e) { echo error(_t($e->getMessage())); }
/** * Send an email with the noreply_email setting in the pref * * @param string $to The address to send the email to * @param string $subject The subject of the email * @param string $body The body of the email * * @return boolean $mail */ function sendEmail($to, $subject, $body) { $pref = new Pref("website"); $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: " . $pref->noreply_email . "\r\n"; $tpl = new Template(PATH_CMS . "templates/"); $tpl->content = $body; $tpl->loadFile("email.tpl.php"); $body = $tpl->buildVar(); $mail = mail($to, $subject, $body, $headers); if ($mail) { return $mail; } else { die("could not send email"); } }
/** * Copyright 2012, openTracker. (http://opentracker.nu) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @link http://opentracker.nu openTracker Project * @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @author Wuild * @package openTracker */ $acl = new Acl(USER_ID); $wpref = new Pref("website"); $control = new Template(PATH_APPLICATIONS . $this->data['url']['application'] . "/"); $control->loadFile($this->data['url']['action'] . ".php"); $control->args = $this->data; $content = $control->buildVar(); $title = $control->title != "" ? " - " . $control->title : ""; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <base href="<?php echo CMS_URL; ?> " /> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <title><?php
<?php $this->setTitle("Admin - Settings"); $this->setSidebar(true); try { $acl = new Acl(USER_ID); if (!$acl->Access("z")) { throw new Exception("Access denied"); } $tpl = new Template(PATH_APPLICATIONS . "admin/tpl/settings/"); $tpl->loadFile("main.php"); $tpl->build(); } catch (Exception $e) { echo error(_t($e->getMessage())); }
$this->setTitle("Admin - Forum"); $this->addJavascript("sortable.js"); $this->setSidebar(true); try { $acl = new Acl(USER_ID); if (!$acl->Access("x")) { throw new Exception("Access denied"); } $this->menu["Forums"] = page("admin", "forum"); $this->menu["Create forum category"] = page("admin", "forum", "create-category"); $this->menu["Create forum"] = page("admin", "forum", "create-forum"); $action = isset($this->args["var_a"]) ? $this->args['var_a'] : ""; $tpl = new Template(PATH_APPLICATIONS . "admin/tpl/forum/"); switch ($action) { default: $tpl->loadFile("main.php"); break; case 'create-forum': $tpl->loadFile("create-forum.php"); break; case 'edit-forum': $tpl->loadFile("edit-forum.php"); break; case 'create-category': $tpl->loadFile("create-category.php"); break; case 'edit-category': $tpl->loadFile("edit-category.php"); break; case 'delete-forum': $tpl->loadFile("delete-forum.php");
$uid = $_GET['uid']; $acl = new Acl($uid); echo "<h4>" . _t("Conversation with") . " " . $acl->name . "</h4>"; $tpl = new Template(PATH_APPLICATIONS . "profile/tpl/"); $tpl->uid = $uid; $tpl->loadFile("convo_reply.php"); $tpl->build(); $db = new DB("messages"); $db->setColPrefix("message_"); $db->setSort("message_added DESC"); $db->select("message_sender = '" . USER_ID . "' AND message_receiver = '" . $uid . "' OR message_sender = '" . $uid . "' AND message_receiver = '" . USER_ID . "'"); if ($db->numRows()) { while ($db->nextRecord()) { $tpl = new Template(PATH_APPLICATIONS . "profile/tpl/"); $tpl->item = $db->id; $tpl->loadFile("convo_item.php"); $tpl->build(); } $db = new DB("messages"); $db->message_unread = "no"; $db->update("message_sender = '" . $uid . "' AND message_receiver = '" . USER_ID . "'"); } else { echo _t("No messages in this conversation yet."); } } catch (Exception $e) { echo error(_t($e->getMessage())); } break; } ?> </div>
echo page("forums", "delete-post", "", "", "", "id=" . $db->post_id . "&confirm"); ?> "> <span class="btn red">Delete</span> </a> <?php } ?> <a href="<?php echo page("forums", "quote-post", "", "", "", "post=" . $db->post_id); ?> "> <span class="btn">Quote</span> </a> </td> </tr> </tbody> </table> <br /> <?php } echo $pagemenu; $tpl = new Template(PATH_APPLICATIONS . "forums/tpl/"); $tpl->loadFile("reply.php"); $tpl->topic_id = $id; $tpl->build(); } catch (Exception $e) { echo error(_t($e->getMessage())); }
*/ if (!defined("INCLUDED")) { die("Access denied"); } $this->setTitle("Admin - Support"); $this->setSidebar(true); try { $acl = new Acl(USER_ID); if (!$acl->Access("x")) { throw new Exception("Access denied"); } $action = isset($this->args["var_a"]) ? $this->args['var_a'] : ""; $tpl = new Template(PATH_APPLICATIONS . "admin/tpl/support/"); switch ($action) { default: $tpl->loadFile("main.php"); break; case 'view': $tpl->loadFile("view.php"); break; case 'delete': $tpl->loadFile("delete.php"); break; } $tpl->build(); } catch (Exception $e) { echo error(_t($e->getMessage())); } ?>
} $this->setTitle("Admin - Widgets"); $this->addJavascript("sortable.js"); $this->setSidebar(true); try { $acl = new Acl(USER_ID); if (!$acl->Access("x")) { throw new Exception("Access denied"); } $action = isset($this->args["var_a"]) ? $this->args['var_a'] : ""; $this->menu["Widgets"] = page("admin", "widgets"); $this->menu["Install Widget"] = page("admin", "widgets", "install"); $tpl = new Template(PATH_APPLICATIONS . "admin/tpl/widgets/"); switch ($action) { default: $tpl->loadFile("main.php"); break; case 'edit': $tpl->id = isset($_GET['id']) ? $_GET['id'] : false; $tpl->loadFile("edit.php"); break; case 'delete': $tpl->loadFile("delete.php"); break; case 'install': $tpl->loadFile("install.php"); break; } $tpl->build(); } catch (Exception $e) { echo error(_t($e->getMessage()));
<?php $this->setTitle("Admin - Members"); $this->setSidebar(true); try { $acl = new Acl(USER_ID); if (!$acl->Access("x")) { throw new Exception("Access denied"); } $action = isset($this->args["var_a"]) ? $this->args['var_a'] : ""; $tpl = new Template(PATH_APPLICATIONS . "admin/tpl/members/"); switch ($action) { default: $tpl->loadFile("main.php"); break; case 'edit': $tpl->userid = getID($this->args['var_b']) ? getID($this->args['var_b']) : 0; $tpl->loadFile("edit.php"); break; case 'log': $tpl->userid = getID($this->args['var_b']) ? getID($this->args['var_b']) : 0; $tpl->loadFile("log.php"); break; case 'create': $tpl->loadFile("create.php"); break; } $tpl->build(); } catch (Exception $e) { echo error(_t($e->getMessage())); }
<?php $this->setTitle("Admin - News"); $this->setSidebar(true); try { $acl = new Acl(USER_ID); if (!$acl->Access("x")) { throw new Exception("Access denied"); } $action = isset($this->args["var_a"]) ? $this->args['var_a'] : ""; $tpl = new Template(PATH_APPLICATIONS . "admin/tpl/news/"); switch ($action) { default: $tpl->loadFile("main.php"); break; case 'edit': $tpl->loadFile("edit.php"); break; case 'delete': $tpl->loadFile("delete.php"); break; case 'compose': $tpl->loadFile("compose.php"); break; } $tpl->build(); } catch (Exception $e) { echo error(_t($e->getMessage())); } ?>
<?php $this->setTitle("Admin - Settings"); $this->setSidebar(true); try { $acl = new Acl(USER_ID); if (!$acl->Access("z")) { throw new Exception("Access denied"); } $tpl = new Template(PATH_APPLICATIONS . "admin/tpl/translations/"); $action = isset($this->args["var_a"]) ? $this->args['var_a'] : ""; switch ($action) { default: $tpl->loadFile("main.php"); break; case 'edit': $tpl->lang_id = isset($this->args['var_b']) ? $this->args['var_b'] : 0; $tpl->loadFile("edit.php"); break; case 'import': $tpl->loadFile("import.php"); break; case 'export': $tpl->lang_id = isset($this->args['var_b']) ? $this->args['var_b'] : 0; $tpl->loadFile("export.php"); break; case 'delete': $tpl->loadFile("delete.php"); break; case 'create': $tpl->loadFile("create.php");
<?php session_start(); ini_set("display_errors", true); error_reporting(E_ALL); include "../rootSettings.php"; include PATH_LIBRARY . "Template.php"; include "parser.php"; $tpl = new Template(PATH_ROOT . "setup/"); $action = isset($_GET['action']) ? $_GET['action'] : ""; $step = new Template(PATH_ROOT . "setup/tpl/"); $_SESSION['action'] = isset($_SESSION['action']) ? $_SESSION['action'] : false; switch ($action) { default: $step->loadFile("welcome.php"); break; case 'step1': $step->loadFile("step1.php"); break; case 'step2': $step->loadFile("step2.php"); break; case 'step3': $step->loadFile("step3.php"); break; case 'step4': $step->loadFile("step4.php"); break; case 'step5': $step->loadFile("step5.php"); break;