Exemple #1
0
function mx_showfanpage($id, $simul = '')
{
    global $mxuser;
    $dbuser = $mxuser->getuserinfo($id);
    if ($dbuser->acctype == MXACCOUNTARTIST) {
        return mx_showartistpage($id, 0, $simul);
    }
    if ($dbuser->status == MXACCTDISABLED) {
        __('This account doesn\'t exist');
        return;
    }
    if (!$dbuser) {
        mx_optiontitle('error', _('This account doesn\'t exist'));
        return;
    }
    /*if ($dbuser->acctype==MXACCOUNTFAN || $option=='viewprof' || $option=='fanprof') {
    		mx_optionsubtitle('→ '.mx_getname($dbuser));
    	} else {
    		mx_optionsubtitle('→ '.mx_getartistname($dbuser));
    	}*/
    $authflds = $mxuser->getauthorizedfields($dbuser->id);
    $authgrps = $mxuser->getauthorizedgroups($authflds);
    $section = '';
    if (!$authgrps || !$authflds) {
        __('No information available.');
        return;
    }
    $custpage = $dbuser->custompage ? $dbuser->custompage : MXDEFFANPAGE;
    mx_showcustompage($custpage, $dbuser, 0, $simul);
    if ($id != $mxuser->id) {
        mx_fbaction('musxpand:check_out?fan=' . urlencode(mx_actionurl('fans', 'fanprof', $id)));
    }
    return;
}
Exemple #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('→ ' . $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 
    }
}
Exemple #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 
}
Exemple #4
0
function mx_mnfbaction($page, $option, $action)
{
    if (!$action) {
        echo '<form method="POST"><input type="text" name="fbaction" placeholder="action here" size="60"><br/>' . '<input type="text" name="object" placeholder="object here" size="60"><br/>' . '<input type="text" name="url" placeholder="url here" size="60"><br/>' . '<input type=submit name="a" value="Submit"></form>';
    } else {
        $fba = $_POST['fbaction'] . '?' . $_POST['object'] . '=' . urlencode($_POST['url']);
        mx_fbaction($fba);
        echo 'action: [' . $fba . '] sent';
    }
}
Exemple #5
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 
    }
}
Exemple #6
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();
}
Exemple #7
0
 function requesthandle($userid, $msgid, $status)
 {
     $dbid = $this->dbid;
     $qstr = 'SELECT sender,receiver FROM mx_msg2acc WHERE msgid=' . $msgid;
     $mxq = $this->query($qstr);
     if (!$mxq) {
         die(mxerror($dbid->error, __FILE__, __LINE__, $qstr));
     }
     $qr = $mxq->fetch_object();
     $mxq->free();
     switch ($status) {
         case MXREQCANCELLED:
             // the author is cancelling its request
             $qstr = 'DELETE FROM mx_friends' . ' WHERE account1_id=' . $userid . ' AND account2_id=' . $qr->receiver . ' AND NOT confirmed & ' . MXMSGREAD;
             break;
         case MXREQACCEPTED:
             // the recipient accepts the request
             $qstr = 'UPDATE mx_friends SET confirmed=1 ' . ' WHERE account1_id=' . $qr->sender . ' AND account2_id=' . $userid;
             break;
         case MXREQRECUSED:
             // the recipient recuses the request
             $qstr = 'UPDATE mx_friends SET confirmed=2 ' . ' WHERE account1_id=' . $qr->sender . ' AND account2_id=' . $userid;
             break;
         case MXREQIGNORED:
             // the recipient ignores the request
             $qstr = 'UPDATE mx_friends SET confirmed=3 ' . ' WHERE account1_id=' . $qr->sender . ' AND account2_id=' . $userid;
             break;
     }
     $mxq = $this->query($qstr);
     if (!$mxq) {
         die(mxerror($dbid->error, __FILE__, __LINE__, $qstr));
     }
     if ($dbid->affected_rows > 0) {
         if ($status == MXREQACCEPTED) {
             mx_fbaction('musxpand:become_a_friend_of?fan=' . mx_actionurl('fans', 'fanprof', $qr->sender));
         }
         return $this->markmsg($userid, $msgid, $status);
     } else {
         return 0;
     }
 }