示例#1
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('→ ' . ($dbuser->fullname ? $dbuser->fullname : $dbuser->firstname . ' ' . $dbuser->lastname));
    } else {
        mx_optionsubtitle('→ ' . ($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>';
}
示例#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('&rarr; ' . $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 
    }
}
示例#3
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 
    }
}