public function go()
 {
     $id = $_GET['id'];
     $article = Article::getArticle($id);
     $this->addToView('article', $article[0]);
     $this->setViewTemplate('readarticle.tpl');
     $this->generateView();
 }
Example #2
0
 public function read($id)
 {
     //die($id);
     $conn = Db::getConnection();
     $fullArticle = new Article();
     $article = $fullArticle->getArticle($conn, $id);
     $joinedTags = $article['tag_name'];
     $tags = explode(' ', $joinedTags);
     $relSql = "SELECT *\n\t\t\t\tFROM articles\n\t\t\t\tWHERE deleted = 'no' AND type = '{$article['type']}' AND id != {$id}\n\t\t\t\tORDER BY time DESC";
     $qr = $conn->prepare($relSql);
     $qr->execute();
     $relatedArticles = $qr->fetchAll(\PDO::FETCH_ASSOC);
     //var_dump($relatedarticles);die();
     //ovde sam dovukao i type od articla, i to koristim u sledecem queriju da bi dovukao povezane article
     $article['time'] = date("d.m.Y H:i", strtotime($article["time"]));
     //ubaci ovde i tagove i onda je sve reseno!!!
     $html = new Html($this->controllerName);
     $html->article = $article;
     $html->tags = $tags;
     //ovde moram da deklarisem $html->relatedArticles
     $html->relatedArticles = $relatedArticles;
     $html->render('article');
 }
Example #3
0
include_once "class/article.php";
// include page file
include_once "class/page.php";
// include template file
include_once "class/template.php";
$getSettings = new Settings($config_setting_file_path);
$cpsub = $getSettings->getSettings();
$getLib = new Lib($cpsub['filter'], $cpsub['stripslashes']);
$getTmp = new Template($config_current_version);
$getId = $_GET['id'];
// set Article
$getArticle = new Article($config_upload_folder, $config_article_file_path, $getLib);
// add view counts
$getArticle->addViewCounts($getId);
// get single article
$getArticleResult = $getArticle->getArticle($getId);
if ($getArticleResult['status'] == true) {
    $getArticleData = $getArticleResult['data'];
    // get colum values
    $article_title = $getLib->setFilter($getArticleData['title']);
    $article_author = $getLib->setFilter($getArticleData['author']);
    $article_date = $getLib->setFilter($getArticleData['date']);
    $article_content = $getLib->setFilter($getArticleData['content']);
    $article_counts = $getLib->setFilter($getArticleData['counts']);
    $article_files = explode(",", $getArticleData['files']);
    $article_files_name = explode(",", $getArticleData['files_name']);
    if ($getArticleData['top'] == "1") {
        $article_top = " checked";
    } else {
        $article_top = "";
    }
Example #4
0
<?php

require_once "../lib/model/article.model.php";
$articles = new Article();
//$_GET['id']=0;
//echo ($_GET['id']);
$article = $articles->getArticle($_GET["id"]);
//echo $article;
$recommentArticle = $articles->getRecomment(3);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>文章内容</title>

<link rel="stylesheet" media="all" type="text/css" href="../css/head.css" />
<link rel="stylesheet" media="all" type="text/css" href="../css/scroll.css" />
<link rel="stylesheet" media="all" type="text/css" href="../css/link.css" />
<link rel="stylesheet" media="all" type="text/css" href="../css/tail.css" />
<link rel="stylesheet" media="all" type="text/css" href="../css/style.css" />
<link rel="stylesheet" media="all" type="text/css" href="../css/content-style.css" />
<link rel="stylesheet" media="all" type="text/css" href="../css/menus.css" />
<script src="../js/jquery.min.js" type="text/javascript"></script>
<script src="../js/jquery-1.4.2.min.js"></script>
<script src="../js/jquery.autoimg.js"></script>
<style type="text/css">
#cnt_content a{text-decoration:none;color:#000000;}
#cnt_content a:hover{text-decoration:underline;color:#F00;}
</style>
}
$now = time();
if (isset($_SESSION['time_exp']) && $now > $_SESSION['time_exp']) {
    unset($_SESSION['time_exp']);
    $_SESSION['time_exp'] = $now + 60 * 15;
}
//if( ini_get('allow_url_fopen') ) {
//    echo "allow_url_fopen is enabled.";
//}else { echo "allow_url_fopen is disabled.";}
get_header();
#defaults to theme header or header_inc.php
?>
    <h3 align="center"><?php 
echo smartTitle();
?>
</h3>
<?php 
$req = $_GET['url'];
if (!isset($_SESSION['feed']) || isset($_GET['forcerefresh'])) {
    $_SESSION['feed'] = file_get_contents($req);
    $_SESSION['feedrefreshed'] = time();
}
$resp = $_SESSION['feed'];
echo "<h4>Last Refreshed " . date('r', $_SESSION['feedrefreshed']) . ' - <a href="' . $_SERVER['REQUEST_URI'] . '&forcerefresh=1" style="color: red">Refresh Now?</a></h4>';
$xml = simplexml_load_string($resp);
//var_dump($xml);
foreach ($xml->channel->item as $story) {
    $article = new Article($story);
    echo $article->getArticle();
}
get_footer();
Example #6
0
function afficher_article()
{
    if (!isset($_GET['news_id']) || !$_GET['news_id']) {
        header("Location : index.php");
        return;
    }
    $article = new Article();
    $article = Article::getArticle((int) $_GET['news_id']);
    require "actions/afficher_article.php";
}
Example #7
0
function supprimer_article()
{
    $article = new Article();
    if (!($article = Article::getArticle($_GET['news_id']))) {
        header("Location: administrateur.php?erreur=articleNonTrouve");
        return;
    }
    $article = Article::getArticle($_GET['news_id']);
    $article->supprimer();
    header("Location: administrateur.php?statue=articleSupprime");
}
Example #8
0
  function GET($matches) {
    $A = new Article();

    if($article = $A->getArticle($matches[1])) {
      $this->layout_vars = array(
        'content' => new View('admin/edit', array('article' => $article)));
    } else {
      $this->layout_vars = array(
        'content' => new View('404', array()));
    }
  }
Example #9
0
<?php

include_once 'App.php';
$article = Article::getArticle();
require_once ROOT_PATH . 'tpl/index.php';
Example #10
0
            $url = html_entity_decode($url);
            // if url use https protocol change it to http
            if (!preg_match('!^https?://!i', $url)) {
                $url = 'http://' . $url;
            }
        }
        $article = new Article();
        $article->setUrl($url);
        if (!$article->isAlreadyExists()) {
            if ($article->retrieveContent()) {
                if ($article->readiIt(isset($_GET['debug']))) {
                    $article->modifyContent();
                    $article->saveContent();
                }
            }
        } else {
            $article = Article::getArticle($url);
            // only for debug
            if ($article->readiIt(isset($_GET['debug']))) {
                $article->modifyContent();
                $article->saveContent();
            }
        }
        if ($article && $article->isLoaded()) {
            generate_page($article->getUrl(), $article->getTitle(), $article->getFinalContent());
            //generate_page($url,$r->articleTitle->innerHTML,$r->articleContent->innerHTML);
        } else {
            echo "Error unable to get link : " . $url;
        }
    }
}