summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordeva <deva>2010-03-18 11:16:28 +0000
committerdeva <deva>2010-03-18 11:16:28 +0000
commit9555417b4166557a33acc5daf230cb7d33f049ac (patch)
tree6489cc790f55a7d6958d137d2925a524af93ac21
parent456e4424f4e457b67c61a6961bb4bc44058f1738 (diff)
Preserve original userid when editing a news post.
-rw-r--r--utils/modules/news.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/utils/modules/news.php b/utils/modules/news.php
index b59b7fd..5fd6ded 100644
--- a/utils/modules/news.php
+++ b/utils/modules/news.php
@@ -166,12 +166,12 @@ class News {
public function admin_edit($action, $vars)
{
- global $UID, $ICONS_DIR;
+ global $ICONS_DIR;
switch($action) {
case "add":
$this->news[$vars["newsid"]]->title = $vars["title"];
- $this->news[$vars["newsid"]]->userid = $UID;
+ $this->news[$vars["newsid"]]->userid = $vars["userid"];//$UID;
$this->news[$vars["newsid"]]->time = DateTimeEdit::toTimestamp($vars, "time");
$this->news[$vars["newsid"]]->category = $vars["category"];
$this->news[$vars["newsid"]]->description = $vars["description"];
@@ -182,7 +182,8 @@ class News {
case "preview":
$n = new NewsEntry($vars["title"], DatetimeEdit::toTimestamp($vars, "time"),
- $vars["category"], $vars["description"], $UID, $vars["icon"]);
+ $vars["category"], $vars["description"],
+ $vars["userid"]/*$UID*/, $vars["icon"]);
echo "<div class=\"preview\">\n";
echo "<div class=\"content\">\n";
echo $n->show($this->newspage);
@@ -212,6 +213,8 @@ class News {
else $description = $this->news[$vars["newsid"]]->description;
if(isset($vars["icon"])) $icon = $vars["icon"];
else $icon = $this->news[$vars["newsid"]]->icon;
+ // if(isset($vars["userid"])) $userid = $vars["userid"];
+ $vars["userid"] = $this->news[$vars["newsid"]]->userid;
$form = new Form("preview");
$form->addWidget(new Hidden($vars));