Пример #1
0
function va()
{
    viewArticle();
}
Пример #2
0
      

	        <h1 class="hotfire">That Hotfire</h1>



	<?php 
require "config.php";
require "classes/article.php";
$action = isset($_GET['action']) ? $_GET['action'] : "";
switch ($action) {
    case 'archive':
        archive();
        break;
    case 'viewArticle':
        viewArticle();
        break;
    default:
        homepage();
}
function archive()
{
    $results = array();
    $data = Article::getList();
    $results['articles'] = $data['results'];
    $results['totalRows'] = $data['totalRows'];
    $results['pageTitle'] = "Article Archive | Widget News";
    require "templates/archive.php";
}
function viewArticle()
{
Пример #3
0
<?php

require_once 'functions.php';
?>
<h1>Meu Artigo</h1>
<?php 
if (isset($_GET['id'])) {
    $id = filter_var($_GET['id'], FILTER_SANITIZE_NUMBER_INT);
    $article = viewArticle($id);
    if ($article) {
        echo $article->title;
        echo '<p>' . $article->content . '</p>';
    }
}
?>
<p><a href="/jstree"> &laquo; Back </a></p>