Esempio n. 1
0
function mx_showfanpage($id, $simul = '')
{
    global $mxuser;
    $dbuser = $mxuser->getuserinfo($id);
    if ($dbuser->acctype == MXACCOUNTARTIST) {
        return mx_showartistpage($id, 0, $simul);
    }
    if ($dbuser->status == MXACCTDISABLED) {
        __('This account doesn\'t exist');
        return;
    }
    if (!$dbuser) {
        mx_optiontitle('error', _('This account doesn\'t exist'));
        return;
    }
    /*if ($dbuser->acctype==MXACCOUNTFAN || $option=='viewprof' || $option=='fanprof') {
    		mx_optionsubtitle('→ '.mx_getname($dbuser));
    	} else {
    		mx_optionsubtitle('→ '.mx_getartistname($dbuser));
    	}*/
    $authflds = $mxuser->getauthorizedfields($dbuser->id);
    $authgrps = $mxuser->getauthorizedgroups($authflds);
    $section = '';
    if (!$authgrps || !$authflds) {
        __('No information available.');
        return;
    }
    $custpage = $dbuser->custompage ? $dbuser->custompage : MXDEFFANPAGE;
    mx_showcustompage($custpage, $dbuser, 0, $simul);
    if ($id != $mxuser->id) {
        mx_fbaction('musxpand:check_out?fan=' . urlencode(mx_actionurl('fans', 'fanprof', $id)));
    }
    return;
}
Esempio n. 2
0
function mx_showmediapage($id)
{
    global $mxuser;
    $id = preg_replace('%[^0-9]%', '', $id);
    // filter fake media ids
    $media = $mxuser->getmediainfo($id);
    if (!$media) {
        __('Sorry, this media could not be found.');
        return;
    }
    $fanship = $mxuser->getfanship($media->owner_id, $id);
    if ($media->status == MXMEDIAREADY || $media->type == MXMEDIABASEBUNDLE && $fanship != null) {
        __('This media has not been released yet');
        return;
    }
    mx_medialist($media, $fanship, true);
    foreach ($media->bundles as $bundle) {
        $bfanship = $mxuser->getfanship($bundle->owner_id, $bundle->id);
        mx_medialist($bundle, $bfanship, true);
    }
    $dbuser = $mxuser->getuserinfo($media->owner_id);
    if ($dbuser->status == MXACCTDISABLED) {
        __('Media is unavailable.');
        return;
    }
    if ($dbuser->acctype == MXACCOUNTFAN) {
        echo sprintf(_('This media is private' . 'and belongs to this %s.'), mx_actionlink('fans', 'fanprof', $id));
        return;
    }
    if (!$dbuser || $dbuser->status == MXACCTDISABLED) {
        mx_optiontitle('error', _('Media unavailable.'));
        return;
    }
    mx_optionsubtitle('→ ' . $media->title);
    $authflds = $mxuser->getauthorizedfields($dbuser->id);
    $authgrps = $mxuser->getauthorizedgroups($authflds);
    $media->artist = $dbuser;
    //echo mx_mediadata($media,$fanship);
    $section = '';
    if (!$authgrps || !$authflds) {
        __('No information available.');
        return;
    }
    $custpage = 'basicmediatemplate';
    mx_showcustompage($custpage, $dbuser, $media);
    if ($media->type == MXMEDIAREGULARBUNDLE) {
        mx_fbaction('musxpand:examine?bundle=' . urlencode(mx_actionurl('media', 'medprof', $id)));
    }
    if ($_GET['z']) {
        ?>
		<script type='text/javascript'>
		$(window).ready(function() {
			play(0);
		});
		</script>
		<?php 
    }
}
Esempio n. 3
0
function mx_content()
{
    global $mxuser;
    $locale = $mxuser->locale ? $mxuser->locale : 'en_US';
    // message and media frame
    echo '<div id="contentframe" class="contentframe form list">';
    echo '<div></div>';
    //media or message will be inserted here
    echo '</div>';
    // contentframe
    echo '<div id="overlay"></div>';
    if (array_key_exists('q', $_REQUEST)) {
        $query = mx_securestring(urldecode($_REQUEST['q']));
    }
    if ($query) {
        $page = 'search';
        $option = '';
        $action = $query;
    } else {
        $page = mx_secureword($_REQUEST['p']);
        if (!$page) {
            $page = 'main';
        }
        $option = mx_secureword($_REQUEST['o']);
        $action = mx_secureword($_REQUEST['a']);
    }
    // log it!
    $referer = $_SERVER['HTTP_REFERER'];
    if (preg_match('%^https?://[^.]+.musxpand.[^/]+%', $referer) > 0) {
        $referer = '';
    }
    $mxuser->logme($page, $option, $action, $referer);
    // define page and option functions
    $pagefunc = 'mx_mn' . $page;
    $optionfunc = 'mx_mn' . $option;
    if (MXDEFFEATURES & MXFTDROPMENU) {
        if (function_exists($pagefunc)) {
            $pagefunc($page, $option, $action);
        }
        if (function_exists($optionfunc)) {
            $optionfunc($page, $option, $action);
        }
        return;
    }
    if ($mxuser->id || $page != 'main') {
        mx_pagetitle($page, mx_pagename($page));
    }
    if ($page == 'artists' && $option == 'artprof' || $page == 'fans' && $option == 'fanprof') {
        $pagefunc($page, $option, $action);
        $optionfunc($page, $option, $action);
        return;
    }
    if (function_exists($pagefunc)) {
        $pagefunc($page, $option, $action);
        $ok = 1;
    } else {
        mx_showhtmlpage($page);
    }
    if ($option) {
        mx_optiontitle($option, mx_optionname($page, $option));
        if (function_exists($optionfunc)) {
            $optionfunc($page, $option, $action);
            $ok = 1;
        } else {
            mx_showhtmlpage($option);
        }
    }
}
Esempio n. 4
0
function mx_mnviewprof($page, $option, $action)
{
    global $mxuser;
    $dbuser = $mxuser->getuserinfo($action);
    // action=id
    if (!$dbuser) {
        mx_optiontitle('error', _('Profile is Not accessible.'));
        return;
    }
    if ($dbuser->acctype == MXACCOUNTFAN || $option == 'viewprof') {
        mx_optionsubtitle('&rarr; ' . ($dbuser->fullname ? $dbuser->fullname : $dbuser->firstname . ' ' . $dbuser->lastname));
    } else {
        mx_optionsubtitle('&rarr; ' . ($dbuser->artistname ? $dbuser->artistname : $dbuser->fullname));
    }
    $authflds = $mxuser->getauthorizedfields($dbuser->id);
    $authgrps = $mxuser->getauthorizedgroups($authflds);
    $section = '';
    if (!$authgrps || !$authflds) {
        __('No information available.');
        return;
    }
    echo '<form name="profile" method="POST">';
    for ($i = 0; $i < 2; $i++) {
        $action = !$i ? 'edit' : '';
        foreach ($mxuser->infogroups() as $group => $details) {
            if (!$authgrps || !array_key_exists($group, $authgrps)) {
                continue;
            }
            if ($section == '') {
                $section = $group;
            }
            $form = 0;
            if ($action == 'edit') {
                $form = 1;
            }
            if ($form) {
                $edit = '';
                $style = 'form';
            } else {
                if ($mxuser->status == MXACCTTRUSTFUL) {
                    $edit = '<a href="javascript:tabswitch(\'' . $group . '\',\'f_' . $group . '\');"' . ' alt="' . sprintf(_('Edit %s Information'), $details[0]) . '">' . mx_icon('edit', '', 16) . '</a>';
                } else {
                    $edit = '';
                }
                $style = 'info';
            }
            echo '<div id="' . ($form ? 'f_' : '') . $group . '" class="' . $style . ($section == $group && !$form ? '' : ' hidden') . '">';
            echo '<table><tr><td>';
            echo '<fieldset>';
            $fldarray = $mxuser->infogroups();
            foreach ($fldarray as $grp => $det) {
                $profflds[$grp] = array(-1, $det[0]);
                foreach ($det[1] as $fld) {
                    $profflds[$fld] = $mxuser->fielddesc($fld, true);
                    // fld description for prof!
                    $profvalue[$fld] = $dbuser->{$fld};
                }
                $profflds['acc_id'] = array(1, $dbuser->id, 'hidden');
                $profflds['a'] = array(1, 'modifyprof', 'hidden');
            }
            $buttons = array('submit' => _('Submit'), 'clear' => _('Clear'));
            $profinfo = array('profinfo', 0, sprintf(_('Profile Information for %s'), mx_getname($dbuser)), _('Find below the details about this user'), $buttons, $profflds);
            //echo '<xmp>'.print_r($profvalue).'</xmp>';
            mx_showform($profinfo, $profvalue, $form);
            echo '</fieldset>';
            echo '</td></tr>';
            if ($form) {
                echo mx_formfield('a', 'submit', 'hidden');
                echo '<tr><td class="buttons">';
                echo mx_formfield('submit', _('Submit'), 'submit') . '&nbsp';
                echo mx_formfield('reset', _('Clear'), 'reset');
            }
            echo '</td></tr>';
            echo '</table>';
            echo '</div>';
        }
    }
    echo '</form>';
}
Esempio n. 5
0
function mx_showartistpage($id, $mediaid = -1, $simul = '')
{
    global $mxuser;
    $dbuser = $mxuser->getuserinfo($id);
    if ($dbuser->status == MXACCTDISABLED) {
        __('This account doesn\'t exist');
        return;
    }
    /*
    if ($dbuser->acctype==MXACCOUNTFAN) {
    	echo sprintf(_('This is not an artist account<br/>'
    	.'You may want to check this %s instead...'),mx_actionlink('fans','fanprof',$id));
    	return;
    }
    */
    if (!$dbuser || $dbuser->status == MXACCTDISABLED) {
        mx_optiontitle('error', _('This account doesn\'t exist'));
        return;
    }
    /*
    	if ($dbuser->acctype==MXACCOUNTFAN || $option=='viewprof') {
    		mx_optionsubtitle('&rarr; '.($dbuser->fullname?
    		$dbuser->fullname:($dbuser->firstname.' '.$dbuser->lastname)));
    	} else {*/
    if ($mxuser && $mxuser->id && $mxuser->id == $id) {
        if ($simul == '') {
            $simdiv = '<div class="simuldiv"><a href="' . mx_actionurl('account', 'myartpage', 'public') . '">' . _('(Public Preview)') . '</a></div>';
        } else {
            $simdiv = '<div class="simuldiv"><a href="' . mx_actionurl('account', 'myartpage', '') . '">' . _('(Normal Preview)') . '</a></div>';
        }
    } else {
        $simdiv = '';
    }
    mx_optionsubtitle($simdiv);
    /*mx_optionsubtitle('&rarr; '.($dbuser->artistname?
    	$dbuser->artistname:$dbuser->fullname).$simdiv);*/
    //}
    $authflds = $mxuser->getauthorizedfields($dbuser->id);
    $authgrps = $mxuser->getauthorizedgroups($authflds);
    $section = '';
    if (!$authgrps || !$authflds) {
        __('No information available.');
        return;
    }
    $custpage = $dbuser->custompage ? $dbuser->custompage : MXDEFARTISTPAGE;
    $media = new stdClass();
    if ($mediaid < 0 && $_GET['z']) {
        $mediaid = 0;
    }
    $media->id = $mediaid;
    mx_showcustompage($custpage, $dbuser, $media, $simul);
    if ($id != $mxuser->id) {
        mx_fbaction('musxpand:check_out?artist=' . urlencode(mx_actionurl('artists', 'artprof', $id)));
    }
    if ($_GET['z']) {
        ?>
		<script type="text/javascript">
		$(window).ready(function() {
			openbundle(0,0);
			//play(0);
		});
		</script>
		<?php 
    }
}