<?php /** * File: index.php * User: zacharydubois * Date: 2016-01-04 * Time: 20:47 * Project: Digital-Footprint-Profile */ namespace dfp; // Create objects. $config = new Config(); $view = new View($config); $nav = new Nav($config); // Create nav (Index is empty). $nav->setActive(''); // Tell view the nav array. $view->navArray($nav->navArray()); // Tell view what template and content. $view->tpl('index'); $view->content(array('title' => 'Welcome | Digital Footprint Profile', 'sessionLink' => Utility::buildFullLink($config, true, 'session'))); echo $view->render();
*/ namespace dfp; // Config $config = new Config(); // Session $session = new Session($config); if ($session->getTMP('allowNext') !== true) { header('Location: ' . Utility::buildFullLink($config, false, 'session')); } else { // View $nav = new Nav($config); $nav->setActive('list'); $view = new View($config); $view->tpl('list'); $view->navArray($nav->navArray(true)); // Parse $parse = new Parse(); // List array $list = array(); $total = 0; $flagged = 0; foreach ($session->get('posts') as $post) { $content = preg_replace('/(\\n)/', ' ', $post['content']); $parse->parse($content); $score = $parse->score(); $tags = $parse->tags(); if ($score >= 3) { $list[] = array('url' => $post['url'], 'score' => $score, 'tags' => $tags, 'content' => $content); $flagged++; }