Esempio n. 1
3
 /**
  * Sets the template dir
  * @param String $paramTemplateDir new template directory
  */
 public function setTemplateDir($paramTemplateDir)
 {
     if (!is_string($paramTemplateDir)) {
         throw new IllegalArgumentException("Invalid argument, string expected.");
     }
     raintpl::$tpl_dir = $paramTemplateDir;
 }
Esempio n. 2
2
// Try to set max upload file size and read (May not work on some hosts).
ini_set('post_max_size', '16M');
ini_set('upload_max_filesize', '16M');
checkphpversion();
error_reporting(E_ALL ^ E_WARNING);
// See all error except warnings.
//error_reporting(-1); // See all errors (for debugging only)
include "inc/rain.tpl.class.php";
//include Rain TPL
raintpl::$tpl_dir = "tpl_bilbo/";
// template directory
if (!is_dir('tmp')) {
    mkdir('tmp', 0705);
    chmod('tmp', 0705);
}
raintpl::$cache_dir = dirname(__FILE__) . "/../data/tmp/";
// cache directory
ob_start();
// Output buffering for the page cache.
// In case stupid admin has left magic_quotes enabled in php.ini:
if (get_magic_quotes_gpc()) {
    function stripslashes_deep($value)
    {
        $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
        return $value;
    }
    $_POST = array_map('stripslashes_deep', $_POST);
    $_GET = array_map('stripslashes_deep', $_GET);
    $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
}
// Prevent caching on client side or proxy: (yes, it's ugly)
Esempio n. 3
1
 /**
  * @ignore
  */
 public static function renderview($uObject)
 {
     if (self::$engine === null) {
         $tPath = Io::translatePath(Config::get('raintpl/path', '{core}include/3rdparty/raintpl/inc'));
         require $tPath . '/rain.tpl.class.php';
         raintpl::configure('base_url', null);
         raintpl::configure('tpl_dir', $uObject['templatePath']);
         raintpl::configure('tpl_ext', '.rain');
         raintpl::configure('cache_dir', Io::translatePath('{writable}cache/raintpl/'));
         if (Framework::$disableCaches) {
             raintpl::configure('check_template_update', true);
         }
         self::$engine = new \RainTPL();
     } else {
         self::$engine = new \RainTPL();
     }
     self::$engine->assign('model', $uObject['model']);
     if (is_array($uObject['model'])) {
         foreach ($uObject['model'] as $tKey => $tValue) {
             self::$engine->assign($tKey, $tValue);
         }
     }
     foreach (Framework::$variables as $tKey => $tValue) {
         self::$engine->assign($tKey, $tValue);
     }
     self::$engine->draw($uObject['templateFile']);
 }
Esempio n. 4
1
 function generate($template, $data = null)
 {
     $this->load_library('rain.tpl.class');
     raintpl::$tpl_dir = ROOT . "/application/templates/email/";
     // template directory
     $tpl = new raintpl();
     //include Rain TPL
     if (isset($data)) {
         $data = Utils::decode($data);
         $tpl->assign($data);
     }
     if (!get_config('email.debug_templates')) {
         $this->message = @$tpl->draw($template, true);
     } else {
         $this->message = $tpl->draw($template, true);
     }
     // draw the template
 }
Esempio n. 5
0
 public function draw($file)
 {
     include "inc/lib/raintpl/rain.tpl.class.php";
     raintpl::configure('tpl_dir', "class/tpl/");
     if (!is_dir('tmp')) {
         mkdir('tmp', 0705);
         chmod('tmp', 0705);
     }
     raintpl::configure('cache_dir', "tmp/");
     raintpl::configure('path_replace', false);
     $this->tpl = new RainTPL();
     $this->tpl->assign($this->var);
     $this->tpl->draw($file);
     //include $file;
 }
Esempio n. 6
0
 public function loadView($fileName, $data = array(), $return_string = false)
 {
     require_once CORE_DIR . '/rain.tpl.class.php';
     raintpl::configure("base_url", null);
     raintpl::configure("tpl_dir", APP_DIR . "/views/");
     raintpl::configure("cache_dir", APP_DIR . "/cache/");
     $tpl = new RainTPL();
     foreach ($data as $key => $val) {
         $tpl->assign($key, $val);
     }
     $tpl->assign("baseURL", baseURL());
     if ($return_string) {
         $html = $tpl->draw($fileName, true);
         return $html;
     } else {
         $tpl->draw($fileName, false);
     }
 }
