Store author as contributor in wiki/blog
This commit is contained in:
parent
b5115182d5
commit
3ad4a6d08e
|
@ -179,10 +179,18 @@ class BlogArticle
|
||||||
$result = pg_execute($con, "prepare1", array($this->permalink, $this->locale, date('r'), date('r'), $user->id, $this->is_commentable, $this->name, $this->content))
|
$result = pg_execute($con, "prepare1", array($this->permalink, $this->locale, date('r'), date('r'), $user->id, $this->is_commentable, $this->name, $this->content))
|
||||||
or die ("Cannot execute statement\n");
|
or die ("Cannot execute statement\n");
|
||||||
|
|
||||||
pg_close($con);
|
|
||||||
|
|
||||||
$this->id = pg_fetch_assoc($result)['id'];
|
$this->id = pg_fetch_assoc($result)['id'];
|
||||||
|
|
||||||
|
$query = "INSERT INTO content_contributors (content, contributor) VALUES
|
||||||
|
($1, $2)";
|
||||||
|
|
||||||
|
pg_prepare($con, "prepare2", $query)
|
||||||
|
or die ("Cannot prepare statement\n");
|
||||||
|
$result = pg_execute($con, "prepare2", array($this->id, $user->id))
|
||||||
|
or die ("Cannot execute statement\n");
|
||||||
|
|
||||||
|
pg_close($con);
|
||||||
|
|
||||||
error_log(
|
error_log(
|
||||||
date('r')." \t".$user->name." (".$user->id.") \tINSERT \tCreate new blog article '".$this->url."'\r\n",
|
date('r')." \t".$user->name." (".$user->id.") \tINSERT \tCreate new blog article '".$this->url."'\r\n",
|
||||||
3,
|
3,
|
||||||
|
|
|
@ -204,10 +204,18 @@ class WikiPage
|
||||||
$result = pg_execute($con, "prepare1", array($this->permalink, $this->locale, date('r'), date('r'), $user->id, $this->name, $this->content))
|
$result = pg_execute($con, "prepare1", array($this->permalink, $this->locale, date('r'), date('r'), $user->id, $this->name, $this->content))
|
||||||
or die ("Cannot execute statement\n");
|
or die ("Cannot execute statement\n");
|
||||||
|
|
||||||
pg_close($con);
|
|
||||||
|
|
||||||
$this->id = pg_fetch_assoc($result)['id'];
|
$this->id = pg_fetch_assoc($result)['id'];
|
||||||
|
|
||||||
|
$query = "INSERT INTO content_contributors (content, contributor) VALUES
|
||||||
|
($1, $2)";
|
||||||
|
|
||||||
|
pg_prepare($con, "prepare2", $query)
|
||||||
|
or die ("Cannot prepare statement\n");
|
||||||
|
$result = pg_execute($con, "prepare2", array($this->id, $user->id))
|
||||||
|
or die ("Cannot execute statement\n");
|
||||||
|
|
||||||
|
pg_close($con);
|
||||||
|
|
||||||
error_log(
|
error_log(
|
||||||
date('r')." \t".$user->name." (".$user->id.") \tINSERT \tCreate new wiki page '".$this->permalink."'\r\n",
|
date('r')." \t".$user->name." (".$user->id.") \tINSERT \tCreate new wiki page '".$this->permalink."'\r\n",
|
||||||
3,
|
3,
|
||||||
|
|
Loading…
Reference in New Issue