Loading app/Helpers/analytics_helper.php +24 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,30 @@ * @link https://castopod.org/ */ /** * For compatibility with PHP-FPM v7.2 and below: */ if (!function_exists('getallheaders')) { function getallheaders() { $headers = []; foreach ($_SERVER as $name => $value) { if (substr($name, 0, 5) == 'HTTP_') { $headers[ str_replace( ' ', '-', ucwords( strtolower(str_replace('_', ' ', substr($name, 5))) ) ) ] = $value; } } return $headers; } } /** * Set user country in session variable, for analytics purpose */ Loading app/Models/EpisodeModel.php +2 −2 Original line number Diff line number Diff line Loading @@ -270,7 +270,7 @@ class EpisodeModel extends Model $sortNumberField = $podcastType == 'serial' ? 'if(isnull(season_number),0,season_number)*1000+number' : 'UNIX_TIMESTAMP(published_at)'; : 'published_at'; $sortNumberValue = $podcastType == 'serial' ? (empty($episode->season_number) Loading @@ -278,7 +278,7 @@ class EpisodeModel extends Model : $episode->season_number) * 1000 + $episode->number : strtotime($episode->published_at); : $episode->published_at; $previousData = $this->orderBy('(' . $sortNumberField . ') DESC') ->where([ Loading Loading
app/Helpers/analytics_helper.php +24 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,30 @@ * @link https://castopod.org/ */ /** * For compatibility with PHP-FPM v7.2 and below: */ if (!function_exists('getallheaders')) { function getallheaders() { $headers = []; foreach ($_SERVER as $name => $value) { if (substr($name, 0, 5) == 'HTTP_') { $headers[ str_replace( ' ', '-', ucwords( strtolower(str_replace('_', ' ', substr($name, 5))) ) ) ] = $value; } } return $headers; } } /** * Set user country in session variable, for analytics purpose */ Loading
app/Models/EpisodeModel.php +2 −2 Original line number Diff line number Diff line Loading @@ -270,7 +270,7 @@ class EpisodeModel extends Model $sortNumberField = $podcastType == 'serial' ? 'if(isnull(season_number),0,season_number)*1000+number' : 'UNIX_TIMESTAMP(published_at)'; : 'published_at'; $sortNumberValue = $podcastType == 'serial' ? (empty($episode->season_number) Loading @@ -278,7 +278,7 @@ class EpisodeModel extends Model : $episode->season_number) * 1000 + $episode->number : strtotime($episode->published_at); : $episode->published_at; $previousData = $this->orderBy('(' . $sortNumberField . ') DESC') ->where([ Loading