Ejemplo n.º 1
0
{
    # Get Variables Object
    global $_variables;
    # Get Variable
    if (!is_null($name)) {
        return $_variables->get($name);
    }
    # Get All Variables
    return $_variables->get();
}
/**
 * Get Variables
 *
 * @since 1.0.0
 */
function vars()
{
    return get();
}
# Debug helpers
set('dev', array('localhost' => is_localhost()));
# Page variables
set('page', array('is_home' => is_home(), 'path' => $_path, 'slug' => get_page()), true);
# User variables
set('user', array('is_loggedin' => is_loggedin()));
# Various useful variables
set('this_year', this_year());
# Trigger: variables_init
if (extras_enabled()) {
    do_trigger('variables_init');
}
Ejemplo n.º 2
0
<?php

use Theme\Variables;
/**
 * Variables Object
 */
$variables = new Variables($_config);
# Include Variable Functions
require __DIR__ . '/functions/variables.php';
# Debug helpers
add_var('dev', array('localhost' => is_localhost()));
# Page variables
add_var('page', array('is_home' => is_home(), 'path' => $path, 'slug' => get_page()), true);
# User variables
add_var('user', array('is_loggedin' => is_loggedin()));
# Various useful variables
add_var('this_year', this_year());
Ejemplo n.º 3
0
<?php

include 'lib/fortissimo.php';
# figure out what they want to filter on
$corpid = $_GET['corpid'];
if (!$corpid) {
    return $ft->errorpage('Sorry, you got to this page in an invalid way.');
}
# load the pilot
$corp = get_corp_name($corpid);
if (!$corp) {
    return $ft->errorpage('Sorry, that corporation does not seem to exist.');
}
# now get some interesting stats
$stats = array();
$get = array('week' => this_week(), 'month' => this_month(), 'year' => this_year(), 'ever' => 0);
foreach ($get as $when => $val) {
    $st = $ft->dbh->_select_row_as_assoc('SELECT * FROM tbl:stats WHERE type = "corp" AND var1 = ? AND dtype = ? AND var2 = ?', array($corpid, $when, $val));
    $stats[$when] = $st;
}
# get various top 10s
$ft->assign('t10weapons', get_top10('corp', $corpid, 'weapon'));
$ft->assign('t10shipslost', get_top10('corp', $corpid, 'ship_lost'));
$ft->assign('t10shipsdestroyed', get_top10('corp', $corpid, 'ship_killed'));
$ft->assign('t10systems', get_top10('corp', $corpid, 'system'));
$ft->assign('t10targets', get_top10('corp', $corpid, 'pilot'));
$ft->assign('t10shipsflown', get_top10('corp', $corpid, 'ship_flown'));
# get the last 50 final blows
#    $fbids = $ft->dbh->_select_column('SELECT killid FROM tbl:summary WHERE k_pilotid = ? AND type = "kill" ' .
#                                      'ORDER BY killtime DESC LIMIT 10', array($pilotid));
#    $fbs = load_kills_by_id($fbids);
Ejemplo n.º 4
0
<?php

use Theme\Variables;
/**
 * Variables Object
 */
$variables = new Variables();
# Debug helpers
$variables->add('dev', array('localhost' => is_localhost()));
# Theme
$variables->add('theme', array('supports' => array_key_exists('supports', $theme) ? $theme['supports'] : array()));
# Global Site Variables
$variables->add('site', array('name' => SITE_NAME, 'email' => SITE_EMAIL, 'domain' => SITE_DOMAIN, 'styles' => load_asset($theme_config['styles'], 'css'), 'scripts' => load_asset($theme_config['scripts'], 'js'), 'assets' => assets_dir(), 'ie' => array('min' => 9, 'strict' => false)));
# Page variables
$variables->add('page', array('is_home' => is_home(), 'path' => $path, 'slug' => get_page()), true);
# User variables
$variables->add('user', array('logged_in' => is_loggedin()));
# Various useful variables
$variables->add('this_year', this_year());
/** ----------------------------------- **
 * Default page meta is set here but     *
 * should be overridden in your          *
 * model files. Access the array using   *
 * $_['page']['meta'] from your model.   *
 ** ----------------------------------- **/
# Page meta data
$meta = array($variables->get('page|slug') => array('title' => SITE_NAME, 'description' => 'Description', 'keywords' => 'Keywords', 'canonical' => 'Canonical'));
$variables->extend('page', 'meta', $meta[$variables->get('page|slug')]);