Browse Source

Fixed Ombi approve/deny for TV and Movies
Added tooltips for side tabs

causefx 8 years ago
parent
commit
90c2afd612
4 changed files with 183 additions and 27 deletions
  1. 6 0
      check.php
  2. 51 8
      functions.php
  3. 122 17
      homepage.php
  4. 4 2
      index.php

+ 6 - 0
check.php

@@ -168,6 +168,12 @@ function getFilePermission($file) {
                 checkFunction("hash");
                 checkFunction("fopen");
                 checkFunction("fsockopen");
+				checkFunction("ob_start");
+				checkFunction("ob_get_contents");
+				checkFunction("ob_end_flush");
+				checkFunction("fwrite");
+				checkFunction("fclose");
+				checkFunction("readfile");
                 ?>
                 </div>
                 <div class="row">

+ 51 - 8
functions.php

@@ -394,6 +394,47 @@ if (function_exists('curl_version')) :
 		return array('content'=>$result, 'http_code'=>$httpcode);
 	}
 
+	// Curl Put
+	function curl_put($url, $data, $headers = array(), $referer='') {
+		// Initiate cURL
+		$curlReq = curl_init($url);
+		// As post request
+		curl_setopt($curlReq, CURLOPT_CUSTOMREQUEST, "PUT");
+		curl_setopt($curlReq, CURLOPT_RETURNTRANSFER, true);
+		curl_setopt($curlReq, CURLOPT_CAINFO, getCert());
+		if(localURL($url)){
+			curl_setopt($curlReq, CURLOPT_SSL_VERIFYHOST, 0);
+			curl_setopt($curlReq, CURLOPT_SSL_VERIFYPEER, 0);
+		}
+		// Format Data
+		switch (isset($headers['Content-Type'])?$headers['Content-Type']:'') {
+			case 'application/json':
+				curl_setopt($curlReq, CURLOPT_POSTFIELDS, json_encode($data));
+				break;
+			case 'application/x-www-form-urlencoded':
+				curl_setopt($curlReq, CURLOPT_POSTFIELDS, http_build_query($data));
+				break;
+			default:
+				$headers['Content-Type'] = 'application/x-www-form-urlencoded';
+				curl_setopt($curlReq, CURLOPT_POSTFIELDS, http_build_query($data));
+		}
+		// Format Headers
+		$cHeaders = array();
+		foreach ($headers as $k => $v) {
+			$cHeaders[] = $k.': '.$v;
+		}
+		if (count($cHeaders)) {
+			curl_setopt($curlReq, CURLOPT_HTTPHEADER, $cHeaders);
+		}
+		// Execute
+		$result = curl_exec($curlReq);
+		$httpcode = curl_getinfo($curlReq);
+		// Close
+		curl_close($curlReq);
+		// Return
+		return array('content'=>$result, 'http_code'=>$httpcode);
+	}
+
 	//Curl Get Function
 	function curl_get($url, $headers = array()) {
 		// Initiate cURL
@@ -1165,7 +1206,8 @@ function getEmbyImage() {
 	    }
         ob_start(); // Start the output buffer
         header('Content-type: image/jpeg');
-        @readfile($image_src);
+        //@readfile($image_src);
+		echo @curl_get($image_src);
         // Cache the output to a file
         $fp = fopen($cachefile, 'wb');
         fwrite($fp, ob_get_contents());
@@ -1206,7 +1248,8 @@ function getPlexImage() {
         }
 		ob_start(); // Start the output buffer
         header('Content-type: image/jpeg');
-		@readfile($image_src);
+		//@readfile($image_src);
+		echo @curl_get($image_src);
         // Cache the output to a file
         $fp = fopen($cachefile, 'wb');
         fwrite($fp, ob_get_contents());
@@ -4768,7 +4811,7 @@ function ombiAction($id, $action, $type){
 			$api = curl_post(OMBIURL."/api/v1/Request/".$type."/approve", $body, $headers);
 			break;
 		case 'deny':
-			$api = curl_post(OMBIURL."/api/v1/Request/".$type."/deny", $body, $headers);
+			$api = curl_put(OMBIURL."/api/v1/Request/".$type."/deny", $body, $headers);
 			break;
 		case 'delete':
 			$api = curl_delete(OMBIURL."/api/v1/Request/".$type."/".$id, $headers);
@@ -4783,11 +4826,11 @@ function ombiAction($id, $action, $type){
 			return false;
 			break;
 		case 200:
-			writeLog("success", "OMBI: action completed successfully");
+			writeLog("success", "OMBI: action completed successfully for [type: $type - action: $action - id: $id]");
 			return true;
 			break;
 		default:
-			writeLog("error", "OMBI: unknown error with request [type: $type | action: $action | id: $id]");
+			writeLog("error", "OMBI: unknown error with request [type: $type - action: $action - id: $id]");
 			return false;
 	}
     //return (!empty($result) ? $result : null );
@@ -4834,9 +4877,9 @@ function getOmbiRequests($type = "both"){
 				'title' => $value['title'],
 				'poster' => $value['posterPath'],
 				'approved' => $value['childRequests'][0]['approved'],
-				'available' => $key['childRequests'][0]['available'],
-				'denied' => $key['childRequests'][0]['denied'],
-				'deniedReason' => $key['childRequests'][0]['deniedReason'],
+				'available' => $value['childRequests'][0]['available'],
+				'denied' => $value['childRequests'][0]['denied'],
+				'deniedReason' => $value['childRequests'][0]['deniedReason'],
 				'user' => $value['childRequests'][0]['requestedUser']['userName'],
 				'request_id' => $value['id'],
 			);

+ 122 - 17
homepage.php

@@ -468,10 +468,10 @@ foreach(loadAppearance() as $key => $value) {
 	                console.log('creating slick for '+name);
 	                $(this).slick({
 
-	                    slidesToShow: 13,
-	                    slidesToScroll: 13,
+	                    slidesToShow: 27,
+	                    slidesToScroll: 27,
 	                    infinite: true,
-						speed: 900,
+						//speed: 900,
 	                    lazyLoad: 'ondemand',
 	                    prevArrow: '<a class="zero-m pull-left prev-mail btn btn-default waves waves-button btn-sm waves-effect waves-float"><i class="fa fa-angle-left"></i></a>',
 	                    nextArrow: '<a class="pull-left next-mail btn btn-default waves waves-button btn-sm waves-effect waves-float"><i class="fa fa-angle-right"></i></a>',
@@ -479,73 +479,178 @@ foreach(loadAppearance() as $key => $value) {
 	                    arrows: true,
 	                    responsive: [
 							{
-			                    breakpoint: 1750,
+								breakpoint: 3744,
+								settings: {
+									slidesToShow: 26,
+									slidesToScroll: 26,
+								}
+							},
+							{
+								breakpoint: 3600,
+								settings: {
+									slidesToShow: 25,
+									slidesToScroll: 25,
+								}
+							},
+							{
+								breakpoint: 3456,
+								settings: {
+									slidesToShow: 24,
+									slidesToScroll: 24,
+								}
+							},
+							{
+								breakpoint: 3312,
+								settings: {
+									slidesToShow: 23,
+									slidesToScroll: 23,
+								}
+							},
+							{
+								breakpoint: 3168,
+								settings: {
+									slidesToShow: 22,
+									slidesToScroll: 22,
+								}
+							},
+							{
+								breakpoint: 3024,
+								settings: {
+									slidesToShow: 21,
+									slidesToScroll: 21,
+								}
+							},
+							{
+								breakpoint: 2880,
+								settings: {
+									slidesToShow: 20,
+									slidesToScroll: 20,
+								}
+							},
+							{
+								breakpoint: 2736,
+								settings: {
+									slidesToShow: 19,
+									slidesToScroll: 19,
+								}
+							},
+							{
+								breakpoint: 2592,
+								settings: {
+									slidesToShow: 18,
+									slidesToScroll: 18,
+								}
+							},
+							{
+								breakpoint: 2448,
+								settings: {
+									slidesToShow: 17,
+									slidesToScroll: 17,
+								}
+							},
+							{
+			                    breakpoint: 2304,
+			                    settings: {
+			                        slidesToShow: 16,
+			                        slidesToScroll: 16,
+			                    }
+		                    },
+							{
+								breakpoint: 2160,
+								settings: {
+									slidesToShow: 15,
+									slidesToScroll: 15,
+								}
+							},
+							{
+			                    breakpoint: 2016,
+			                    settings: {
+			                        slidesToShow: 14,
+			                        slidesToScroll: 14,
+			                    }
+		                    },
+							{
+			                    breakpoint: 1872,
+			                    settings: {
+			                        slidesToShow: 13,
+			                        slidesToScroll: 13,
+			                    }
+		                    },
+							{
+			                    breakpoint: 1728,
+			                    settings: {
+			                        slidesToShow: 12,
+			                        slidesToScroll: 12,
+			                    }
+		                    },
+							{
+			                    breakpoint: 1584,
 			                    settings: {
 			                        slidesToShow: 11,
 			                        slidesToScroll: 11,
 			                    }
 		                    },
 		                    {
-			                    breakpoint: 1600,
+			                    breakpoint: 1440,
 			                    settings: {
 			                        slidesToShow: 10,
 			                        slidesToScroll: 10,
 			                    }
 		                    },
 		                    {
-			                    breakpoint: 1450,
+			                    breakpoint: 1296,
 			                    settings: {
 			                        slidesToShow: 9,
 			                        slidesToScroll: 9,
 			                    }
 		                    },
 		                    {
-			                    breakpoint: 1300,
+			                    breakpoint: 1152,
 			                    settings: {
 			                        slidesToShow: 8,
 			                        slidesToScroll: 8,
 			                    }
 		                    },
 		                    {
-			                    breakpoint: 1150,
+			                    breakpoint: 1008,
 			                    settings: {
 			                        slidesToShow: 7,
 			                        slidesToScroll: 7,
 			                    }
 		                    },
 		                    {
-			                    breakpoint: 1000,
+			                    breakpoint: 864,
 			                    settings: {
 			                        slidesToShow: 6,
 			                        slidesToScroll: 6,
 			                    }
 		                    },
 		                    {
-			                    breakpoint: 850,
+			                    breakpoint: 720,
 			                    settings: {
 			                        slidesToShow: 5,
 			                        slidesToScroll: 5,
 			                    }
 		                    },
 		                    {
-			                    breakpoint: 700,
+			                    breakpoint: 576,
 			                    settings: {
 			                        slidesToShow: 4,
 			                        slidesToScroll: 4,
 			                    }
 		                    },
 		                    {
-			                    breakpoint: 675,
+			                    breakpoint: 432,
 			                    settings: {
-			                        slidesToShow: 4,
-			                        slidesToScroll: 4,
+			                        slidesToShow: 3,
+			                        slidesToScroll: 3,
 			                    }
 		                    },
 		                    {
-			                    breakpoint: 480,
+			                    breakpoint: 288,
 			                    settings: {
-			                        slidesToShow: 3,
-			                        slidesToScroll: 3,
+			                        slidesToShow: 2,
+			                        slidesToScroll: 2,
 			                    }
 		                    }
 		                ]

+ 4 - 2
index.php

@@ -538,7 +538,7 @@ $group = (isset($group) ? $group : "guest");
 									<li window="<?=$row['window'];?>" class="tab-item <?=$defaultz;?>" id="<?=$row['url'];?>x" data-title="<?=$row['name'];?>" name="<?php echo strtolower($row['name']);?>">
 										<a class="tab-link">
 											<?php if($row['iconurl']) { ?>
-												<i style="font-size: 19px; padding: 0 10px; font-size: 19px;">
+												<i style="font-size: 19px; padding: 0 10px; font-size: 19px" data-toggle="tooltip" data-placement="bottom" data-original-title="<?=$row['name'];?>">
 													<span id="<?=$row['url'];?>s" class="badge badge-success" style="position: absolute;z-index: 100;right: 0px;"></span>
 													<img src="<?=$row['iconurl'];?>" style="height: 30px; width: 30px; margin-top: -2px;">
 													<?php if($row['ping'] == "true" && $row['ping_url']){ $allPings["image".$name] = $row['ping_url']; ?>
@@ -546,7 +546,7 @@ $group = (isset($group) ? $group : "guest");
 													<?php }?>
 												</i>
 											<?php }else { ?>
-												<i class="fa <?=$row['icon'];?> fa-lg">
+												<i class="fa <?=$row['icon'];?> fa-lg" data-toggle="tooltip" data-placement="bottom" data-original-title="<?=$row['name'];?>">
 													<span id="<?=$row['url'];?>s" class="badge badge-success" style="position: absolute;z-index: 100;right: 0px;"></span>
 													<?php if($row['ping'] == "true" && $row['ping_url']){ $allPings["icon".$name] = $row['ping_url']; ?>
 														<ping class="ping-<?=$name;?> startPingTimer"></ping>
@@ -1559,8 +1559,10 @@ $group = (isset($group) ? $group : "guest");
 		update();
 		setInterval(update, 60000);
 		console.log(date);
+		<?php if($userDevice !== "phone"){?>
 		//Tooltips
 		$('[data-toggle="tooltip"]').tooltip();
+		<?php } ?>
 		$(".box").niceScroll({
             railpadding: {top:0,right:0,left:0,bottom:0},
             scrollspeed: 30,