Пример #1
0
 public static function check_if_favor($uid, $obj_uid, $pk, $keep_type, $model_code, $obj_id, $url = '', $output = 'normal')
 {
     global $_lang;
     $favor_type = keke_glob_class::get_favor_type();
     $favor_tab = TABLEPRE . "witkey_" . $keep_type;
     if ($obj_uid == $uid) {
         kekezu::keke_show_msg($url, $_lang['you_can_not_collection_self'] . $favor_type[$keep_type] . "!", "error", $output);
     } else {
         $if_favor = db_factory::get_count(sprintf(" select f_id from %switkey_favorite where keep_type='%s' and obj_type='%s' and obj_id='%d' and uid='%d'", TABLEPRE, $keep_type, $model_code, $obj_id, $uid));
         if (!$if_favor) {
             return TRUE;
         } else {
             kekezu::keke_show_msg($url, $_lang['you_has_collection_this'] . $favor_type[$keep_type] . "," . $_lang['no_need_continue_collection'], "error", $output);
             return false;
         }
     }
 }