function mx_mnerrpage() { mx_pagetitle('errpage', mx_pagename('errpage')); __('<p>You tried to access a page that does not exist on MusXpand,' . ' that was moved away or that you are simply not allowed access to.</p>'); echo sprintf(_('<p>If necessary, please contact our support at %s.</p>'), MXSUPPORTEMAIL); __('Thank you.'); }
function mx_sitetitle() { global $mxuser; $page = $_GET['p']; $option = $_GET['o']; $action = $_GET['a']; if (!$page) { echo 'MusXpand - ' . mx_option('title'); return; } if (!$option) { echo 'MusXpand - ' . mx_pagename($page); return; } if (($page == 'artists' && $option == 'artprof' || $page == 'fans' && $option == 'fanprof') && $action) { $user = $mxuser->getuserinfo($action); if ($option == 'fanprof') { echo sprintf(_('%s - MusXpand'), mx_getname($user)); } else { echo sprintf(_('%s - MusXpand'), mx_getartistname($user)); } return; } else { if ($page == 'media' && $option == 'medprof') { $media = $mxuser->getmediainfo($action); echo sprintf(_('%s by %s - MusXpand'), $media->title, $media->artistname); return; } } echo 'MusXpand - ' . mx_pagename($page) . ' - ' . mx_optionname($page, $option); }
function whoswhere() { global $mxdb, $mxuser; $users = $mxdb->whoswhere($this->id); if ($users) { if (is_admin()) { $whoswhere['users'] = array('user' => array(0, _('Who'), 'fan'), 'location' => array(0, _('Where'), 'text'), 'time' => array(0, _('when'), 'date'), 'ip' => array(0, _('IP'), 'text')); } else { $whoswhere['users'] = array('user' => array(0, _('Who'), 'fan'), 'location' => array(0, _('Where'), 'text'), 'time' => array(0, _('when'), 'date')); } $logs = array(); foreach ($users as $k => $userloc) { $log = new StdClass(); $log->user = $userloc->userid; $log->location = mx_pagename($userloc->pag) . ($userloc->opt ? '/' . mx_optionname($userloc->pag, $userloc->opt) : ''); $log->time = $userloc->date; $log->ip = $userloc->ip; $logs['users'][] = $log; } echo '<div class="form">'; echo mx_showtablestr($whoswhere, $logs, 'whoswhere', array(), 'users'); echo '</div>'; /* echo '<ul>'; foreach ($users as $id => $userloc) { $user=$this->getuserinfo($id); echo '<li>'; $where=mx_pagename($userloc->pag) .(($userloc->opt)?('/'.mx_optionname($userloc->pag,$userloc->opt)):''); echo sprintf(_('%s was in "%s" %s'), mx_getname($user), $where,mx_difftime($userloc->date)); echo '</li>'; } echo '</ul>'; */ } }
function mx_showmenu($menu, $menutype, $curpage = '', $curopt = '') { global $mx_ctxmenu, $mx_fbmenu, $mxuser; define('MXMENUVERTUSER', 0); define('MXMENUHORIZTOP', 1); define('MXMENUHORIZBOT', 2); define('MXMENUHORIZICON', 3); define('MXMENUHORIZHELP', 4); define('MXMENUVERTMAIN', 5); define('MXMENUHORIZFB', 6); define('MXMENUVERTICON', 7); if ($menutype != 0 && $menutype != 4 && $menutype != 6 && $menu != $mx_ctxmenu && array_key_exists($curpage, $mx_ctxmenu) && ($mx_ctxmenu[$curpage][0] == 1 && is_logged() || $mx_ctxmenu[$curpage][0] == 1.5 && !is_confirmed() || $mx_ctxmenu[$curpage][0] == 2 && !is_logged() || $mx_ctxmenu[$curpage][0] == 2.4 && (!is_logged() || is_confirmed()) || $mx_ctxmenu[$curpage][0] == 2.5 && (!is_confirmed() || is_setup()) || $mx_ctxmenu[$curpage][0] >= 3 && !is_setup() || $mx_ctxmenu[$curpage][0] == 10 && !(is_setup() && is_artist()) || $mx_ctxmenu[$curpage][0] == 11 && !(is_setup() && is_artist() && is_pageadmin()) || $mx_ctxmenu[$curpage][0] == 20 && !is_privileged() || $mx_ctxmenu[$curpage][0] < 0 || $mx_ctxmenu[$curpage][0] == 127 && !is_admin() || $mx_ctxmenu[$curpage][0] == 126 && !is_pseudoadmin())) { return; } if ($menutype == 6 && ($mx_fbmenu[$curpage][0] == 1 && is_logged() || $mx_fbmenu[$curpage][0] == 1.5 && !is_confirmed() || $mx_fbmenu[$curpage][0] == 2 && !is_logged() || $mx_fbmenu[$curpage][0] == 2.4 && (!is_logged() || is_confirmed()) || $mx_fbmenu[$curpage][0] == 2.5 && (!is_confirmed() || is_setup()) || $mx_fbmenu[$curpage][0] >= 3 && !is_setup() || $mx_fbmenu[$curpage][0] == 10 && !(is_setup() && is_artist()) || $mx_fbmenu[$curpage][0] == 11 && !(is_setup() && is_artist() && is_pageadmin()) || $mx_fbmenu[$curpage][0] < 0 || $mx_fbmenu[$curpage][0] == 127 && !is_admin() || $mx_fbmenu[$curpage][0] == 126 && !is_pseudoadmin())) { //error_log(print_r($mx_fbmenu[$curpage][0],true)); return; } switch ($menutype) { case MXMENUVERTUSER: // user vertical menu $style = 'usermenu menusep'; break; case MXMENUHORIZTOP: // topbar horizontal menu $style = 'ctxmenu'; break; case MXMENUHORIZBOT: // bottom screen menu $style = 'musxmenu'; break; case MXMENUHORIZICON: // topbar icon menu $style = 'iconmenu'; break; case MXMENUHORIZHELP: // help menu $style = 'helpmenu'; break; case MXMENUVERTMAIN: // main vertical menu $style = 'mainmenu menusep'; break; case MXMENUHORIZFB: // facebook menu $style = 'fbmenu'; break; case MXMENUVERTICON: // big icons menu $style = 'bigmenu'; break; } echo '<div class=\'' . $style . '\'>'; echo '<ul>'; if ($mxuser->id && ($menutype == MXMENUVERTUSER || $menutype == MXMENUVERTMAIN)) { echo '<li class="menutitle">' . ($menutype == MXMENUVERTMAIN ? '' : strtoupper(mx_pagename($curpage))) . '</li>'; } foreach ($menu as $menuopt => $menutable) { /*if (abs($menutable[0])>1 && !is_confirmed() && $menuopt!='signoff' //&& $menuopt!='messages' && $menuopt!='help' //&& $menuopt!='friends' && $menuopt!='setup') continue;*/ if (array_key_exists(2, $menutable) && !is_array($menutable[2]) && $menutable[2] != '#') { // redirection $page = $menutable[2]; $option = $menutable[3] != '' ? $menutable[3] : ''; } else { if (array_key_exists(2, $menutable) && $menutable[2] == '#') { // javascript (feedback) $page = '#'; $option = ''; } else { if ($menutype == 1 || $menutype == 0 || $menutype == 7) { // top or user menu $page = $curpage; $option = $menuopt; } else { if ($menutype == 4) { // help menu if ($mx_ctxmenu['help'][2][$curpage][3] == '') { $page = 'help'; $option = $curpage; } else { $page = 'help'; $option = $mx_ctxmenu['help'][2][$curpage][3]; } } else { $page = $menuopt; $option = ''; } } } } if (($menutype != 4 || $curpage != $menuopt) && (!$menutable[0] || $menutable[0] == 1 && !is_logged() || $menutable[0] == 1.5 && !is_logged() || $menutable[0] == 2 && is_logged() || $menutable[0] == 2.4 && is_logged() && !is_confirmed() || $menutable[0] == 2.5 && is_confirmed() && !is_setup() || $menutable[0] == 3 && is_setup() || $menutable[0] == 10 && is_setup() && is_artist() || $menutable[0] == 11 && is_setup() && is_artist() && is_pageadmin() || $menutable[0] == 20 && is_privileged() || $menutable[0] == 127 && is_admin() || $menutable[0] == 126 && is_pseudoadmin())) { if ($menutype == 3) { // icon menu $label = mx_icon($menuopt, $menutable[1], '20px'); if ($menuopt == 'messages' && $mxuser->newmsgs > 0) { $label .= '<div class="newmsgs"><div>' . $mxuser->newmsgs . '</div></div>'; } if ($menuopt == 'cart' && $mxuser->cart && $mxuser->cart->items > 0) { $label .= '<div class="cartitems"><div>' . $mxuser->cart->items . '</div></div>'; } } else { if ($menutype == 7) { // big menu $label = mx_icon($menuopt . '-big', $menutable[1], '112px'); if ($menuopt == 'messages' && $mxuser->newmsgs > 0) { $label .= '<div class="newmsgs"><div>' . $mxuser->newmsgs . '</div></div>'; } if ($menuopt == 'cart' && $mxuser->cart && $mxuser->cart->items > 0) { $label .= '<div class="cartitems"><div>' . $mxuser->cart->items . '</div></div>'; } } else { if ($menutype == 0 || $menutype == 5 || $menutype == 6) { // vertical menus if ($menutype != 6 && file_exists(mx_iconfile($menuopt . 'btn'))) { $label = '<span class="menubutton"><div>' . mx_icon($menuopt . 'btn', $menutable[1], '', 'xx', $menuopt . 'btnhover') . '</div></span>'; } else { if (file_exists(mx_iconfile($menuopt))) { $label = '<span class="menuicon">' . mx_icon($menuopt, $menutable[1], '16px') . '</span>'; } else { $label = '<span class="menuicon">' . mx_icon('blank', '', '16px') . '</span>'; } if ($menuopt == 'messages' && $mxuser->newmsgs > 0) { $label .= '<div class="newmsgs2"><div>' . $mxuser->newmsgs . '</div></div>'; } if ($menuopt == 'cart' && $mxuser->cart && $mxuser->cart->items > 0) { $label .= '<div class="cartitems2"><div>' . $mxuser->cart->items . '</div></div>'; } $label .= '<span class="menulabel">' . $menutable[1] . '</span>'; } //$label.=$menutable[1]; } else { $label = $menutable[1]; } } } echo '<li'; if ($menutype != 6 && file_exists(mx_iconfile($menuopt . 'btn'))) { echo ' class="button"'; } else { if ($curpage == $menuopt || $curopt == $menuopt) { echo ' class="selected"'; } else { if (!function_exists('mx_mn' . $menuopt)) { echo ' class="inactive"'; } } } echo '>'; if ($page == "#") { echo '<a href="#" onclick="' . $menutable[3] . '"' . ' alt="' . $menutable[1] . '">' . $label . '</a>'; } else { if (function_exists('mx_mn' . $menuopt)) { echo '<a href="' . mx_optionurl($page, $option) . '">' . $label . '</a>' . ($menutable[4] ? '<div class="newmenu">' . mx_icon('new', _('New'), '16px') . '</div>' : ''); } else { echo '<span class="inactive">' . $label . ' ' . _('(soon)') . '</span>'; } } echo '</li>'; } } echo '</ul></div>'; }