Exemple #1
0
 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_counton()
{
    // how many users connected ?
    global $mxdb;
    $users = $mxdb->counton();
    echo '<div class="quicknums">';
    echo '<h5>' . _('Some Numbers') . '</h5>';
    if (is_privileged()) {
        echo '<a href="' . mx_pageurl('whoswhere') . '" alt="' . mx_pagename('whoswhere') . '">';
        if (!$users['on']) {
            __('Nobody\'s online...');
        } else {
            if ($users['on'] == 1) {
                __('1 user online');
            } else {
                echo sprintf(_('%s users online'), $users['on']);
            }
        }
        echo '</a>';
        echo '<br/>';
        echo '<a href="' . mx_optionurl('fans', 'fandir') . '" alt="' . mx_optionname('fans', 'fandir') . '">';
        if (!$users['fans']) {
            __('No fan registered...');
        } else {
            if ($users['fans'] == 1) {
                __('1 fan registered');
            } else {
                echo sprintf(_('%s fans registered'), $users['fans']);
            }
        }
        echo '</a>';
        echo '<br/>';
        echo '<a href="' . mx_optionurl('artists', 'artsdir') . '" alt="' . mx_optionname('artists', 'artsdir') . '">';
        if (!$users['artists']) {
            __('No artist registered...');
        } else {
            if ($users['artists'] == 1) {
                __('1 artist registered');
            } else {
                echo sprintf(_('%s artists registered'), $users['artists']);
            }
        }
        echo '</a>';
        echo '<hr/>';
    }
    echo sprintf(_('%s visitors'), '<span id="mxvisits">' . $users['visitors'] . '</span>');
    echo '<br/>';
    //echo sprintf(_('%d connections'),$users['connections']);
    //echo '<br/>';
    echo sprintf(_('%s hits'), '<span id="mxhits">' . $users['hits'] . '</span>');
    echo '<br/>';
    echo '<script>cnttmr=setInterval(\'checkvisits()\',10000);</script>';
    echo '</div>';
}
Exemple #3
0
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);
}