示例#1
0
文件: List.php 项目: 4otaku/art
 public function __construct(Query $query, $disabled = false)
 {
     $config = Config::getInstance()->get('comment');
     $this->reverse = (bool) $config['reverse'];
     $this->per_page = (int) $config['per_page'];
     $this->is_tree = (bool) $config['tree'];
     parent::__construct($query, $disabled);
 }
示例#2
0
文件: Item.php 项目: 4otaku/art
 public function recieve_data($data)
 {
     $data['date'] = $this->format_time($data['sortdate']);
     if (!empty($data['editdate'])) {
         $data['editdate'] = $this->format_time($data['editdate']);
     }
     $data['uid'] = md5(rand());
     $data['text'] = new Text($data['text']);
     $data['text']->trim()->links2bb();
     parent::recieve_data($data);
 }
示例#3
0
文件: Similar.php 项目: 4otaku/art
 public function recieve_data($data)
 {
     $this->modules['paginator']->build_pager($data['count']);
     foreach ($data['data'] as &$item) {
         $item['first']['weight'] = $this->format_weight($item['first']['weight']);
         $item['second']['weight'] = $this->format_weight($item['second']['weight']);
         $item['first']['created'] = $this->format_time($item['first']['created']);
         $item['second']['created'] = $this->format_time($item['second']['created']);
     }
     parent::recieve_data($data);
 }
示例#4
0
文件: Abstract.php 项目: 4otaku/art
 public function recieve_data($data)
 {
     $data['tip'] = $this->make_tooltip($data);
     $data['hidden'] = $this->is_filtered($data['tag']);
     $large = Config::getInstance()->get('art', 'largethumbs') ? 'large' : '';
     if (!empty($data['md5'])) {
         $data['src'] = Config::getInstance()->get('api', 'image_url') . 'art/' . $data['md5'] . '_' . $large . 'thumb.jpg';
     } else {
         $data['src'] = '/images/empty_' . $large . 'pool.jpg';
     }
     parent::recieve_data($data);
 }
示例#5
0
文件: Tag.php 项目: 4otaku/art
 public function recieve_data($data)
 {
     $this->modules['paginator']->build_pager($data['count']);
     foreach ($data['data'] as &$item) {
         if (isset($this->color[$item['color']])) {
             $item['color_name'] = $this->color[$item['color']];
         } else {
             $item['color_name'] = 'Ошибка';
         }
         $item['variant'] = implode(', ', $item['variant']);
         $item['escaped_name'] = str_replace('\\', '\\\\', $item['name']);
     }
     parent::recieve_data($data);
 }
示例#6
0
文件: Info.php 项目: 4otaku/art
 public function recieve_data($data)
 {
     if (!$data['count']) {
         return;
     }
     parent::recieve_data($data['data']);
     if (!empty($data['data']['source'])) {
         $source = new Text($data['data']['source']);
         $this->set_param('source', $source->links2html());
     }
     if (!empty($data['data']['weight'])) {
         $this->set_param('weight', $this->format_weight($data['data']['weight']));
     }
     if (isset($data['data']['state']) && is_array($data['data']['state']) && in_array('approved', $data['data']['state']) && in_array('tagged', $data['data']['state'])) {
         $this->set_param('date_main', $this->format_date($data['data']['sortdate']));
     }
     if (!empty($data['data']['created'])) {
         $this->set_param('created', $this->format_date($data['data']['created']));
     }
 }
示例#7
0
文件: Html.php 项目: 4otaku/art
 public function get_data()
 {
     $this->set_param('title', $this->modules['body']->get_title());
     return parent::get_data();
 }