fix blog view page

This commit is contained in:
leosw
2018-11-05 22:05:42 +01:00
parent 9aa7498db7
commit 7a29f0825f
3 changed files with 33 additions and 42 deletions

View File

@@ -271,13 +271,13 @@ class BlogArticles
/*****
** Return the list of archived version of a blog article
*****/
/* public function getHistory($url) {
public function getHistory($url) {
global $config;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "SELECT id FROM blog_articles WHERE url=$1 ORDER BY lastedit DESC";
$query = "SELECT * FROM contents WHERE permalink=$1 AND type='blog' ORDER BY update_date DESC";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
@@ -290,12 +290,12 @@ class BlogArticles
for($i = 0; $i < $this->number; $i++) {
$row = pg_fetch_assoc($result, $i);
$this->ids[$i] = $row['id'];
$this->objs[$i] = new BlogArticle;
$this->objs[$i]->populate($row);
}
}*/
}
}
/**********************************************************
***********************************************************
**