diff --git a/airtime_mvc/application/Bootstrap.php b/airtime_mvc/application/Bootstrap.php index ee2790bd3..a8596f31f 100644 --- a/airtime_mvc/application/Bootstrap.php +++ b/airtime_mvc/application/Bootstrap.php @@ -164,8 +164,12 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap && strpos($_SERVER['REQUEST_URI'], $baseUrl.'audiopreview/playlist-preview') === false && strpos($_SERVER['REQUEST_URI'], $baseUrl.'audiopreview/block-preview') === false) { if (Application_Model_Preference::GetLiveChatEnabled()) { - $client_id = Application_Model_Preference::GetClientId(); - $view->headScript()->appendScript("var livechat_client_id = '$client_id';"); + $client_id = strval(Application_Model_Preference::GetClientId()); + $plan_level = strval(Application_Model_Preference::GetPlanLevel()); + $station_url = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; + $view->headScript()->appendScript("var livechat_client_id = '$client_id';\n". + "var livechat_plan_type = '$plan_level';\n". + "var livechat_station_url = 'http://$station_url';"); $view->headScript()->appendFile($baseUrl . 'js/airtime/common/livechat.js?'.$CC_CONFIG['airtime_version'], 'text/javascript'); } } diff --git a/airtime_mvc/application/configs/navigation.php b/airtime_mvc/application/configs/navigation.php index 5b7e4e049..e25fb7900 100644 --- a/airtime_mvc/application/configs/navigation.php +++ b/airtime_mvc/application/configs/navigation.php @@ -114,6 +114,11 @@ $pages = array( 'uri' => '#', 'resource' => 'dashboard', 'pages' => array( + array( + 'label' => _('Help Center'), + 'uri' => "http://help.sourcefabric.org/", + 'target' => "_blank" + ), array( 'label' => _('Getting Started'), 'module' => 'default', diff --git a/airtime_mvc/application/controllers/BillingController.php b/airtime_mvc/application/controllers/BillingController.php index ca2f7594d..fd7f90c10 100644 --- a/airtime_mvc/application/controllers/BillingController.php +++ b/airtime_mvc/application/controllers/BillingController.php @@ -572,6 +572,7 @@ class BillingController extends Zend_Controller_Action { try { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); // WHMCS IP whitelist doesn't support IPv6 curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 5); //Aggressive 5 second timeout curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); @@ -598,4 +599,4 @@ class BillingController extends Zend_Controller_Action { throw new Exception("Invalid client ID: " . Application_Model_Preference::GetClientId()); } } -} \ No newline at end of file +} diff --git a/airtime_mvc/application/controllers/ShowbuilderController.php b/airtime_mvc/application/controllers/ShowbuilderController.php index 2de99ce52..b88d4e2e7 100644 --- a/airtime_mvc/application/controllers/ShowbuilderController.php +++ b/airtime_mvc/application/controllers/ShowbuilderController.php @@ -439,6 +439,7 @@ class ShowbuilderController extends Zend_Controller_Action $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); // WHMCS IP whitelist doesn't support IPv6 curl_setopt($ch, CURLOPT_TIMEOUT, 5); //Aggressive 5 second timeout curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string); diff --git a/airtime_mvc/application/controllers/WhmcsLoginController.php b/airtime_mvc/application/controllers/WhmcsLoginController.php index b8573c557..0b8a00a83 100644 --- a/airtime_mvc/application/controllers/WhmcsLoginController.php +++ b/airtime_mvc/application/controllers/WhmcsLoginController.php @@ -155,6 +155,7 @@ class WHMCS_Auth_Adapter implements Zend_Auth_Adapter_Interface { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, WHMCS_API_URL); + curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); // WHMCS IP whitelist doesn't support IPv6 curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_FAILONERROR, 1); @@ -164,7 +165,8 @@ class WHMCS_Auth_Adapter implements Zend_Auth_Adapter_Interface { curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $jsondata = curl_exec($ch); if (curl_error($ch)) { - die(curl_getinfo($ch, CURLINFO_EFFECTIVE_URL)); + Logging::error("Failed to reach WHMCS server in " . __FUNCTION__ . ": " + . curl_errno($ch) . ' - ' . curl_error($ch) . ' - ' . curl_getinfo($ch, CURLINFO_EFFECTIVE_URL)); //die("Connection Error: ".curl_errno($ch).' - '.curl_error($ch)); } curl_close($ch); @@ -201,6 +203,7 @@ class WHMCS_Auth_Adapter implements Zend_Auth_Adapter_Interface { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, WHMCS_API_URL); + curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); // WHMCS IP whitelist doesn't support IPv6 curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_FAILONERROR, 1); @@ -210,7 +213,8 @@ class WHMCS_Auth_Adapter implements Zend_Auth_Adapter_Interface { curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $jsondata = curl_exec($ch); if (curl_error($ch)) { - die(curl_getinfo($ch, CURLINFO_EFFECTIVE_URL)); + Logging::error("Failed to reach WHMCS server in " . __FUNCTION__ . ": " + . curl_errno($ch) . ' - ' . curl_error($ch) . ' - ' . curl_getinfo($ch, CURLINFO_EFFECTIVE_URL)); //die("Connection Error: ".curl_errno($ch).' - '.curl_error($ch)); } curl_close($ch); @@ -255,4 +259,4 @@ class WHMCS_Auth_Adapter implements Zend_Auth_Adapter_Interface { } return false; } -} \ No newline at end of file +} diff --git a/airtime_mvc/application/forms/GeneralPreferences.php b/airtime_mvc/application/forms/GeneralPreferences.php index c45437b08..ecee11b6d 100644 --- a/airtime_mvc/application/forms/GeneralPreferences.php +++ b/airtime_mvc/application/forms/GeneralPreferences.php @@ -94,7 +94,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm // // Add the description element $this->addElement('textarea', 'widgetCode', array( - 'label' => 'Javascript Code:', + 'label' => _('HTML Code:'), 'required' => false, 'readonly' => true, 'style' => 'font-family: Consolas, "Liberation Mono", Courier, @@ -134,10 +134,14 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm $host = $_SERVER['SERVER_NAME']; $code = << - - + + + + + +
@@ -159,6 +163,8 @@ $(document).ready(function() { sourceDomain:"http://$host", updatePeriod: 600 //seconds }); + var d = new Date().getDay(); + $('#scheduleTabs').tabs({selected: d === 0 ? 6 : d-1, fx: { opacity: 'toggle' }}); }); CODE; diff --git a/airtime_mvc/application/models/Webstream.php b/airtime_mvc/application/models/Webstream.php index 21c794b07..a7e7d82b1 100644 --- a/airtime_mvc/application/models/Webstream.php +++ b/airtime_mvc/application/models/Webstream.php @@ -309,7 +309,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable $media_url = self::getXspfUrl($url); } elseif (preg_match("/pls\+xml/", $mime) || preg_match("/x-scpls/", $mime)) { $media_url = self::getPlsUrl($url); - } elseif (preg_match("/(mpeg|ogg|audio\/aacp)/", $mime)) { + } elseif (preg_match("/(mpeg|ogg|audio\/aacp|audio\/aac)/", $mime)) { if ($content_length_found) { throw new Exception(_("Invalid webstream - This appears to be a file download.")); } diff --git a/airtime_mvc/public/js/airtime/common/livechat.js b/airtime_mvc/public/js/airtime/common/livechat.js index 35801c697..0adc99d83 100644 --- a/airtime_mvc/public/js/airtime/common/livechat.js +++ b/airtime_mvc/public/js/airtime/common/livechat.js @@ -5,7 +5,9 @@ function setupLiveChat() { // this is where we pass custom variables to livechat; // only pass the client id assigned by WHMCS for now __lc.params = [ - { name: 'client_id', value: livechat_client_id } + { name: 'client_id', value: livechat_client_id }, + { name: 'plan_type', value: livechat_plan_type}, + { name: 'station_url', value: livechat_station_url} ]; var lc = document.createElement('script'); lc.type = 'text/javascript'; lc.async = true; @@ -15,4 +17,4 @@ function setupLiveChat() { $(document).ready(function() { setupLiveChat(); -}); \ No newline at end of file +}); diff --git a/python_apps/pypo/liquidsoap_scripts/fdkaac.liq b/python_apps/pypo/liquidsoap_scripts/fdkaac.liq index 0c6945221..ab51b8655 100644 --- a/python_apps/pypo/liquidsoap_scripts/fdkaac.liq +++ b/python_apps/pypo/liquidsoap_scripts/fdkaac.liq @@ -1,24 +1,24 @@ if bitrate == 24 then - ignore(output_stereo(%fdkaac(bitrate = 24, aot="mpeg4_he_aac_v2"), !source)) + ignore(output_stereo(%fdkaac(bitrate = 24, aot="mpeg4_he_aac_v2", afterburner=false, sbr_mode=true), !source)) elsif bitrate == 32 then - ignore(output_stereo(%fdkaac(bitrate = 32, aot="mpeg4_he_aac_v2"), !source)) + ignore(output_stereo(%fdkaac(bitrate = 32, aot="mpeg4_he_aac_v2", afterburner=false, sbr_mode=true), !source)) elsif bitrate == 48 then - ignore(output_stereo(%fdkaac(bitrate = 48, aot="mpeg4_he_aac_v2"), !source)) + ignore(output_stereo(%fdkaac(bitrate = 48, aot="mpeg4_he_aac_v2", afterburner=false, sbr_mode=true), !source)) elsif bitrate == 64 then - ignore(output_stereo(%fdkaac(bitrate = 64, aot="mpeg4_he_aac_v2"), !source)) + ignore(output_stereo(%fdkaac(bitrate = 64, aot="mpeg4_he_aac_v2", afterburner=false, sbr_mode=true), !source)) elsif bitrate == 96 then - ignore(output_stereo(%fdkaac(bitrate = 96, aot="mpeg4_he_aac_v2"), !source)) + ignore(output_stereo(%fdkaac(bitrate = 96, aot="mpeg4_he_aac_v2", afterburner=false, sbr_mode=true), !source)) elsif bitrate == 128 then - ignore(output_stereo(%fdkaac(bitrate = 128, aot="mpeg4_he_aac_v2"), !source)) + ignore(output_stereo(%fdkaac(bitrate = 128, aot="mpeg4_he_aac_v2", afterburner=false, sbr_mode=true), !source)) elsif bitrate == 160 then - ignore(output_stereo(%fdkaac(bitrate = 160, aot="mpeg4_he_aac_v2"), !source)) + ignore(output_stereo(%fdkaac(bitrate = 160, aot="mpeg4_he_aac_v2", afterburner=true, sbr_mode=true), !source)) elsif bitrate == 192 then - ignore(output_stereo(%fdkaac(bitrate = 192, aot="mpeg4_he_aac_v2"), !source)) + ignore(output_stereo(%fdkaac(bitrate = 192, aot="mpeg4_he_aac_v2", afterburner=true, sbr_mode=true), !source)) elsif bitrate == 224 then - ignore(output_stereo(%fdkaac(bitrate = 224, aot="mpeg4_he_aac_v2"), !source)) + ignore(output_stereo(%fdkaac(bitrate = 224, aot="mpeg4_he_aac_v2", afterburner=true, sbr_mode=true), !source)) elsif bitrate == 256 then - ignore(output_stereo(%fdkaac(bitrate = 256, aot="mpeg4_he_aac_v2"), !source)) + ignore(output_stereo(%fdkaac(bitrate = 256, aot="mpeg4_he_aac_v2", afterburner=true, sbr_mode=true), !source)) elsif bitrate == 320 then - ignore(output_stereo(%fdkaac(bitrate = 320, aot="mpeg4_he_aac_v2"), !source)) + ignore(output_stereo(%fdkaac(bitrate = 320, aot="mpeg4_he_aac_v2", afterburner=true, sbr_mode=true), !source)) end diff --git a/python_apps/pypo/liquidsoap_scripts/ls_lib.liq b/python_apps/pypo/liquidsoap_scripts/ls_lib.liq index e4459600d..0646bf6b6 100644 --- a/python_apps/pypo/liquidsoap_scripts/ls_lib.liq +++ b/python_apps/pypo/liquidsoap_scripts/ls_lib.liq @@ -150,20 +150,22 @@ def output_to(output_type, type, bitrate, host, port, pass, mount_point, url, de end %endif - %ifencoder %aac - if type == "aac" then - %include "aac.liq" - end - %endif +# FDK-AAC is the only good AAC encoder. libvoaac is deprecated and aacplus is subpar. +# The difference in compression quality is clearly audible. -- Albert +# %ifencoder %aac +# if type == "aac" then +# %include "aac.liq" +# end +# %endif - %ifencoder %aacplus - if type == "aacplus" then - %include "aacplus.liq" - end - %endif +# %ifencoder %aacplus +# if type == "aacplus" then +# %include "aacplus.liq" +# end +# %endif %ifencoder %fdkaac - if type == "fdkaac" then + if type == "aac" then %include "fdkaac.liq" end %endif