}
 if (!is_current_favorite($_POST['type'], $_POST['id_element'])) {
     if (get_current_favorite_count($_POST['type']) >= 6) {
         echo 6;
         //Limit exceded
         exit;
     }
     if ($_POST['type'] == 'country') {
         $_check = get_current_favorite_country_data($_POST['id_element']);
         if (empty($_check)) {
             echo 1;
             //No data
             exit;
         }
     } elseif ($_POST['type'] == 'page') {
         $_check = get_current_favorite_page_data($_POST['id_element']);
         if (empty($_check)) {
             echo 1;
             //No data
             exit;
         }
     } else {
         reconnect_db('owloo_twitter');
         $_check = get_current_favorite_twitter_data($_POST['id_element']);
         if (empty($_check)) {
             echo 1;
             //No data
             exit;
         }
         reconnect_db('owloo_owloo');
     }
Beispiel #2
0
$user_profile = $site->get_profile();
if (!empty($user_profile)) {
    set_current_user_id($user_profile['user_id']);
}
$_favorites = get_current_favorite_array();
$_country_favorites = array();
$_twitter_favorites = array();
$_fb_page_favorites = array();
foreach ($_favorites['country'] as $value) {
    $_aux_data = get_current_favorite_country_data($value);
    if (!empty($_aux_data)) {
        $_country_favorites[] = $_aux_data;
    }
}
foreach ($_favorites['page'] as $value) {
    $_aux_data = get_current_favorite_page_data($value);
    if (!empty($_aux_data)) {
        $_fb_page_favorites[] = $_aux_data;
    }
}
reconnect_db('owloo_twitter');
foreach ($_favorites['twitter'] as $value) {
    $_aux_data = get_current_favorite_twitter_data($value);
    if (!empty($_aux_data)) {
        $_twitter_favorites[] = $_aux_data;
    }
}
/**** FIN FAVORITES ****/
//Upload the avatar if the user click "Upload Avatar"
$site->process_uploadavatar();
//Update the settings or profile if either forms where submitted.