@@ -178,7 +178,7 @@ |
||
| 178 | 178 | $this->setVideoNotFound(parent::PROCESS_TRAKT, $row['id']); |
| 179 | 179 | $this->titleCache[] = $release['cleanname']; |
| 180 | 180 | } |
| 181 | - } else{ |
|
| 181 | + } else { |
|
| 182 | 182 | //Processing failed, set the episode ID to the next processing group |
| 183 | 183 | $this->setVideoNotFound(parent::PROCESS_TRAKT, $row['id']); |
| 184 | 184 | $this->titleCache[] = $release['cleanname']; |
@@ -46,7 +46,8 @@ |
||
| 46 | 46 | $page->content = $page->smarty->fetch('user-list.tpl'); |
| 47 | 47 | $page->render(); |
| 48 | 48 | |
| 49 | -function checkREQUEST($param) { |
|
| 49 | +function checkREQUEST($param) |
|
| 50 | +{ |
|
| 50 | 51 | global $uSearch, $variables; |
| 51 | 52 | if (isset($_REQUEST[$param])) { |
| 52 | 53 | $variables[$param] = $_REQUEST[$param]; |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | $id = $_REQUEST['id']; |
| 16 | 16 | //Get info for first guid to populate form |
| 17 | 17 | $rel = $releases->getByGuid($_REQUEST['id'][0]); |
| 18 | -} else { |
|
| 18 | +} else { |
|
| 19 | 19 | $id = $rel = ''; |
| 20 | 20 | } |
| 21 | 21 | |
@@ -26,14 +26,11 @@ |
||
| 26 | 26 | $page->meta_description = ""; |
| 27 | 27 | $page->smarty->registerPlugin('modifier', 'ss', 'stripslashes'); |
| 28 | 28 | |
| 29 | - if (isset($_GET['modal'])) |
|
| 30 | - { |
|
| 29 | + if (isset($_GET['modal'])) { |
|
| 31 | 30 | $page->content = $page->smarty->fetch('viewmovie.tpl'); |
| 32 | 31 | $page->smarty->assign('modal', true); |
| 33 | 32 | echo $page->content; |
| 34 | - } |
|
| 35 | - else |
|
| 36 | - { |
|
| 33 | + } else { |
|
| 37 | 34 | $page->content = $page->smarty->fetch('viewmoviefull.tpl'); |
| 38 | 35 | $page->render(); |
| 39 | 36 | } |
@@ -15,26 +15,24 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | function smarty_modifier_daysAgo($date) |
| 17 | 17 | { |
| 18 | - if ($date == "") |
|
| 19 | - return "n/a"; |
|
| 18 | + if ($date == "") { |
|
| 19 | + return "n/a"; |
|
| 20 | + } |
|
| 20 | 21 | $sec = mktime(0,0,0,date("m"), date("d"), date("Y")) - (( strtotime($date)) ? strtotime(date("Y-m-d", strtotime($date))) : strtotime(date("Y-m-d", $date))); |
| 21 | 22 | $min = $sec / 60; |
| 22 | 23 | $hrs = $min / 60; |
| 23 | 24 | $days = $sec/60/60/24; |
| 24 | - if ( $hrs <= 24) return ' Today'; |
|
| 25 | - if ($days >= 365) |
|
| 26 | - { |
|
| 25 | + if ( $hrs <= 24) { |
|
| 26 | + return ' Today'; |
|
| 27 | + } |
|
| 28 | + if ($days >= 365) { |
|
| 27 | 29 | $years = round(($days/365), 1); |
| 28 | 30 | return $years.' Yr'.($years!=1?"s":"").' ago'; |
| 29 | - } |
|
| 30 | - else if ($days >= 90) |
|
| 31 | - { |
|
| 31 | + } else if ($days >= 90) { |
|
| 32 | 32 | return round($days/7).' Wks ago'; |
| 33 | - } |
|
| 34 | - else if ($days <= 2) |
|
| 35 | - return 'Yesterday'; |
|
| 36 | - else |
|
| 37 | - { |
|
| 33 | + } else if ($days <= 2) { |
|
| 34 | + return 'Yesterday'; |
|
| 35 | + } else { |
|
| 38 | 36 | return round($days, 0).'d ago'; |
| 39 | 37 | } |
| 40 | 38 | } |
@@ -14,7 +14,8 @@ |
||
| 14 | 14 | * @param string |
| 15 | 15 | * @return string |
| 16 | 16 | */ |
| 17 | -function smarty_modifier_magicurl($str, $dereferrer="") { |
|
| 17 | +function smarty_modifier_magicurl($str, $dereferrer="") |
|
| 18 | +{ |
|
| 18 | 19 | return preg_replace('/(https?):\/\/([A-Za-z0-9\._\-\/\?=&;%]+)/is', '<a href="'.$dereferrer.'$1://$2" target="_blank">$1://$2</a>', $str); |
| 19 | 20 | } |
| 20 | 21 | ?> |
| 21 | 22 | \ No newline at end of file |
@@ -1,9 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | function smarty_modifier_parray ($string,$explode,$limit=NULL) |
| 3 | 3 | { |
| 4 | - if($limit == NULL) |
|
| 5 | - return explode( $explode , $string ); |
|
| 6 | - else |
|
| 7 | - return explode( $explode , $string , $limit); |
|
| 8 | -} |
|
| 4 | + if($limit == NULL) { |
|
| 5 | + return explode( $explode , $string ); |
|
| 6 | + } else { |
|
| 7 | + return explode( $explode , $string , $limit); |
|
| 8 | + } |
|
| 9 | + } |
|
| 9 | 10 | ?> |
| 10 | 11 | \ No newline at end of file |
@@ -59,8 +59,8 @@ |
||
| 59 | 59 | $_win_to = array ('%#d', '%H:%M:%S', '%m/%d/%y'); |
| 60 | 60 | $format = str_replace($_win_from, $_win_to, $format); |
| 61 | 61 | }*/ |
| 62 | - if (substr($format,0,5)=='DATE_'){ |
|
| 63 | - switch ($format){ |
|
| 62 | + if (substr($format,0,5)=='DATE_') { |
|
| 63 | + switch ($format) { |
|
| 64 | 64 | case 'DATE_ATOM': $nformat=DATE_ATOM; break; |
| 65 | 65 | case 'DATE_COOKIE': $nformat=DATE_COOKIE; break; |
| 66 | 66 | case 'DATE_ISO8601': $nformat=DATE_ISO8601; break; |
@@ -15,34 +15,44 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | function smarty_modifier_timeAgo( $date) |
| 17 | 17 | { |
| 18 | - if ($date == "") |
|
| 19 | - return "n/a"; |
|
| 18 | + if ($date == "") { |
|
| 19 | + return "n/a"; |
|
| 20 | + } |
|
| 20 | 21 | $timeStrings = array( 'now', // 0 |
| 21 | 22 | 'Sec', 'Secs', // 1,1 |
| 22 | 23 | 'Min','Mins', // 3,3 |
| 23 | 24 | 'Hour', 'Hrs', // 5,5 |
| 24 | 25 | 'Day', 'Days'); |
| 25 | 26 | $sec = time() - (( !is_numeric($date) && strtotime($date)) ? strtotime($date) : $date); |
| 26 | - if ( $sec <= 0) return $timeStrings[0]; |
|
| 27 | - if ( $sec < 2) return $sec." ".$timeStrings[1]; |
|
| 28 | - if ( $sec < 60) return $sec." ".$timeStrings[2]; |
|
| 27 | + if ( $sec <= 0) { |
|
| 28 | + return $timeStrings[0]; |
|
| 29 | + } |
|
| 30 | + if ( $sec < 2) { |
|
| 31 | + return $sec." ".$timeStrings[1]; |
|
| 32 | + } |
|
| 33 | + if ( $sec < 60) { |
|
| 34 | + return $sec." ".$timeStrings[2]; |
|
| 35 | + } |
|
| 29 | 36 | $min = $sec / 60; |
| 30 | - if ( floor($min+0.5) < 2) return floor($min+0.5)." ".$timeStrings[3]; |
|
| 31 | - if ( $min < 60) return floor($min+0.5)." ".$timeStrings[4]; |
|
| 37 | + if ( floor($min+0.5) < 2) { |
|
| 38 | + return floor($min+0.5)." ".$timeStrings[3]; |
|
| 39 | + } |
|
| 40 | + if ( $min < 60) { |
|
| 41 | + return floor($min+0.5)." ".$timeStrings[4]; |
|
| 42 | + } |
|
| 32 | 43 | $hrs = $min / 60; |
| 33 | - if ( floor($hrs+0.5) < 2) return floor($hrs+0.5)." ".$timeStrings[5]; |
|
| 34 | - if ( $hrs < 24) return floor($hrs+0.5)." ".$timeStrings[6]; |
|
| 44 | + if ( floor($hrs+0.5) < 2) { |
|
| 45 | + return floor($hrs+0.5)." ".$timeStrings[5]; |
|
| 46 | + } |
|
| 47 | + if ( $hrs < 24) { |
|
| 48 | + return floor($hrs+0.5)." ".$timeStrings[6]; |
|
| 49 | + } |
|
| 35 | 50 | $days = $sec/60/60/24; |
| 36 | - if ($days > 365) |
|
| 37 | - { |
|
| 51 | + if ($days > 365) { |
|
| 38 | 52 | return round(($days/365), 1).' Yrs'; |
| 39 | - } |
|
| 40 | - else if ($days > 90) |
|
| 41 | - { |
|
| 53 | + } else if ($days > 90) { |
|
| 42 | 54 | return round($days/7).' Wks'; |
| 43 | - } |
|
| 44 | - else |
|
| 45 | - { |
|
| 55 | + } else { |
|
| 46 | 56 | return round($days, 1).'d'; |
| 47 | 57 | } |
| 48 | 58 | } |