|
|
@@ -2,13 +2,15 @@
|
|
|
|
|
|
// ===================================
|
|
|
// Define Version
|
|
|
- define('INSTALLEDVERSION', '1.40');
|
|
|
+ define('INSTALLEDVERSION', '1.42');
|
|
|
// ===================================
|
|
|
|
|
|
// Debugging output functions
|
|
|
function debug_out($variable, $die = false) {
|
|
|
$trace = debug_backtrace()[0];
|
|
|
- echo '<pre style="background-color: #f2f2f2; border: 2px solid black; border-radius: 5px; padding: 5px; margin: 5px;">'.$trace['file'].':'.$trace['line']."\n\n".print_r($variable, true).'</pre>';
|
|
|
+ echo "<center><img height='200px' src='images/confused.png'></center>";
|
|
|
+ echo "<center>Look's like something happened, here are the errors and perhaps how to fix them:</center>";
|
|
|
+ echo '<pre style="white-space: pre-line; background-color: #f2f2f2; border: 2px solid black; border-radius: 5px; padding: 5px; margin: 5px;">'.$trace['file'].':'.$trace['line']."\n\n".print_r($variable, true).'</pre>';
|
|
|
if ($die) { http_response_code(503); die(); }
|
|
|
}
|
|
|
|
|
|
@@ -225,7 +227,7 @@ if (function_exists('curl_version')) :
|
|
|
}
|
|
|
}
|
|
|
}else{
|
|
|
- writeLog("error", "$username is not an authorized user or entered invalid password");
|
|
|
+ writeLog("error", "$username is not an authorized PLEX user or entered invalid password");
|
|
|
}
|
|
|
}else{
|
|
|
writeLog("error", "error occured logging into plex might want to check curl.cainfo=/path/to/downloaded/cacert.pem in php.ini");
|
|
|
@@ -640,7 +642,7 @@ function resolveEmbyItem($address, $token, $item, $nowPlaying = false, $showName
|
|
|
$itemDetails['Overview'] = '';
|
|
|
}
|
|
|
|
|
|
-if (file_exists('images/cache/'.$key.'.jpg')){ $image_url = 'images/cache/'.$key.'.jpg'; }
|
|
|
+ if (file_exists('images/cache/'.$key.'.jpg')){ $image_url = 'images/cache/'.$key.'.jpg'; }
|
|
|
if (file_exists('images/cache/'.$key.'.jpg') && (time() - 604800) > filemtime('images/cache/'.$key.'.jpg') || !file_exists('images/cache/'.$key.'.jpg')) {
|
|
|
$image_url = 'ajax.php?a=emby-image&type='.$imageType.'&img='.$imageId.'&height='.$height.'&width='.$width.'&key='.$key.'';
|
|
|
}
|
|
|
@@ -655,12 +657,12 @@ if (file_exists('images/cache/'.$key.'.jpg')){ $image_url = 'images/cache/'.$key
|
|
|
if(isset($useImage)){ $image_url = $useImage; }
|
|
|
|
|
|
// Assemble Item And Cache Into Array
|
|
|
-if($nowPlaying){
|
|
|
- //prettyPrint($itemDetails);
|
|
|
- return '<div class="col-sm-6 col-md-3"><div class="thumbnail ultra-widget"><div style="display: none;" np="'.$id.'" class="overlay content-box small-box gray-bg">'.$streamInfo.'</div><span class="w-refresh w-p-icon gray" link="'.$id.'"><span class="fa-stack fa-lg" style="font-size: .5em"><i class="fa fa-square fa-stack-2x"></i><i class="fa fa-info-circle fa-stack-1x fa-inverse"></i></span></span><a href="'.$URL.'" target="_blank"><img style="width: 500px; display:inherit;" src="'.$image_url.'" alt="'.$itemDetails['Name'].'"></a><div class="progress progress-bar-sm zero-m"><div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="'.$watched.'" aria-valuemin="0" aria-valuemax="100" style="width: '.$watched.'%"></div><div class="progress-bar palette-Grey-500 bg" style="width: 0%"></div></div><div class="caption"><i style="float:left" class="fa fa-'.$state.'"></i>'.$topTitle.''.$bottomTitle.'</div></div></div>';
|
|
|
+ if($nowPlaying){
|
|
|
+ //prettyPrint($itemDetails);
|
|
|
+ return '<div class="col-sm-6 col-md-3"><div class="thumbnail ultra-widget"><div style="display: none;" np="'.$id.'" class="overlay content-box small-box gray-bg">'.$streamInfo.'</div><span class="w-refresh w-p-icon gray" link="'.$id.'"><span class="fa-stack fa-lg" style="font-size: .5em"><i class="fa fa-square fa-stack-2x"></i><i class="fa fa-info-circle fa-stack-1x fa-inverse"></i></span></span><a href="'.$URL.'" target="_blank"><img style="width: 500px; display:inherit;" src="'.$image_url.'" alt="'.$itemDetails['Name'].'"></a><div class="progress progress-bar-sm zero-m"><div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="'.$watched.'" aria-valuemin="0" aria-valuemax="100" style="width: '.$watched.'%"></div><div class="progress-bar palette-Grey-500 bg" style="width: 0%"></div></div><div class="caption"><i style="float:left" class="fa fa-'.$state.'"></i>'.$topTitle.''.$bottomTitle.'</div></div></div>';
|
|
|
}else{
|
|
|
- return '<div class="item-'.$itemDetails['Type'].'"><a href="'.$URL.'" target="_blank"><img alt="'.$itemDetails['Name'].'" class="'.$image.'" data-lazy="'.$image_url.'"></a><small style="margin-right: 13px" class="elip">'.$title.'</small></div>';
|
|
|
-}
|
|
|
+ return '<div class="item-'.$itemDetails['Type'].'"><a href="'.$URL.'" target="_blank"><img alt="'.$itemDetails['Name'].'" class="'.$image.'" data-lazy="'.$image_url.'"></a><small style="margin-right: 13px" class="elip">'.$title.'</small></div>';
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// Format item from Plex for Carousel
|
|
|
@@ -707,7 +709,7 @@ function resolvePlexItem($server, $token, $item, $nowPlaying = false, $showNames
|
|
|
$image = 'slick-image-tall';
|
|
|
$style = '';
|
|
|
if(!$nowPlaying){
|
|
|
- $thumb = $item['parentThumb'];
|
|
|
+ $thumb = ($item['parentThumb'] ? $item['parentThumb'] : $item['grandparentThumb']);
|
|
|
$key = $item['ratingKey'] . "-list";
|
|
|
}else {
|
|
|
$height = 281;
|
|
|
@@ -731,7 +733,7 @@ function resolvePlexItem($server, $token, $item, $nowPlaying = false, $showNames
|
|
|
$state = (($item->Player['state'] == "paused") ? "pause" : "play");
|
|
|
$topTitle = '<h5 class="text-center zero-m elip">'.$title.' - '.$item['title'].'</h5>';
|
|
|
$bottomTitle = '<small class="zero-m">S'.$item['parentIndex'].' · E'.$item['index'].'</small>';
|
|
|
- if($showNames == "true"){ $bottomTitle .= '</small><small class="zero-m pull-right">'.$user.'</small>'; }
|
|
|
+ if($showNames == "true"){ $bottomTitle .= '<small class="zero-m pull-right">'.$user.'</small>'; }
|
|
|
}
|
|
|
break;
|
|
|
case 'clip':
|
|
|
@@ -747,7 +749,8 @@ function resolvePlexItem($server, $token, $item, $nowPlaying = false, $showNames
|
|
|
$height = 281;
|
|
|
$width = 500;
|
|
|
$thumb = $item['art'];
|
|
|
- $key = $item['ratingKey'] . "-np";
|
|
|
+ $key = isset($item['ratingKey']) ? $item['ratingKey'] . "-np" : (isset($item['live']) ? "livetv.png" : ":)");
|
|
|
+ $useImage = (isset($item['live']) ? "images/livetv.png" : null);
|
|
|
$extraInfo = isset($item['extraType']) ? "Trailer" : (isset($item['live']) ? "Live TV" : ":)");
|
|
|
$elapsed = $item['viewOffset'];
|
|
|
$duration = $item['duration'];
|
|
|
@@ -839,7 +842,7 @@ function resolvePlexItem($server, $token, $item, $nowPlaying = false, $showNames
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (substr_count(PLEXURL, ':') == 2) {
|
|
|
+ if (substr_count(PLEXURL, '.') != 2) {
|
|
|
$address = "https://app.plex.tv/web/app#!/server/$server/details?key=/library/metadata/".$item['ratingKey'];
|
|
|
}else{
|
|
|
$address = PLEXURL."/web/index.html#!/server/$server/details?key=/library/metadata/".$item['ratingKey'];
|
|
|
@@ -852,7 +855,12 @@ function resolvePlexItem($server, $token, $item, $nowPlaying = false, $showNames
|
|
|
if (file_exists('images/cache/'.$key.'.jpg') && (time() - 604800) > filemtime('images/cache/'.$key.'.jpg') || !file_exists('images/cache/'.$key.'.jpg')) {
|
|
|
$image_url = 'ajax.php?a=plex-image&img='.$thumb.'&height='.$height.'&width='.$width.'&key='.$key.'';
|
|
|
}
|
|
|
- if(!$thumb){ $image_url = "images/no-np.png"; $key = "no-np"; }
|
|
|
+ if($nowPlaying){
|
|
|
+ if(!$thumb){ $image_url = "images/no-np.png"; $key = "no-np"; }
|
|
|
+ }else{
|
|
|
+ if(!$thumb){ $image_url = "images/no-list.png"; $key = "no-list"; }
|
|
|
+ }
|
|
|
+ if(isset($useImage)){ $image_url = $useImage; }
|
|
|
$openTab = (PLEXTABNAME) ? "true" : "false";
|
|
|
// Assemble Item And Cache Into Array
|
|
|
if($nowPlaying){
|
|
|
@@ -864,22 +872,23 @@ function resolvePlexItem($server, $token, $item, $nowPlaying = false, $showNames
|
|
|
|
|
|
//Recent Added
|
|
|
function outputRecentAdded($header, $items, $script = false, $array) {
|
|
|
- $hideMenu = '<div class="pull-right"><div class="btn-group" role="group"><button type="button" class="btn waves btn-default btn-sm dropdown-toggle waves-effect waves-float" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Filter<span class="caret"></span></button><ul style="right:0; left: auto" class="dropdown-menu">';
|
|
|
+ $hideMenu = '<div class="pull-right"><div class="btn-group" role="group"><button type="button" class="btn waves btn-default btn-sm dropdown-toggle waves-effect waves-float" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Filter<span class="caret"></span></button><ul style="right:0; left: auto" class="dropdown-menu filter-recent-event">';
|
|
|
if($array["movie"] == "true"){
|
|
|
- $hideMenu .= '<li><a class="js-filter-movie" href="javascript:void(0)">Hide Movies</a></li>';
|
|
|
+ $hideMenu .= '<li data-filter="item-movie" data-filter-on="false"><a class="js-filter-movie" href="javascript:void(0)">Movies</a></li>';
|
|
|
}
|
|
|
if($array["season"] == "true"){
|
|
|
- $hideMenu .= '<li><a class="js-filter-season" href="javascript:void(0)">Hide Show</a></li>';
|
|
|
+ $hideMenu .= '<li data-filter="item-season" data-filter-on="false"><a class="js-filter-season" href="javascript:void(0)">Shows</a></li>';
|
|
|
}
|
|
|
if($array["album"] == "true"){
|
|
|
- $hideMenu .= '<li><a class="js-filter-album" href="javascript:void(0)">Hide Music</a></li>';
|
|
|
+ $hideMenu .= '<li data-filter="item-album" data-filter-on="false"><a class="js-filter-album" href="javascript:void(0)">Music</a></li>';
|
|
|
}
|
|
|
$hideMenu .= '</ul></div></div>';
|
|
|
// If None Populate Empty Item
|
|
|
if (!count($items)) {
|
|
|
- return '<div id=recentMedia><h5 class="text-center">'.$header.'</h5><p class="text-center">No Media Found</p></div>';
|
|
|
+ return '<div id="recentMedia" class="content-box box-shadow big-box"><h5 class="text-center">'.$header.'</h5><p class="text-center">No Media Found</p></div>';
|
|
|
}else{
|
|
|
- return '<div id=recentMedia><h5 style="margin-bottom: -20px" class="text-center">'.$header.'</h5><div class="recentHeader inbox-pagination">'.$hideMenu.'</div><br/><div class="recentItems">'.implode('',$items).'</div></div>'.($script?'<script>'.$script.'</script>':'');
|
|
|
+ $className = str_replace(' ', '', $header);
|
|
|
+ return '<div id="recentMedia" class="content-box box-shadow big-box"><h5 style="margin-bottom: -20px" class="text-center">'.$header.'</h5><div class="recentHeader inbox-pagination '.$className.'">'.$hideMenu.'</div><br/><div class="recentItems" data-name="'.$className.'">'.implode('',$items).'</div></div>'.($script?'<script>'.$script.'</script>':'');
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -890,7 +899,7 @@ function outputNowPlaying($header, $size, $type, $items, $script = false) {
|
|
|
if (!count($items)) {
|
|
|
return '<div id=streamz></div>'.($script?'<script>'.$script.'</script>':'');
|
|
|
}else{
|
|
|
- return '<div id=streamz><h5 class="text-center">'.$header.'</h5>'.implode('',$items).'</div>'.($script?'<script>'.$script.'</script>':'');
|
|
|
+ return '<div id=streamz><h5 class="zero-m big-box"><strong>'.$header.'</strong></h5>'.implode('',$items).'</div>'.($script?'<script>'.$script.'</script>':'');
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -928,27 +937,35 @@ function getPlexStreams($size, $showNames, $role){
|
|
|
// Perform API requests
|
|
|
$api = @curl_get($address."/status/sessions?X-Plex-Token=".PLEXTOKEN);
|
|
|
$api = simplexml_load_string($api);
|
|
|
- $getServer = simplexml_load_string(@curl_get($address."/?X-Plex-Token=".PLEXTOKEN));
|
|
|
- if (!$getServer) { return 'Could not load!'; }
|
|
|
-
|
|
|
- // Identify the local machine
|
|
|
- $gotServer = $getServer['machineIdentifier'];
|
|
|
-
|
|
|
- $items = array();
|
|
|
- foreach($api AS $child) {
|
|
|
- $items[] = resolvePlexItem($gotServer, PLEXTOKEN, $child, true, $showNames, $role);
|
|
|
+ if (is_array($api) || is_object($api)){
|
|
|
+ if (!$api->head->title){
|
|
|
+ $getServer = simplexml_load_string(@curl_get($address."/?X-Plex-Token=".PLEXTOKEN));
|
|
|
+ if (!$getServer) { return 'Could not load!'; }
|
|
|
+
|
|
|
+ // Identify the local machine
|
|
|
+ $gotServer = $getServer['machineIdentifier'];
|
|
|
+
|
|
|
+ $items = array();
|
|
|
+ foreach($api AS $child) {
|
|
|
+ $items[] = resolvePlexItem($gotServer, PLEXTOKEN, $child, true, $showNames, $role);
|
|
|
+ }
|
|
|
+
|
|
|
+ return outputNowPlaying(translate('PLAYING_NOW_ON_PLEX')." ( ".count($items)." Streams )", $size, 'streams-plex', $items, "
|
|
|
+ setInterval(function() {
|
|
|
+ $('<div></div>').load('ajax.php?a=plex-streams',function() {
|
|
|
+ var element = $(this).find('[id]');
|
|
|
+ var loadedID = element.attr('id');
|
|
|
+ $('#'+loadedID).replaceWith(element);
|
|
|
+ console.log('Loaded updated: '+loadedID);
|
|
|
+ });
|
|
|
+ }, 15000);
|
|
|
+ ");
|
|
|
+ }else{
|
|
|
+ writeLog("error", "PLEX STREAM ERROR: could not connect - check token - if HTTPS, is cert valid");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ writeLog("error", "PLEX STREAM ERROR: could not connect - check URL - if HTTPS, is cert valid");
|
|
|
}
|
|
|
-
|
|
|
- return outputNowPlaying(translate('PLAYING_NOW_ON_PLEX'), $size, 'streams-plex', $items, "
|
|
|
- setInterval(function() {
|
|
|
- $('<div></div>').load('ajax.php?a=plex-streams',function() {
|
|
|
- var element = $(this).find('[id]');
|
|
|
- var loadedID = element.attr('id');
|
|
|
- $('#'+loadedID).replaceWith(element);
|
|
|
- console.log('Loaded updated: '+loadedID);
|
|
|
- });
|
|
|
- }, 15000);
|
|
|
- ");
|
|
|
}
|
|
|
|
|
|
// Get Recent Content From Emby
|
|
|
@@ -1008,21 +1025,29 @@ function getPlexRecent($array){
|
|
|
// Perform Requests
|
|
|
$api = @curl_get($address."/library/recentlyAdded?limit=".PLEXRECENTITEMS."&X-Plex-Token=".PLEXTOKEN);
|
|
|
$api = simplexml_load_string($api);
|
|
|
- $getServer = simplexml_load_string(@curl_get($address."/?X-Plex-Token=".PLEXTOKEN));
|
|
|
- if (!$getServer) { return 'Could not load!'; }
|
|
|
-
|
|
|
- // Identify the local machine
|
|
|
- $gotServer = $getServer['machineIdentifier'];
|
|
|
-
|
|
|
- $items = array();
|
|
|
- foreach($api AS $child) {
|
|
|
- $type = (string) $child['type'];
|
|
|
- if($array[$type] == "true"){
|
|
|
- $items[] = resolvePlexItem($gotServer, PLEXTOKEN, $child, false, false, false);
|
|
|
+ if (is_array($api) || is_object($api)){
|
|
|
+ if (!$api->head->title){
|
|
|
+ $getServer = simplexml_load_string(@curl_get($address."/?X-Plex-Token=".PLEXTOKEN));
|
|
|
+ if (!$getServer) { return 'Could not load!'; }
|
|
|
+
|
|
|
+ // Identify the local machine
|
|
|
+ $gotServer = $getServer['machineIdentifier'];
|
|
|
+
|
|
|
+ $items = array();
|
|
|
+ foreach($api AS $child) {
|
|
|
+ $type = (string) $child['type'];
|
|
|
+ if($array[$type] == "true"){
|
|
|
+ $items[] = resolvePlexItem($gotServer, PLEXTOKEN, $child, false, false, false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return outputRecentAdded($header, $items, "", $array);
|
|
|
+ }else{
|
|
|
+ writeLog("error", "PLEX STREAM ERROR: could not connect - check token - if HTTPS, is cert valid");
|
|
|
}
|
|
|
+ }else{
|
|
|
+ writeLog("error", "PLEX STREAM ERROR: could not connect - check URL - if HTTPS, is cert valid");
|
|
|
}
|
|
|
-
|
|
|
- return outputRecentAdded($header, $items, "", $array);
|
|
|
}
|
|
|
|
|
|
// Get Image From Emby
|
|
|
@@ -1044,7 +1069,7 @@ function getEmbyImage() {
|
|
|
$cachefile = 'images/cache/'.$key.'.jpg';
|
|
|
$cachetime = 604800;
|
|
|
// Serve from the cache if it is younger than $cachetime
|
|
|
- if (file_exists($cachefile) && time() - $cachetime > filemtime($cachefile)) {
|
|
|
+ if (file_exists($cachefile) && time() - $cachetime < filemtime($cachefile)) {
|
|
|
header("Content-type: image/jpeg");
|
|
|
@readfile($cachefile);
|
|
|
exit;
|
|
|
@@ -1080,7 +1105,7 @@ function getPlexImage() {
|
|
|
$cachefile = 'images/cache/'.$key.'.jpg';
|
|
|
$cachetime = 604800;
|
|
|
// Serve from the cache if it is younger than $cachetime
|
|
|
- if (file_exists($cachefile) && time() - $cachetime > filemtime($cachefile)) {
|
|
|
+ if (file_exists($cachefile) && time() - $cachetime < filemtime($cachefile)) {
|
|
|
header("Content-type: image/jpeg");
|
|
|
@readfile($cachefile);
|
|
|
exit;
|
|
|
@@ -1423,13 +1448,53 @@ function upgradeCheck() {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+// Get OS from server
|
|
|
+function getOS(){
|
|
|
+ if(PHP_SHLIB_SUFFIX == "dll"){
|
|
|
+ return "win";
|
|
|
+ }else{
|
|
|
+ return "nix";
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//Get Error by Server OS
|
|
|
+function getError($os, $error){
|
|
|
+ $ini = (!empty(php_ini_loaded_file()) ? php_ini_loaded_file() : "php.ini");
|
|
|
+ $ext = (!empty(ini_get('extension_dir')) ? "uncomment ;extension_dir = and make sure it says -> extension_dir = '".ini_get('extension_dir')."'" : "uncomment ;extension_dir = and add path to 'ext' to make it like extension_dir = 'C:\nginx\php\ext'");
|
|
|
+ $errors = array(
|
|
|
+ 'pdo_sqlite' => array(
|
|
|
+ 'win' => '<b>PDO:SQLite</b> not enabled, uncomment ;extension=php_pdo_sqlite.dll in the file php.ini | '.$ext,
|
|
|
+ 'nix' => '<b>PDO:SQLite</b> not enabled, PHP7 -> run sudo apt-get install php7.0-sqlite | PHP5 -> run sudo apt-get install php5-sqlite',
|
|
|
+ ),
|
|
|
+ 'sqlite3' => array(
|
|
|
+ 'win' => '<b>SQLite3</b> not enabled, uncomment ;extension=php_sqlite3.dll in the file php.ini | uncomment ;sqlite3.extension_dir = and add "ext" to make it sqlite3.extension_dir = ext',
|
|
|
+ 'nix' => '<b>SQLite3</b> not enabled, run sudo apt-get install php-sqlite3',
|
|
|
+ ),
|
|
|
+ 'curl' => array(
|
|
|
+ 'win' => '<b>cURL</b> not enabled, uncomment ;extension=php_curl.dll in the file php.ini | '.$ext,
|
|
|
+ 'nix' => '<b>cURL</b> not enabled, PHP7 -> sudo apt-get install php-curl | PHP5 -> run sudo apt-get install php5.6-curl',
|
|
|
+ ),
|
|
|
+ 'zip' => array(
|
|
|
+ 'win' => '<b>PHP Zip</b> not enabled, uncomment ;extension=php_zip.dll in the file php.ini, if that doesn\'t work remove that line',
|
|
|
+ 'nix' => '<b>PHP Zip</b> not enabled, PHP7 -> run sudo apt-get install php7.0-zip | PHP5 -> run sudo apt-get install php5.6-zip',
|
|
|
+ ),
|
|
|
+
|
|
|
+ );
|
|
|
+ return (isset($errors[$error][$os]) ? $errors[$error][$os] : 'No Error Info Found');
|
|
|
+}
|
|
|
+
|
|
|
// Check if all software dependancies are met
|
|
|
function dependCheck() {
|
|
|
$output = array();
|
|
|
- if (!extension_loaded('pdo_sqlite')) { $output[] = 'PDO:SQLite not enabled, please add "extension = php_pdo_sqlite.dll" to php.ini'; }
|
|
|
- //if (!extension_loaded('sqlite3')) { $output[] = 'SQLite3 not enabled, please add "extension = php_sqlite3.dll" to php.ini'; }
|
|
|
+ $i = 1;
|
|
|
+ if (!extension_loaded('pdo_sqlite')) { $output["Step $i"] = getError(getOS(),'pdo_sqlite'); $i++; }
|
|
|
+ if (!extension_loaded('curl')) { $output["Step $i"] = getError(getOS(),'curl'); $i++; }
|
|
|
+ if (!extension_loaded('zip')) { $output["Step $i"] = getError(getOS(),'zip'); $i++; }
|
|
|
+ //if (!extension_loaded('sqlite3')) { $output[] = getError(getOS(),'sqlite3'); }
|
|
|
|
|
|
if ($output) {
|
|
|
+ $output["Step $i"] = "<b>Restart PHP and/or Webserver to apply changes</b>"; $i++;
|
|
|
+ $output["Step $i"] = "<b>Please visit here to also check status of necessary components after you fix them: <a href='check.php'>check.php<a/></b>"; $i++;
|
|
|
debug_out($output,1);
|
|
|
}
|
|
|
return true;
|
|
|
@@ -1953,7 +2018,7 @@ function timezoneOptions() {
|
|
|
// Build Database
|
|
|
function createSQLiteDB($path = false) {
|
|
|
if ($path === false) {
|
|
|
- if (defined('DATABASE_LOCATION')) {
|
|
|
+ if (DATABASE_LOCATION){
|
|
|
$path = DATABASE_LOCATION;
|
|
|
} else {
|
|
|
debug_out('No Path Specified!');
|
|
|
@@ -2149,11 +2214,6 @@ function sendNotification($success, $message = false, $send = true) {
|
|
|
|
|
|
// Load colours from the database
|
|
|
function loadAppearance() {
|
|
|
- if (!isset($GLOBALS['file_db'])) {
|
|
|
- $GLOBALS['file_db'] = new PDO('sqlite:'.DATABASE_LOCATION.'users.db');
|
|
|
- $GLOBALS['file_db']->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
|
|
- }
|
|
|
-
|
|
|
// Defaults
|
|
|
$defaults = array(
|
|
|
'title' => 'Organizr',
|
|
|
@@ -2170,19 +2230,27 @@ function loadAppearance() {
|
|
|
'loading' => '#66D9EF',
|
|
|
'hovertext' => '#000000',
|
|
|
);
|
|
|
-
|
|
|
- // Database Lookup
|
|
|
- $options = $GLOBALS['file_db']->query('SELECT * FROM options');
|
|
|
-
|
|
|
- // Replace defaults with filled options
|
|
|
- foreach($options as $row) {
|
|
|
- foreach($defaults as $key => $value) {
|
|
|
- if (isset($row[$key]) && $row[$key]) {
|
|
|
- $defaults[$key] = $row[$key];
|
|
|
+
|
|
|
+ if (DATABASE_LOCATION) {
|
|
|
+ if(is_file(DATABASE_LOCATION.'users.db') && filesize(DATABASE_LOCATION.'users.db') > 0){
|
|
|
+ if (!isset($GLOBALS['file_db'])) {
|
|
|
+ $GLOBALS['file_db'] = new PDO('sqlite:'.DATABASE_LOCATION.'users.db');
|
|
|
+ $GLOBALS['file_db']->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
|
|
+ }
|
|
|
+
|
|
|
+ // Database Lookup
|
|
|
+ $options = $GLOBALS['file_db']->query('SELECT * FROM options');
|
|
|
+ // Replace defaults with filled options
|
|
|
+ foreach($options as $row) {
|
|
|
+ foreach($defaults as $key => $value) {
|
|
|
+ if (isset($row[$key]) && $row[$key]) {
|
|
|
+ $defaults[$key] = $row[$key];
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// Return the Results
|
|
|
return $defaults;
|
|
|
}
|
|
|
@@ -2306,42 +2374,44 @@ function nzbgetConnect($list = 'listgroups') {
|
|
|
|
|
|
$api = curl_get($url.'/'.NZBGETUSERNAME.':'.NZBGETPASSWORD.'/jsonrpc/'.$list);
|
|
|
$api = json_decode($api, true);
|
|
|
-
|
|
|
$gotNZB = array();
|
|
|
-
|
|
|
- foreach ($api['result'] AS $child) {
|
|
|
- $downloadName = htmlentities($child['NZBName'], ENT_QUOTES);
|
|
|
- $downloadStatus = $child['Status'];
|
|
|
- $downloadCategory = $child['Category'];
|
|
|
- if($list == "history"){ $downloadPercent = "100"; $progressBar = ""; }
|
|
|
- if($list == "listgroups"){ $downloadPercent = (($child['FileSizeMB'] - $child['RemainingSizeMB']) / $child['FileSizeMB']) * 100; $progressBar = "progress-bar-striped active"; }
|
|
|
- if($child['Health'] <= "750"){
|
|
|
- $downloadHealth = "danger";
|
|
|
- }elseif($child['Health'] <= "900"){
|
|
|
- $downloadHealth = "warning";
|
|
|
- }elseif($child['Health'] <= "1000"){
|
|
|
- $downloadHealth = "success";
|
|
|
- }
|
|
|
-
|
|
|
- $gotNZB[] = '<tr>
|
|
|
- <td class="col-xs-7 nzbtable-file-row">'.$downloadName.'</td>
|
|
|
- <td class="col-xs-2 nzbtable nzbtable-row">'.$downloadStatus.'</td>
|
|
|
- <td class="col-xs-1 nzbtable nzbtable-row">'.$downloadCategory.'</td>
|
|
|
- <td class="col-xs-2 nzbtable nzbtable-row">
|
|
|
- <div class="progress">
|
|
|
- <div class="progress-bar progress-bar-'.$downloadHealth.' '.$progressBar.'" role="progressbar" aria-valuenow="'.$downloadPercent.'" aria-valuemin="0" aria-valuemax="100" style="width: '.$downloadPercent.'%">
|
|
|
- <p class="text-center">'.round($downloadPercent).'%</p>
|
|
|
- <span class="sr-only">'.$downloadPercent.'% Complete</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </td>
|
|
|
- </tr>';
|
|
|
- }
|
|
|
-
|
|
|
- if ($gotNZB) {
|
|
|
- return implode('',$gotNZB);
|
|
|
- } else {
|
|
|
- return '<tr><td colspan="4"><p class="text-center">No Results</p></td></tr>';
|
|
|
+ if (is_array($api) || is_object($api)){
|
|
|
+ foreach ($api['result'] AS $child) {
|
|
|
+ $downloadName = htmlentities($child['NZBName'], ENT_QUOTES);
|
|
|
+ $downloadStatus = $child['Status'];
|
|
|
+ $downloadCategory = $child['Category'];
|
|
|
+ if($list == "history"){ $downloadPercent = "100"; $progressBar = ""; }
|
|
|
+ if($list == "listgroups"){ $downloadPercent = (($child['FileSizeMB'] - $child['RemainingSizeMB']) / $child['FileSizeMB']) * 100; $progressBar = "progress-bar-striped active"; }
|
|
|
+ if($child['Health'] <= "750"){
|
|
|
+ $downloadHealth = "danger";
|
|
|
+ }elseif($child['Health'] <= "900"){
|
|
|
+ $downloadHealth = "warning";
|
|
|
+ }elseif($child['Health'] <= "1000"){
|
|
|
+ $downloadHealth = "success";
|
|
|
+ }
|
|
|
+
|
|
|
+ $gotNZB[] = '<tr>
|
|
|
+ <td class="col-xs-7 nzbtable-file-row">'.$downloadName.'</td>
|
|
|
+ <td class="col-xs-2 nzbtable nzbtable-row">'.$downloadStatus.'</td>
|
|
|
+ <td class="col-xs-1 nzbtable nzbtable-row">'.$downloadCategory.'</td>
|
|
|
+ <td class="col-xs-2 nzbtable nzbtable-row">
|
|
|
+ <div class="progress">
|
|
|
+ <div class="progress-bar progress-bar-'.$downloadHealth.' '.$progressBar.'" role="progressbar" aria-valuenow="'.$downloadPercent.'" aria-valuemin="0" aria-valuemax="100" style="width: '.$downloadPercent.'%">
|
|
|
+ <p class="text-center">'.round($downloadPercent).'%</p>
|
|
|
+ <span class="sr-only">'.$downloadPercent.'% Complete</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>';
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($gotNZB) {
|
|
|
+ return implode('',$gotNZB);
|
|
|
+ } else {
|
|
|
+ return '<tr><td colspan="4"><p class="text-center">No Results</p></td></tr>';
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ writeLog("error", "NZBGET ERROR: could not connect - check URL and/or check token and/or Usernamd and Password - if HTTPS, is cert valid");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -2616,19 +2686,30 @@ function explosion($string, $position){
|
|
|
}
|
|
|
|
|
|
function getServerPath() {
|
|
|
-
|
|
|
- if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {
|
|
|
-
|
|
|
+ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == "https"){
|
|
|
+ $protocol = "https://";
|
|
|
+ }elseif (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {
|
|
|
$protocol = "https://";
|
|
|
-
|
|
|
} else {
|
|
|
-
|
|
|
$protocol = "http://";
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
- return $protocol . $_SERVER['SERVER_NAME'] . dirname($_SERVER['REQUEST_URI']);
|
|
|
-
|
|
|
+ $domain = '';
|
|
|
+ if (isset($_SERVER['SERVER_NAME']) && strpos($_SERVER['SERVER_NAME'], '.') !== false){
|
|
|
+ $domain = $_SERVER['SERVER_NAME'];
|
|
|
+ }elseif(isset($_SERVER['HTTP_HOST'])){
|
|
|
+ if (strpos($_SERVER['HTTP_HOST'], ':') !== false) {
|
|
|
+ $domain = explode(':', $_SERVER['HTTP_HOST'])[0];
|
|
|
+ $port = explode(':', $_SERVER['HTTP_HOST'])[1];
|
|
|
+ if ($port == "80" || $port == "443"){
|
|
|
+ $domain = $domain;
|
|
|
+ }else{
|
|
|
+ $domain = $_SERVER['HTTP_HOST'];
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ $domain = $_SERVER['HTTP_HOST'];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return $protocol . $domain . dirname($_SERVER['REQUEST_URI']);
|
|
|
}
|
|
|
|
|
|
function get_browser_name() {
|
|
|
@@ -2665,7 +2746,7 @@ function getSickrageCalendarWanted($array){
|
|
|
if (new DateTime() < new DateTime($episodeAirDate)) { $unaired = true; }
|
|
|
$downloaded = "0";
|
|
|
if($downloaded == "0" && isset($unaired)){ $downloaded = "indigo-bg"; }elseif($downloaded == "1"){ $downloaded = "green-bg";}else{ $downloaded = "red-bg"; }
|
|
|
- $gotCalendar .= "{ title: \"$seriesName\", start: \"$episodeAirDate\", className: \"$downloaded\", imagetype: \"tv\", url: \"https://thetvdb.com/?tab=series&id=$episodeID\" }, \n";
|
|
|
+ $gotCalendar .= "{ title: \"$seriesName\", start: \"$episodeAirDate\", className: \"$downloaded tvID--$episodeID\", imagetype: \"tv\" }, \n";
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -2682,7 +2763,7 @@ function getSickrageCalendarWanted($array){
|
|
|
if (new DateTime() < new DateTime($episodeAirDate)) { $unaired = true; }
|
|
|
$downloaded = "0";
|
|
|
if($downloaded == "0" && isset($unaired)){ $downloaded = "indigo-bg"; }elseif($downloaded == "1"){ $downloaded = "green-bg";}else{ $downloaded = "red-bg"; }
|
|
|
- $gotCalendar .= "{ title: \"$seriesName\", start: \"$episodeAirDate\", className: \"$downloaded\", imagetype: \"tv\", url: \"https://thetvdb.com/?tab=series&id=$episodeID\" }, \n";
|
|
|
+ $gotCalendar .= "{ title: \"$seriesName\", start: \"$episodeAirDate\", className: \"$downloaded tvID--$episodeID\", imagetype: \"tv\" }, \n";
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -2699,7 +2780,7 @@ function getSickrageCalendarWanted($array){
|
|
|
if (new DateTime() < new DateTime($episodeAirDate)) { $unaired = true; }
|
|
|
$downloaded = "0";
|
|
|
if($downloaded == "0" && isset($unaired)){ $downloaded = "indigo-bg"; }elseif($downloaded == "1"){ $downloaded = "green-bg";}else{ $downloaded = "red-bg"; }
|
|
|
- $gotCalendar .= "{ title: \"$seriesName\", start: \"$episodeAirDate\", className: \"$downloaded\", imagetype: \"tv\", url: \"https://thetvdb.com/?tab=series&id=$episodeID\" }, \n";
|
|
|
+ $gotCalendar .= "{ title: \"$seriesName\", start: \"$episodeAirDate\", className: \"$downloaded tvID--$episodeID\", imagetype: \"tv\" }, \n";
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -2716,7 +2797,7 @@ function getSickrageCalendarWanted($array){
|
|
|
if (new DateTime() < new DateTime($episodeAirDate)) { $unaired = true; }
|
|
|
$downloaded = "0";
|
|
|
if($downloaded == "0" && isset($unaired)){ $downloaded = "indigo-bg"; }elseif($downloaded == "1"){ $downloaded = "green-bg";}else{ $downloaded = "red-bg"; }
|
|
|
- $gotCalendar .= "{ title: \"$seriesName\", start: \"$episodeAirDate\", className: \"$downloaded\", imagetype: \"tv\", url: \"https://thetvdb.com/?tab=series&id=$episodeID\" }, \n";
|
|
|
+ $gotCalendar .= "{ title: \"$seriesName\", start: \"$episodeAirDate\", className: \"$downloaded tvID--$episodeID\", imagetype: \"tv\" }, \n";
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -2737,7 +2818,7 @@ function getSickrageCalendarHistory($array){
|
|
|
$episodeID = $child['tvdbid'];
|
|
|
$episodeAirDate = $child['date'];
|
|
|
$downloaded = "green-bg";
|
|
|
- $gotCalendar .= "{ title: \"$seriesName\", start: \"$episodeAirDate\", className: \"$downloaded\", imagetype: \"tv\", url: \"https://thetvdb.com/?tab=series&id=$episodeID\" }, \n";
|
|
|
+ $gotCalendar .= "{ title: \"$seriesName\", start: \"$episodeAirDate\", className: \"$downloaded tvID--$episodeID\", imagetype: \"tv\" }, \n";
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -2767,7 +2848,7 @@ function getSonarrCalendar($array){
|
|
|
$downloaded = $child['hasFile'];
|
|
|
if($downloaded == "0" && isset($unaired) && $episodePremier == "true"){ $downloaded = "light-blue-bg"; }elseif($downloaded == "0" && isset($unaired)){ $downloaded = "indigo-bg"; }elseif($downloaded == "1"){ $downloaded = "green-bg";}else{ $downloaded = "red-bg"; }
|
|
|
|
|
|
- $gotCalendar .= "{ title: \"$seriesName\", start: \"$episodeAirDate\", className: \"$downloaded\", imagetype: \"tv\", url: \"https://thetvdb.com/?tab=series&id=$episodeID\" }, \n";
|
|
|
+ $gotCalendar .= "{ title: \"$seriesName\", start: \"$episodeAirDate\", className: \"$downloaded tvID--$episodeID\", imagetype: \"tv\" }, \n";
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -2807,7 +2888,7 @@ function getRadarrCalendar($array){
|
|
|
|
|
|
}
|
|
|
|
|
|
- $gotCalendar .= "{ title: \"$movieName\", start: \"$physicalRelease\", className: \"$downloaded\", imagetype: \"film\", url: \"https://www.themoviedb.org/movie/$movieID\" }, \n";
|
|
|
+ $gotCalendar .= "{ title: \"$movieName\", start: \"$physicalRelease\", className: \"$downloaded movieID--$movieID\", imagetype: \"film\" }, \n";
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -2817,41 +2898,46 @@ function getRadarrCalendar($array){
|
|
|
}
|
|
|
|
|
|
function getHeadphonesCalendar($url, $key, $list){
|
|
|
- $url = qualifyURL(HEADPHONESURL);
|
|
|
-
|
|
|
+ $url = qualifyURL(HEADPHONESURL);
|
|
|
$api = curl_get($url."/api?apikey=".$key."&cmd=$list");
|
|
|
-
|
|
|
$api = json_decode($api, true);
|
|
|
-
|
|
|
$i = 0;
|
|
|
-
|
|
|
$gotCalendar = "";
|
|
|
-
|
|
|
- foreach($api AS $child) {
|
|
|
-
|
|
|
- if($child['Status'] == "Wanted"){
|
|
|
-
|
|
|
- $i++;
|
|
|
- $albumName = addslashes($child['AlbumTitle']);
|
|
|
- $albumArtist = htmlentities($child['ArtistName'], ENT_QUOTES);
|
|
|
- $albumDate = $child['ReleaseDate'];
|
|
|
- $albumID = $child['AlbumID'];
|
|
|
- $albumDate = strtotime($albumDate);
|
|
|
- $albumDate = date("Y-m-d", $albumDate);
|
|
|
- $albumStatus = $child['Status'];
|
|
|
-
|
|
|
- if (new DateTime() < new DateTime($albumDate)) { $notReleased = "true"; }else{ $notReleased = "false"; }
|
|
|
-
|
|
|
- if($albumStatus == "Wanted" && $notReleased == "true"){ $albumStatusColor = "indigo-bg"; }elseif($albumStatus == "Downloaded"){ $albumStatusColor = "green-bg"; }else{ $albumStatusColor = "red-bg"; }
|
|
|
-
|
|
|
- $gotCalendar .= "{ title: \"$albumArtist - $albumName\", start: \"$albumDate\", className: \"$albumStatusColor\", imagetype: \"music\", url: \"https://musicbrainz.org/release-group/$albumID\" }, \n";
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- if ($i != 0){ return $gotCalendar; }
|
|
|
-
|
|
|
+ if (is_array($api) || is_object($api)){
|
|
|
+ foreach($api AS $child) {
|
|
|
+ if($child['Status'] == "Wanted" && $list == "getWanted"){
|
|
|
+ $i++;
|
|
|
+ $albumName = addslashes($child['AlbumTitle']);
|
|
|
+ $albumArtist = htmlentities($child['ArtistName'], ENT_QUOTES);
|
|
|
+ $albumDate = $child['ReleaseDate'];
|
|
|
+ $albumID = $child['AlbumID'];
|
|
|
+ $albumDate = strtotime($albumDate);
|
|
|
+ $albumDate = date("Y-m-d", $albumDate);
|
|
|
+ $albumStatus = $child['Status'];
|
|
|
+
|
|
|
+ if (new DateTime() < new DateTime($albumDate)) { $notReleased = "true"; }else{ $notReleased = "false"; }
|
|
|
+
|
|
|
+ if($albumStatus == "Wanted" && $notReleased == "true"){ $albumStatusColor = "indigo-bg"; }elseif($albumStatus == "Downloaded"){ $albumStatusColor = "green-bg"; }else{ $albumStatusColor = "red-bg"; }
|
|
|
+
|
|
|
+ $gotCalendar .= "{ title: \"$albumArtist - $albumName\", start: \"$albumDate\", className: \"$albumStatusColor\", imagetype: \"music\", url: \"https://musicbrainz.org/release-group/$albumID\" }, \n";
|
|
|
+ }
|
|
|
+ if($child['Status'] == "Processed" && $list == "getHistory"){
|
|
|
+ $i++;
|
|
|
+ $albumName = addslashes($child['Title']);
|
|
|
+ $albumDate = $child['DateAdded'];
|
|
|
+ $albumID = $child['AlbumID'];
|
|
|
+ $albumDate = strtotime($albumDate);
|
|
|
+ $albumDate = date("Y-m-d", $albumDate);
|
|
|
+ $albumStatusColor = "green-bg";
|
|
|
+ if (new DateTime() < new DateTime($albumDate)) { $notReleased = "true"; }else{ $notReleased = "false"; }
|
|
|
+
|
|
|
+ $gotCalendar .= "{ title: \"$albumName\", start: \"$albumDate\", className: \"$albumStatusColor\", imagetype: \"music\", url: \"https://musicbrainz.org/release-group/$albumID\" }, \n";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ($i != 0){ return $gotCalendar; }
|
|
|
+ }else{
|
|
|
+ writeLog("error", "HEADPHONES $list ERROR: could not connect - check URL and/or check API key - if HTTPS, is cert valid");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
function checkRootPath($string){
|
|
|
@@ -2862,6 +2948,10 @@ function checkRootPath($string){
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+function strip($string){
|
|
|
+ return str_replace(array("\r","\n","\t"),"",$string);
|
|
|
+}
|
|
|
+
|
|
|
function writeLog($type, $message){
|
|
|
$message = date("Y-m-d H:i:s")."|".$type."|".$message."\n";
|
|
|
file_put_contents("org.log", $message, FILE_APPEND | LOCK_EX);
|
|
|
@@ -2924,12 +3014,13 @@ function getPlatform($platform){
|
|
|
"Emby Classic" => "emby.png",
|
|
|
"Safari" => "safari.png",
|
|
|
"Android" => "android.png",
|
|
|
+ "AndroidTv" => "android.png",
|
|
|
"Chromecast" => "chromecast.png",
|
|
|
"Dashboard" => "emby.png",
|
|
|
"Dlna" => "dlna.png",
|
|
|
"Windows Phone" => "wp.png",
|
|
|
"Windows RT" => "win8.png",
|
|
|
- "Kodi" => "koid.png",
|
|
|
+ "Kodi" => "kodi.png",
|
|
|
);
|
|
|
if (array_key_exists($platform, $allPlatforms)) {
|
|
|
return $allPlatforms[$platform];
|
|
|
@@ -3151,7 +3242,7 @@ function searchPlex($query){
|
|
|
}
|
|
|
if(!$results['image']){ $image_url = "images/no-search.png"; $key = "no-search"; }
|
|
|
|
|
|
- if (substr_count(PLEXURL, ':') == 2) {
|
|
|
+ if (substr_count(PLEXURL, '.') != 2) {
|
|
|
$link = "https://app.plex.tv/web/app#!/server/$server/details?key=/library/metadata/".$results['ratingkey'];
|
|
|
}else{
|
|
|
$link = PLEXURL."/web/index.html#!/server/$server/details?key=/library/metadata/".$results['ratingkey'];
|
|
|
@@ -3248,6 +3339,34 @@ function sendEmail($email, $username = "Organizr User", $subject, $body, $cc = n
|
|
|
|
|
|
}
|
|
|
|
|
|
+//EMAIL SHIT
|
|
|
+function sendTestEmail($to, $from, $host, $auth, $username, $password, $type, $port, $sendername){
|
|
|
+
|
|
|
+ $mail = new PHPMailer;
|
|
|
+ $mail->isSMTP();
|
|
|
+ $mail->Host = $host;
|
|
|
+ $mail->SMTPAuth = $auth;
|
|
|
+ $mail->Username = $username;
|
|
|
+ $mail->Password = $password;
|
|
|
+ $mail->SMTPSecure = $type;
|
|
|
+ $mail->Port = $port;
|
|
|
+ $mail->setFrom($from, $sendername);
|
|
|
+ $mail->addReplyTo($from, $sendername);
|
|
|
+ $mail->isHTML(true);
|
|
|
+ $mail->addAddress($to, "Organizr Admin");
|
|
|
+ $mail->Subject = "Organizr Test E-Mail";
|
|
|
+ $mail->Body = "This was just a test!";
|
|
|
+ //$mail->send();
|
|
|
+ if(!$mail->send()) {
|
|
|
+ writeLog("error", "EMAIL TEST: mail failed to send - Error:".$mail->ErrorInfo);
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ writeLog("success", "EMAIL TEST: mail has been sent successfully");
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
function libraryList(){
|
|
|
$address = qualifyURL(PLEXURL);
|
|
|
$headers = array(
|
|
|
@@ -3265,7 +3384,9 @@ function libraryList(){
|
|
|
foreach($api->SharedServer AS $child) {
|
|
|
if(!empty($child['username'])){
|
|
|
$username = (string)strtolower($child['username']);
|
|
|
+ $email = (string)strtolower($child['email']);
|
|
|
$libraryList['users'][$username] = (string)$child['id'];
|
|
|
+ $libraryList['emails'][$email] = (string)$child['id'];
|
|
|
}
|
|
|
}
|
|
|
return (!empty($libraryList) ? array_change_key_case($libraryList,CASE_LOWER) : null );
|
|
|
@@ -3320,7 +3441,7 @@ function plexUserDelete($username){
|
|
|
);
|
|
|
$getServer = simplexml_load_string(@curl_get($address."/?X-Plex-Token=".PLEXTOKEN));
|
|
|
if (!$getServer) { return 'Could not load!'; }else { $gotServer = $getServer['machineIdentifier']; }
|
|
|
- $id = convertPlexName($username, "id");
|
|
|
+ $id = (is_numeric($username) ? $id : convertPlexName($username, "id"));
|
|
|
|
|
|
$api = curl_delete("https://plex.tv/api/servers/$gotServer/shared_servers/$id", $headers);
|
|
|
|
|
|
@@ -3491,5 +3612,472 @@ function customCSS(){
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+function tvdbToken(){
|
|
|
+ $headers = array(
|
|
|
+ "Accept" => "application/json",
|
|
|
+ "Content-Type" => "application/json"
|
|
|
+ );
|
|
|
+ $json = array(
|
|
|
+ "apikey" => "FBE7B62621F4CAD7",
|
|
|
+ "userkey" => "328BB46EB1E9A0F5",
|
|
|
+ "username" => "causefx"
|
|
|
+ );
|
|
|
+ $api = curl_post("https://api.thetvdb.com/login", $json, $headers);
|
|
|
+ return json_decode($api['content'], true)['token'];
|
|
|
+}
|
|
|
+
|
|
|
+function tvdbGet($id){
|
|
|
+ $headers = array(
|
|
|
+ "Accept" => "application/json",
|
|
|
+ "Authorization" => "Bearer ".tvdbToken(),
|
|
|
+ "trakt-api-key" => "4502cfdf8f7282fe454878ff8583f5636392cdc5fcac30d0cc4565f7173bf443",
|
|
|
+ "trakt-api-version" => "2"
|
|
|
+ );
|
|
|
+
|
|
|
+ $trakt = curl_get("https://api.trakt.tv/search/tvdb/$id?type=show", $headers);
|
|
|
+ @$api['trakt'] = json_decode($trakt, true)[0]['show']['ids'];
|
|
|
+
|
|
|
+ if(empty($api['trakt'])){
|
|
|
+ $series = curl_get("https://api.thetvdb.com/series/$id", $headers);
|
|
|
+ $poster = curl_get("https://api.thetvdb.com/series/$id/images/query?keyType=poster", $headers);
|
|
|
+ $backdrop = curl_get("https://api.thetvdb.com/series/$id/images/query?keyType=fanart", $headers);
|
|
|
+ $api['series'] = json_decode($series, true)['data'];
|
|
|
+ $api['poster'] = json_decode($poster, true)['data'];
|
|
|
+ $api['backdrop'] = json_decode($backdrop, true)['data'];
|
|
|
+ }
|
|
|
+ return $api;
|
|
|
+}
|
|
|
+
|
|
|
+function getPlexPlaylists(){
|
|
|
+ $address = qualifyURL(PLEXURL);
|
|
|
+
|
|
|
+ // Perform API requests
|
|
|
+ $api = @curl_get($address."/playlists?X-Plex-Token=".PLEXTOKEN);
|
|
|
+ $api = simplexml_load_string($api);
|
|
|
+ if (is_array($api) || is_object($api)){
|
|
|
+ if (!$api->head->title){
|
|
|
+ $getServer = simplexml_load_string(@curl_get($address."/?X-Plex-Token=".PLEXTOKEN));
|
|
|
+ if (!$getServer) { return 'Could not load!'; }
|
|
|
+ // Identify the local machine
|
|
|
+ $gotServer = $getServer['machineIdentifier'];
|
|
|
+ $output = "";
|
|
|
+ foreach($api AS $child) {
|
|
|
+ $items = "";
|
|
|
+ if ($child['playlistType'] == "video" && strpos(strtolower($child['title']) , 'private') === false){
|
|
|
+ $api = @curl_get($address.$child['key']."?X-Plex-Token=".PLEXTOKEN);
|
|
|
+ $api = simplexml_load_string($api);
|
|
|
+ if (is_array($api) || is_object($api)){
|
|
|
+ if (!$api->head->title){
|
|
|
+ foreach($api->Video AS $child){
|
|
|
+ $items[] = resolvePlexItem($gotServer, PLEXTOKEN, $child, false, false,false);
|
|
|
+ }
|
|
|
+ if (count($items)) {
|
|
|
+ $className = preg_replace("/(\W)+/", "", $api['title']);
|
|
|
+ $output .= '<div id="playlist-'.$className.'" class="content-box box-shadow big-box"><h5 style="margin-bottom: -20px" class="text-center">'.$api['title'].'</h5><div class="recentHeader inbox-pagination '.$className.'"></div><br/><div class="recentItems" data-name="'.$className.'">'.implode('',$items).'</div></div>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return $output;
|
|
|
+ }else{
|
|
|
+ writeLog("error", "PLEX PLAYLIST ERROR: could not connect - check token - if HTTPS, is cert valid");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ writeLog("error", "PLEX PLAYLIST ERROR: could not connect - check URL - if HTTPS, is cert valid");
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+function orgEmail($header = "Message From Admin", $title = "Important Message", $user = "Organizr User", $mainMessage = "", $button = null, $buttonURL = null, $subTitle = "", $subMessage = ""){
|
|
|
+ $path = getServerPath();
|
|
|
+ return '
|
|
|
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
|
|
|
+<head>
|
|
|
+ <!--[if gte mso 9]><xml>
|
|
|
+<o:OfficeDocumentSettings>
|
|
|
+<o:AllowPNG/>
|
|
|
+<o:PixelsPerInch>96</o:PixelsPerInch>
|
|
|
+</o:OfficeDocumentSettings>
|
|
|
+</xml><![endif]-->
|
|
|
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
|
+ <meta name="viewport" content="width=device-width">
|
|
|
+ <!--[if !mso]><!-->
|
|
|
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
+ <!--<![endif]-->
|
|
|
+ <title></title>
|
|
|
+ <!--[if !mso]><!-- -->
|
|
|
+ <link href="https://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet" type="text/css">
|
|
|
+ <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet" type="text/css">
|
|
|
+ <!--<![endif]-->
|
|
|
+ <style type="text/css" id="media-query">
|
|
|
+ body {
|
|
|
+ margin: 0;
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
+ table,
|
|
|
+ tr,
|
|
|
+ td {
|
|
|
+ vertical-align: top;
|
|
|
+ border-collapse: collapse;
|
|
|
+ }
|
|
|
+ .ie-browser table,
|
|
|
+ .mso-container table {
|
|
|
+ table-layout: fixed;
|
|
|
+ }
|
|
|
+ * {
|
|
|
+ line-height: inherit;
|
|
|
+ }
|
|
|
+ a[x-apple-data-detectors=true] {
|
|
|
+ color: inherit !important;
|
|
|
+ text-decoration: none !important;
|
|
|
+ }
|
|
|
+ [owa] .img-container div,
|
|
|
+ [owa] .img-container button {
|
|
|
+ display: block !important;
|
|
|
+ }
|
|
|
+ [owa] .fullwidth button {
|
|
|
+ width: 100% !important;
|
|
|
+ }
|
|
|
+ [owa] .block-grid .col {
|
|
|
+ display: table-cell;
|
|
|
+ float: none !important;
|
|
|
+ vertical-align: top;
|
|
|
+ }
|
|
|
+ .ie-browser .num12,
|
|
|
+ .ie-browser .block-grid,
|
|
|
+ [owa] .num12,
|
|
|
+ [owa] .block-grid {
|
|
|
+ width: 615px !important;
|
|
|
+ }
|
|
|
+ .ExternalClass,
|
|
|
+ .ExternalClass p,
|
|
|
+ .ExternalClass span,
|
|
|
+ .ExternalClass font,
|
|
|
+ .ExternalClass td,
|
|
|
+ .ExternalClass div {
|
|
|
+ line-height: 100%;
|
|
|
+ }
|
|
|
+ .ie-browser .mixed-two-up .num4,
|
|
|
+ [owa] .mixed-two-up .num4 {
|
|
|
+ width: 204px !important;
|
|
|
+ }
|
|
|
+ .ie-browser .mixed-two-up .num8,
|
|
|
+ [owa] .mixed-two-up .num8 {
|
|
|
+ width: 408px !important;
|
|
|
+ }
|
|
|
+ .ie-browser .block-grid.two-up .col,
|
|
|
+ [owa] .block-grid.two-up .col {
|
|
|
+ width: 307px !important;
|
|
|
+ }
|
|
|
+ .ie-browser .block-grid.three-up .col,
|
|
|
+ [owa] .block-grid.three-up .col {
|
|
|
+ width: 205px !important;
|
|
|
+ }
|
|
|
+ .ie-browser .block-grid.four-up .col,
|
|
|
+ [owa] .block-grid.four-up .col {
|
|
|
+ width: 153px !important;
|
|
|
+ }
|
|
|
+ .ie-browser .block-grid.five-up .col,
|
|
|
+ [owa] .block-grid.five-up .col {
|
|
|
+ width: 123px !important;
|
|
|
+ }
|
|
|
+ .ie-browser .block-grid.six-up .col,
|
|
|
+ [owa] .block-grid.six-up .col {
|
|
|
+ width: 102px !important;
|
|
|
+ }
|
|
|
+ .ie-browser .block-grid.seven-up .col,
|
|
|
+ [owa] .block-grid.seven-up .col {
|
|
|
+ width: 87px !important;
|
|
|
+ }
|
|
|
+ .ie-browser .block-grid.eight-up .col,
|
|
|
+ [owa] .block-grid.eight-up .col {
|
|
|
+ width: 76px !important;
|
|
|
+ }
|
|
|
+ .ie-browser .block-grid.nine-up .col,
|
|
|
+ [owa] .block-grid.nine-up .col {
|
|
|
+ width: 68px !important;
|
|
|
+ }
|
|
|
+ .ie-browser .block-grid.ten-up .col,
|
|
|
+ [owa] .block-grid.ten-up .col {
|
|
|
+ width: 61px !important;
|
|
|
+ }
|
|
|
+ .ie-browser .block-grid.eleven-up .col,
|
|
|
+ [owa] .block-grid.eleven-up .col {
|
|
|
+ width: 55px !important;
|
|
|
+ }
|
|
|
+ .ie-browser .block-grid.twelve-up .col,
|
|
|
+ [owa] .block-grid.twelve-up .col {
|
|
|
+ width: 51px !important;
|
|
|
+ }
|
|
|
+ @media only screen and (min-width: 635px) {
|
|
|
+ .block-grid {
|
|
|
+ width: 615px !important;
|
|
|
+ }
|
|
|
+ .block-grid .col {
|
|
|
+ display: table-cell;
|
|
|
+ Float: none !important;
|
|
|
+ vertical-align: top;
|
|
|
+ }
|
|
|
+ .block-grid .col.num12 {
|
|
|
+ width: 615px !important;
|
|
|
+ }
|
|
|
+ .block-grid.mixed-two-up .col.num4 {
|
|
|
+ width: 204px !important;
|
|
|
+ }
|
|
|
+ .block-grid.mixed-two-up .col.num8 {
|
|
|
+ width: 408px !important;
|
|
|
+ }
|
|
|
+ .block-grid.two-up .col {
|
|
|
+ width: 307px !important;
|
|
|
+ }
|
|
|
+ .block-grid.three-up .col {
|
|
|
+ width: 205px !important;
|
|
|
+ }
|
|
|
+ .block-grid.four-up .col {
|
|
|
+ width: 153px !important;
|
|
|
+ }
|
|
|
+ .block-grid.five-up .col {
|
|
|
+ width: 123px !important;
|
|
|
+ }
|
|
|
+ .block-grid.six-up .col {
|
|
|
+ width: 102px !important;
|
|
|
+ }
|
|
|
+ .block-grid.seven-up .col {
|
|
|
+ width: 87px !important;
|
|
|
+ }
|
|
|
+ .block-grid.eight-up .col {
|
|
|
+ width: 76px !important;
|
|
|
+ }
|
|
|
+ .block-grid.nine-up .col {
|
|
|
+ width: 68px !important;
|
|
|
+ }
|
|
|
+ .block-grid.ten-up .col {
|
|
|
+ width: 61px !important;
|
|
|
+ }
|
|
|
+ .block-grid.eleven-up .col {
|
|
|
+ width: 55px !important;
|
|
|
+ }
|
|
|
+ .block-grid.twelve-up .col {
|
|
|
+ width: 51px !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ @media (max-width: 635px) {
|
|
|
+ .block-grid,
|
|
|
+ .col {
|
|
|
+ min-width: 320px !important;
|
|
|
+ max-width: 100% !important;
|
|
|
+ }
|
|
|
+ .block-grid {
|
|
|
+ width: calc(100% - 40px) !important;
|
|
|
+ }
|
|
|
+ .col {
|
|
|
+ width: 100% !important;
|
|
|
+ }
|
|
|
+ .col>div {
|
|
|
+ margin: 0 auto;
|
|
|
+ }
|
|
|
+ img.fullwidth {
|
|
|
+ max-width: 100% !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+</head>
|
|
|
+<body class="clean-body" style="margin: 0;padding: 0;-webkit-text-size-adjust: 100%;background-color: #FFFFFF">
|
|
|
+ <!--[if IE]><div class="ie-browser"><![endif]-->
|
|
|
+ <!--[if mso]><div class="mso-container"><![endif]-->
|
|
|
+ <div class="nl-container" style="min-width: 320px;Margin: 0 auto;background-color: #FFFFFF">
|
|
|
+ <!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="center" style="background-color: #FFFFFF;"><![endif]-->
|
|
|
+ <div style="background-color:#333333;">
|
|
|
+ <div style="Margin: 0 auto;min-width: 320px;max-width: 615px;width: 615px;width: calc(30500% - 193060px);overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: transparent;"
|
|
|
+ class="block-grid ">
|
|
|
+ <div style="border-collapse: collapse;display: table;width: 100%;">
|
|
|
+ <!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="background-color:#333333;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width: 615px;"><tr class="layout-full-width" style="background-color:transparent;"><![endif]-->
|
|
|
+ <!--[if (mso)|(IE)]><td align="center" width="615" style=" width:615px; padding-right: 0px; padding-left: 0px; padding-top:0px; padding-bottom:0px; border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent;" valign="top"><![endif]-->
|
|
|
+ <div class="col num12" style="min-width: 320px;max-width: 615px;width: 615px;width: calc(29500% - 180810px);background-color: transparent;">
|
|
|
+ <div style="background-color: transparent; width: 100% !important;">
|
|
|
+ <!--[if (!mso)&(!IE)]><!-->
|
|
|
+ <div style="border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent; padding-top:0px; padding-bottom:0px; padding-right: 0px; padding-left: 0px;">
|
|
|
+ <!--<![endif]-->
|
|
|
+ <div align="left" class="img-container left fullwidth" style="padding-right: 30px; padding-left: 30px;">
|
|
|
+ <!--[if mso]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-right: 30px; padding-left: 30px;" align="left"><![endif]-->
|
|
|
+ <img class="left fullwidth" align="left" border="0" src="'.$path.'images/organizr-logo-h.png" alt="Image" title="Image"
|
|
|
+ style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: block !important;border: 0;height: auto;float: none;width: 100%;max-width: 555px"
|
|
|
+ width="555">
|
|
|
+ <!--[if mso]></td></tr></table><![endif]-->
|
|
|
+ </div>
|
|
|
+ <!--[if (!mso)&(!IE)]><!-->
|
|
|
+ </div>
|
|
|
+ <!--<![endif]-->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--[if (mso)|(IE)]></td></tr></table></td></tr></table><![endif]-->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="background-color:#333333;">
|
|
|
+ <div style="Margin: 0 auto;min-width: 320px;max-width: 615px;width: 615px;width: calc(30500% - 193060px);overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: transparent;"
|
|
|
+ class="block-grid ">
|
|
|
+ <div style="border-collapse: collapse;display: table;width: 100%;">
|
|
|
+ <!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="background-color:#333333;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width: 615px;"><tr class="layout-full-width" style="background-color:transparent;"><![endif]-->
|
|
|
+ <!--[if (mso)|(IE)]><td align="center" width="615" style=" width:615px; padding-right: 0px; padding-left: 0px; padding-top:0px; padding-bottom:0px; border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent;" valign="top"><![endif]-->
|
|
|
+ <div class="col num12" style="min-width: 320px;max-width: 615px;width: 615px;width: calc(29500% - 180810px);background-color: transparent;">
|
|
|
+ <div style="background-color: transparent; width: 100% !important;">
|
|
|
+ <!--[if (!mso)&(!IE)]><!-->
|
|
|
+ <div style="border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent; padding-top:0px; padding-bottom:0px; padding-right: 0px; padding-left: 0px;">
|
|
|
+ <!--<![endif]-->
|
|
|
+ <!--[if mso]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-right: 0px; padding-left: 0px; padding-top: 0px; padding-bottom: 0px;"><![endif]-->
|
|
|
+ <div style="font-family:\'Lato\', Tahoma, Verdana, Segoe, sans-serif;line-height:120%;color:#FFFFFF; padding-right: 0px; padding-left: 0px; padding-top: 0px; padding-bottom: 0px;">
|
|
|
+ <div style="font-size:12px;line-height:14px;color:#FFFFFF;font-family:\'Lato\', Tahoma, Verdana, Segoe, sans-serif;text-align:left;">
|
|
|
+ <p style="margin: 0;font-size: 12px;line-height: 14px;text-align: center"><span style="font-size: 16px; line-height: 19px;"><strong><span style="line-height: 19px; font-size: 16px;">'.$header.'</span></strong>
|
|
|
+ </span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--[if mso]></td></tr></table><![endif]-->
|
|
|
+ <!--[if (!mso)&(!IE)]><!-->
|
|
|
+ </div>
|
|
|
+ <!--<![endif]-->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--[if (mso)|(IE)]></td></tr></table></td></tr></table><![endif]-->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="background-color:#393939;">
|
|
|
+ <div style="Margin: 0 auto;min-width: 320px;max-width: 615px;width: 615px;width: calc(30500% - 193060px);overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: transparent;"
|
|
|
+ class="block-grid ">
|
|
|
+ <div style="border-collapse: collapse;display: table;width: 100%;">
|
|
|
+ <!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="background-color:#393939;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width: 615px;"><tr class="layout-full-width" style="background-color:transparent;"><![endif]-->
|
|
|
+ <!--[if (mso)|(IE)]><td align="center" width="615" style=" width:615px; padding-right: 0px; padding-left: 0px; padding-top:5px; padding-bottom:5px; border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent;" valign="top"><![endif]-->
|
|
|
+ <div class="col num12" style="min-width: 320px;max-width: 615px;width: 615px;width: calc(29500% - 180810px);background-color: transparent;">
|
|
|
+ <div style="background-color: transparent; width: 100% !important;">
|
|
|
+ <!--[if (!mso)&(!IE)]><!-->
|
|
|
+ <div style="border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent; padding-top:5px; padding-bottom:5px; padding-right: 0px; padding-left: 0px;">
|
|
|
+ <!--<![endif]-->
|
|
|
+ <!--[if mso]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-right: 30px; padding-left: 30px; padding-top: 0px; padding-bottom: 0px;"><![endif]-->
|
|
|
+ <div style="font-family:\'Ubuntu\', Tahoma, Verdana, Segoe, sans-serif;line-height:120%;color:#FFFFFF; padding-right: 30px; padding-left: 30px; padding-top: 0px; padding-bottom: 0px;">
|
|
|
+ <div style="font-family:Ubuntu, Tahoma, Verdana, Segoe, sans-serif;font-size:12px;line-height:14px;color:#FFFFFF;text-align:left;">
|
|
|
+ <p style="margin: 0;font-size: 12px;line-height: 14px;text-align: center"><span style="font-size: 16px; line-height: 19px;"><strong>'.$title.'</strong></span></p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--[if mso]></td></tr></table><![endif]-->
|
|
|
+ <div style="padding-right: 5px; padding-left: 5px; padding-top: 5px; padding-bottom: 5px;">
|
|
|
+ <!--[if (mso)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-right: 5px;padding-left: 5px; padding-top: 5px; padding-bottom: 5px;"><table width="55%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td><![endif]-->
|
|
|
+ <div align="center">
|
|
|
+ <div style="border-top: 2px solid #66D9EF; width:55%; line-height:2px; height:2px; font-size:2px;"> </div>
|
|
|
+ </div>
|
|
|
+ <!--[if (mso)]></td></tr></table></td></tr></table><![endif]-->
|
|
|
+ </div>
|
|
|
+ <!--[if mso]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-right: 30px; padding-left: 30px; padding-top: 15px; padding-bottom: 10px;"><![endif]-->
|
|
|
+ <div style="font-family:\'Lato\', Tahoma, Verdana, Segoe, sans-serif;line-height:120%;color:#FFFFFF; padding-right: 30px; padding-left: 30px; padding-top: 15px; padding-bottom: 10px;">
|
|
|
+ <div style="font-family:\'Lato\',Tahoma,Verdana,Segoe,sans-serif;font-size:12px;line-height:14px;color:#FFFFFF;text-align:left;">
|
|
|
+ <p style="margin: 0;font-size: 12px;line-height: 14px"><span style="font-size: 28px; line-height: 33px;">Hey '.$user.',</span></p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--[if mso]></td></tr></table><![endif]-->
|
|
|
+ <!--[if mso]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-right: 15px; padding-left: 30px; padding-top: 10px; padding-bottom: 25px;"><![endif]-->
|
|
|
+ <div style="font-family:\'Lato\', Tahoma, Verdana, Segoe, sans-serif;line-height:180%;color:#FFFFFF; padding-right: 15px; padding-left: 30px; padding-top: 10px; padding-bottom: 25px;">
|
|
|
+ <div style="font-size:12px;line-height:22px;font-family:\'Lato\',Tahoma,Verdana,Segoe,sans-serif;color:#FFFFFF;text-align:left;">
|
|
|
+ <p style="margin: 0;font-size: 14px;line-height: 25px"><span style="font-size: 18px; line-height: 32px;"><em><span style="line-height: 32px; font-size: 18px;">'.$mainMessage.'</span></em>
|
|
|
+ </span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--[if mso]></td></tr></table><![endif]-->
|
|
|
+ <div align="center" class="button-container center" style="padding-right: 30px; padding-left: 30px; padding-top:15px; padding-bottom:15px;">
|
|
|
+ <!--[if mso]><table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 0; border-collapse: collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;"><tr><td style="padding-right: 30px; padding-left: 30px; padding-top:15px; padding-bottom:15px;" align="center"><v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="'.$path.'" style="height:48px; v-text-anchor:middle; width:194px;" arcsize="53%" strokecolor="" fillcolor="#66D9EF"><w:anchorlock/><center style="color:#000; font-family:\'Lato\', Tahoma, Verdana, Segoe, sans-serif; font-size:18px;"><![endif]-->
|
|
|
+ <a href="'.$buttonURL.'" target="_blank" style="display: inline-block;text-decoration: none;-webkit-text-size-adjust: none;text-align: center;color: #000; background-color: #66D9EF; border-radius: 25px; -webkit-border-radius: 25px; -moz-border-radius: 25px; max-width: 180px; width: 114px; width: auto; border-top: 3px solid transparent; border-right: 3px solid transparent; border-bottom: 3px solid transparent; border-left: 3px solid transparent; padding-top: 5px; padding-right: 30px; padding-bottom: 5px; padding-left: 30px; font-family: \'Lato\', Tahoma, Verdana, Segoe, sans-serif;mso-border-alt: none">
|
|
|
+<span style="font-size:12px;line-height:21px;"><span style="font-size: 18px; line-height: 32px;" data-mce-style="font-size: 18px; line-height: 44px;">'.$button.'</span></span></a>
|
|
|
+ <!--[if mso]></center></v:roundrect></td></tr></table><![endif]-->
|
|
|
+ </div>
|
|
|
+ <!--[if mso]></center></v:roundrect></td></tr></table><![endif]-->
|
|
|
+ </div>
|
|
|
+ <!--[if (!mso)&(!IE)]><!-->
|
|
|
+ </div>
|
|
|
+ <!--<![endif]-->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--[if (mso)|(IE)]></td></tr></table></td></tr></table><![endif]-->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="background-color:#ffffff;">
|
|
|
+ <div style="Margin: 0 auto;min-width: 320px;max-width: 615px;width: 615px;width: calc(30500% - 193060px);overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: transparent;"
|
|
|
+ class="block-grid ">
|
|
|
+ <div style="border-collapse: collapse;display: table;width: 100%;">
|
|
|
+ <!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="background-color:#ffffff;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width: 615px;"><tr class="layout-full-width" style="background-color:transparent;"><![endif]-->
|
|
|
+ <!--[if (mso)|(IE)]><td align="center" width="615" style=" width:615px; padding-right: 0px; padding-left: 0px; padding-top:5px; padding-bottom:30px; border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent;" valign="top"><![endif]-->
|
|
|
+ <div class="col num12" style="min-width: 320px;max-width: 615px;width: 615px;width: calc(29500% - 180810px);background-color: transparent;">
|
|
|
+ <div style="background-color: transparent; width: 100% !important;">
|
|
|
+ <!--[if (!mso)&(!IE)]><!-->
|
|
|
+ <div style="border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent; padding-top:5px; padding-bottom:30px; padding-right: 0px; padding-left: 0px;">
|
|
|
+ <!--<![endif]-->
|
|
|
+ <!--[if mso]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-right: 10px; padding-left: 10px; padding-top: 0px; padding-bottom: 10px;"><![endif]-->
|
|
|
+ <div style="font-family:\'Lato\', Tahoma, Verdana, Segoe, sans-serif;line-height:120%;color:#555555; padding-right: 10px; padding-left: 10px; padding-top: 0px; padding-bottom: 10px;">
|
|
|
+ <div style="font-size:12px;line-height:14px;color:#555555;font-family:\'Lato\', Tahoma, Verdana, Segoe, sans-serif;text-align:left;">
|
|
|
+ <p style="margin: 0;font-size: 14px;line-height: 17px;text-align: center"><strong><span style="font-size: 26px; line-height: 31px;">'.$subTitle.'<br></span></strong></p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--[if mso]></td></tr></table><![endif]-->
|
|
|
+ <div style="padding-right: 20px; padding-left: 20px; padding-top: 15px; padding-bottom: 20px;">
|
|
|
+ <!--[if (mso)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-right: 20px;padding-left: 20px; padding-top: 15px; padding-bottom: 20px;"><table width="40%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td><![endif]-->
|
|
|
+ <div align="center">
|
|
|
+ <div style="border-top: 3px solid #66D9EF; width:40%; line-height:3px; height:3px; font-size:3px;"> </div>
|
|
|
+ </div>
|
|
|
+ <!--[if (mso)]></td></tr></table></td></tr></table><![endif]-->
|
|
|
+ </div>
|
|
|
+ <!--[if mso]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-right: 10px; padding-left: 10px; padding-top: 0px; padding-bottom: 0px;"><![endif]-->
|
|
|
+ <div style="font-family:\'Lato\', Tahoma, Verdana, Segoe, sans-serif;line-height:180%;color:#7E7D7D; padding-right: 10px; padding-left: 10px; padding-top: 0px; padding-bottom: 0px;">
|
|
|
+ <div style="font-size:12px;line-height:22px;color:#7E7D7D;font-family:\'Lato\', Tahoma, Verdana, Segoe, sans-serif;text-align:left;">
|
|
|
+ <p style="margin: 0;font-size: 14px;line-height: 25px;text-align: center"><em><span style="font-size: 18px; line-height: 32px;">'.$subMessage.'</span></em></p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--[if mso]></td></tr></table><![endif]-->
|
|
|
+ <!--[if (!mso)&(!IE)]><!-->
|
|
|
+ </div>
|
|
|
+ <!--<![endif]-->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--[if (mso)|(IE)]></td></tr></table></td></tr></table><![endif]-->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="background-color:#333333;">
|
|
|
+ <div style="Margin: 0 auto;min-width: 320px;max-width: 615px;width: 615px;width: calc(30500% - 193060px);overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: transparent;"
|
|
|
+ class="block-grid ">
|
|
|
+ <div style="border-collapse: collapse;display: table;width: 100%;">
|
|
|
+ <!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="background-color:#333333;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width: 615px;"><tr class="layout-full-width" style="background-color:transparent;"><![endif]-->
|
|
|
+ <!--[if (mso)|(IE)]><td align="center" width="615" style=" width:615px; padding-right: 0px; padding-left: 0px; padding-top:5px; padding-bottom:5px; border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent;" valign="top"><![endif]-->
|
|
|
+ <div class="col num12" style="min-width: 320px;max-width: 615px;width: 615px;width: calc(29500% - 180810px);background-color: transparent;">
|
|
|
+ <div style="background-color: transparent; width: 100% !important;">
|
|
|
+ <!--[if (!mso)&(!IE)]><!-->
|
|
|
+ <div style="border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent; padding-top:5px; padding-bottom:5px; padding-right: 0px; padding-left: 0px;">
|
|
|
+ <!--<![endif]-->
|
|
|
+ <!--[if mso]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px;"><![endif]-->
|
|
|
+ <div style="font-family:\'Lato\', Tahoma, Verdana, Segoe, sans-serif;line-height:120%;color:#959595; padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px;">
|
|
|
+ <div style="font-size:12px;line-height:14px;color:#959595;font-family:\'Lato\', Tahoma, Verdana, Segoe, sans-serif;text-align:left;">
|
|
|
+ <p style="margin: 0;font-size: 14px;line-height: 17px;text-align: center">This email was sent by <a style="color:#AD80FD;text-decoration: underline;" title="Organizr"
|
|
|
+ href="https://github.com/causefx/Organizr" target="_blank" rel="noopener noreferrer">Organizr</a><strong><br></strong></p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--[if mso]></td></tr></table><![endif]-->
|
|
|
+ <!--[if (!mso)&(!IE)]><!-->
|
|
|
+ </div>
|
|
|
+ <!--<![endif]-->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--[if (mso)|(IE)]></td></tr></table></td></tr></table><![endif]-->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--[if (mso)|(IE)]></td></tr></table><![endif]-->
|
|
|
+ </div>
|
|
|
+ <!--[if (mso)|(IE)]></div><![endif]-->
|
|
|
+</body>
|
|
|
+</html>
|
|
|
+ ';
|
|
|
+}
|
|
|
+
|
|
|
// Always run this
|
|
|
dependCheck();
|