<?php /* Copyright by C-ART WEBDESIGN '2007 - www.c-art-web.de - (c-art@web.de) - 01/22/07 * * *** S T A R T I N G H A N D S *** */ error_reporting(E_ALL); define('ERROR_ECHO', true); define('ADMIN_MAIL', '*****@*****.**'); define('DEBUG', false); define('SITE_NAME', 8); define('SITE_URL', 'starting-hands.com'); define('SITE_REALNAME', 'starting-hands.com'); define('AUTHOR_LOGIN', ''); define('TUTOR_LOGIN', ''); ## load global config file include_once dirname(dirname(__FILE__)) . '/inc.config.php'; define('TEMPLATE_DIR', dirname(__FILE__) . '/templates'); $db = new PDO('mysql:host=' . DB_HOST . ';dbname=' . DB_NAME, DB_USER, DB_PASSWORD); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); ######################## MYSQL TABLES ################################## define('TABLE_SITES', '38_8_cm_seiten'); define('TABLE_CONTENT', '39_8_content'); define('TABLE_LOG', 'log'); ################################################ $pageI = new PageInfo($db, 1); $pageI->load($_REQUEST); $pageI->clearRequest(); ################################################ define('CONFIG', true);
public function __construct($totalResults) { $defaultPageSize = Configuration::Instance()->GetKey(ConfigKeys::DEFAULT_PAGE_SIZE); parent::__construct($totalResults, 1, $defaultPageSize); $this->TotalPages = 1; $this->ResultsStart = 1; $this->ResultsEnd = $totalResults; }
function LoadPageInfoFromSerializedData($data) { $pi = new PageInfo(); $pi->SetInitialValues(); $pi->content_id = $data['content_id']; $pi->content_title = $data['title']; $pi->content_menutext = $data['menutext']; $pi->content_hierarchy = $data['hierarchy']; $pi->template_id = $data['template_id']; $pi->template_encoding = $data['encoding']; $pi->cachable = false; return $pi; }
* Nathan Reed, 2011-03-22 */ $app->get('/', function () use($app) { $top_links = UsageCount::GetCurrentTop(); $url_root = $_SERVER['SERVER_NAME'] == 'localhost' ? 'localhost/redditstream' : 'reddit-stream.com'; $app->render('home.twig', array('url_root' => $url_root, 'top_links' => $top_links)); }); $app->get('/r/:subreddit/comments/:id/', function ($subreddit, $id) use($app) { $app->redirect("/comments/{$id}"); }); $app->get('/r/:subreddit/comments/:id/(:name/)', function ($subreddit, $id, $name) use($app) { $app->redirect("/comments/{$id}"); }); $app->get('/comments/:id/', function ($id) use($app) { $fs_root = $_SERVER['SERVER_NAME'] == 'localhost' ? '/redditstream' : ''; if (PageInfo::HasTitle($id)) { $send_title = false; UsageCount::Increment($id); } else { $send_title = true; } $app->render('thread.twig', array('thread_id' => $id, 'root' => $fs_root, 'send_title' => $send_title)); }); $app->get('/pageusage/increment/:id', function ($id) use($app) { $title = $app->request()->get('title'); if ($title != null) { PageInfo::Insert($id, $title); } UsageCount::Increment($id); print '{}'; });