예제 #1
0
function mx_mnlocate($page, $option, $action)
{
    $location = mx_locate();
    if ($location) {
        echo 'You are in ' . $location->city . ' (' . mx_region($location) . '), ' . $location->countryName;
    } else {
        echo 'No location available.';
    }
    print_r($location);
}
예제 #2
0
function mx_mnmxversion($page, $option, $action)
{
    global $MXVersion, $MXRelease, $MXRelDate, $MXlines, $MXCodinoma;
    $versform = array('mxversion', 0, 'MusXpand Version', _('Some information about MusXpand\'s development...'), array(), array('coding' => array(-1, _('Version Information'), _('About current version of MusXpand Software')), 'version' => array(0, _('Version:'), 'text'), 'codename' => array(0, _('Codename:'), 'quote'), 'release' => array(0, _('Release:'), 'text'), 'reldate' => array(0, _('Release Date:'), 'text'), 'lines' => array(0, _('Code Lines:'), 'text'), 'hosting' => array(-1, _('Hosting'), _('What\'s behind?')), 'location' => array(1, _('Server Location:'), 'text'), 'system' => array(1, _('System:'), 'text'), 'server' => array(1, _('Server:'), 'text'), 'php' => array(1, _('PHP Version:'), 'text'), 'team' => array(-1, _('Project Information'), _('The MusXpand Development Facts')), 'startdev' => array(0, _('Started:'), 'text'), 'developer' => array(0, _('Developer:'), 'text'), 'testers' => array(0, _('Local/Remote<br/>Beta-Testers:'), 'text'), 'equipments' => array(0, _('Development<br/>platforms:'), 'text'), 'software' => array(0, _('Software:'), 'text'), 'tests' => array(0, _('Tests:'), 'text'), 'a' => array(1, 'submit', 'hidden')));
    $fp = popen('uname -sr', 'r');
    $system = fgets($fp);
    pclose($fp);
    $fp = popen('uname -p', 'r');
    $machine = fgets($fp);
    pclose($fp);
    preg_match('%(Apache/(?P<apache>[^ ]+))%i', $_SERVER['SERVER_SOFTWARE'], $sver);
    $location = mx_locate(gethostbyname("www.example.com"));
    if ($location) {
        $region = mx_region($location);
    } else {
        $region = '';
    }
    $versvalues = array('startdev' => '28-Sep-2010', 'developer' => mx_peoplepage('peergum') . ', IT Engineer and somehow musician (FR)', 'testers' => mx_peoplepage(45) . ', Music Fan & Wife :-) (BR)' . '<br/>' . mx_peoplepage(47) . ', Artist (US)' . '<br/>' . mx_peoplepage('limey59') . ', Music Fan (CA)' . '<br/><a href="' . mx_optionurl('about', 'cQ') . '">Christopher Quinn, Artist (US) - R.I.P.</a>' . '<br/>' . mx_peoplepage('anubisspire') . ', Artist (US)' . '<br/>' . mx_peoplepage('carosta') . ', Artist (DE)' . '<br/>' . mx_peoplepage(58) . ', Artist (US)' . '<br/>' . mx_peoplepage('francisvoignier') . ', Artist (US)' . '<br/>' . mx_peoplepage('iMickeyD') . ', Artist (US)' . '<br/>' . mx_peoplepage('skyfire') . ', Music Fan (AU)', 'equipments' => 'MacBook Pro (500GB/8GB)' . '<br/>Fedora Linux Server (Dell)' . '<br/>Windows 7 PC (Dell)', 'software' => 'Mac OS X 10.7' . '<br/>Windows 7' . '<br/>Eclipse' . '<br/>Subversion (SVN)' . '<br/>XAMP & LAMP (Apache/MySQL/PHP on Mac OS X and Linux)' . '<br/>unix shell scripts (bash,awk)', 'tests' => 'Mac: Safari + Firefox' . '<br/>Windows: Internet Explorer + Firefox', 'version' => $MXVersion, 'codename' => $MXCodinoma, 'release' => $MXRelease, 'reldate' => $MXRelDate, 'lines' => $MXlines, 'location' => ($location->city ? $location->city : '') . ($region ? ' (' . $region . '),' : ($location->region ? '/' . $location->region . ',' : '')) . ' ' . $location->countryName, 'server' => 'Apache ' . $sver['apache'], 'php' => phpversion(), 'system' => $system, 'processor' => $machine);
    echo '<div class="mx-message">';
    mx_showform($versform, $versvalues, false);
    echo '</div>';
    //print_r($location);
    //phpinfo();
}
예제 #3
0
function mx_mnsetup($page, $option, $action)
{
    global $mxuser, $errors, $me, $facebook;
    if ($action == 'done') {
        $buttons = array();
        $setupform = array('setup', 0, _('You\'re Done!'), '', $buttons, array('confirmlabel' => array(-1, _('OPEN SESAME'), _('<p>Your account is now fully setup!</p><p>We know it was a bit painful,' . ' but you did really well and we\'re happy to unlock all features of MusXpand' . ' for you.</p><p>Note that you will always be able to make changes' . ' to your profile whenever you want, by using the menu on the left.</p>' . '<p>Now, feel at home, sit comfortably and start enjoying!</p>')), 'a' => array(1, 'done', 'hidden')));
        mx_showform($setupform, array(), false, true);
        switch ($mxuser->acctype) {
            case MXACCOUNTFAN:
                $typ = 'fan';
                $url = mx_actionurl('fans', 'fanprof', $mxuser->id);
                break;
            case MXACCOUNTARTIST:
                $typ = 'artist';
                $url = mx_actionurl('artists', 'artprof', $mxuser->id);
        }
        mx_fbaction('musxpand:register_as?' . $typ . '=' . urlencode($url));
        ?>

<!-- Google Code for Setup Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 949396365;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "-NVjCOPdzwMQjcfaxAM";
var google_conversion_value = 0;
if (2) {
  google_conversion_value = 2;
}
/* ]]> */
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/949396365/?value=2&amp;label=-NVjCOPdzwMQjcfaxAM&amp;guid=ON&amp;script=0"/>
</div>
</noscript>

		<?php 
        return;
    }
    $steps = array(1 => _('Account Type'), _('Basic Information'), _('Additional Details'), _('Profile Customization'), _('Privacy & Notifications'));
    $section = preg_replace('%[^0-9]%', '', $action);
    // just keep step number
    if ($section == '0') {
        $buttons = array('+setup_1' => _('Continue to Account Setup'));
        $setupform = array('setup', 0, _('Account Confirmation'), '', $buttons, array('confirmlabel' => array(-1, _('Account Activated'), _('<p>Your account is now confirmed!</p><p><b>We just sent you a temporary password,' . ' so that you can sign into your account any time.</b> You will be able to change this' . ' password later on in your profile.</p><p>We\'ll now go through' . ' a few more steps to set up your profile.</p>')), 'a' => array(1, 'confirmation', 'hidden')));
        mx_showform($setupform, array(), true, true);
        ?>

<!-- Google Code for Registered Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 949396365;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "EFxUCOvczwMQjcfaxAM";
var google_conversion_value = 0;
/* ]]> */
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/949396365/?label=EFxUCOvczwMQjcfaxAM&amp;guid=ON&amp;script=0"/>
</div>
</noscript>

		<?php 
        return;
    }
    if (!$section || $section > count($steps)) {
        $section = 1;
    }
    $fldarray = $mxuser->infogroups($section, $mxuser->acctype);
    foreach ($fldarray as $grp => $det) {
        if ($grp == 'location') {
            $location = mx_locate();
        }
        $bandflds[$grp] = array(-1, $det[0]);
        foreach ($det[1] as $fld) {
            $bandflds[$fld] = $mxuser->fielddesc($fld, false);
            // fld description for users!
            if ($bandflds[$fld][0] == 2 && $mxuser->acctype != MXACCOUNTARTIST && $mxuser->acctype != MXACCOUNTBAND) {
                unset($bandflds[$fld]);
                continue;
            }
            if ($fld == "password") {
                $bandflds[$fld][5] = true;
                // allow password changes
            }
            $bandvalue[$fld] = $mxuser->{$fld};
        }
        $bandflds['a'] = array(1, 'modifyuser', 'hidden');
        $bandflds['k'] = array(1, $section, 'hidden');
    }
    if ($section > 1) {
        $buttons['setup_' . ($section - 1)] = '&larr; ' . $steps[$section - 1];
    }
    // previous step
    if ($section < count($steps)) {
        $buttons['+setup_' . ($section + 1)] = $steps[$section + 1] . ' &rarr;';
        // next step
        if ($section > 1) {
            $buttons['done'] = _('I\'ll finish later!') . ' &rarr;';
        }
    }
    if ($section == count($steps)) {
        $buttons['+done'] = _('I\'m Done!') . ' &rarr;';
    }
    $buttons['clear'] = _('Clear');
    $bandinfo = array('setup', 0, sprintf(_('Setup: %s %s'), $steps[$section], $section > 1 ? '(' . $section . '/' . count($steps) . ')' : ''), _('Please fill in as appropriate'), $buttons, $bandflds);
    //echo '<xmp>'.print_r($bandvalue).'</xmp>';
    if (array_key_exists('city', $bandflds)) {
        // auto fill geographical location
        $location = mx_locate();
        if ($location) {
            $locvalues = array('city' => iconv('ISO-8859-1', 'utf-8', $location->city), 'state' => mx_region($location), 'country' => $location->countryCode);
            $bandvalue = array_replace($bandvalue, $locvalues);
        }
    }
    mx_showform($bandinfo, $bandvalue, true, true, $errors);
    ?>
<script language="javascript">
    function createUploader(){
        var uploader = new qq.FileUploader({
            element: document.getElementById('fileuploader'),
            action: '<?php 
    echo mx_option('siteurl') . '/picupload.php';
    ?>
',
            params: {
            	id: '<?php 
    echo $mxuser->id;
    ?>
'
            },
            allowedExtensions: ['jpg','jpeg','png'],
			sizeLimit: 2000000,
			onComplete: function(id, fileName, responseJSON){
				if (responseJSON.success) {
					var mypic=document.getElementById('newpic');
					if (mypic) mypic.src='<?php 
    echo mx_option('usersURL') . '/tmp/';
    ?>
'+encodeURIComponent(fileName);
					var piclist=document.getElementById('piclist');
					if (piclist) {
						listelem=document.createElement('li');
						input=document.createElement('input');
						input.type='radio';
						input.name='picture';
						input.value=responseJSON['link'];
						input.checked=true;
						input.onclick=function() {
							mypic.src='<?php 
    echo mx_option('usersURL') . '/tmp/';
    ?>
'+encodeURIComponent(fileName);
						}
						var radiolabel=document.createTextNode(fileName);
						listelem.appendChild(input);
						listelem.appendChild(radiolabel);
						piclist.appendChild(listelem);
					}
				}
            }
        });
    }

    // in your app create uploader as soon as the DOM is ready
    // don't wait for the window to load
    //if (window.onload) {
    //	var oldloadfunction=window.onload;
    //	window.onload = (typeof window.onload != 'function') ? createUploader : function() { oldloadfunction(); createUploader(); };
    //} else window.onload = createUploader;
    createUploader();
</script>
<?php 
}