コード例 #1
0
ファイル: cashmusic.php プロジェクト: JamesLinus/platform
 function cashmusic_shortcode($attributes)
 {
     extract(shortcode_atts(array('element' => false, 'name' => false), $attributes));
     if ($element) {
         CASHSystem::embedElement($element);
     } else {
         echo '<!-- CASH Music error: no such element found -->';
     }
 }
コード例 #2
0
ファイル: index.php プロジェクト: blacktire/DIY
<body>

<div id="mainspc">
	<img src="assets/images/funzone.png" width="160" height="77" id="titleimg" />
	<span id="navtitle">&nbsp;MGMT<b>FUNZONE</b></span>
	<div id="navmenu">
		<a href="#">NEWS</a><a href="#">EVENTS</a><a href="#" class="selected">TICKETS</a><a href="#">MERCH</a><a href="#">PHOTOS</a><a href="#">MUSIC+VIDEO</a><a href="#">SHOW ARCHIVE</a>
	</div>
	<?php 
CASHSystem::embedElement(106);
// CASH element (Dandy's e-card test / ecard)
?>
		It's working. Here's a sample element:<br />
		<?php 
CASHSystem::embedElement(107);
// CASH element (Front page news box)
?>
 
	<?php 
CASHSystem::embedElement(106);
// CASH element (Dandy's e-card test / ecard)
?>
</div>

<?php 
include '../../../../framework/php/settings/debug/cashmusic_debug.php';
// Debug
?>
</body>
</html>
コード例 #3
0
ファイル: request.php プロジェクト: JamesLinus/platform
         $embed_location = $requests[3];
         $embed_location = str_replace('!slash!', '/', $embed_location);
         // dumb. supporting old versions.
     }
     if (isset($_GET['location'])) {
         $embed_location = $_GET['location'];
     }
     if (isset($_GET['geo'])) {
         $embed_geo = $_GET['geo'];
     }
     $template_request = new CASHRequest(array('cash_request_type' => 'element', 'cash_action' => 'getelementtemplate', 'element_id' => $requests[1], 'return_template' => 1));
     $template = $template_request->response['payload'];
     $embed_data = array();
     $element_markup = false;
     ob_start();
     CASHSystem::embedElement($requests[1], 'embed', $embed_location, $embed_geo);
     $embed_data['element_markup'] = ob_get_contents();
     $embed_data['cdn_url'] = defined('CDN_URL') ? CDN_URL : CASH_ADMIN_URL;
     ob_end_clean();
     header('Content-Type: text/html; charset=utf-8');
     $template = str_replace('</head>', '<script type="text/javascript" src="' . CASH_PUBLIC_URL . '/cashmusic.js"></script></head>', $template);
     $encoded_html = $freddiemercury->render($template, $embed_data);
     echo $encoded_html;
 } else {
     if ($initial_page_request) {
         if (in_array('payload', $requests)) {
             $output = $initial_page_request['response']['payload'];
         } else {
             $output = array('response' => $initial_page_request['response']);
         }
     } else {
コード例 #4
0
ファイル: index.php プロジェクト: rayangc/platform
        $template_id = false;
    }
    $template = false;
    if ($template_id) {
        $template_request = new CASHRequest(array('cash_request_type' => 'system', 'cash_action' => 'gettemplate', 'template_id' => $template_id, 'user_id' => $user_id));
        $template = $template_request->response['payload'];
    }
    // with a real user but no template we redirect to the admin
    if ($template) {
        $element_embeds = false;
        // i know we don't technically need this, but the immaculate variable in preg_match_all freaks me out
        $found_elements = preg_match_all('/{{{element_(.*?)}}}/', $template, $element_embeds, PREG_PATTERN_ORDER);
        if ($found_elements) {
            foreach ($element_embeds[1] as $element_id) {
                ob_start();
                CASHSystem::embedElement($element_id);
                $page_vars['element_' . $element_id] = ob_get_contents();
                ob_end_clean();
            }
        }
        // render out the page itself
        echo CASHSystem::renderMustache($template, $page_vars);
        exit;
    } else {
        // redirect to the admin
        header('Location: ./admin/');
    }
}
/***************************************
 *
 *  ADD PUBLIC PAGE BELOW CLOSING "?>"
コード例 #5
0
 function test_embedElement()
 {
     $element_request = new CASHRequest(array('cash_request_type' => 'element', 'cash_action' => 'addelement', 'name' => 'test', 'type' => 'staticcontent', 'options_data' => array('storedcotent' => 'basic text'), 'user_id' => 1));
     // should have failed with just a title:
     $element_id = $element_request->response['payload'];
     $this->assertTrue(is_numeric($element_id));
     if ($element_id) {
         ob_start();
         CASHSystem::embedElement($element_id);
         $output = ob_get_clean();
         $this->assertPattern('/basic text/', $output);
     }
 }
コード例 #6
0
ファイル: index.php プロジェクト: blacktire/DIY
<?php

include '../../../../framework/php/cashmusic.php';
// Initialize CASH Music
?>
<!DOCTYPE html>
<head> 
<title>Sandbox / CASH Music</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="assets/css/demo.css" rel="stylesheet" type="text/css" />
<link rel="icon" type="image/png" href="http://cashmusic.org/images/icons/cash.png" />
</head> 
<body>

	<div id="mainspc">
		<?php 
CASHSystem::embedElement(112);
?>
	</div>

<?php 
include '../../../../framework/php/settings/debug/cashmusic_debug.php';
// Debug
?>
</body> 
</html>