Esempio n. 1
0
<?php

$user_ip = zbs_UserDetectIp('debug');
$user_login = zbs_UserGetLoginByIp($user_ip);
$us_config = zbs_LoadConfig();
if (@$us_config['MG_ENABLED']) {
    $megogo = new MegogoFrontend();
    deb($megogo->renderSubscribeForm());
} else {
    show_window(__('Sorry'), __('This module is disabled'));
}
Esempio n. 2
0
<?php

$user_ip = zbs_UserDetectIp('debug');
$user_login = zbs_UserGetLoginByIp($user_ip);
$us_config = zbs_LoadConfig();
if (@$us_config['MG_ENABLED']) {
    $userData = zbs_UserGetStargazerData($user_login);
    //Check for user active state
    if ($userData['Passive'] == 0 and $userData['Down'] == 0) {
        $megogo = new MegogoFrontend();
        $megogo->setLogin($user_login);
        //try subscribe service
        if (la_CheckGet(array('subscribe'))) {
            $subscribeResult = $megogo->pushSubscribeRequest($_GET['subscribe']);
            if (!$subscribeResult) {
                rcms_redirect('?module=megogo');
            } else {
                show_window(__('Sorry'), __($subscribeResult));
            }
        }
        //  try unsubscribe service
        if (la_CheckGet(array('unsubscribe'))) {
            $unsubscribeResult = $megogo->pushUnsubscribeRequest($_GET['unsubscribe']);
            if (!$unsubscribeResult) {
                rcms_redirect('?module=megogo');
            } else {
                show_window(__('Sorry'), __($unsubscribeResult));
            }
        }
        //view button if is some subscriptions here
        if ($megogo->haveSubscribtions()) {