Display releases postdate information based on users location

This commit is contained in:
DariusIII
2019-12-01 21:54:45 +01:00
parent 6c1910d64d
commit 02de47e2ad
19 changed files with 313 additions and 15 deletions
+1
View File
@@ -52,6 +52,7 @@ QUEUE_CONNECTION=sync
REDIS_HOST=127.0.0.1 REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null REDIS_PASSWORD=null
REDIS_PORT=6379 REDIS_PORT=6379
REDIS_CLIENT = phpredis
SESSION_DRIVER=file SESSION_DRIVER=file
SESSION_DOMAIN=localhost SESSION_DOMAIN=localhost
+2
View File
@@ -1,3 +1,5 @@
2019-12-01 DariusIII
* Chg: Display releases postdate information based on users location
2019-11-27 DariusIII 2019-11-27 DariusIII
* Fix: Fix wrong Book categories seeders and fixtures * Fix: Fix wrong Book categories seeders and fixtures
2019-11-25 DariusIII 2019-11-25 DariusIII
+2
View File
@@ -107,6 +107,7 @@
"intervention/image": "^2.4", "intervention/image": "^2.4",
"intervention/imagecache": "^2.3", "intervention/imagecache": "^2.3",
"james-heinrich/getid3": "1.9.*", "james-heinrich/getid3": "1.9.*",
"jamesmills/laravel-timezone": "^1.3",
"joshpinkney/tv-maze-php-api": "dev-master", "joshpinkney/tv-maze-php-api": "dev-master",
"jrean/laravel-user-verification": "^8.0", "jrean/laravel-user-verification": "^8.0",
"junaidnasir/larainvite": "^3.0", "junaidnasir/larainvite": "^3.0",
@@ -130,6 +131,7 @@
"php-http/guzzle6-adapter": "^1.1", "php-http/guzzle6-adapter": "^1.1",
"php-http/message": "^1.6", "php-http/message": "^1.6",
"pragmarx/firewall": "^2.3", "pragmarx/firewall": "^2.3",
"predis/predis": "^1.1",
"propaganistas/laravel-disposable-email": "^2.0", "propaganistas/laravel-disposable-email": "^2.0",
"ramsey/uuid": "^3.7", "ramsey/uuid": "^3.7",
"rtconner/laravel-tagging": "^3.0", "rtconner/laravel-tagging": "^3.0",
Generated
+129 -1
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "d4a4fc9636f52a79f2542aa67c1187d6", "content-hash": "3bce991fe31d6165781b1c3aa94c8176",
"packages": [ "packages": [
{ {
"name": "aharen/omdbapi", "name": "aharen/omdbapi",
@@ -2394,6 +2394,60 @@
], ],
"time": "2019-09-16T19:08:47+00:00" "time": "2019-09-16T19:08:47+00:00"
}, },
{
"name": "jamesmills/laravel-timezone",
"version": "1.3.0",
"source": {
"type": "git",
"url": "https://github.com/jamesmills/laravel-timezone.git",
"reference": "c8fefb4da8222914fc048a89be20af450d98d6fe"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/jamesmills/laravel-timezone/zipball/c8fefb4da8222914fc048a89be20af450d98d6fe",
"reference": "c8fefb4da8222914fc048a89be20af450d98d6fe",
"shasum": ""
},
"require": {
"laravel/framework": "5.6.* || 5.7.* || 5.8.* || ^6",
"nesbot/carbon": "^1.0 || ^2.0",
"php": ">=7",
"torann/geoip": "^1.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.12"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"JamesMills\\LaravelTimezone\\LaravelTimezoneServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"JamesMills\\LaravelTimezone\\": "src/",
"JamesMills\\LaravelTimezone\\Database\\Seeds\\": "database/seeds/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "James Mills",
"email": "james@clicksco.com"
}
],
"description": "Timezone storage and retrieval for Laravel",
"keywords": [
"laravel",
"timezone"
],
"time": "2019-10-21T12:14:23+00:00"
},
{ {
"name": "jenssegers/model", "name": "jenssegers/model",
"version": "v1.2.2", "version": "v1.2.2",
@@ -8617,6 +8671,80 @@
"homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles",
"time": "2019-10-24T08:53:34+00:00" "time": "2019-10-24T08:53:34+00:00"
}, },
{
"name": "torann/geoip",
"version": "1.0.13",
"source": {
"type": "git",
"url": "https://github.com/Torann/laravel-geoip.git",
"reference": "9577c9d865050af39bb4c23795c9eb09bebb6476"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Torann/laravel-geoip/zipball/9577c9d865050af39bb4c23795c9eb09bebb6476",
"reference": "9577c9d865050af39bb4c23795c9eb09bebb6476",
"shasum": ""
},
"require": {
"illuminate/console": "~5.5|^6.0",
"illuminate/support": "~5.5|^6.0",
"php": "^7.1",
"vlucas/phpdotenv": "^3.5"
},
"require-dev": {
"geoip2/geoip2": "~2.1",
"mockery/mockery": "^0.9.4",
"phpunit/phpunit": "^7.0"
},
"suggest": {
"geoip2/geoip2": "Required to use the MaxMind database or web service with GeoIP (~2.1).",
"monolog/monolog": "Allows for storing location not found errors to the log"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
},
"laravel": {
"providers": [
"Torann\\GeoIP\\GeoIPServiceProvider"
],
"aliases": {
"GeoIP": "Torann\\GeoIP\\Facades\\GeoIP"
}
}
},
"autoload": {
"files": [
"src/helpers.php"
],
"psr-4": {
"Torann\\GeoIP\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-2-Clause"
],
"authors": [
{
"name": "Daniel Stainback",
"email": "torann@gmail.com"
}
],
"description": "Support for multiple GeoIP services.",
"keywords": [
"IP API",
"geoip",
"geolocation",
"infoDB",
"laravel",
"laravel 5",
"location",
"maxmind"
],
"time": "2019-10-30T15:41:29+00:00"
},
{ {
"name": "vlucas/phpdotenv", "name": "vlucas/phpdotenv",
"version": "v3.6.0", "version": "v3.6.0",
+1 -1
View File
@@ -123,7 +123,7 @@ return [
*/ */
'redis' => [ 'redis' => [
'client' => 'phpredis', 'client' => env('REDIS_CLIENT', 'phpredis'),
'options' => [ 'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'), 'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => Str::slug(env('APP_NAME', 'laravel'), '_').'_database_', 'prefix' => Str::slug(env('APP_NAME', 'laravel'), '_').'_database_',
+165
View File
@@ -0,0 +1,165 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Logging Configuration
|--------------------------------------------------------------------------
|
| Here you may configure the log settings for when a location is not found
| for the IP provided.
|
*/
'log_failures' => true,
/*
|--------------------------------------------------------------------------
| Include Currency in Results
|--------------------------------------------------------------------------
|
| When enabled the system will do it's best in deciding the user's currency
| by matching their ISO code to a preset list of currencies.
|
*/
'include_currency' => true,
/*
|--------------------------------------------------------------------------
| Default Service
|--------------------------------------------------------------------------
|
| Here you may specify the default storage driver that should be used
| by the framework.
|
| Supported: "maxmind_database", "maxmind_api", "ipapi"
|
*/
'service' => 'ipapi',
/*
|--------------------------------------------------------------------------
| Storage Specific Configuration
|--------------------------------------------------------------------------
|
| Here you may configure as many storage drivers as you wish.
|
*/
'services' => [
'maxmind_database' => [
'class' => \Torann\GeoIP\Services\MaxMindDatabase::class,
'database_path' => storage_path('app/geoip.mmdb'),
'update_url' => 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz',
'locales' => ['en'],
],
'maxmind_api' => [
'class' => \Torann\GeoIP\Services\MaxMindWebService::class,
'user_id' => env('MAXMIND_USER_ID'),
'license_key' => env('MAXMIND_LICENSE_KEY'),
'locales' => ['en'],
],
'ipapi' => [
'class' => \Torann\GeoIP\Services\IPApi::class,
'secure' => true,
'key' => env('IPAPI_KEY'),
'continent_path' => storage_path('app/continents.json'),
'lang' => 'en',
],
'ipgeolocation' => [
'class' => \Torann\GeoIP\Services\IPGeoLocation::class,
'secure' => true,
'key' => env('IPGEOLOCATION_KEY'),
'continent_path' => storage_path('app/continents.json'),
'lang' => 'en',
],
'ipdata' => [
'class' => \Torann\GeoIP\Services\IPData::class,
'key' => env('IPDATA_API_KEY'),
'secure' => true,
],
'ipfinder' => [
'class' => \Torann\GeoIP\Services\IPFinder::class,
'key' => env('IPFINDER_API_KEY'),
'secure' => true,
'locales' => ['en'],
],
],
/*
|--------------------------------------------------------------------------
| Default Cache Driver
|--------------------------------------------------------------------------
|
| Here you may specify the type of caching that should be used
| by the package.
|
| Options:
|
| all - All location are cached
| some - Cache only the requesting user
| none - Disable cached
|
*/
'cache' => 'all',
/*
|--------------------------------------------------------------------------
| Cache Tags
|--------------------------------------------------------------------------
|
| Cache tags are not supported when using the file or database cache
| drivers in Laravel. This is done so that only locations can be cleared.
|
*/
'cache_tags' => ['torann-geoip-location'],
/*
|--------------------------------------------------------------------------
| Cache Expiration
|--------------------------------------------------------------------------
|
| Define how long cached location are valid.
|
*/
'cache_expires' => 30,
/*
|--------------------------------------------------------------------------
| Default Location
|--------------------------------------------------------------------------
|
| Return when a location is not found.
|
*/
'default_location' => [
'ip' => '127.0.0.0',
'iso_code' => 'US',
'country' => 'United States',
'city' => 'New Haven',
'state' => 'CT',
'state_name' => 'Connecticut',
'postal_code' => '06510',
'lat' => 41.31,
'lon' => -72.92,
'timezone' => 'America/New_York',
'continent' => 'NA',
'default' => true,
'currency' => 'USD',
],
];
+1 -1
View File
@@ -105,7 +105,7 @@
id="chksingle"/> id="chksingle"/>
</label> </label>
<span class="badge badge-info">{$result->size|filesize}</span> <span class="badge badge-info">{$result->size|filesize}</span>
<span class="badge badge-info">Posted {$result->postdate|timeago} <span class="badge badge-info">Posted {{{Timezone::convertToLocal($result->postdate, 'Y-m-d h:i:s')}}|timeago}
ago</span> ago</span>
<br/> <br/>
{if isset($result->review) && $result->review != ""}<span {if isset($result->review) && $result->review != ""}<span
+1 -1
View File
@@ -149,7 +149,7 @@
</td> </td>
<td><span class="badge badge-info">{$result->category_name}</span> <td><span class="badge badge-info">{$result->category_name}</span>
</td> </td>
<td>{$result->postdate|timeago}</td> <td>{{{Timezone::convertToLocal($result->postdate, 'Y-m-d h:i:s')}}|timeago}</td>
<td>{$result->size|filesize}</td> <td>{$result->size|filesize}</td>
<td> <td>
<a href="{{url("/getnzb?id={$result->guid}")}}" <a href="{{url("/getnzb?id={$result->guid}")}}"
+1 -1
View File
@@ -115,7 +115,7 @@
id="chksingle"/> id="chksingle"/>
</label> </label>
<span class="badge badge-default">{$result->size|filesize}</span> <span class="badge badge-default">{$result->size|filesize}</span>
<span class="badge badge-default">Posted {$result->postdate|timeago} <span class="badge badge-default">Posted {{{Timezone::convertToLocal($result->postdate, 'Y-m-d h:i:s')}}|timeago}
ago</span> ago</span>
{if isset($isadmin)} {if isset($isadmin)}
<a <a
+1 -1
View File
@@ -129,7 +129,7 @@
id="chksingle"/> id="chksingle"/>
</label> </label>
<span class="badge badge-info">{$result->size|filesize}</span> <span class="badge badge-info">{$result->size|filesize}</span>
<span class="badge badge-info">Posted {$result->postdate|timeago} <span class="badge badge-info">Posted {{{Timezone::convertToLocal($result->postdate, 'Y-m-d h:i:s')}}|timeago}
ago</span> ago</span>
{if isset($isadmin)}<a {if isset($isadmin)}<a
class="badge badge-warning" class="badge badge-warning"
+1 -1
View File
@@ -109,7 +109,7 @@
value="{$result->guid}" id="chksingle"/> value="{$result->guid}" id="chksingle"/>
</label> </label>
<span class="badge badge-info">{$result->size|filesize}</span> <span class="badge badge-info">{$result->size|filesize}</span>
<span class="badge badge-info">Posted {$result->postdate|timeago} <span class="badge badge-info">Posted {{{Timezone::convertToLocal($result->postdate, 'Y-m-d h:i:s')}}|timeago}
ago</span> ago</span>
{if isset($isadmin)}<a class="badge badge-warning" {if isset($isadmin)}<a class="badge badge-warning"
href="{{url("/admin/release-edit?id={$result->guid}")}}" href="{{url("/admin/release-edit?id={$result->guid}")}}"
+2 -2
View File
@@ -312,8 +312,8 @@
<a title="Browse {$result->category_name}" <a title="Browse {$result->category_name}"
href="{{url("/browse/{$result->parent_category}/{$result->sub_category}")}}"> {$result->category_name}</a> href="{{url("/browse/{$result->parent_category}/{$result->sub_category}")}}"> {$result->category_name}</a>
</td> </td>
<td class="posted" title="{$result->postdate}"> <td class="posted" title="{{Timezone::convertToLocal($result->postdate, 'Y-m-d h:i:s')}}">
{$result->postdate|timeago} {{{Timezone::convertToLocal($result->postdate, 'Y-m-d h:i:s')}}|timeago}
</td> </td>
<td class="size"> <td class="size">
{$result->size|filesize} {$result->size|filesize}
+1 -1
View File
@@ -136,7 +136,7 @@
</div> </div>
</td> </td>
<td><span class="badge badge-info">{$result->category_name}</span></td> <td><span class="badge badge-info">{$result->category_name}</span></td>
<td width="40" title="{$result->postdate}">{$result->postdate|timeago}</td> <td width="40" title="{{Timezone::convertToLocal($result->postdate, 'Y-m-d h:i:s')}}">{{{Timezone::convertToLocal($result->postdate, 'Y-m-d h:i:s')}}|timeago}</td>
<td>{$result->size|filesize}</td> <td>{$result->size|filesize}</td>
<td class="icon_nzb"><a <td class="icon_nzb"><a
href="{{url("/getnzb?id={$result->guid}")}}"><i href="{{url("/getnzb?id={$result->guid}")}}"><i
+1 -1
View File
@@ -571,7 +571,7 @@
</tr> </tr>
<tr> <tr>
<th width="140">Posted</th> <th width="140">Posted</th>
<td>{$release.postdate|date_format:"%b %e, %Y %T"} <td>{{Timezone::convertToLocal($release.postdate, 'F j, Y H:i:s')}}
({$release.postdate|daysago} ({$release.postdate|daysago}
) )
</td> </td>
@@ -206,7 +206,7 @@
<span class="badge badge-info">{$result->category_name}</span> <span class="badge badge-info">{$result->category_name}</span>
</td> </td>
<td width="40" <td width="40"
title="{$result->postdate}">{$result->postdate|timeago}</td> title="{{Timezone::convertToLocal($result->postdate, 'Y-m-d h:i:s')}}">{{{Timezone::convertToLocal($result->postdate, 'Y-m-d h:i:s')}}|timeago}</td>
<td> <td>
{$result->size|filesize} {$result->size|filesize}
</td> </td>
@@ -24,7 +24,7 @@
<td class="less">{$release.category_name}</td> <td class="less">{$release.category_name}</td>
<td class="less right">{$release.size|filesize}</td> <td class="less right">{$release.size|filesize}</td>
<td class="less mid"><a href="release-files?id={$release.guid}">{$release.totalpart}</a></td> <td class="less mid"><a href="release-files?id={$release.guid}">{$release.totalpart}</a></td>
<td class="less">{$release.postdate|date_format}</td> <td class="less">{Timezone::convertToLocal($release.postdate, 'Y-m-d H:i:s')}}</td>
<td class="less">{$release.adddate|date_format}</td> <td class="less">{$release.adddate|date_format}</td>
<td class="less mid">{$release.grabs}</td> <td class="less mid">{$release.grabs}</td>
<td> <td>
@@ -89,7 +89,7 @@
<tr> <tr>
<td><label for="postdate">Posted Date:</label></td> <td><label for="postdate">Posted Date:</label></td>
<td> <td>
<input id="postdate" class="long" name="postdate" value="{$release.postdate}"/> <input id="postdate" class="long" name="postdate" value="{Timezone::convertToLocal($release.postdate, 'Y-m-d H:i:s')}}"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -24,7 +24,7 @@
<td class="less">{$release.category_name}</td> <td class="less">{$release.category_name}</td>
<td class="less right">{$release.size|filesize}</td> <td class="less right">{$release.size|filesize}</td>
<td class="less mid"><a href="release-files?id={$release.guid}">{$release.totalpart}</a></td> <td class="less mid"><a href="release-files?id={$release.guid}">{$release.totalpart}</a></td>
<td class="less">{$release.postdate|date_format}</td> <td class="less">{Timezone::convertToLocal($release.postdate, 'Y-m-d H:i:s')}}</td>
<td class="less">{$release.adddate|date_format}</td> <td class="less">{$release.adddate|date_format}</td>
<td class="less mid">{$release.grabs}</td> <td class="less mid">{$release.grabs}</td>
<td><a href="{{url("/admin/release-delete/{$release.guid}")}}">delete</a></td> <td><a href="{{url("/admin/release-delete/{$release.guid}")}}">delete</a></td>