Beispiel #1
0
 static function get_badword($update_cache = 0, $delcache = false)
 {
     $badword = array();
     $subDir = 'badword';
     $badword = AZCache::cache('SELECT * FROM bad_words ORDER By exact DESC', __LINE__ . __FILE__, 86400, $update_cache, '', $subDir, $delcache);
     usort($badword, array('BW', 'word_length_sort'));
     if ($badword && !$delcache) {
         return $badword;
     }
     return $badword;
 }
Beispiel #2
0
 static function get_tag_search($cat_id = 0, $sub_cat_id = 0, $update_cache = 0, $delcache = false)
 {
     $tag_search = array();
     $subDir = 'tag_search';
     $sql = 'SELECT id, keywords, hit, cat_id FROM tag_search WHERE cat_id IN (' . $cat_id . ',' . $sub_cat_id . ') ORDER By hit DESC';
     $tag_search = AZCache::cache($sql, __LINE__ . __FILE__, 86400, $update_cache, '', $subDir, $delcache);
     if ($tag_search && !$delcache) {
         return $tag_search;
     }
     return $tag_search;
 }
Beispiel #3
0
 static function getAdminNoticeUser($user_id, $update_cache = 0, $delcache = 0)
 {
     $arr_notices = array();
     $subDir = 'Notices/' . floor($user_id / 1000) . '/' . $user_id;
     $arr_notices = AZCache::cache("SELECT * FROM admin_notice_user WHERE active=1 AND user_id = {$user_id} ORDER BY id DESC LIMIT 1", __LINE__ . __FILE__, 0, $update_cache, '', $subDir, $delcache);
     if ($arr_notices && !$delcache) {
         return $arr_notices;
     }
     return $arr_notices;
 }
Beispiel #4
0
 static function get_item_images($item_id, $del_cache = 0)
 {
     $sql = 'SELECT * FROM item_image WHERE item_id = ' . $item_id . ' ORDER BY position ';
     //$item_images = AZCache::cache($sql,__LINE__.__FILE__,1,0,'','',$del_cache);
     $item_images = AZCache::cache($sql, __LINE__ . __FILE__, 0, 0, '', '', $del_cache);
     if (!$del_cache) {
         $_item_images = false;
         if ($item_images) {
             foreach ($item_images as $value) {
                 if ($value && $value['img_url']) {
                     $i = $value['position'];
                     $title = str_replace(array('"', "'"), array('"', '\\\''), stripslashes($value['title']));
                     $_item_images[$i] = $value;
                     $_item_images[$i]['i'] = $i;
                     $_item_images[$i]['id'] = $value['id'];
                     $_item_images[$i]['title'] = $title;
                     $_item_images[$i]['img_server'] = $value['img_server'];
                     $_item_images[$i]['thumb316'] = AZLib::getImageThumb($value['img_url'], 316, 0, 0, $value['img_server']);
                     $_item_images[$i]['thumb80_80'] = AZLib::getImageThumb($value['img_url'], 80, 80, 0, $value['img_server']);
                     $_item_images[$i]['img_full_url'] = "http://" . CGlobal::$img_server[$value['img_server']] . $value['img_url'];
                     $_item_images[$i]['max_path'] = AZLib::getImageThumbMax($value['img_url'], $title, 1, $value['img_server']);
                 }
             }
             unset($item_images);
             return $_item_images;
         }
         return array();
     }
     return true;
 }