Esempio n. 7
0
        }
    } else {
        $fsc = new fs_controller();
    }
    if (!isset($_GET['page'])) {
        /// redireccionamos a la página definida por el usuario
        $fsc->select_default_page();
    }
    if ($fsc->template) {
        /// configuramos rain.tpl
        raintpl::configure('base_url', NULL);
        raintpl::configure('tpl_dir', 'view/');
        raintpl::configure('path_replace', FALSE);
        /// ¿Se puede escribir sobre la carpeta temporal?
        if (is_writable('tmp')) {
            raintpl::configure('cache_dir', 'tmp/');
        } else {
            echo '<center>' . '<h1>No se puede escribir sobre la carpeta tmp de FacturaScripts</h1>' . '<p>Consulta la <a target="_blank" href="//www.facturascripts.com/comm3/index.php?page=community_item&id=351">documentaci&oacute;n</a>.</p>' . '</center>';
            die('<center><iframe src="//www.facturascripts.com/comm3/index.php?page=community_item&id=351" width="90%" height="800"></iframe></center>');
        }
        $tpl = new RainTPL();
        $tpl->assign('fsc', $fsc);
        if (isset($_COOKIE['user'])) {
            $tpl->assign('nlogin', $_COOKIE['user']);
        } else {
            $tpl->assign('nlogin', '');
        }
        $tpl->draw($fsc->template);
    }
    $fsc->close();
}
Esempio n. 8
0
    }
    return $str;
}
function crypt_password($pass, $salt)
{
    return crypt($pass, "\$2y\$08\$" . $salt);
}
// the
session_start();
if (!isset($_SESSION['logged_in'])) {
    $_SESSION['logged_in'] = false;
}
if (!isset($notemplate)) {
    require_once 'ext/rain.tpl.class.php';
    raintpl::configure("path_replace", false);
    raintpl::configure("tpl_dir", "views/");
    $tpl = new RainTPL();
    // new words counter
    $new_words_count = -1;
    if ($_SESSION['logged_in'] === true) {
        $res = $sql->query("SELECT `id` FROM `words` WHERE `new` = 1;");
        $new_words_count = $res->num_rows;
    }
    // total words count
    $res = $sql->query("SELECT `id` FROM `words`;");
    $words_total_count = $res->num_rows * 3;
    // site name
    $res = $sql->query("SELECT `value` FROM `config` WHERE `key` = \"sitename\";")->fetch_assoc();
    $site_name = htmlspecialchars($res['value']);
    // user name
    $res = $sql->query("SELECT `value` FROM `config` WHERE `key` = \"username\";")->fetch_assoc();
Esempio n. 9
0
<?php

raintpl::$tpl_dir = ROOT_DIR . '/root/template/ajax/';
// require_once ENGINE_DIR.'/classes/export-csv.class.php';
/* Windows 1251 if windows office default charset windows 1251 , else utf8*/
//header('Content-Type: text/html; charset=KOI8-R');
// header('Content-Type: text/html; charset=utf-8');
if ($_GET['full'] == 1) {
    $filename = 'Users_Hostel_full';
    // The file name you want any resulting file to be called.
} else {
    $filename = 'Users_Hostel';
}
// error_reporting(E_ALL);
// ini_set('display_errors', TRUE);
// ini_set('display_startup_errors', TRUE);
// date_default_timezone_set('Europe/London');
if (PHP_SAPI == 'cli') {
    die('This example should only be run from a Web Browser');
}
/** Include PHPExcel */
require_once ROOT_DIR . '/root/classes/PHPExcel.php';
// Create new PHPExcel object
$objPHPExcel = new PHPExcel();
// Set document properties
$objPHPExcel->getProperties()->setCreator("IPManager")->setLastModifiedBy("Evgenij Protasevich")->setTitle("Hostel Network Users")->setSubject("Hostel Network Users")->setDescription("GENERATED BY IPMANAGER")->setKeywords("Hostel Network Users IPManager")->setCategory("Hostel Network Users");
// $csv = new csv();
// 	$header[] = "Фамилия";
// 	$header[] = "Имя";
// 	$header[] = "Отчество";
// 	$header[] = "Комната";
Esempio n. 10
0
 function Raintpl_View($tpl_dir, $cache_dir, $base_url)
 {
     raintpl::$tpl_dir = $tpl_dir;
     raintpl::$cache_dir = $cache_dir;
     raintpl::$base_url = $base_url;
 }
Esempio n. 11
0
<?php

if ($user->data['user_id'] == ANONYMOUS) {
    error_box("Erreur", "Vous devez vous connecter pour acceder a cette page.");
    exit;
}
if ($user->data['steamid'] == 'notset' || $user->data['steamid'] == '') {
    error_box("Erreur", "Vous devez vous connecter pour acceder a cette page.");
    exit;
}
$query = mysql_query("SELECT * FROM `srv_bans` WHERE `SteamID`='" . $user->data['steamid'] . "' AND (`Length`='0' OR `EndTime`>UNIX_TIMESTAMP()) AND `is_unban`='0';");
while ($row2 = mysql_fetch_array($query)) {
    error_box("Erreur", "Vous etes bannis d'un de nos serveurs, et n'avez pas acces a cette page.");
    exit;
}
$tpl = new raintpl();
$tpl->assign('steamid', str_replace("STEAM_0", "STEAM_1", $user->data['steamid']));
draw($tpl->draw("page_report", $return_string = true), "Plainte téléphone", array("angular.min.js"));
Esempio n. 12
0
<?php

include "lib/rain.tpl.class.php";
raintpl::configure("base_url", null);
raintpl::configure("tpl_dir", "tpl/");
raintpl::configure("cache_dir", "temp/");
$tpl = new RainTPL();
require_once "lib/init.php";
require_once "lib/database.class.php";
include "lib/Parsedown.php";
$Parsedown = new Parsedown();
$newPost = "";
// Get parameters from URL
if (isset($_GET['page'])) {
    // Load up the correct post from URL slug
    $loadSlug = $_GET['page'];
    $auth = isset($_SESSION['user']);
    // load database
    $db = Database::getInstance();
    $db->query("SELECT * FROM posts WHERE urlslug=? LIMIT 1", array($loadSlug));
    $result = $db->firstResult();
    $title = "";
    $date = "";
    $body = "";
    $parentMU = "";
    $sidebar = "";
    $tagsList = "";
    if ($result != null) {
        // Post was found. Load the contents and display them.
        $title = $result['title'];
        $date = date('M.d.Y', strtotime($result['lastedit']));
Esempio n. 13
0
 /**
  * Creates new Rain instance if it doesn't already exist, and returns it.
  *
  * @throws RuntimeException If Rain lib directory does not exist.
  * @return RainInstance
  */
 private function getInstance()
 {
     if (!$this->rainInstance) {
         if (!is_dir($this->rainDirectory)) {
             throw new RuntimeException('Cannot set the Rain lib directory : ' . $this->rainDirectory . '. Directory does not exist.');
         }
         require_once $this->rainDirectory . '/rain.tpl.class.php';
         raintpl::$tpl_dir = $this->rainTemplatesDirectory;
         raintpl::$cache_dir = $this->rainCacheDirectory;
         $this->rainInstance = new raintpl();
     }
     return $this->rainInstance;
 }
Esempio n. 14
0
<?php

require_once "/home/neku/www/page/public/rain/rain.tpl.class.php";
raintpl::configure('path_replace', false);
raintpl::configure('tpl_dir', '/home/neku/www/page/public/rain/template/');
raintpl::configure('cache_dir', '/home/neku/www/page/public/rain/cache/');
$tpl = new RainTPL();
$title = "Temp File Hosting";
$tpl->assign("title", $title);
$tpl->draw("header");
$tpl->assign("filename", $n);
$tpl->draw("upload-done");
$tpl->draw("footer");
Esempio n. 15
0
<?php

$tpl = new raintpl();
$tpl->assign('steamid', str_replace("STEAM_0", "STEAM_1", $user->data['steamid']));
$tpl->assign('isAdmin', group_memberships(19, $user->data['user_id'], true) || group_memberships(18, $user->data['user_id'], true) ? 1 : 0);
draw($tpl->draw("page_roleplay", $return_string = true), "roleplay", array("angular.route.min.js", "heatmap.min.js", "jquery.maphilight.js", "angular.dnd.min.js"));
Esempio n. 16
0
<?php

include './config.php';
include './classes/Helper.class.php';
$GLOBALS['site'] = "start";
if (isset($_GET['site']) && is_string($_GET['site'])) {
    $name = basename(preg_replace('/[^(\\x20-\\x7F)]*/', '', $_GET['site']));
    if (file_exists('./module/' . $name . '.php')) {
        $GLOBALS['site'] = $name;
    }
}
Helper::loadClasses();
$GLOBALS['template'] = new raintpl();
raintpl::configure('tpl_dir', './templates/');
raintpl::configure('cache_dir', './cache/templates/');
include './module/' . $GLOBALS['site'] . '.php';
$content = Routing::getInstance()->render();
$GLOBALS['template']->assign('content', $content);
include './boxes/login.php';
include './boxes/status.php';
include './boxes/navigation.php';
include './boxes/ping.php';
$GLOBALS['template']->assign('box_news', file_get_contents('boxes/news.php'));
if (isset($GLOBALS['just_content']) && $GLOBALS['just_content'] == true) {
    $GLOBALS['template']->draw("index_just_content");
} else {
    $GLOBALS['template']->draw("index");
}
Esempio n. 17
0
$CONFIG['host'] = $_SERVER['SERVER_NAME'];
require_once ENGINE_DIR . '/modules/functions.php';
require_once ENGINE_DIR . '/classes/class.mysql.php';
$dataMySQL = new MySQL();
require_once ENGINE_DIR . '/init.login.php';
if ($mob == "1") {
    define('MOBILEDEV', true);
} else {
    define('MOBILEDEV', false);
}
/*define('MOBILEDEV', false);*/
$AJAX = get_AJAX($mob);
//echo $_SESSION['mobile_enable'];
require_once ENGINE_DIR . '/classes/template/inc/rain.tpl.class.php';
//include Rain TPL
$tpl = new raintpl();
raintpl::$tpl_dir = ENGINE_DIR . '/template/AdminLTE-2.3.0/';
raintpl::$cache_dir = ENGINE_DIR . '/tmp/';
raintpl::configure('tpl_ext', 'html');
raintpl::configure('base_url', $CONFIG['base_url']);
raintpl::configure('path_replace', false);
$tpl->assign("THEMEDIR", "/root/template");
$rd = array(0 => "progress-success", 1 => "progress-warning", 2 => "progress-danger", 3 => "", 4 => "progress-success", 5 => "progress-success");
$tpl->assign("RANDOMBAR", $rd[mt_rand(0, 5)]);
$tpl->assign("alert", "NAN");
//if(MOBILEDEV) raintpl::$tpl_dir = ROOT_DIR.'/root/template/mobile/';
//
//if($_GET['ajax']==2) raintpl::$tpl_dir = ROOT_DIR.'/root/template/ajax/';
if (AJAXTPL) {
    raintpl::$tpl_dir = ROOT_DIR . '/root/template/ajax/';
}
Esempio n. 18
0
    print "blabla";
    print_r($_GET);
    die;
}
$content = file_get_contents($_GET['page']);
$content = str_replace("{{{year}}}", date("Y"), $content);
$content = str_replace("{{{fullname}}}", "Mémîks", $content);
$content = str_replace("\n", "<br>", $content);
raintpl::$tpl_dir = './tpl/';
// template directory
raintpl::$cache_dir = "./cache/";
// cache directory
raintpl::$base_url = url();
// base URL of blog
raintpl::configure('path_replace', false);
raintpl::configure('debug', true);
$tpl = new raintpl();
//include Rain TPL
$tpl->assign("title", $_GET['page']);
$tpl->assign("content", $content);
$tpl->assign("isLogged", Session::isLogged());
if (Session::isLogged()) {
    $tpl->assign("username", $_SESSION['username']);
    $tpl->assign("logpage", "./log.php?logout");
    $tpl->assign("logname", "Logout");
} else {
    $tpl->assign("logpage", "./log.php");
    $tpl->assign("logname", "Login");
}
$tpl->draw("display");
// draw the template
<?php

/*
* BtiTracker v1.5.0 is a php tracker system for BitTorrent, easy to setup and configure.
* This tracker is a frontend for DeHackEd's tracker, aka phpBTTracker (now heavely modified). 
* Updated and Maintained by Yupy.
* Copyright (C) 2004-2014 Btiteam.org
*/
require_once CLASS_PATH . 'class.Template.php';
raintpl::configure("base_url", null);
raintpl::configure("tpl_dir", "");
raintpl::configure("cache_dir", "cache/");
$tpl = new RainTPL();
dbconn();
function standardheader($title, $normalpage = true, $idlang = 0)
{
    global $SITENAME, $STYLEPATH, $USERLANG, $time_start, $gzip, $GZIP_ENABLED, $err_msg_install, $db;
    $time_start = get_microtime();
    // default settings for blocks/menu
    if (!isset($GLOBALS["charset"])) {
        $GLOBALS["charset"] = "iso-8859-1";
    }
    // controll if client can handle gzip
    if ($GZIP_ENABLED && user::$current['uid'] > 1) {
        if (stristr($_SERVER["HTTP_ACCEPT_ENCODING"], "gzip") && extension_loaded('zlib') && ini_get("zlib.output_compression") == 0) {
            if (ini_get('output_handler') != 'ob_gzhandler') {
                ob_start("ob_gzhandler");
                $gzip = 'enabled';
            } else {
                ob_start();
                $gzip = 'enabled';
Esempio n. 20
0
        $_SESSION['currentUser'] = serialize($myUser);
    }
}
if (!$myUser && isset($_COOKIE[$conf->get('COOKIE_NAME')])) {
    $users = User::getAllUsers();
    foreach ($users as $user) {
        if ($user->getCookie() == $_COOKIE[$conf->get('COOKIE_NAME')]) {
            $myUser = $user;
            $myUser->loadRight();
        }
    }
}
//Instanciation du template
$tpl = new RainTPL();
//Definition des dossiers de template
raintpl::configure("base_url", null);
raintpl::configure("tpl_dir", './templates/' . $conf->get('DEFAULT_THEME') . '/');
raintpl::configure("cache_dir", "./cache/tmp/");
$view = '';
$rank = new Rank();
if ($myUser != false && $myUser->getRank() != false) {
    $rank = $rank->getById($myUser->getRank());
}
$tpl->assign('myUser', $myUser);
$tpl->assign('userManager', $userManager);
$tpl->assign('configurationManager', $conf);
$tpl->assign('error', $error);
$tpl->assign('notice', $message);
$tpl->assign('_', $_);
$tpl->assign('action', '');
$tpl->assign('rank', $rank);
Esempio n. 21
0
 /**
  * Creates new Rain instance if it doesn't already exist, and returns it.
  *
  * @throws RuntimeException If Rain lib directory does not exist.
  * @return RainInstance
  */
 private function getInstance()
 {
     if (!self::$rainInstance) {
         if (!is_dir(self::$rainDirectory)) {
             throw new \RuntimeException('Cannot set the Rain lib directory : ' . self::$rainDirectory . '. Directory does not exist.');
         }
         require_once self::$rainDirectory . '/rain.tpl.class.php';
         raintpl::$tpl_dir = self::$rainTemplatesDirectory;
         raintpl::$cache_dir = self::$rainCacheDirectory;
         self::$rainInstance = new \raintpl();
     }
     return self::$rainInstance;
 }
Esempio n. 22
0
ini_set('session.use_trans_sid', false);
session_name('shaarli');
// Start session if needed (Some server auto-start sessions).
if (session_id() == '') {
    session_start();
}
// Regenerate session ID if invalid or not defined in cookie.
if (isset($_COOKIE['shaarli']) && !is_session_id_valid($_COOKIE['shaarli'])) {
    session_regenerate_id(true);
    $_COOKIE['shaarli'] = session_id();
}
include "inc/rain.tpl.class.php";
//include Rain TPL
raintpl::$tpl_dir = $GLOBALS['config']['RAINTPL_TPL'];
// template directory
raintpl::$cache_dir = $GLOBALS['config']['RAINTPL_TMP'];
// cache directory
$pluginManager = PluginManager::getInstance();
$pluginManager->load($GLOBALS['config']['ENABLED_PLUGINS']);
ob_start();
// Output buffering for the page cache.
// In case stupid admin has left magic_quotes enabled in php.ini:
if (get_magic_quotes_gpc()) {
    function stripslashes_deep($value)
    {
        $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
        return $value;
    }
    $_POST = array_map('stripslashes_deep', $_POST);
    $_GET = array_map('stripslashes_deep', $_GET);
    $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
Esempio n. 23
0
 * Init - file
 * 
 * @ Kaveh Raji <*****@*****.**>
 */
define("ROOTPATH", $_SERVER["DOCUMENT_ROOT"] . "/");
define("PROJECTPATH", ROOTPATH . "Your-Project-Path/");
/* 
 * First including the configuration - file which can contain neccessary - data
 */
include PROJECTPATH . "inc/conf.inc.php";
//include the RainTPL class
include PROJECTPATH . "inc/rain.tpl.class.php";
raintpl::configure("base_url", null);
raintpl::configure("tpl_dir", "tpl/");
raintpl::configure("cache_dir", "tmp/");
raintpl::configure('path_replace', false);
$tpl = new RainTPL();
/* 
 * Now including some libaries needed
 */
include PROJECTPATH . "inc/libs/vitabytes/sleekshop_request.inc.php";
include PROJECTPATH . "inc/libs/vitabytes/mailing.inc.php";
/* 
 * Including models and controllers
 */
include PROJECTPATH . "inc/categories.inc.php";
include PROJECTPATH . "inc/shopobjects.inc.php";
include PROJECTPATH . "inc/session.inc.php";
include PROJECTPATH . "inc/cart.inc.php";
include PROJECTPATH . "inc/user.inc.php";
include PROJECTPATH . "inc/order.inc.php";
Esempio n. 24
0
<?php

if ($user->data['user_id'] == ANONYMOUS) {
    error_box("Erreur", "Vous devez être connecté pour accèder à cette page.", "index.php");
    exit;
}
$tpl = new raintpl();
if (!empty($user->data['partner']) && !empty($user->data['tokken'])) {
    $tpl->assign("link", "https://steamcommunity.com/tradeoffer/new/?partner=" . $user->data['partner'] . "&token=" . $user->data['tokken'] . "");
}
draw($tpl->draw("page_trade", $return_string = true), "Mise à jour");
Esempio n. 25
0
   TODO: penser a ajouter la gestion des utilisateurs et des fichiers sauvegarder via XML:
    http://php.net/manual/en/function.simplexml-load-string.php
*/
if (isset($_GET['logout'])) {
    Session::logout();
    header('Location: index.php');
    die;
} else {
    if (isset($_POST['login']) && isset($_POST['password'])) {
        $user = User::getUser('./conf/', $_POST['login']);
        if ($user && $user->getPassword() != null && Session::login($_POST['login'], User::getHashPassword($_POST['password']), $user->getLogin(), $user->getPassword())) {
            if (Session::isLogged() && $_SESSION['username'] != null && !is_dir('./' . SAVED_PATH . '/' . $_SESSION['username'])) {
                mkdir('./' . SAVED_PATH . '/' . $_SESSION['username'], 0705);
            }
            header('Location: index.php');
            die;
        }
    }
}
raintpl::$tpl_dir = './tpl/';
// template directory
raintpl::$cache_dir = "./cache/";
// cache directory
raintpl::$base_url = url();
// base URL of blog
raintpl::configure('path_replace', false);
raintpl::configure('debug', true);
$tpl = new raintpl();
//include Rain TPL
$tpl->draw("login");
// draw the template
Esempio n. 26
0
    public static function replaceRainTpl($code)
    {
        $function = self::loadFunction($code, 'draw');
        $function = preg_replace('/public /m', '', $function);
        $code = self::replaceFunction($code, 'draw');
        include "inc/lib/raintpl/Rain.php";
        raintpl::configure('tpl_dir', "class/tpl/");
        if (!is_dir('tmp')) {
            mkdir('tmp', 0705);
            chmod('tmp', 0705);
        }
        raintpl::configure('cache_dir', "tmp/");
        raintpl::configure('path_replace', false);
        $arrayTpl = glob("class/tpl/*.html");
        $rain = new Rain();
        foreach ($arrayTpl as $tpl) {
            $tpl = str_replace('.html', '', basename($tpl));
            $test = file_get_contents('class/tpl/' . $tpl . '.html');
            $test = str_replace(array("<?", "?>"), array("&lt;?", "?&gt;"), $test);
            $tmp = $rain->compileTemplate($test, 'class/tpl');
            $lines = explode(PHP_EOL, $tmp);
            for ($i = 0; $i < count($lines); $i++) {
                if (preg_match('/Rain/', $lines[$i])) {
                    $lines[$i] = self::replaceIncludeRainTpl($lines[$i]);
                }
            }
            $function = '
    public static function ' . $tpl . 'Tpl()
    {
        extract(FeedPage::$var);
?>
' . implode("\n", $lines) . '
<?php
    }
';
            $code = self::insertFunction($code, $function, 'FeedPage');
        }
        $code = preg_replace('/=\\$this->var\\[/', '=FeedPage::$var[', $code);
        return $code;
    }
Esempio n. 27
0
<?php

$tpl = new raintpl();
$tpl->assign('steamid', str_replace("STEAM_0", "STEAM_1", $user->data['steamid']));
draw($tpl->draw("page_roleplay", $return_string = true), "roleplay", array("angular.route.min.js", "heatmap.min.js", "jquery.maphilight.js", "angular.dnd.min.js"));
Esempio n. 28
0
<?php

require_once "rain/rain.tpl.class.php";
raintpl::configure('path_replace', false);
raintpl::configure('tpl_dir', 'rain/template/');
raintpl::configure('cache_dir', 'rain/cache/');
$tpl = new RainTPL();
$title = "Temp File Hosting";
if (isset($_GET['info'])) {
    $title = "Info";
}
$tpl->assign("title", $title);
$tpl->draw("header");
if (isset($_GET['info'])) {
    $tpl->draw("info");
} else {
    $tpl->draw("upload");
}
$tpl->draw("footer");
Esempio n. 29
0
<?php

/*** include the controller class ***/
include __SITE_PATH . '/application/' . 'controller_base.class.php';
/*** include the registry class ***/
include __SITE_PATH . '/application/' . 'registry.class.php';
/*** include the router class ***/
include __SITE_PATH . '/application/' . 'router.class.php';
/*** include the template class ***/
//include __SITE_PATH . '/application/' . 'template.class.php'; // Original TPL Class
include __SITE_PATH . '/application/' . 'rainTPL.class.php';
raintpl::$tpl_dir = __SITE_PATH . '/views/';
raintpl::$cache_dir = __SITE_PATH . '/cache/';
raintpl::configure('base_url', __SITE_PATH);
$config = parse_ini_file("application/config.ini", 1);
/*** auto load model classes ***/
function __autoload($class_name)
{
    $filename = strtolower($class_name) . '.class.php';
    $file = __SITE_PATH . '/model/' . $filename;
    if (file_exists($file) == false) {
        return false;
    }
    include $file;
}
/*** a new registry object ***/
$registry = new registry();
$registry->DB_Conn = $config['db_conn'];
$registry->config = $config;
/*** create the database registry object ***/
$registry->database = new db($registry->DB_Conn);
Esempio n. 30
-1
 public function __construct($options = array())
 {
     $rootdir = PATH;
     raintpl::configure("base_url", $rootdir);
     raintpl::configure("tpl_dir", $rootdir . "/res/tpl/");
     raintpl::configure("cache_dir", $rootdir . "/res/tpl/tmp/");
     raintpl::configure("path_replace", false);
     $options = array_merge($this->options, $options);
     if (isset($_SESSION["lang"])) {
         $options["strings"] = $_SESSION["lang"];
     }
     $options['data']['string'] = $this->loadString($options["strings"]);
     $tpl = $this->getTpl();
     $this->options = $options;
     if (gettype($this->options['data']) == 'array') {
         foreach ($this->options['data'] as $key => $val) {
             $tpl->assign($key, $val);
         }
     }
     $tpl->draw("header", false);
 }