<?php date_default_timezone_set('Europe/Brussels'); define('TWIG_CONFIG', serialize(array('twig.path' => __DIR__ . '/../assets/views', 'twig.options' => array('strict_variables' => false)))); define('TWITTER_CONFIG', serialize(array("API_key" => get_registry('twitter_api_key', ""), "API_secret" => get_registry('twitter_api_secret', ""), "token" => get_registry('twitter_token', ""), "secret" => get_registry('twitter_secret', "")))); define('EMBEDLY_CONFIG', get_registry('embedly_key', "")); define('TWIG_GLOBALS', serialize(array("telephone" => get_registry('Telephone', ""), "email" => get_registry('Email', ""), "nav" => collection("Pages")->find(["navigation" => true])->toArray(), "embedly" => EMBEDLY_CONFIG))); define('CV_URL', get_registry('cv_url', ""));
require_once 'lib/dbsql.class.php'; require_once 'lib/class.get.image.php'; require_once 'lib/markhtml.php'; require_once 'lib/osrLogs.php'; require_once 'lib/Mobile_Detect.php'; require_once 'vendor/autoload.php'; $detect = new Mobile_Detect(); if ($component == 'rss') { require_once 'lib/rss.class.php'; } //export $user = new flexibleAccess('', $settings); $DB = new DB_Engine('mysql', $settings['dbHost'], $settings['dbUser'], $settings['dbPass'], $settings['dbName']); $DB->show_err = true; $DB->prefix = $settings['dbPrefix']; get_registry(); get_powerstatus(); $LOG = new osrLogs($registry, $DB); if ($_POST['export'] == 1) { $export = 1; include 'export.php'; } if ($_GET['logout'] == 1) { $user->logout('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']); } if (!$user->is_loaded()) { if (isset($_POST['uname']) && isset($_POST['pwd'])) { if (!$user->login($_POST['uname'], $_POST['pwd'], $_POST['remember'])) { $err = 2; header('Location: /com/login/'); } else {
<?php /* * * cockpit-test * index.php * Created on 7-1-2015 19:55 * * @author Matthijs * @copyright Copyright (C)2015 Bixie.nl * */ // make cockpit api available require 'cockpit/bootstrap.php'; $app = new Lime\App(); $baseVars = ['pageTitle' => 'Bixie Cockpit', 'min' => get_registry('minify', 0) ? '.min' : '']; // bind routes $app->bind("/", function () use($app, $baseVars) { $nieuwsList = collection('Nieuws')->find(['active' => true])->sort(['created' => 1])->toArray(); $homeContent = collection('Content')->findOne(["title_slug" => 'home']); return $app->render('views/index.php with template/template.php', array_merge($baseVars, ['nieuwsList' => $nieuwsList, 'homeContent' => $homeContent])); }); $app->bind("/nieuws/:title_slug", function ($params) use($app, $baseVars) { $post = collection('Nieuws')->findOne(["title_slug" => $params['title_slug']]); $pageTitle = $post['title']; return $app->render('views/article.php with template/template.php', array_merge($baseVars, ['pageTitle' => $pageTitle, 'post' => $post])); }); $app->run();
<?php $url = $app->pathToUrl('site:'); $href = $app->routeUrl("/preview"); if (!empty(get_registry('screeenly'))) { $key = get_registry('screeenly'); } else { $key = "KJG8NXmqoMgzVAS31Mbh71TSLcV4PiR8dCscRaUJlumIUwpzrB"; } $payload = array('key' => $key, 'url' => ' ** YOUR URL HERE ** '); $payload = json_encode($payload); $ch = curl_init('http://screeenly.com/api/v1/fullsize'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Content-Length: ' . strlen($payload))); $result = curl_exec($ch); $result = json_decode($result); $path = $result->path; ?> <div class="uk-margin-bottom"> <a href="<?php echo $href; ?> "> <img src="<?php echo $path; ?> " alt="Screenshot">
<?php $config = ['pageTitle' => 'Page Title', 'siteName' => get_registry('siteName'['Site Name']), 'lang' => get_registry('lang'['en-US']), 'cockpitApi' => get_registry('apiToken'['NONE']), 'currentRoute' => $app->retrieve('route', '')];