Ejemplo n.º 1
0
if (!isset($APP)) {
    die;
}
$default_controller = $APP['controller_path'] . '/news_controller.php';
$constraint = NULL;
$id = NULL;
if (isset($_GET['constraint'])) {
    $constraint = trim($_GET['constraint']);
}
if (isset($_GET['id'])) {
    $id = (int) trim($_GET['id']);
}
$post_data = 'action: "view_subject"';
$news_feeds = new Subject();
$news_feeds->load_from_name('News Feeds');
$feeds_object_array = $news_feeds->to_array();
$feeds_string = '';
foreach ($feeds_object_array['aspects'] as $x) {
    $feeds_string .= '"' . $x['aspect_data'] . '",';
}
$feeds_string = rtrim($feeds_string, ",");
?>

<div class="col-xs-12" id="main_view">
	<h3>Today's News</h3>
	<div id="feed_display" class="feed_stage" style="padding: 0px;"></div>

</div>
<script type="text/javascript">
  
   $(function() {   
Ejemplo n.º 2
0
 * @since      File included in initial release
 *
 */
// bootstrap the rest of the codebase.
require_once '../config.php';
csfr_protection();
$db = Database::get_instance();
$action = NULL;
if (isset($_POST['action'])) {
    $action = trim($_POST['action']);
}
if (isset($action)) {
    switch ($action) {
        case "view_dash":
            break;
        case "inspire_me":
            $sayings = new Subject();
            $sayings->load_from_name('Inspirations');
            $sayings_array = $sayings->to_array();
            $output = $sayings_array['aspects'][array_rand($sayings_array['aspects'])]['aspect_data'];
            // print_r($inspirational_sayings);
            echo $output;
            break;
        default:
            new LogEntry(__FILE__ . " was hit with an invalid action, from IP: " . $_SERVER['REMOTE_ADDR']);
            echo 'There was an error.  It has been logged.';
    }
} else {
    new LogEntry(__FILE__ . " was hit with no action, from IP: " . $_SERVER['REMOTE_ADDR']);
    echo 'There was an error.  It has been logged.';
}