Example #1
0
<?php

include "./class/template.php";
include "./class/DB_Class.php";
include "./class/userClass.php";
$user = new userClass();
$user->sessionCheck();
$template = new template_class();
?>

<!DOCTYPE html>
<html lang="lv">
	<head>
		<?php 
$template->getHead();
?>

		<title>Par autoru</title>
	</head>
	<body>
		<section class = "container-fluid">
			<section class = "row main-menu">
				<?php 
$template->getMenu();
?>
			</section>

			<section class = "row main-content">
				<aside class = "col-md-3">
					<h1  class = "hide">Foto</h1>
					<a href="images/mypic2.jpg" rel="lightbox[myself]" title="Nakts pastaiga pa Vecrīgu"><img id="my-photo" class="img-responsive img-thumbnail" src="images/mypic2.jpg"></a>
Example #2
0
/**
 * This is the function cache_generic() coded by Ptirhiik and used in Categories hierarchy 2.0.5
 * and Profile Control Panel 2.0.0-1
 */
function bbc_box_generic($cache_tpl, $cache_file, $table, $key_field, $sql_where = '', $order_by = '')
{
    global $board_config, $phpbb_root_path, $phpEx, $db, $userdata;
    // assign vars
    $cache_tpl_path = 'includes/cache_tpls/';
    // ensure categories hierarchy v2.1.x compliancy
    if (!empty($board_config['mod_cat_hierarchy'])) {
        global $config;
        // intantiate the template
        $template = new template_class($config->root . $cache_tpl_path, false, $cache_tpl_path);
        $template->set_filenames(array('cache' => $cache_tpl . '.tpl'));
    } else {
        // intantiate the template
        $template = new Template($phpbb_root_path);
        $template->set_filenames(array('cache' => $cache_tpl_path . $cache_tpl . '.tpl'));
    }
    $time = time();
    $template->assign_vars(array('TIME' => date('Y-m-d H:i:s', $time) . ' (GMT)', 'DAY' => mktime(0, 0, 0, date('m', $time), date('d', $time), date('Y', $time)), 'USERNAME' => $userdata['username']));
    $sql = "SELECT * FROM {$table} {$sql_where} {$order_by}";
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, 'Could not read ' . $table . ' table', '', __LINE__, __FILE__, $sql);
    }
    while ($row = $db->sql_fetchrow($result)) {
        $id = $row[$key_field];
        $cells = array();
        foreach ($row as $key => $value) {
            $nkey = intval($key);
            if ($key != "{$nkey}") {
                $cells[] = sprintf("'%s' => '%s'", str_replace("'", "\\'", $key), str_replace("'", "\\'", $value));
            }
        }
        $s_cells = empty($cells) ? '' : implode(', ', $cells);
        $template->assign_block_vars('cache_row', array('ID' => sprintf("'%s'", str_replace("'", "\\'", $id)), 'CELLS' => $s_cells));
    }
    // transfert to a var
    $template->assign_var_from_handle('cache', 'cache');
    $res = "<?php\n" . $template->_tpldata['.'][0]['cache'] . "\n?>";
    // output to file
    $cache_path = 'includes/';
    $handle = @fopen($phpbb_root_path . $cache_path . $cache_file . '.' . $phpEx, 'w');
    @flock($fp, LOCK_EX);
    @fwrite($handle, $res);
    @flock($fp, LOCK_UN);
    @fclose($handle);
    @umask(00);
    @chmod($phpbb_root_path . $cache_path . $cache_file . '.' . $phpEx, 0666);
}