Esempio n. 1
0
function mx_searchbox()
{
    if (is_logged()) {
        ?>
	<div class="searchbox"><div class="qsearch"><form name="searchbox" method="POST" action="<?php 
        echo mx_pageurl('');
        ?>
"><input id="q" name="q" type="text"
	placeholder="<?php 
        __('Search');
        ?>
"
	 onkeyup="return quicksearch(event,this,'q');"
	 onblur="return quicksearch(event,this,'q');"
	 ></form><div class="qresults"><div id="q_search" class="quicksearch"></div></div></div></div>
<?php 
    }
}
Esempio n. 2
0
function mx_ckplugins($page, $option, $action)
{
    header('location: ' . mx_pageurl('main'));
}
Esempio n. 3
0
function mx_mxforartists()
{
    echo '<div class="dummies"><a href="' . mx_pageurl('bestdealarts') . '" alt="' . _('MusXpand for Artists') . '">' . mx_icon('musxpand-artists') . '</a></div>';
}
Esempio n. 4
0
 function picture($size = 'large')
 {
     $str = '<img title="' . $this->getname() . ' - ' . _('See Your Page') . '" tag="' . $this->id . '" class="profilepic pictooltip" style="cursor:pointer;" src="' . mx_fanpic($this->id, $size, $this->gender, is_artist()) . '"' . ($this->id ? 'onclick="window.location=\'' . mx_pageurl('account') . '\';"' : MXICONCLICK) . '>';
     if ($this->picture == 'fb') {
         return '<div class="userpic">' . '<div class="pending">' . mx_icon('working.gif', 'updating', '16px') . '</div>' . $str . '<script>$(window).load(function() {savefbpics();});</script>' . '</div>';
     }
     return '<div class="userpic"' . ($this->id && $this->status >= MXACCTSETUP ? ' onmouseover="showbutton(\'profilepic\');"' . ' onmouseout="hidebutton(\'profilepic\');"' : '') . '>' . '<div id="profilepic" class="picbutton" onclick="window.location=\'' . mx_actionurl('account', 'profile', 'edit', 'picinfo') . '\';">' . _('Update Pic') . '</div>' . $str . '</div>';
 }
Esempio n. 5
0
function mx_preheader()
{
    global $mx_ctxmenu, $mxuser;
    $page = mx_secureword($_GET['p']);
    $option = mx_secureword($_GET['o']);
    $action = mx_secureword($_REQUEST['a']);
    $section = mx_secureword($_REQUEST['k']);
    if ($_REQUEST['signed_request']) {
        //mx_checkfblogin(false);
        $facebook_page = mx_actionurl('main');
        $auth_url = 'https://www.facebook.com/dialog/oauth?client_id=' . FACEBOOK_APP_ID . '&redirect_uri=' . urlencode($facebook_page);
        $signed_request = $_REQUEST['signed_request'];
        list($encoded_sig, $payload) = explode('.', $signed_request, 2);
        $data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);
        $mxuser->fbdata = $data;
        if ($mxuser->fbdata['page']) {
            if (!is_pagelike() || !$mxuser->fbdata['user_id'] && !$mxuser->id) {
                $page = $_GET['p'] = $_REQUEST['p'] = 'fblikeus';
                $option = $_GET['o'] = $_REQUEST['o'] = '';
                $action = $_POST['a'] = $_REQUEST['a'] = '';
                $section = $_REQUEST['k'] = '';
            } else {
                if (($page == '' || $page == 'main') && ($pageuser = mx_getaccountfrompage($mxuser->fbdata['page']['id']))) {
                    // MX registered page
                    $page = $_GET['p'] = $_REQUEST['p'] = 'artists';
                    $option = $_GET['o'] = $_REQUEST['o'] = 'artprof';
                    $action = $_POST['a'] = $_REQUEST['a'] = $pageuser;
                    $section = $_REQUEST['k'] = '';
                }
            }
        } else {
        }
    }
    if ($page == '' || $page == 'main') {
        $page = 'main';
        $option = '';
        if (!$mxuser->id) {
            //$page='account';
            //$option='signin';
        } else {
            switch ($mxuser->status) {
                case MXACCTUNCONFIRMED:
                    $page = 'account';
                    $option = 'confirm';
                    break;
                case MXACCTEMAILCONFIRMED:
                    $page = 'account';
                    $option = 'setup';
                    break;
                default:
                    $page = 'main';
            }
        }
        $_GET['p'] = $_REQUEST['p'] = $page;
        $_GET['o'] = $_REQUEST['o'] = $option;
    }
    switch (mx_checkpage($page, $option)) {
        case MXUNKNOWNPAGE:
        case MXRESTRICTEDPAGE:
        case MXMAINPAGE:
            header('Location: ' . mx_pageurl('main'));
            break;
        case MXNOACCESS:
            header('Location: ' . mx_pageurl('noaccess'));
            break;
        case MXREDIRECT:
            $other = preg_replace('%[&]?(a|p|o|k|fbp|canvas)=[^&]*%', '', $_SERVER['QUERY_STRING']);
            $other = preg_replace('%^[&]+%', '', $other);
            header('Location: ' . mx_loginredirecturl($page, $option, $action, $section, $other));
            break;
    }
    if ($page != '') {
        $checkfunction = 'mx_ck' . $page;
        if (function_exists($checkfunction)) {
            $checkfunction($page, $option, $action);
        }
    }
    if ($option != '') {
        $checkfunction = 'mx_ck' . $option;
        if (function_exists($checkfunction)) {
            $checkfunction($page, $option, $action);
        }
    }
}
Esempio n. 6
0
function mx_actionlink($page, $option, $action = '', $section = '', $redir = '', $other = '')
{
    global $mx_ctxmenu;
    //if ($action) $act='&a='.$action;
    if (array_key_exists($page, $mx_ctxmenu)) {
        if (array_key_exists($option, $mx_ctxmenu[$page][2])) {
            return '<a href="' . mx_actionurl($page, $option, $action, $section, $redir, null, $other) . '" alt="' . $mx_ctxmenu[$page][2][$option][1] . '">' . $mx_ctxmenu[$page][2][$option][1] . '</a>';
        } else {
            return '<a href="' . mx_pageurl($page) . '" alt="' . $mx_ctxmenu[$page][1] . '">' . $mx_ctxmenu[$page][1] . '</a>';
        }
    } else {
        return '<a href="' . mx_pageurl($page) . '" alt="' . $page . '">' . $page . '</a>';
    }
}
Esempio n. 7
0
function mx_mnfblikeus($page, $option, $action)
{
    global $mxuser, $facebook;
    echo '<div class="fblikeus">';
    if (!is_pagelike() && !$mxuser->fbdata['user_id']) {
        echo mx_icon('click_like', _('Like us!'));
    } else {
        if (!is_pagelike()) {
            echo mx_icon('click_like_registered', _('Like us!'));
        } else {
            echo mx_icon('click_liked', _('Like us!')) . '<br/><a target=_blank href="' . mx_actionurl('account', 'register', '', '', '', '', '', true) . '">' . mx_icon('click_register', _('Register!')) . '</a>';
            ?>
		<!--
		<script>
		function checkappstatus() {
			FB.getLoginStatus(function(response) {
				if (response.status === 'connected') {
					window.location='<?php 
            echo mx_pageurl('main');
            ?>
';
				} else {
					setTimeout('checkappstatus();',2000);
				}
			},true);
		}
		setTimeout('checkappstatus();',2000);
		</script>
		-->
		<?php 
        }
    }
    echo '</div>';
    //echo print_r($mxuser,true);
}