Beispiel #1
0
function mx_mnmystuff($page, $option, $action)
{
    global $mxuser, $errors;
    if ($errors) {
        mx_warning($errors);
    }
    switch ($action) {
        case 'submit':
            print_r($_FILES);
            break;
        case 'fileupload':
            $tmpfiles = $mxuser->gettmpmedia();
            if (!$tmpfiles) {
                __('No files seem to have been uploaded to your account.');
                break;
            }
            $allmedia = array();
            $mediaval = array();
            $pid = 0;
            $onlynew = $_REQUEST['onlynew'];
            //echo 'onlynew:'.$onlynew.'<br/>time()='.time().' - date():'.date('U').' - gmdate():'.gmdate('U').'<br/>';
            while ($tmpfiles && ($media = $mxuser->gettmpmedia($tmpfiles))) {
                $flds = array('filename_' . $pid => array(-1, $media->filename), 'id_' . $pid => array(1, $media->id, 'hidden'), 'name_' . $pid => array(0, $media->filename, 'hidden'), 'title_' . $pid => array(1, _('Title:'), 'text', 100), 'type_' . $pid => array(1, _('Type:'), 'filetype'), 'desc_' . $pid => array(1, _('Description:'), 'simplememo'), 'comp_' . $pid => array(1, _('State:'), 'completion'), 'delete_' . $pid => array(1, _('Delete:'), 'checkbox', _('Permanently remove this file from server'), null, $onlynew && $onlynew > strtotime($media->timestamp)));
                //echo 'id #'.$pid.' date:'.$media->timestamp.' ('.strtotime($media->timestamp).')<br/>';
                switch (pathinfo($media->filename, PATHINFO_EXTENSION)) {
                    case 'jpg':
                    case 'png':
                    case 'gif':
                        $ftype = MXMEDIAPIC;
                        break;
                    case 'mp4':
                    case 'm4v':
                    case 'avi':
                    case 'mov':
                        $ftype = MXMEDIAVIDEO;
                        break;
                    case 'mp3':
                    case 'wav':
                    case 'aif':
                        $ftype = MXMEDIASONG;
                        break;
                    default:
                        $ftype = MXMEDIADOC;
                        break;
                }
                $fvalues = array('title_' . $pid => $media->filename, 'type_' . $pid => $ftype, 'desc_' . $pid => _('You should describe your media here...'), 'comp_' . $pid => MXMEDIANOSTATUS, 'delete_' . $pid => 1);
                $allmedia = array_merge($allmedia, $flds);
                $mediaval = array_merge($mediaval, $fvalues);
                $pid++;
            }
            $allmedia['a'] = array(1, 'mediaupdate', 'hidden');
            $buttons = array('mediaupdate' => _('Submit'), 'clear' => _('Clear'));
            $mediaform = array('mediaform', 0, _('Media Information'), _('Please fill in the information' . ' about the uploaded files'), $buttons, $allmedia);
            mx_showform($mediaform, $mediaval);
            break;
        case 'm_publishnew':
        case 'm_publisharch':
        case 'm_editpub':
        case 'm_editarch':
        case 'm_editmed':
            $selmedia = $_REQUEST['selmedia'];
            if (!$selmedia) {
                __('No media selected.');
                break;
            }
            $medialist = $mxuser->listselectedmedia($selmedia);
            if (!$medialist) {
                __('No media selected.');
                break;
            }
            $allmedia = array();
            $mediaval = array();
            $pid = 0;
            foreach ($medialist as $id => $media) {
                $flds = array('filename_' . $pid => array(-1, $media->filename), 'id_' . $pid => array(1, $id, 'hidden'), 'name_' . $pid => array(0, $media->filename, 'hidden'), 'title_' . $pid => array(1, _('Title:'), 'text', 60), 'desc_' . $pid => array(1, _('Description:'), 'simplememo', '', '', _('You should describe your media here...')), 'type_' . $pid => array(1, _('Type:'), 'filetype'), 'comp_' . $pid => array(1, _('State:'), 'completion'), 'size_' . $pid => array(0, _('Size:'), 'size'), 'status_' . $pid => array(1, _('Status:'), 'mediastatus'));
                //echo 'id #'.$pid.' date:'.$media->timestamp.' ('.strtotime($media->timestamp).')<br/>';
                switch (pathinfo($media->filename, PATHINFO_EXTENSION)) {
                    case 'jpg':
                    case 'png':
                    case 'gif':
                        $ftype = MXMEDIAPIC;
                        break;
                    case 'mp4':
                    case 'm4v':
                    case 'avi':
                    case 'mov':
                        $ftype = MXMEDIAVIDEO;
                        break;
                    case 'mp3':
                    case 'wav':
                    case 'aif':
                        $ftype = MXMEDIASONG;
                        break;
                    default:
                        $ftype = MXMEDIADOC;
                        break;
                }
                $fvalues = array('title_' . $pid => $media->title ? $media->title : $media->filename, 'size_' . $pid => $media->size, 'type_' . $pid => $media->type ? $media->type : $ftype, 'desc_' . $pid => $media->desc, 'comp_' . $pid => $media->comp, 'status_' . $pid => $media->status);
                $allmedia = array_merge($allmedia, $flds);
                $mediaval = array_merge($mediaval, $fvalues);
                $pid++;
            }
            $agreement = array('warning' => array(-1, _('Legal Terms'), _('By checking the box below,' . ' you acknowledge that any media made available to your current fans' . ' will be available to them for at least one full year from the date of' . ' its publication. Whoever is not a fan will lose access to any media as soon as you' . ' archive them.')), 'agreement' => array(1, _('Agreement'), 'checkbox', _('I fully agree with the above statement.'), _('You have to agree to continue...')));
            $allmedia = array_merge($allmedia, $agreement);
            $allmedia['a'] = array(1, 'none', 'hidden');
            //$mediaval['agreement']=0;
            $buttons = array('mediapublish' => _('Publish'), 'mymedia' => _('Cancel'), 'clear' => _('Reset form'));
            $mediaform = array('mediaform', 0, _('Media Information'), _('Please inform the scope of publication' . ' for each media'), $buttons, $allmedia);
            mx_showform($mediaform, $mediaval, true);
            break;
        case 'm_editnew':
            //case 'm_editpub':
            //case 'm_editarch':
            //case 'm_editmed':
            $selmedia = $_REQUEST['selmedia'];
            if (!$selmedia) {
                __('No media selected.');
                break;
            }
            $medialist = $mxuser->listselectedmedia($selmedia);
            if (!$medialist) {
                __('No media selected.');
                break;
            }
            $allmedia = array();
            $mediaval = array();
            $pid = 0;
            foreach ($medialist as $id => $media) {
                $flds = array('filename_' . $pid => array(-1, $media->filename), 'id_' . $pid => array(1, $id, 'hidden'), 'name_' . $pid => array(0, $media->filename, 'hidden'), 'title_' . $pid => array(1, _('Title:'), 'text', 100), 'type_' . $pid => array(1, _('Type:'), 'filetype'), 'size_' . $pid => array(0, _('Size:'), 'integer'), 'desc_' . $pid => array(1, _('Description:'), 'simplememo', '', '', _('You should describe your media here...')), 'comp_' . $pid => array(1, _('State:'), 'completion'));
                if ($action == 'm_editpub') {
                    $flds['status_' . $pid] = array(1, _('Access'), 'mediastatus');
                }
                //echo 'id #'.$pid.' date:'.$media->timestamp.' ('.strtotime($media->timestamp).')<br/>';
                switch (pathinfo($media->filename, PATHINFO_EXTENSION)) {
                    case 'jpg':
                    case 'jpeg':
                    case 'png':
                    case 'gif':
                        $ftype = MXMEDIAPIC;
                        break;
                    case 'mp4':
                    case 'm4v':
                    case 'avi':
                    case 'mov':
                        $ftype = MXMEDIAVIDEO;
                        break;
                    case 'mp3':
                    case 'wav':
                    case 'aif':
                        $ftype = MXMEDIASONG;
                        break;
                    default:
                        $ftype = MXMEDIADOC;
                        break;
                }
                $fvalues = array('title_' . $pid => $media->title ? $media->title : $media->filename, 'size_' . $pid => $media->size, 'type_' . $pid => $media->type ? $media->type : $ftype, 'desc_' . $pid => $media->desc, 'comp_' . $pid => $media->comp, 'status_' . $pid => $media->status);
                $allmedia = array_merge($allmedia, $flds);
                $mediaval = array_merge($mediaval, $fvalues);
                $pid++;
            }
            $allmedia['a'] = array(1, 'mediadescupdate', 'hidden');
            $buttons = array('mediadescupdate' => _('Submit'), 'mymedia' => _('Cancel'), 'clear' => _('Clear'));
            $mediaform = array('mediaform', 0, _('Media Information'), _('Please fill in the information' . ' about the uploaded files'), $buttons, $allmedia);
            mx_showform($mediaform, $mediaval);
            break;
        case 'mymedia':
        default:
            $mxuser->checkbundles();
            $listorder = mx_secureword($_GET['s']);
            if ($listorder != '') {
                $listorder .= ' asc';
            }
            $listorder .= ($listorder ? ',' : '') . 'timestamp desc';
            $allmedia = array();
            $medialist = array('medialist', 0, _('Media List'), '', array('new' => array('m_bundle' => _('Bundle Maker'), 'm_publishnew' => _('Publish'), 'm_deletenew' => _('Delete'), 'clear' => _('Clear')), 'published' => array('clear' => _('Clear')), 'archived' => array('*m_deletearch' => _('Delete [ADMIN]'), 'clear' => _('Clear')), 'allmedia' => array('clear' => _('Clear'))), array('new' => array('new' => array(-1, _('New Media & Uploads'), _('Below is the list of all media you uploaded recently' . ' and still haven\'t published for fans, members and/or everyone to discover.') . '<div class="helpnotice"><span class="helpnotice">' . _('On quality:') . '</span> ' . _('for music, we now <u>require</u> artists to upload 320Kbps/44KHz media files (HiFi) for the fans to enjoy a' . ' satisfactory listening experience.') . '<br/>' . _('Click or the Help button on the right for some help about the publishing process') . '</div>' . '<div id="fileuploader"></div>'), 'select' => array(0, '<input id="checkallbox" type="checkbox" onclick="javascript:checkall(\'new\');">', 'html', 3), 'mediadata' => array(0, '<div id="player">' . mx_mediabutton('openbundle', _('Open All Bundles'), 24, 'oa_', 0, 'hover') . mx_mediabutton('notready.gif', _('Please wait...'), 24, 'wa_', 0) . mx_mediabutton('closebundle', _('Close All Bundles'), 24, 'ca_', 0, 'hover') . '</div>', 'html'), 'a' => array(1, 'newbundle', 'hidden')), 'published' => array('published' => array(-1, _('Published'), _('The media you published so far.')), 'select' => array(0, '<input id="checkallbox" type="checkbox" onclick="javascript:checkall(\'published\');">', 'html', 3), 'mediadata' => array(0, '<div id="player">' . mx_mediabutton('openbundle', _('Open All Bundles'), 24, 'oa_', 0, 'hover') . mx_mediabutton('notready.gif', _('Please wait...'), 24, 'wa_', 0) . mx_mediabutton('closebundle', _('Close All Bundles'), 24, 'ca_', 0, 'hover') . '</div>', 'html'), 'a' => array(1, 'none', 'hidden')), 'archived' => array('archived' => array(-1, _('Archived'), _('The published media you decided to archive<br/>' . ' (still available to fans during one year after archived).')), 'select' => array(0, '<input id="checkallbox" type="checkbox" onclick="javascript:checkall(\'archived\');">', 'html', 3), 'mediadata' => array(0, '<div id="player">' . mx_mediabutton('openbundle', _('Open All Bundles'), 24, 'oa_', 0, 'hover') . mx_mediabutton('notready.gif', _('Please wait...'), 24, 'wa_', 0) . mx_mediabutton('closebundle', _('Close All Bundles'), 24, 'ca_', 0, 'hover') . '</div>', 'html'), 'a' => array(1, 'none', 'hidden')), 'allmedia' => array('allmedia' => array(-1, _('All Media'), _('Below is the list of all media you uploaded' . ' into your account.')), 'select' => array(0, '<input id="checkallbox" type="checkbox" onclick="javascript:checkall(\'allmedia\');">', 'html', 3), 'mediadata' => array(0, '<div id="player">' . mx_mediabutton('openbundle', _('Open All Bundles'), 24, 'oa_', 0, 'hover') . mx_mediabutton('notready.gif', _('Please wait...'), 24, 'wa_', 0) . mx_mediabutton('closebundle', _('Close All Bundles'), 24, 'ca_', 0, 'hover') . '</div>', 'html'), 'a' => array(1, 'none', 'hidden'))));
            $mediabundles = $mxuser->listbundles($mxuser->id, null, $listorder, true);
            while ($mediabundles && ($bundle = $mxuser->listbundles($mxuser->id, $mediabundles, $listorder, true))) {
                foreach ($mxuser->getmediainfo($bundle->id) as $key => $value) {
                    $bundle->{$key} = $value;
                }
                $bundle->filesize = $bundle->size;
                //$bundle->info=sprintf(_('%d media<br/>(%s)'),$bundle->cnt,mx_size($bundle->size));
                mx_medialist($bundle, null, false, true);
                //error_log(print_r($bundle,true));
                if ($bundle->type == MXMEDIABASEBUNDLE) {
                    $allmedia['new'][] = $bundle;
                    $allmedia['published'][] = $bundle;
                    $allmedia['archived'][] = $bundle;
                } else {
                    if ($bundle->status < MXMEDIAFANVISIBLE) {
                        $allmedia['new'][] = $bundle;
                    }
                    if ($bundle->status >= MXMEDIAFANVISIBLE && $bundle->status < MXMEDIAARCHIVED) {
                        $allmedia['published'][] = $bundle;
                    }
                    if ($bundle->status == MXMEDIAARCHIVED) {
                        $allmedia['archived'][] = $bundle;
                    }
                }
                /* else if ($bundle->status==MXMEDIAVALIDATED || $bundle->status==MXMEDIAREADY) $allmedia['new'][]=$bundle;
                			else if ($bundle->status==MXMEDIAARCHIVED) $allmedia['archived'][]=$bundle;
                			else if ($bundle->status>=MXMEDIAFANVISIBLE && $bundle->status<=MXMEDIAPUBLICSHARED) {
                				$allmedia['published'][]=$bundle;
                				$allmedia['archived'][]=$bundle;
                			}*/
                $allmedia['allmedia'][] = $bundle;
            }
            //$str='<div id="mediaplayer"><div id="playerwindow"></div></div>';
            //$str.='<div class="form">';
            /*$str.='<form name="media">'
            		.mx_showtablestr($medialist[5],$allmedia,'pubmed',$medialist[4],'media')
            		.'</form></div>';*/
            $str .= mx_showliststr($medialist, $allmedia, 'media', true);
            /*$str.='<script type="text/javascript" charset="utf-8">
               // Add VideoJS to all video tags on the page when the DOM is ready
               VideoJS.setupAllWhenReady();
             	</script>';*/
            echo $str;
            echo '<script language="javascript">';
            foreach ($allmedia['allmedia'] as $bundle) {
                echo 'setdroppable(' . $bundle->id . ');';
                if ($bundle->type == MXMEDIABASEBUNDLE) {
                    echo 'setworksortable(' . $bundle->id . ');';
                } else {
                    echo 'setsortable(' . $bundle->id . ');';
                }
            }
            $wbundleid = $mxuser->getbasebundle();
            echo 'openbundle(' . $wbundleid . ');';
            echo '</script>';
            ?>
<script language="javascript">
    function createUploader(){
        var uploader = new qq.FileUploader({
            element: document.getElementById('fileuploader'),
            action: '<?php 
            echo mx_option('siteurl') . '/fileupload.php';
            ?>
',
            params: {
            	id: '<?php 
            echo $mxuser->id;
            ?>
'
            },
            allowedExtensions: ['jpg','jpeg','png','mp3','m4v','pdf','mp4','mov'],
			sizeLimit: <?php 
            echo MXMAXFILESIZE;
            ?>
,
			onComplete: function(id,filename,result) { if ('success' in result) showupload(result); }
        });
    }

    // 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;
</script>
		<?php 
            break;
        case 'upload':
            ?>
<div id="basicuploader">
<noscript>
		<?php 
            __('Javascript is not currently enabled in your browser. You can enjoy a easier and' . ' simpler file uploader if you enable that feature. If you prefer, consult' . ' your manual, activate Javascript and reload this page...');
            ?>
</noscript>
		<?
		$buttons=array(
			'submit' => _('Submit'),
			'clear' => _('Clear')
		);
		$uploadform=array(
			'basicupload',0,_('Media Upload [Basic Uploader]'),_('Please fill the form below to upload' .
					' new media to your account'),
			$buttons,
			array(
				'fileinfo' => array(-1,_('File Information'),_('Please describe the file you' .
						' will upload')),
				'name' => array(1,_('Media name:'),'text',100),
				'filename' => array(1,_('File:'),'file'),
				'type' => array(1,_('Type:'),'filetype'),
				'description' => array(1,_('Description:'),'simplememo'),
				'authorship' => array(-1,_('Legal Bindings'),_('By clicking the box below,' .
						' you hereby certify to the full extends of copyright laws that you' .
						' fully own the rights' .
						' on the material you are going to upload, or are legally' .
						' authorized to do so. You also confirm, that you are aware that' .
						' any false claim is subject to prosecution by the legal copyrights' .
						' owner to whom you will directly and exclusively respond to.')),
				'agreement'  => array(1,_('I Agree'),'boolean',2),
				'a' => array(1,'submit','hidden')
			)
		);
		mx_showform($uploadform,'',true);
		?>
</div>
<div id='jsuploader' style="display:none;">
		<?php 
            $oldmedia = "";
            $tmpfiles = $mxuser->gettmpmedia();
            while ($tmpfiles && ($media = $mxuser->gettmpmedia($tmpfiles))) {
                $oldmedia .= $media->filename . '<br/>';
            }
            $buttons = array('submit' => _('Submit'), 'clear' => _('Clear'));
            $uploadform = array('jsupload', 0, _('Media Upload [Javascript Uploader]'), _('Please upload one or more files' . ' below by clicking on the Upload button or using drag-and-drop, then submit the' . ' form to fill the necessary information about the files'), $buttons, array('upload' => array(-1, _('File Upload'), _('Please click the Upload button or' . ' drag-and-drop your files on it<br/>' . 'If you already uploaded files and want to validate them,' . ' just agree with the legal terms and submit the form.')), 'oldfiles' => array(0, _('Previously Uploaded:'), 'text'), 'onlynew' => array(1, _('Only New'), 'checkbox', _('Discard previously uploaded files')), 'files' => array(1, _('Files:'), 'fileuploader'), 'authorship' => array(-1, _('Legal Bindings'), _('By clicking the box below,' . ' you hereby certify to the full extends of copyright laws that you' . ' fully own the rights' . ' on the material you are going to upload, or are legally' . ' authorized to do so. You also confirm, that you are aware that' . ' any false claim is subject to prosecution by the legal copyrights' . ' owner to whom you will directly and exclusively respond to.')), 'agreement' => array(1, _('I Agree'), 'boolean', 2), 'a' => array(1, 'fileupload', 'hidden')));
            mx_showform($uploadform, array('oldfiles' => $oldmedia ? $oldmedia : _('None'), 'onlynew' => time()), true);
            ?>
</div>

<script language="javascript">
	var jsuploader=document.getElementById('jsuploader');
	jsuploader.style.display='block';
	var bsuploader=document.getElementById('basicuploader');
	bsuploader.style.display='none';

    function createUploader(){
        var uploader = new qq.FileUploader({
            element: document.getElementById('fileuploader'),
            action: '<?php 
            echo mx_option('siteurl') . '/fileupload.php';
            ?>
',
            params: {
            	id: '<?php 
            echo $mxuser->id;
            ?>
'
            },
            allowedExtensions: ['jpg','jpeg','png','mp3','m4v','pdf','mp4','mov'],
			sizeLimit: <?php 
            echo MXMAXFILESIZE;
            ?>
        });
    }

    // 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;
</script>
<?php 
    }
    ?>
	<script type="text/javascript" charset="utf-8">
    // Add VideoJS to all video tags on the page when the DOM is ready
    VideoJS.setupAllWhenReady();
  	</script>
<?php 
}
Beispiel #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();
}
Beispiel #3
0
function mx_mndelacct($page, $option, $action)
{
    global $mxuser, $delconf;
    if ($action == 'accdelok' && !$delconf) {
        $action = '';
    }
    switch ($action) {
        case 'accdelno':
            $buttons = array();
            $deleteform = array('deleteform', 0, _('Account Deletion'), '', $buttons, array('confirmlabel' => array(-1, _('Hey, Good News!'), _('<p>We\'re happy you decided to stay with us.<br/>' . 'And don\'t forget we\'re here to help if you need us, so don\'t hesitate!</p>' . '<p>Thanks for your renewed trust!</p>')), 'a' => array(1, 'done', 'hidden')));
            mx_showform($deleteform, array(), false, true);
            break;
        case 'accdelok':
            error_log('deleting account ' . $mxuser->id);
            $medias = $mxuser->listbundles($mxuser->id);
            while ($medias && ($media = $mxuser->listbundles($mxuser->id, $medias))) {
                //echo $media->title.'<br/>';
                $mxuser->deletemedia($media->id, $media->filename, true);
                error_log('deleted ' . $media->title);
            }
            $medias = $mxuser->listmedia($mxuser->id);
            while ($medias && ($media = $mxuser->listmedia($mxuser->id, $medias))) {
                //echo $media->title.'<br/>';
                $mxuser->deletemedia($media->id, $media->filename, true);
                error_log('deleted ' . $media->title);
            }
            $mxuser->setoption('status', MXACCTDISABLED);
            $buttons = array();
            $deleteform = array('deleteform', 0, _('Account Deletion'), '', $buttons, array('confirmlabel' => array(-1, _('YOU\'RE DONE...'), _('<p>All your medias were deleted from our database and servers and your account was successfully removed.</p>' . '<p>We\'re sorry to see you go, and we hope you had at least some fun with us.</p>' . '<p align="right">Good Luck!</p>')), 'a' => array(1, 'done', 'hidden')));
            mx_showform($deleteform, array(), false, true);
            break;
        default:
            $buttons = array('accdelok' => _('OK'), 'accdelno' => 'Cancel');
            $pass = array(1, _('Password'), 'password');
            $deleteform = array('deleteform', 0, _('Account Deletion'), '', $buttons, array('confirmlabel' => array(-1, _('Almost there...'), _('<p>Are you sure you want to do that...?</p>' . '<p><b>All your medias will be deleted from MusXpand and your account will be removed.</b><br/>' . 'You will also <b>lose all friendships</b> you built on MusXpand, and the <b>access to any artist' . ' you subscribed</b>. Have you thought about downloading their media beforehand...?</p>' . '<p>Also note that <u>for security reasons, you will not be able to use the same email address and/or Facebook account again</u>,' . ' should you decide to come back and re-register in the future. <b>Deleted accounts can\'t be recovered.</b></p>' . '<p>Please confirm your identity by entering your password below.<br/>' . 'After clicking OK, we\'ll proceed to the permanent removal of your account.</p>')), 'pass' => array(1, _('Current Password'), 'password'), 'a' => array(1, 'done', 'hidden')));
            mx_showform($deleteform, array(), true, true);
    }
}
Beispiel #4
0
function mx_mncart($page, $option, $action)
{
    global $mxuser, $prodtypes, $mxdb, $prodprice;
    $prodlist = array();
    $progress = $mxuser->cart->progress;
    if ($mxuser->cart->lines) {
        foreach ($mxuser->cart->lines as $line) {
            //if ($mxuser->cart->orderinfo || $mxuser->cart->orderconfirm)
            if ($mxuser->cart->progress > 1) {
                $line->select = '<img height="12px" src="' . mx_iconurl('okmark') . '">';
            } else {
                $line->select = '<input type="checkbox" name="cartline[]" value="' . $line->id . '">';
            }
            $line->proddesc = mx_proddesc($line);
            /*if ($line->prodtype==MXARTSUB) {
            			$user=$mxuser->getuserinfo($line->prodref);
            			$line->prodref='<div class="cartline"><img class="cartpic" src="'.mx_fanpic($user->id).'" /> '.mx_getartistname($user).'</div>';
            		}*/
            $line->prodvar = $prodtypes[$line->prodtype][1][$line->prodvar];
            $line->prodtype = $prodtypes[$line->prodtype][0];
            $prodlist['cart'][] = $line;
        }
    }
    if ($mxuser->cart->wishes) {
        foreach ($mxuser->cart->wishes as $line) {
            $line->select = '<input type="checkbox" name="wishline[]" value="' . $line->id . '">';
            $line->proddesc = mx_proddesc($line);
            /*if ($line->prodtype==MXARTSUB) {
            			$user=$mxuser->getuserinfo($line->prodref);
            			$line->prodref=mx_getartistname($user);
            		}*/
            $line->prodvar = $prodtypes[$line->prodtype][1][$line->prodvar];
            $line->prodtype = $prodtypes[$line->prodtype][0];
            $prodlist['wishlist'][] = $line;
        }
    }
    if ($mxuser->cart->items > 0) {
        $contshoppinglabel = _('Continue Shopping');
    } else {
        $contshoppinglabel = _('Go Shopping');
    }
    $yourehere = _('** YOU\'RE HERE **');
    $progresstable = '<table class="form progress"><tr class="top">' . '<td class="' . ($progress == 1 ? 'current' : 'done') . '">' . _('Shopping Cart') . '</td>' . '<td' . ($progress > 1 ? ' class="done"' : ' class="todo"') . '>&rarr;</td>' . '<td class="' . ($progress == 2 ? 'current' : ($progress < 2 ? 'next' : 'done')) . '">' . _('Shipping/Billing') . '</td>' . '<td' . ($progress > 2 ? ' class="done"' : ' class="todo"') . '>&rarr;</td>' . '<td class="' . ($progress == 3 ? 'current' : ($progress < 3 ? 'next' : 'done')) . '">' . _('Order Review') . '</td>' . '<td' . ($progress > 3 ? ' class="done"' : ' class="todo"') . '>&rarr;</td>' . '<td class="' . ($progress == 4 ? 'current' : 'next') . '">' . _('Order Confirmation') . '</td>' . '<td class="last"></td>' . '</tr><tr class="bottom">' . '<td>' . ($progress == 1 ? $yourehere : '') . '</td>' . '<td></td>' . '<td>' . ($progress == 2 ? $yourehere : '') . '</td>' . '<td></td>' . '<td>' . ($progress == 3 ? $yourehere : '') . '</td>' . '<td></td>' . '<td>' . ($progress == 4 ? $yourehere : '') . '</td>' . '<td class="last"></td>' . '</tr></table>';
    if ($mxuser->cart->err) {
        $progresstable .= mx_warningstr(implode('<br/>', $mxuser->cart->err));
    }
    if ($mxuser->cart->info) {
        $progresstable .= mx_infomsgstr($mxuser->cart->info);
    }
    //echo $progresstable;
    if ($mxuser->cart->orderinfo) {
        // checkcout confirmation
        $ckoutbuttons = array('canckout' => _('Cancel Checkout'), 'confckout' => _('Confirm PAYPAL Payment'));
        $cartlist = array('cart' => array('select' => array(0, '', 'text', 3), 'prodtype' => array(0, _('Item'), 'text', 20), 'proddesc' => array(0, _('Description'), 'html', 30), 'prodvar' => array(0, _('Type'), 'text', 20), 'price' => array(0, _('Price'), 'price', 10)));
        $salesterms = mx_windowedpage('salesterms', _('Terms & Conditions'));
        $ckoutlist = array('checkout', 0, _('Checkout Review Page'), $progresstable, $ckoutbuttons, array('cart' => array(-1, _('Checking out these products'), _('The following items are currently in your cart')), 'cartcontent' => array(-2, $cartlist, $prodlist, 'cart', array(), 'cart'), 'billing' => array(-1, _('Billing Information'), ''), 'FIRSTNAME' => array(0, _('Firstname'), 'text', 30), 'LASTNAME' => array(0, _('Lastname'), 'text', 30), 'COUNTRYCODE' => array(0, _('Country'), 'text', 3), 'EMAIL' => array(0, _('Billing E-Mail'), 'text', 40), 'shipping' => array(-1, _('Shipping Information'), _('Please check your shipping information')), 'SHIPTONAME' => array(0, _('Ship To'), 'text', 30), 'SHIPTOSTREET' => array(0, _('Address'), 'text', 30), 'SHIPTOCITY' => array(0, _('City'), 'text', 20), 'SHIPTOSTATE' => array(0, _('State/Province'), 'text', 20), 'SHIPTOZIP' => array(0, _('Zip Code'), 'text', 10), 'SHIPTOCOUNTRYNAME' => array(0, _('Country'), 'text', 20), 'salesterms' => array(-1, _('Sales Terms And Conditions'), sprintf(_('Please read and agree with our %s before' . ' confirming your payment'), $salesterm)), 'agreement' => array(1, _('Agreement'), 'checkbox', sprintf(_('I accept MusXpand\'s sales %s'), mx_windowedpage('salesterms', _('terms & conditions'))), _('You have to agree to continue...')), 'a' => array(1, 'none', 'hidden'), 'PAYERID' => array(1, 'none', 'hidden'), 'cartid' => array(1, $mxuser->cart->id, 'hidden'), 'paymentoption' => array(1, 'PayPal', 'hidden')));
        mx_showform($ckoutlist, $mxuser->cart->orderinfo, true, true);
        //echo print_r($mxuser->cart->orderinfo);
    } else {
        if ($mxuser->cart->progress == 4) {
            // order confirmation
            if ($action != 'printorder') {
                $ckoutbuttons = array('printorder' => _('Print this Confirmation Page'));
            } else {
                $ckoutbuttons = array();
            }
            $cartlist = array('cart' => array('select' => array(0, '', 'text', 3), 'prodtype' => array(0, _('Item'), 'text', 20), 'proddesc' => array(0, _('Description'), 'html', 30), 'prodvar' => array(0, _('Type'), 'text', 20), 'price' => array(0, _('Price'), 'price', 10)));
            $values = $mxuser->cart->orderconfirm;
            $values['invoicenum'] = $mxuser->cart->invoicenum;
            //sprintf(_('%06d'),$mxuser->cart->id);
            $billing = $mxuser->getaddress($mxuser->cart->billingid);
            $shipping = $mxuser->getaddress($mxuser->cart->shippingid);
            $values['FIRSTNAME'] = $billing['first'];
            $values['LASTNAME'] = $billing['last'];
            $values['EMAIL'] = $billing['email'];
            $values['SHIPTONAME'] = $shipping['shiptoname'];
            $values['SHIPTOSTREET'] = $shipping['street1'];
            $values['SHIPTOCITY'] = $shipping['city'];
            $values['SHIPTOSTATE'] = $shipping['state'];
            $values['SHIPTOZIP'] = $shipping['zip'];
            $values['SHIPTOCOUNTRYNAME'] = $shipping['countrycode'];
            $values['termscond'] = mx_showhtmlpagestr('salesterms');
            $ckoutlist = array('checkout', 0, _('Order Confirmation'), $action != 'printorder' ? $progresstable : mx_infomsgstr($mxuser->cart->info), $ckoutbuttons, array('cart' => array(-1, sprintf(_('Invoice # %s'), $mxuser->cart->invoicenum), _('You purchased the following items.')), 'cartcontent' => array(-2, $cartlist, $prodlist, 'cart', array(), 'cart'), 'billing' => array(-1, _('Billing Information'), ''), 'FIRSTNAME' => array(0, _('Firstname'), 'text', 30), 'LASTNAME' => array(0, _('Lastname'), 'text', 30), 'EMAIL' => array(0, _('Billing E-Mail'), 'text', 40), 'shipping' => array(-1, _('Shipping Information'), ''), 'SHIPTONAME' => array(0, _('Ship To'), 'text', 30), 'SHIPTOSTREET' => array(0, _('Address'), 'text', 30), 'SHIPTOCITY' => array(0, _('City'), 'text', 20), 'SHIPTOSTATE' => array(0, _('State/Province'), 'text', 20), 'SHIPTOZIP' => array(0, _('Zip Code'), 'text', 10), 'SHIPTOCOUNTRYNAME' => array(0, _('Country'), 'text', 20), 'confirmation' => array(-1, _('Payment Confirmation'), _('Below are the details of the transaction')), 'invoicenum' => array(0, _('Invoice #'), 'text', 30), 'PAYMENTINFO_0_PAYMENTSTATUS' => array(0, _('Payment Status'), 'text', 20), 'PAYMENTINFO_0_TRANSACTIONID' => array(0, _('Transaction ID'), 'transactionid', 20), 'PAYMENTINFO_0_ORDERTIME' => array(0, _('Order Time'), 'text', 20), 'PAYMENTINFO_0_AMT' => array(0, _('Total Amount'), 'price', 20), 'PAYMENTINFO_0_TAXAMT' => array(0, _('Taxes included'), 'price', 20), 'PAYMENTINFO_0_CURRENCYCODE' => array(0, _('Currency'), 'text', 20), 'terms' => array(-1, _('Sales Terms'), _('Please keep the following sales conditions along with your purchase receipt.')), 'termscond' => array(0, _('Buyer Information'), 'html'), 'a' => array(1, 'none', 'hidden'), 'PAYERID' => array(1, 'none', 'hidden'), 'cartid' => array(1, $mxuser->cart->id, 'hidden'), 'paymentoption' => array(1, 'PayPal', 'hidden')));
            //mx_showform($ckoutlist,$mxuser->cart->orderconfirm,true,true);
            mx_showform($ckoutlist, $values, true, true);
            // confirmation emails
            if ($action != 'printorder') {
                // email to buyer
                $ckoutemail = $ckoutlist;
                $ckoutemail[4] = array();
                $ckoutemail[3] = mx_infomsgstr($mxuser->cart->info);
                $to = $mxuser->fullname . ' <' . $mxuser->email . '>';
                $subj = sprintf(_('Order Confirmation - Invoice # %06d'), $mxuser->cart->id);
                $html = mx_showhtmlpagestr('orderconfirmation');
                $confform = mx_showformstr($ckoutemail, $values, true, true);
                $html = str_replace('{ORDERFORM}', $confform, $html);
                $html = str_replace('{INVOICENUM}', $mxuser->cart->invoicenum, $html);
                // sprintf('%06d',$mxuser->cart->id)
                $txt = sprintf(_('To print your order confirmation, please go to %s'), mx_actionurl('cart', '', 'printorder', '', '', 'secure', 'cartid=' . $mxuser->cart->id));
                mx_sendmail($to, $subj, $txt, $html);
                // email to artists
                foreach ($prodlist['cart'] as $line) {
                    if ($prodtype == MXARTSUB) {
                        $artistid = $line->prodref;
                    } else {
                        if ($prodtype == MXMEDSUB) {
                            $media = $mxuser->getmediainfo($line->prodref);
                            $artistid = $media->owner_id;
                        } else {
                            $artistid = 0;
                        }
                    }
                    $prodtype = $line->prodtype;
                    $prodvar = $line->prodvar;
                    $prodprice = sprintf('US$ %.02f', $line->price);
                    if ($artistid) {
                        $artist = $mxdb->getuserinfo($mxuser->id, $artistid);
                    }
                    if ($artist && $artist->email) {
                        $to = mx_getartistname($artist) . ' <' . $artist->email . '>';
                        if ($prodtype == MXARTSUB) {
                            $subj = _('You just made a new fan');
                            // html version
                            $html = mx_showhtmlpagestr('newfan');
                            // text version
                            $txt = _("Hey {ARTISTNAME}!\n\n" . "We just wanted to give you the good news:\n\n" . "You just made a new fan in {FANNAME}:\n" . "{FANNAME} just purchased a {PRODVAR} {PRODTYPE} from you for {PRICE}\n\n" . "Sales Team,\nMusXpand.\n" . MXSALESEMAIL . "\n" . mx_option('basicsiteurl'));
                            mx_fbaction('musxpand:subscribe_to?artist=' . urlencode(mx_actionurl('artists', 'artprof', $artistid)));
                        } else {
                            if ($prodtype == MXMEDSUB) {
                                $subj = _('Someone bought media from you');
                                // html version
                                $html = mx_showhtmlpagestr('newbuyer');
                                // text version
                                $txt = _("Hey {ARTISTNAME}!\n\n" . "We just wanted to give you the good news:\n\n" . "{FANNAME} bought some media from you:\n" . "{FANNAME} just purchased \"{MEDIANAME}\" from you for {PRICE}\n\n" . "Sales Team,\nMusXpand.\n" . MXSALESEMAIL . "\n" . mx_option('basicsiteurl'));
                            }
                        }
                        $fan = '<a href="' . mx_actionurl('fans', 'fanprof', $mxuser->id) . '">' . mx_getname($mxuser) . '</a>';
                        $html = str_replace('{ARTISTNAME}', mx_getartistname($artist), $html);
                        $html = str_replace('{PRICE}', $prodprice, $html);
                        $html = str_replace('{FANNAME}', $fan, $html);
                        $html = str_replace('{MEDIANAME}', $media->title, $html);
                        $html = str_replace('{PRODVAR}', $prodvar, $html);
                        $html = str_replace('{PRODTYPE}', $prodtype, $html);
                        $siteurl = '<a href="' . mx_option('basicsiteurl') . '">MusXpand</a>';
                        $html = str_replace('{SITEURL}', $siteurl, $html);
                        $html = str_replace('{SALESEMAIL}', MXSALESEMAIL, $html);
                        $txt = str_replace('{ARTISTNAME}', mx_getartistname($artist), $txt);
                        $txt = str_replace('{PRICE}', $prodprice, $txt);
                        $fan = mx_getname($mxuser);
                        $txt = str_replace('{FANNAME}', $fan, $txt);
                        $txt = str_replace('{MEDIANAME}', $media->title, $txt);
                        $txt = str_replace('{PRODVAR}', $prodvar, $txt);
                        $txt = str_replace('{PRODTYPE}', $prodtype, $txt);
                        mx_sendmail($to, $subj, $txt, $html);
                    }
                }
            } else {
                // purchase
                ?>

<!-- Google Code for Bought 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 = "f7QfCNPfzwMQjcfaxAM";
var google_conversion_value = <?php 
                echo $mxuser->cart->total;
                ?>
;
/* ]]> */
</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=f7QfCNPfzwMQjcfaxAM&amp;guid=ON&amp;script=0"/>
</div>
</noscript>

		<?php 
            }
            /*$ckoutlist[0]='printout';
            		echo '<div id="order"><div class="order">';
            		mx_showform($ckoutlist,$mxuser->cart->orderinfo,false,true);
            		echo '</div></div>';*/
            //echo print_r($mxuser->cart->orderconfirm);
        } else {
            // cart and wishlist display
            $cartbuttons = array('towish' => _('Move to Wishlist'), 'delcart' => _('Remove Checked Items'), 'sep' => null, 'shopmore' => $contshoppinglabel, 'checkout' => _('Proceed to Checkout'));
            $cartlist = array('cartlist', 0, _('Cart & Wishlist Content'), $progresstable, array('cart' => $cartbuttons, 'wishlist' => array('tocart' => _('Move to Cart'), 'delwish' => _('Remove Checked Items'), 'sep' => null, 'shopmore_w' => $contshoppinglabel)), array('cart' => array('cart' => array(-1, _('Your Cart'), _('The following items are currently in your cart')), 'select' => array(0, '<input id="checkallbox" type="checkbox" onclick="javascript:checkall(\'cart\');">', 'text', 3), 'prodtype' => array(0, _('Item'), 'text', 20), 'proddesc' => array(0, _('Description'), 'html', 30), 'prodvar' => array(0, _('Type'), 'text', 20), 'price' => array(0, _('Price'), 'price', 10), 'a' => array(1, 'none', 'hidden'), 'k' => array(1, 'cart', 'hidden')), 'wishlist' => array('wishlist' => array(-1, _('Your Wish List'), _('The following items are currently in your wishlist')), 'select' => array(0, '<input id="checkallbox" type="checkbox" onclick="javascript:checkall(\'wishlist\');">', 'text', 3), 'prodtype' => array(0, _('Item'), 'text', 20), 'proddesc' => array(0, _('Description'), 'html', 30), 'prodvar' => array(0, _('Type'), 'text', 20), 'price' => array(0, _('Price'), 'price', 10), 'a' => array(1, 'none', 'hidden'), 'k' => array(1, 'wishlist', 'hidden'))));
            mx_showlist($cartlist, $prodlist, 'cart', true, true);
            //if ($action=='addfoy' || $action=='adfofa' || $action=='upgfofa') {
            ?>

<!-- Google Code for Added To Cart 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 = "ziXpCNvezwMQjcfaxAM";
var google_conversion_value = <?php 
            echo $prodprice;
            ?>
;
/* ]]> */
</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=ziXpCNvezwMQjcfaxAM&amp;guid=ON&amp;script=0"/>
</div>
</noscript>

			<?php 
            //}
        }
    }
    //phpinfo();
}