Example #1
0
 public static function NewsUpdate(Ab_Database $db, $d)
 {
     $info = NewsQuery::NewsInfo($db, $d->id);
     Ab_CoreQuery::ContentUpdate($db, $info['ctid'], $d->body);
     $sql = "\n\t\t\tUPDATE " . $db->prefix . "ns_news\n\t\t\tSET \n\t\t\t\tdateedit=" . TIMENOW . ",\n\t\t\t\tpublished=" . bkint($d->dp) . ",\n\t\t\t\ttitle='" . bkstr($d->tl) . "',\n\t\t\t\tintro='" . bkstr($d->intro) . "',\n\t\t\t\timageid='" . bkstr($d->img) . "',\n\t\t\t\tsource_name='" . bkstr($d->srcnm) . "',\n\t\t\t\tsource_link='" . bkstr($d->srclnk) . "'\n\t\t\tWHERE newsid=" . bkint($d->id) . "\n\t\t";
     $db->query_write($sql);
 }
Example #2
0
 public function IsNewsWriteAccess($newid)
 {
     if (!$this->IsWriteRole()) {
         return false;
     }
     if ($this->IsAdminRole()) {
         return true;
     }
     $info = NewsQuery::NewsInfo($this->db, $newid);
     if (empty($info) || $info['uid'] != $this->userid) {
         return false;
     }
     return true;
 }