Merge branch 'saas-dev' into saas-dev-bandwidth-limits
This commit is contained in:
commit
34eb7d6e22
13 changed files with 267 additions and 32 deletions
|
@ -96,6 +96,12 @@ class Config {
|
|||
$CC_CONFIG['soundcloud-client-id'] = $globalAirtimeConfigValues['soundcloud']['soundcloud_client_id'];
|
||||
$CC_CONFIG['soundcloud-client-secret'] = $globalAirtimeConfigValues['soundcloud']['soundcloud_client_secret'];
|
||||
$CC_CONFIG['soundcloud-redirect-uri'] = $globalAirtimeConfigValues['soundcloud']['soundcloud_redirect_uri'];
|
||||
if (isset($globalAirtimeConfigValues['facebook']['facebook_app_id'])) {
|
||||
$CC_CONFIG['facebook-app-id'] = $globalAirtimeConfigValues['facebook']['facebook_app_id'];
|
||||
$CC_CONFIG['facebook-app-url'] = $globalAirtimeConfigValues['facebook']['facebook_app_url'];
|
||||
$CC_CONFIG['facebook-app-api-key'] = $globalAirtimeConfigValues['facebook']['facebook_app_api_key'];
|
||||
}
|
||||
|
||||
|
||||
if(isset($values['demo']['demo'])){
|
||||
$CC_CONFIG['demo'] = $values['demo']['demo'];
|
||||
|
|
|
@ -48,6 +48,12 @@ $pages = array(
|
|||
'module' => 'default',
|
||||
'controller' => 'embeddablewidgets',
|
||||
'action' => 'schedule',
|
||||
),
|
||||
array(
|
||||
'label' => _('Facebook'),
|
||||
'module' => 'default',
|
||||
'controller' => 'embeddablewidgets',
|
||||
'action' => 'facebook',
|
||||
)
|
||||
)
|
||||
),
|
||||
|
|
|
@ -26,8 +26,8 @@ class EmbeddableWidgetsController extends Zend_Controller_Action
|
|||
$this->view->player_form = $form;
|
||||
} else {
|
||||
$this->view->player_error_msg = _("To configure and use the embeddable player you must:<br><br>
|
||||
1. Enable at least one MP3, AAC, or OGG stream under System -> Streams<br>
|
||||
2. Enable the Public Airtime API under System -> Preferences");
|
||||
1. Enable at least one MP3, AAC, or OGG stream under Settings -> Streams<br>
|
||||
2. Enable the Public Airtime API under Settings -> Preferences");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,8 +39,83 @@ class EmbeddableWidgetsController extends Zend_Controller_Action
|
|||
|
||||
if (!$apiEnabled) {
|
||||
$this->view->weekly_schedule_error_msg = _("To use the embeddable weekly schedule widget you must:<br><br>
|
||||
Enable the Public Airtime API under System -> Preferences");
|
||||
Enable the Public Airtime API under Settings -> Preferences");
|
||||
}
|
||||
}
|
||||
|
||||
public function facebookAction()
|
||||
{
|
||||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Widgets');
|
||||
|
||||
$apiEnabled = Application_Model_Preference::GetAllow3rdPartyApi();
|
||||
|
||||
if (!$apiEnabled) {
|
||||
$this->view->facebook_error_msg = _("To add the Radio Tab to your Facebook Page, you must first:<br><br>
|
||||
Enable the Public Airtime API under Settings -> Preferences");
|
||||
}
|
||||
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$facebookAppId = $CC_CONFIG['facebook-app-id'];
|
||||
$this->view->headScript()->appendScript("var FACEBOOK_APP_ID = " . json_encode($facebookAppId) . ";");
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/common/facebook.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
}
|
||||
|
||||
/** Airtime makes an AJAX POST here after it successfully adds a tab to your Facebook page. */
|
||||
public function facebookTabSuccessAction()
|
||||
{
|
||||
// disable the view and the layout
|
||||
$this->view->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
//TODO: Get list of page IDs (deserialize)
|
||||
|
||||
$request = $this->getRequest();
|
||||
if (!$request->isPost()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$values = $request->getPost();
|
||||
$facebookPageIds = json_decode($values["pages"]);
|
||||
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$facebookMicroserviceUrl = $CC_CONFIG['facebook-app-url'];
|
||||
$facebookMicroserviceApiKey = $CC_CONFIG['facebook-app-api-key'];
|
||||
|
||||
//Post the page tab ID and station subdomain to the social microservice so that mapping can be saved
|
||||
//in a database.
|
||||
foreach ($facebookPageIds as $facebookPageId)
|
||||
{
|
||||
$postfields = array();
|
||||
$postfields["facebookPageId"] = $facebookPageId;
|
||||
$postfields["stationId"] = $CC_CONFIG['stationId'];
|
||||
|
||||
$query_string = "";
|
||||
foreach ($postfields as $k => $v) $query_string .= "$k=".urlencode($v)."&";
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $facebookMicroserviceUrl);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
||||
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string);
|
||||
curl_setopt($ch, CURLOPT_USERPWD, ":$facebookMicroserviceApiKey");
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
|
||||
$jsondata = curl_exec($ch);
|
||||
if (curl_error($ch)) {
|
||||
throw new Exception("Failed to reach server in " . __FUNCTION__ . ": "
|
||||
. curl_errno($ch) . ' - ' . curl_error($ch) . ' - ' . curl_getinfo($ch, CURLINFO_EFFECTIVE_URL));
|
||||
}
|
||||
curl_close($ch);
|
||||
|
||||
}
|
||||
|
||||
//$arr = json_decode($jsondata, true); # Decode JSON String
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -227,6 +227,9 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|||
}
|
||||
?>
|
||||
|
||||
<div id="fb-root"></div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -1572,6 +1572,9 @@ class Application_Model_Preference
|
|||
self::setValue("station_podcast_download_counter", empty($c) ? 0 : --$c);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int either 0 (public) or 1 (private)
|
||||
*/
|
||||
public static function getStationPodcastPrivacy() {
|
||||
if (!Billing::isStationPodcastAllowed()) {
|
||||
// return private setting
|
||||
|
|
|
@ -482,10 +482,15 @@ class Application_Model_Scheduler
|
|||
->orderByDbStarts()
|
||||
->find($this->con);
|
||||
|
||||
$now = new DateTime("now", new DateTimeZone("UTC"));
|
||||
$itemStartDT = $instance->getDbStarts(null);
|
||||
foreach ($schedule as $item) {
|
||||
$itemEndDT = $this->findEndTime($itemStartDT, $item->getDbClipLength());
|
||||
Logging::info($itemEndDT);
|
||||
// If the track has already ended, don't change it.
|
||||
if ($itemEndDT < $now) {
|
||||
$itemStartDT = $itemEndDT;
|
||||
continue;
|
||||
}
|
||||
$item->setDbStarts($itemStartDT)
|
||||
->setDbEnds($itemEndDT)
|
||||
->save($this->con);
|
||||
|
@ -515,10 +520,15 @@ class Application_Model_Scheduler
|
|||
->orderByDbStarts()
|
||||
->find($this->con);
|
||||
|
||||
$now = new DateTime("now", new DateTimeZone("UTC"));
|
||||
$itemStartDT = $instance->getDbStarts(null);
|
||||
foreach ($schedule as $item) {
|
||||
|
||||
$itemEndDT = $this->findEndTime($itemStartDT, $item->getDbClipLength());
|
||||
// If the track has already ended, don't change it.
|
||||
if ($itemEndDT < $now) {
|
||||
$itemStartDT = $itemEndDT;
|
||||
continue;
|
||||
}
|
||||
|
||||
$item->setDbStarts($itemStartDT)
|
||||
->setDbEnds($itemEndDT);
|
||||
|
@ -1191,7 +1201,7 @@ class Application_Model_Scheduler
|
|||
|
||||
foreach ($removedItems as $removedItem) {
|
||||
$instance = $removedItem->getCcShowInstances($this->con);
|
||||
$effectedInstanceIds[] = $instance->getDbId();
|
||||
$effectedInstanceIds[$instance->getDbId()] = $instance->getDbId();
|
||||
|
||||
//check if instance is linked and if so get the schedule items
|
||||
//for all linked instances so we can delete them too
|
||||
|
|
|
@ -193,13 +193,13 @@ $(document).ready(function() {
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>64kbps Stream Quality
|
||||
<td>Up to 64kbps Stream Quality
|
||||
</td>
|
||||
<td>64kbps and 128kbps Stream Quality
|
||||
<td>Up to 128kbps Stream Quality
|
||||
</td>
|
||||
<td>64kbps and 196kbps Stream Quality
|
||||
<td>Up to 196kbps Stream Quality
|
||||
</td>
|
||||
<td class="last-column">64kbps, 128kbps, and 196kbps Stream Quality
|
||||
<td class="last-column">Up to 196kbps Stream Quality
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -222,7 +222,18 @@ $(document).ready(function() {
|
|||
<td class="last-column">
|
||||
150GB Storage
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>No Built-in Podcast
|
||||
</td>
|
||||
<td>2,000 Podcast Episode Downloads
|
||||
</td>
|
||||
<td>5,000 Podcast Episode Downloads
|
||||
</td>
|
||||
<td class="last-column">
|
||||
10,000 Podcast Episode Downloads
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ticket, Email, Forum Support
|
||||
</td>
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
<div id="weekly-schedule-widget" class="prefpanel ui-widget simple-formblock clearfix padded-strong ">
|
||||
|
||||
<?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
|
||||
|
||||
<h2 style="float:left"><?php echo _("Facebook Radio Player") ?></h2>
|
||||
<div style="clear:both"></div>
|
||||
|
||||
<p><button class="btn btn-new" id="facebook-login" style="margin-left: 300px;">Add to My Facebook Page</button></p>
|
||||
|
||||
<div id="weekly-schedule-widget-error">
|
||||
<?php echo $this->facebook_error_msg; ?>
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<h3 style="padding-left: 0px">Preview:</h3>
|
||||
|
||||
<div>
|
||||
<iframe width=800 height=800 src="<?php echo Application_Common_HTTPHelper::getStationUrl(); ?>/?facebook=1"></iframe>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
|
||||
|
||||
<div>
|
||||
<h3 style="padding-left: 0px">Tips:</h3>
|
||||
<p>
|
||||
To make the tab more visible on your Facebook page, click "More", and "Manage Tabs":<br>
|
||||
<img src="<?php echo($baseUrl) . "images/doc/facebook_widget1.png"?>"><br><br>
|
||||
|
||||
Then, drag the Radio Player item higher in the list, and click Save. It will now appear as one of the default tabs instead of being buried under "More":<br>
|
||||
<img src="<?php echo($baseUrl) . "images/doc/facebook_widget2.png"?>">
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue