Пример #1
0
function favorite_add_delete($user, $link, $type = 'link')
{
    global $globals;
    if (favorite_exists($user, $link, $type)) {
        favorite_delete($user, $link, $type);
        return 0;
    } else {
        favorite_insert($user, $link, $type);
        return 1;
    }
}
Пример #2
0
function favorite_add_delete($user, $link)
{
    global $globals;
    if (favorite_exists($user, $link)) {
        favorite_delete($user, $link);
        return FAV_NO;
    } else {
        favorite_insert($user, $link);
        return FAV_YES;
    }
}