Ejemplo n.º 1
0
 /**
  * 设置对应的信息
  * @param array $meta
  * @throws \Exception
  */
 public function set_meta_info($meta)
 {
     if (isset($meta['more_info'])) {
         $this->meta->set(['more_info' => htmlspecialchars($meta['more_info'], ENT_NOQUOTES)]);
     } else {
         throw new \Exception(_("Set gallery more info error."));
     }
     //传入数据未过滤
     hook()->apply("Gallery_set_meta_info", NULL, $meta, $this->meta);
 }
Ejemplo n.º 2
0
 public function get_user_meta()
 {
     $id = req()->_plain()->get('id');
     $id = intval($id);
     if ($id < 1) {
         $this->rt_msg['msg'] = "错误的用户ID";
     } else {
         try {
             lib()->load('Meta');
             $meta = new Meta("user_meta", "users_id", $id);
             $this->rt_msg['content'] = $meta->get_all();
             $this->rt_msg['status'] = true;
         } catch (\Exception $ex) {
             $this->rt_msg['msg'] = $ex->getMessage();
         }
     }
 }