mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-23 19:50:40 -05:00
Reformatted per psr-2 coding standards
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
|
||||
@@ -29,5 +29,5 @@ class UserMade100Comments extends Achievement
|
||||
/*
|
||||
* The amount of "points" this user need to obtain in order to complete this achievement
|
||||
*/
|
||||
public $points = 100;
|
||||
public $points = 100;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
|
||||
@@ -29,5 +29,5 @@ class UserMade200Comments extends Achievement
|
||||
/*
|
||||
* The amount of "points" this user need to obtain in order to complete this achievement
|
||||
*/
|
||||
public $points = 200;
|
||||
public $points = 200;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
@@ -26,8 +26,8 @@ class UserMade25Uploads extends Achievement
|
||||
*/
|
||||
public $description = "You have made 25 torrent uploads!";
|
||||
|
||||
/*
|
||||
* The amount of "points" this user need to obtain in order to complete this achievement
|
||||
*/
|
||||
/*
|
||||
* The amount of "points" this user need to obtain in order to complete this achievement
|
||||
*/
|
||||
public $points = 25;
|
||||
}
|
||||
|
||||
@@ -29,5 +29,5 @@ class UserMade300Comments extends Achievement
|
||||
/*
|
||||
* The amount of "points" this user need to obtain in order to complete this achievement
|
||||
*/
|
||||
public $points = 300;
|
||||
public $points = 300;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
@@ -29,5 +29,5 @@ class UserMade400Comments extends Achievement
|
||||
/*
|
||||
* The amount of "points" this user need to obtain in order to complete this achievement
|
||||
*/
|
||||
public $points = 400;
|
||||
public $points = 400;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
@@ -29,5 +29,5 @@ class UserMade500Comments extends Achievement
|
||||
/*
|
||||
* The amount of "points" this user need to obtain in order to complete this achievement
|
||||
*/
|
||||
public $points = 500;
|
||||
public $points = 500;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
@@ -29,5 +29,5 @@ class UserMade50Comments extends Achievement
|
||||
/*
|
||||
* The amount of "points" this user need to obtain in order to complete this achievement
|
||||
*/
|
||||
public $points = 50;
|
||||
public $points = 50;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
@@ -29,5 +29,5 @@ class UserMade600Comments extends Achievement
|
||||
/*
|
||||
* The amount of "points" this user need to obtain in order to complete this achievement
|
||||
*/
|
||||
public $points = 600;
|
||||
public $points = 600;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
@@ -29,5 +29,5 @@ class UserMade700Comments extends Achievement
|
||||
/*
|
||||
* The amount of "points" this user need to obtain in order to complete this achievement
|
||||
*/
|
||||
public $points = 700;
|
||||
public $points = 700;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
@@ -29,5 +29,5 @@ class UserMade800Comments extends Achievement
|
||||
/*
|
||||
* The amount of "points" this user need to obtain in order to complete this achievement
|
||||
*/
|
||||
public $points = 800;
|
||||
public $points = 800;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
@@ -29,5 +29,5 @@ class UserMade900Comments extends Achievement
|
||||
/*
|
||||
* The amount of "points" this user need to obtain in order to complete this achievement
|
||||
*/
|
||||
public $points = 900;
|
||||
public $points = 900;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
@@ -26,9 +26,9 @@ class UserMadeTenComments extends Achievement
|
||||
*/
|
||||
public $description = "Wow! You have already made 10 comments!";
|
||||
|
||||
/*
|
||||
* The amount of "points" this user need to obtain in order to complete this achievement
|
||||
*/
|
||||
/*
|
||||
* The amount of "points" this user need to obtain in order to complete this achievement
|
||||
*/
|
||||
public $points = 10;
|
||||
|
||||
/*
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Achievements;
|
||||
|
||||
use Gstt\Achievements\Achievement;
|
||||
|
||||
+4
-4
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -26,9 +26,9 @@ class Article extends Model
|
||||
];
|
||||
|
||||
/**
|
||||
* Belongs to User
|
||||
*
|
||||
*/
|
||||
* Belongs to User
|
||||
*
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(\App\User::class);
|
||||
|
||||
+4
-4
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App;
|
||||
|
||||
use App\User;
|
||||
@@ -43,9 +43,9 @@ class Ban extends Model
|
||||
];
|
||||
|
||||
/**
|
||||
* Rules For Validation
|
||||
*
|
||||
*/
|
||||
* Rules For Validation
|
||||
*
|
||||
*/
|
||||
public $rules = [
|
||||
'owned_by' => 'required',
|
||||
'created_by' => 'required',
|
||||
|
||||
+34
-34
@@ -19,24 +19,24 @@ class BonExchange extends Model
|
||||
{
|
||||
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'bon_exchange';
|
||||
|
||||
/**
|
||||
* Tells Laravel to not maintain the timestamp columns
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
* Tells Laravel to not maintain the timestamp columns
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* The attributes that should be casted to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
* The attributes that should be casted to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'upload' => 'boolean',
|
||||
'download' => 'boolean',
|
||||
@@ -51,10 +51,10 @@ class BonExchange extends Model
|
||||
*/
|
||||
public function getDownloadOptions()
|
||||
{
|
||||
return BonExchange::where('download' , true)
|
||||
->orderBy('value' , 'asc')
|
||||
->get()
|
||||
->toArray();
|
||||
return BonExchange::where('download', true)
|
||||
->orderBy('value', 'asc')
|
||||
->get()
|
||||
->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -64,10 +64,10 @@ class BonExchange extends Model
|
||||
*/
|
||||
public function getUploadOptions()
|
||||
{
|
||||
return BonExchange::where('upload' , true)
|
||||
->orderBy('value' , 'asc')
|
||||
->get()
|
||||
->toArray();
|
||||
return BonExchange::where('upload', true)
|
||||
->orderBy('value', 'asc')
|
||||
->get()
|
||||
->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,10 +77,10 @@ class BonExchange extends Model
|
||||
*/
|
||||
public function getPersonalFreeleechOption()
|
||||
{
|
||||
return BonExchange::where('personal_freeleech' , true)
|
||||
->orderBy('value' , 'asc')
|
||||
->get()
|
||||
->toArray();
|
||||
return BonExchange::where('personal_freeleech', true)
|
||||
->orderBy('value', 'asc')
|
||||
->get()
|
||||
->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -90,10 +90,10 @@ class BonExchange extends Model
|
||||
*/
|
||||
public function getInviteOption()
|
||||
{
|
||||
return BonExchange::where('invite' , true)
|
||||
->orderBy('value' , 'asc')
|
||||
->get()
|
||||
->toArray();
|
||||
return BonExchange::where('invite', true)
|
||||
->orderBy('value', 'asc')
|
||||
->get()
|
||||
->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,12 +101,12 @@ class BonExchange extends Model
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getItemCost($id)
|
||||
{
|
||||
return BonExchange::where('id', '=' , $id)
|
||||
->get()
|
||||
->toArray()[0]['cost'];
|
||||
}
|
||||
public function getItemCost($id)
|
||||
{
|
||||
return BonExchange::where('id', '=', $id)
|
||||
->get()
|
||||
->toArray()[0]['cost'];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
+12
-12
@@ -18,17 +18,17 @@ class BonTransactions extends Model
|
||||
{
|
||||
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'bon_transactions';
|
||||
|
||||
/**
|
||||
* Tells Laravel to not maintain the timestamp columns
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
* Tells Laravel to not maintain the timestamp columns
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
@@ -39,8 +39,8 @@ class BonTransactions extends Model
|
||||
protected $dateFormat = 'U';
|
||||
|
||||
/**
|
||||
* Mass assignment fields
|
||||
*
|
||||
*/
|
||||
protected $fillable = ['itemID', 'name', 'cost', 'sender' ,'receiver', 'comment', 'torrent_id'];
|
||||
* Mass assignment fields
|
||||
*
|
||||
*/
|
||||
protected $fillable = ['itemID', 'name', 'cost', 'sender', 'receiver', 'comment', 'torrent_id'];
|
||||
}
|
||||
|
||||
+1
-1
@@ -16,5 +16,5 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Bookmark extends Model
|
||||
{
|
||||
//
|
||||
//
|
||||
}
|
||||
|
||||
+8
-8
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -18,16 +18,16 @@ use App\Torrent;
|
||||
class Catalog extends Model
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = "catalogs";
|
||||
|
||||
/**
|
||||
* Mass assignment fields
|
||||
*
|
||||
*/
|
||||
* Mass assignment fields
|
||||
*
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name', 'slug'
|
||||
];
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -20,16 +20,16 @@ use App\CatalogTorrent;
|
||||
class CatalogTorrent extends Model
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = "catalog_torrent";
|
||||
|
||||
/**
|
||||
* Mass assignment fields
|
||||
*
|
||||
*/
|
||||
* Mass assignment fields
|
||||
*
|
||||
*/
|
||||
protected $fillable = [
|
||||
'imdb', 'tvdb', 'catalog_id'
|
||||
];
|
||||
|
||||
+4
-4
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -41,9 +41,9 @@ class Category extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Has many requests
|
||||
*
|
||||
*/
|
||||
* Has many requests
|
||||
*
|
||||
*/
|
||||
public function requests()
|
||||
{
|
||||
return $this->hasMany(\App\Requests::class);
|
||||
|
||||
+7
-8
@@ -9,19 +9,18 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
|
||||
|
||||
class Client extends Model
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'clients';
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'clients';
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
@@ -20,34 +20,34 @@ use Illuminate\Console\Command;
|
||||
class FlushPeers extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'FlushPeers';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Flushes ghost peers every hour.';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
Peer::chunk(250, function ($section) {
|
||||
|
||||
@@ -26,32 +26,30 @@ use Illuminate\Support\Facades\Mail;
|
||||
class autoBan extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'autoBan';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Ban if user has more than x Active Warnings';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$bans = Warning::with('warneduser')->select(DB::raw('user_id, count(*) as value'))->where('active','=','1')->groupBy('user_id')->having('value','>=','3')->get();
|
||||
$bans = Warning::with('warneduser')->select(DB::raw('user_id, count(*) as value'))->where('active', '=', '1')->groupBy('user_id')->having('value', '>=', '3')->get();
|
||||
|
||||
foreach($bans as $ban)
|
||||
{
|
||||
if($ban->warneduser->group_id != 5 && !$ban->warneduser->group->is_immune)
|
||||
{
|
||||
foreach ($bans as $ban) {
|
||||
if ($ban->warneduser->group_id != 5 && !$ban->warneduser->group->is_immune) {
|
||||
// If User Has 3 or More Active Warnings Ban Set The Users Group To Banned
|
||||
$ban->warneduser->group_id = 5;
|
||||
$ban->warneduser->save();
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\PrivateMessage;
|
||||
@@ -25,99 +25,99 @@ use Illuminate\Support\Facades\DB;
|
||||
class autoGroup extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'autoGroup';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Automatically Change A Users Group Class If Requirements Met';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
// Temp Hard Coding of Immune Groups (Config Files To Come)
|
||||
$current = Carbon::now();
|
||||
$groups = Group::select('id')->where('autogroup', '=', 1)->get()->toArray();
|
||||
$users = User::whereIn('group_id', $groups)->get();
|
||||
// Temp Hard Coding of Immune Groups (Config Files To Come)
|
||||
$current = Carbon::now();
|
||||
$groups = Group::select('id')->where('autogroup', '=', 1)->get()->toArray();
|
||||
$users = User::whereIn('group_id', $groups)->get();
|
||||
|
||||
foreach ($users as $user) {
|
||||
foreach ($users as $user) {
|
||||
|
||||
$hiscount = History::where('user_id', '=', $user->id)->count();
|
||||
$hiscount = History::where('user_id', '=', $user->id)->count();
|
||||
|
||||
// Temp Hard Coding of Group Requirements (Config Files To Come) (Upload in Bytes!) (Seedtime in Seconds!)
|
||||
// Temp Hard Coding of Group Requirements (Config Files To Come) (Upload in Bytes!) (Seedtime in Seconds!)
|
||||
|
||||
//Leech ratio dropped below sites minimum
|
||||
if ($user->getRatio() < Config::get('other.ratio') && $user->group_id != 15) {
|
||||
$user->group_id = 15;
|
||||
$user->can_request = 0;
|
||||
$user->can_invite = 0;
|
||||
$user->can_download = 0;
|
||||
$user->save();
|
||||
//PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $user->id, 'subject' => "Sad News My Friend!", 'message' => "You have been demoted to Leech group. Your ratio dropped below 0.2. So now you have been placed in Leech Group and your download rights, invite rights and request rights have been revoked. Please seed and use bon to bring ratio back up! [color=red][b]THIS IS AN AUTOMATED SYSTEM MESSAGE, PLEASE DO NOT REPLY![/b][/color]"]);
|
||||
}
|
||||
//Member >= 0 but < 1TB and ratio above sites minimum
|
||||
if ($user->uploaded >= 0 && $user->getRatio() > Config::get('other.ratio') && $user->group_id != 3) {
|
||||
$user->group_id = 3;
|
||||
$user->can_download = 1;
|
||||
$user->can_request = 1;
|
||||
$user->can_invite = 1;
|
||||
$user->save();
|
||||
//PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $user->id, 'subject' => "Group Change", 'message' => "You group/rank has been changed! [color=red][b]THIS IS AN AUTOMATED SYSTEM MESSAGE, PLEASE DO NOT REPLY![/b][/color]"]);
|
||||
}
|
||||
//Leech ratio dropped below sites minimum
|
||||
if ($user->getRatio() < Config::get('other.ratio') && $user->group_id != 15) {
|
||||
$user->group_id = 15;
|
||||
$user->can_request = 0;
|
||||
$user->can_invite = 0;
|
||||
$user->can_download = 0;
|
||||
$user->save();
|
||||
//PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $user->id, 'subject' => "Sad News My Friend!", 'message' => "You have been demoted to Leech group. Your ratio dropped below 0.2. So now you have been placed in Leech Group and your download rights, invite rights and request rights have been revoked. Please seed and use bon to bring ratio back up! [color=red][b]THIS IS AN AUTOMATED SYSTEM MESSAGE, PLEASE DO NOT REPLY![/b][/color]"]);
|
||||
}
|
||||
//Member >= 0 but < 1TB and ratio above sites minimum
|
||||
if ($user->uploaded >= 0 && $user->getRatio() > Config::get('other.ratio') && $user->group_id != 3) {
|
||||
$user->group_id = 3;
|
||||
$user->can_download = 1;
|
||||
$user->can_request = 1;
|
||||
$user->can_invite = 1;
|
||||
$user->save();
|
||||
//PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $user->id, 'subject' => "Group Change", 'message' => "You group/rank has been changed! [color=red][b]THIS IS AN AUTOMATED SYSTEM MESSAGE, PLEASE DO NOT REPLY![/b][/color]"]);
|
||||
}
|
||||
|
||||
//BluMember >= 1TB but < 5TB and account 1 month old
|
||||
if ($user->uploaded >= 1073741824000 && $user->uploaded < 1073741824000*5 && $user->created_at < $current->copy()->subDays(30)->toDateTimeString() && $user->group_id != 11) {
|
||||
$user->group_id = 11;
|
||||
$user->save();
|
||||
//PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $user->id, 'subject' => "Group Change", 'message' => "You group/rank has been changed! [color=red][b]THIS IS AN AUTOMATED SYSTEM MESSAGE, PLEASE DO NOT REPLY![/b][/color]"]);
|
||||
}
|
||||
//BluMaster >= 5TB but < 20TB and account 1 month old
|
||||
if ($user->uploaded >= 1073741824000*5 && $user->uploaded < 1073741824000*20 && $user->created_at < $current->copy()->subDays(30)->toDateTimeString() && $user->group_id != 12) {
|
||||
$user->group_id = 12;
|
||||
$user->save();
|
||||
//PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $user->id, 'subject' => "Group Change", 'message' => "You group/rank has been changed! [color=red][b]THIS IS AN AUTOMATED SYSTEM MESSAGE, PLEASE DO NOT REPLY![/b][/color]"]);
|
||||
}
|
||||
//BluExtremist >= 20TB but < 50TB and account 3 month old
|
||||
if ($user->uploaded >= 1073741824000*20 && $user->uploaded < 1073741824000*50 && $user->created_at < $current->copy()->subDays(90)->toDateTimeString() && $user->group_id != 13) {
|
||||
$user->group_id = 13;
|
||||
$user->save();
|
||||
//PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $user->id, 'subject' => "Group Change", 'message' => "You group/rank has been changed! [color=red][b]THIS IS AN AUTOMATED SYSTEM MESSAGE, PLEASE DO NOT REPLY![/b][/color]"]);
|
||||
}
|
||||
//BluLegend >= 50TB but < 100TB and account 6 month old
|
||||
if ($user->uploaded >= 1073741824000*50 && $user->uploaded < 1073741824000*100 && $user->created_at < $current->copy()->subDays(180)->toDateTimeString() && $user->group_id != 14) {
|
||||
$user->group_id = 14;
|
||||
$user->save();
|
||||
//PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $user->id, 'subject' => "Group Change", 'message' => "You group/rank has been changed! [color=red][b]THIS IS AN AUTOMATED SYSTEM MESSAGE, PLEASE DO NOT REPLY![/b][/color]"]);
|
||||
}
|
||||
//Blutopian >= 100TB and account 1 year old
|
||||
if ($user->uploaded >= 1073741824000*100 && $user->created_at < $current->copy()->subDays(365)->toDateTimeString() && $user->group_id != 16) {
|
||||
$user->group_id = 16;
|
||||
$user->save();
|
||||
//PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $user->id, 'subject' => "Group Change", 'message' => "You group/rank has been changed! [color=red][b]THIS IS AN AUTOMATED SYSTEM MESSAGE, PLEASE DO NOT REPLY![/b][/color]"]);
|
||||
}
|
||||
//BluMember >= 1TB but < 5TB and account 1 month old
|
||||
if ($user->uploaded >= 1073741824000 && $user->uploaded < 1073741824000 * 5 && $user->created_at < $current->copy()->subDays(30)->toDateTimeString() && $user->group_id != 11) {
|
||||
$user->group_id = 11;
|
||||
$user->save();
|
||||
//PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $user->id, 'subject' => "Group Change", 'message' => "You group/rank has been changed! [color=red][b]THIS IS AN AUTOMATED SYSTEM MESSAGE, PLEASE DO NOT REPLY![/b][/color]"]);
|
||||
}
|
||||
//BluMaster >= 5TB but < 20TB and account 1 month old
|
||||
if ($user->uploaded >= 1073741824000 * 5 && $user->uploaded < 1073741824000 * 20 && $user->created_at < $current->copy()->subDays(30)->toDateTimeString() && $user->group_id != 12) {
|
||||
$user->group_id = 12;
|
||||
$user->save();
|
||||
//PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $user->id, 'subject' => "Group Change", 'message' => "You group/rank has been changed! [color=red][b]THIS IS AN AUTOMATED SYSTEM MESSAGE, PLEASE DO NOT REPLY![/b][/color]"]);
|
||||
}
|
||||
//BluExtremist >= 20TB but < 50TB and account 3 month old
|
||||
if ($user->uploaded >= 1073741824000 * 20 && $user->uploaded < 1073741824000 * 50 && $user->created_at < $current->copy()->subDays(90)->toDateTimeString() && $user->group_id != 13) {
|
||||
$user->group_id = 13;
|
||||
$user->save();
|
||||
//PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $user->id, 'subject' => "Group Change", 'message' => "You group/rank has been changed! [color=red][b]THIS IS AN AUTOMATED SYSTEM MESSAGE, PLEASE DO NOT REPLY![/b][/color]"]);
|
||||
}
|
||||
//BluLegend >= 50TB but < 100TB and account 6 month old
|
||||
if ($user->uploaded >= 1073741824000 * 50 && $user->uploaded < 1073741824000 * 100 && $user->created_at < $current->copy()->subDays(180)->toDateTimeString() && $user->group_id != 14) {
|
||||
$user->group_id = 14;
|
||||
$user->save();
|
||||
//PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $user->id, 'subject' => "Group Change", 'message' => "You group/rank has been changed! [color=red][b]THIS IS AN AUTOMATED SYSTEM MESSAGE, PLEASE DO NOT REPLY![/b][/color]"]);
|
||||
}
|
||||
//Blutopian >= 100TB and account 1 year old
|
||||
if ($user->uploaded >= 1073741824000 * 100 && $user->created_at < $current->copy()->subDays(365)->toDateTimeString() && $user->group_id != 16) {
|
||||
$user->group_id = 16;
|
||||
$user->save();
|
||||
//PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $user->id, 'subject' => "Group Change", 'message' => "You group/rank has been changed! [color=red][b]THIS IS AN AUTOMATED SYSTEM MESSAGE, PLEASE DO NOT REPLY![/b][/color]"]);
|
||||
}
|
||||
|
||||
//BluSeeder seeding >= 150 and account 1 month old and seedtime average 30 days or better
|
||||
if ($user->getSeeding() >= 150 && round($user->getTotalSeedTime() / max(1, $hiscount)) > 2592000 && $user->created_at < $current->copy()->subDays(30)->toDateTimeString() && $user->group_id != 17) {
|
||||
$user->group_id = 17;
|
||||
$user->save();
|
||||
//PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $user->id, 'subject' => "Group Change", 'message' => "You group/rank has been changed! [color=red][b]THIS IS AN AUTOMATED SYSTEM MESSAGE, PLEASE DO NOT REPLY![/b][/color]"]);
|
||||
//BluSeeder seeding >= 150 and account 1 month old and seedtime average 30 days or better
|
||||
if ($user->getSeeding() >= 150 && round($user->getTotalSeedTime() / max(1, $hiscount)) > 2592000 && $user->created_at < $current->copy()->subDays(30)->toDateTimeString() && $user->group_id != 17) {
|
||||
$user->group_id = 17;
|
||||
$user->save();
|
||||
//PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $user->id, 'subject' => "Group Change", 'message' => "You group/rank has been changed! [color=red][b]THIS IS AN AUTOMATED SYSTEM MESSAGE, PLEASE DO NOT REPLY![/b][/color]"]);
|
||||
}
|
||||
//BluArchivist seeding >= 300 and account 3 month old and seedtime average 60 days or better
|
||||
if ($user->getSeeding() >= 300 && round($user->getTotalSeedTime() / max(1, $hiscount)) > 2592000 * 2 && $user->created_at < $current->copy()->subDays(90)->toDateTimeString() && $user->group_id != 18) {
|
||||
$user->group_id = 18;
|
||||
$user->save();
|
||||
//PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $user->id, 'subject' => "Group Change", 'message' => "You group/rank has been changed! [color=red][b]THIS IS AN AUTOMATED SYSTEM MESSAGE, PLEASE DO NOT REPLY![/b][/color]"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
//BluArchivist seeding >= 300 and account 3 month old and seedtime average 60 days or better
|
||||
if ($user->getSeeding() >= 300 && round($user->getTotalSeedTime() / max(1, $hiscount)) > 2592000*2 && $user->created_at < $current->copy()->subDays(90)->toDateTimeString() && $user->group_id != 18) {
|
||||
$user->group_id = 18;
|
||||
$user->save();
|
||||
//PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $user->id, 'subject' => "Group Change", 'message' => "You group/rank has been changed! [color=red][b]THIS IS AN AUTOMATED SYSTEM MESSAGE, PLEASE DO NOT REPLY![/b][/color]"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,24 +26,24 @@ use Illuminate\Support\Facades\Config;
|
||||
class autoNerdStat extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'autoNerdStat';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Automatically Posts Daily Nerd Stat To Shoutbox';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
// Current Timestamp
|
||||
@@ -70,21 +70,21 @@ class autoNerdStat extends Command
|
||||
$du = Torrent::where('doubleup', '=', 1)->count();
|
||||
|
||||
// Select A Random Nerd Stat
|
||||
$statArray = ["In The Last 24 Hours " .$logins. " Unique Users Have Logged Into " .Config::get('other.title'). "!",
|
||||
"In The Last 24 Hours " .$uploads. " Torrents Have Been Uploaded To " .Config::get('other.title'). "!",
|
||||
"In The Last 24 Hours " .$users. " Users Have Registered To " .Config::get('other.title'). "!",
|
||||
"There Are Currently " .$fl. " Freeleech Torrents On " .Config::get('other.title'). "!",
|
||||
"There Are Currently " .$du. " DoubleUpload Torrents On " .Config::get('other.title'). "!",
|
||||
"Currently " .$seeders->name. " Is The Best Seeded Torrent On " .Config::get('other.title'). "!",
|
||||
"Currently " .$leechers->name. " Is The Most Leeched Torrent On " .Config::get('other.title'). "!",
|
||||
"Currently " .$snatched->name. " Is The Most Snatched Torrent On " .Config::get('other.title'). "!",
|
||||
"Currently " .$banker->username. " Is The Top BON Holder On " .Config::get('other.title'). "!",
|
||||
Config::get('other.title'). " Birthdate Is " .$bday->toFormattedDateString(). "!"
|
||||
$statArray = ["In The Last 24 Hours " . $logins . " Unique Users Have Logged Into " . Config::get('other.title') . "!",
|
||||
"In The Last 24 Hours " . $uploads . " Torrents Have Been Uploaded To " . Config::get('other.title') . "!",
|
||||
"In The Last 24 Hours " . $users . " Users Have Registered To " . Config::get('other.title') . "!",
|
||||
"There Are Currently " . $fl . " Freeleech Torrents On " . Config::get('other.title') . "!",
|
||||
"There Are Currently " . $du . " DoubleUpload Torrents On " . Config::get('other.title') . "!",
|
||||
"Currently " . $seeders->name . " Is The Best Seeded Torrent On " . Config::get('other.title') . "!",
|
||||
"Currently " . $leechers->name . " Is The Most Leeched Torrent On " . Config::get('other.title') . "!",
|
||||
"Currently " . $snatched->name . " Is The Most Snatched Torrent On " . Config::get('other.title') . "!",
|
||||
"Currently " . $banker->username . " Is The Top BON Holder On " . Config::get('other.title') . "!",
|
||||
Config::get('other.title') . " Birthdate Is " . $bday->toFormattedDateString() . "!"
|
||||
];
|
||||
$selected = mt_rand(0, count($statArray) -1);
|
||||
$selected = mt_rand(0, count($statArray) - 1);
|
||||
|
||||
// Auto Shout Nerd Stat
|
||||
Shoutbox::create(['user' => "2", 'mentions' => "2", 'message' => ":nerd: [b]Random Nerd Stat:[/b] ".$statArray[$selected]." :nerd:"]);
|
||||
Shoutbox::create(['user' => "2", 'mentions' => "2", 'message' => ":nerd: [b]Random Nerd Stat:[/b] " . $statArray[$selected] . " :nerd:"]);
|
||||
Cache::forget('shoutbox_messages');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,43 +21,41 @@ use Illuminate\Support\Facades\DB;
|
||||
|
||||
class autoSeedbox extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'autoSeedbox';
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'autoSeedbox';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Updates Torrents Highspeed Tag based on registered seedboxes.';
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Updates Torrents Highspeed Tag based on registered seedboxes.';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
DB::table('torrents')->update(['highspeed' => 0]);
|
||||
|
||||
$seedboxips = Client::select('ip')->get()->toArray();
|
||||
|
||||
if(is_array($seedboxips) && count($seedboxips) > 0)
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$torid = Peer::select('torrent_id')->whereIn('ip', $seedboxips)->get()->toArray();
|
||||
DB::table('torrents')->update(['highspeed' => 0]);
|
||||
|
||||
foreach($torid as $id)
|
||||
{
|
||||
$torrent = Torrent::where('id' , '=' , $id)->first();
|
||||
$torrent->highspeed = 1;
|
||||
$torrent->save();
|
||||
$seedboxips = Client::select('ip')->get()->toArray();
|
||||
|
||||
unset($torrent);
|
||||
if (is_array($seedboxips) && count($seedboxips) > 0) {
|
||||
$torid = Peer::select('torrent_id')->whereIn('ip', $seedboxips)->get()->toArray();
|
||||
|
||||
foreach ($torid as $id) {
|
||||
$torrent = Torrent::where('id', '=', $id)->first();
|
||||
$torrent->highspeed = 1;
|
||||
$torrent->save();
|
||||
|
||||
unset($torrent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,58 +25,56 @@ use Illuminate\Support\Facades\DB;
|
||||
class autoWarning extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'autoWarning';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Automatically Post Warnings To Users Accounts and Warnings Table';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$current = new Carbon();
|
||||
$hitrun = History::with(['user','torrent'])->where('actual_downloaded', '>', 0)->where('active', '=', 0)->where('seedtime', '<=', 604800)->where('updated_at','<', $current->copy()->subDays(3)->toDateTimeString())->get();
|
||||
$hitrun = History::with(['user', 'torrent'])->where('actual_downloaded', '>', 0)->where('active', '=', 0)->where('seedtime', '<=', 604800)->where('updated_at', '<', $current->copy()->subDays(3)->toDateTimeString())->get();
|
||||
|
||||
foreach($hitrun as $hr)
|
||||
{
|
||||
if(!$hr->user->group->is_immune)
|
||||
{
|
||||
if( $hr->actual_downloaded > ($hr->torrent->size * (config('hitrun.buffer')/100))) {
|
||||
foreach ($hitrun as $hr) {
|
||||
if (!$hr->user->group->is_immune) {
|
||||
if ($hr->actual_downloaded > ($hr->torrent->size * (config('hitrun.buffer') / 100))) {
|
||||
|
||||
$exsist = Warning::where('torrent', '=', $hr->torrent->id)->where('user_id', '=', $hr->user->id)->first();
|
||||
$exsist = Warning::where('torrent', '=', $hr->torrent->id)->where('user_id', '=', $hr->user->id)->first();
|
||||
|
||||
// Insert Warning Into Warnings Table if doesnt already exsist
|
||||
if (!$exsist) {
|
||||
$warning = new Warning();
|
||||
$warning->user_id = $hr->user->id;
|
||||
$warning->warned_by = "0";
|
||||
$warning->torrent = $hr->torrent->id;
|
||||
$warning->reason = "Hit and Run Warning For Torrent {$hr->torrent->name}";
|
||||
$warning->expires_on = $current->copy()->addDays(14);
|
||||
$warning->active = "1";
|
||||
$warning->save();
|
||||
// Insert Warning Into Warnings Table if doesnt already exsist
|
||||
if (!$exsist) {
|
||||
$warning = new Warning();
|
||||
$warning->user_id = $hr->user->id;
|
||||
$warning->warned_by = "0";
|
||||
$warning->torrent = $hr->torrent->id;
|
||||
$warning->reason = "Hit and Run Warning For Torrent {$hr->torrent->name}";
|
||||
$warning->expires_on = $current->copy()->addDays(14);
|
||||
$warning->active = "1";
|
||||
$warning->save();
|
||||
|
||||
// Add +1 To Users Warnings Count In Users Table
|
||||
$hr->user->hitandruns++;
|
||||
$hr->user->save();
|
||||
// Add +1 To Users Warnings Count In Users Table
|
||||
$hr->user->hitandruns++;
|
||||
$hr->user->save();
|
||||
|
||||
// Send PM To The Offender
|
||||
PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $hr->user->id, 'subject' => "Hit and Run Warning Recieved", 'message' => "You have received a automated [b]WARNING[/b] from the system because [b]you failed to follow the Hit and Run rules in relation to Torrent " .$hr->torrent->name. "[/b][color=red][b]THIS IS AN AUTOMATED SYSTEM MESSAGE, PLEASE DO NOT REPLY![/b][/color]"]);
|
||||
// Send PM To The Offender
|
||||
PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $hr->user->id, 'subject' => "Hit and Run Warning Recieved", 'message' => "You have received a automated [b]WARNING[/b] from the system because [b]you failed to follow the Hit and Run rules in relation to Torrent " . $hr->torrent->name . "[/b][color=red][b]THIS IS AN AUTOMATED SYSTEM MESSAGE, PLEASE DO NOT REPLY![/b][/color]"]);
|
||||
}
|
||||
|
||||
unset($exist);
|
||||
}
|
||||
|
||||
unset($exist);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\BonTransactions;
|
||||
@@ -22,140 +22,140 @@ use Illuminate\Support\Facades\DB;
|
||||
class bonAllocation extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'bonAllocation';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Allocates Bonus Points to users based on Peer Activity.';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
//Dying Torrent
|
||||
$dying = DB::table('peers')
|
||||
->select(DB::raw('count(DISTINCT(peers.hash)) as value'), 'peers.user_id')
|
||||
->join('torrents', 'torrents.id', 'peers.torrent_id')
|
||||
->where('torrents.seeders', '=', 1)
|
||||
->where('torrents.times_completed', '>', 2)
|
||||
->where('peers.seeder', '=', 1)
|
||||
->whereRaw('date_sub(peers.created_at,interval 30 minute) < now()')
|
||||
->groupBy('peers.user_id')
|
||||
->get()
|
||||
->toArray();
|
||||
->select(DB::raw('count(DISTINCT(peers.hash)) as value'), 'peers.user_id')
|
||||
->join('torrents', 'torrents.id', 'peers.torrent_id')
|
||||
->where('torrents.seeders', '=', 1)
|
||||
->where('torrents.times_completed', '>', 2)
|
||||
->where('peers.seeder', '=', 1)
|
||||
->whereRaw('date_sub(peers.created_at,interval 30 minute) < now()')
|
||||
->groupBy('peers.user_id')
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
$legendary = DB::table('peers')
|
||||
->select(DB::raw('count(DISTINCT(peers.hash)) as value'), 'peers.user_id')
|
||||
->join('torrents', 'torrents.id', 'peers.torrent_id')
|
||||
->where('peers.seeder', '=', 1)
|
||||
->whereRaw('torrents.created_at < date_sub(now(), interval 12 month)')
|
||||
->whereRaw('date_sub(peers.created_at,interval 30 minute) < now()')
|
||||
->groupBy('peers.user_id')
|
||||
->get()
|
||||
->toArray();
|
||||
->select(DB::raw('count(DISTINCT(peers.hash)) as value'), 'peers.user_id')
|
||||
->join('torrents', 'torrents.id', 'peers.torrent_id')
|
||||
->where('peers.seeder', '=', 1)
|
||||
->whereRaw('torrents.created_at < date_sub(now(), interval 12 month)')
|
||||
->whereRaw('date_sub(peers.created_at,interval 30 minute) < now()')
|
||||
->groupBy('peers.user_id')
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
$old = DB::table('peers')
|
||||
->select(DB::raw('count(DISTINCT(peers.hash)) as value'), 'peers.user_id')
|
||||
->join('torrents', 'torrents.id', 'peers.torrent_id')
|
||||
->where('peers.seeder', '=', 1)
|
||||
->whereRaw('torrents.created_at < date_sub(now(), Interval 6 month)')
|
||||
->whereRaw('torrents.created_at > date_sub(now(), interval 12 month)')
|
||||
->whereRaw('date_sub(peers.created_at,interval 30 minute) < now()')
|
||||
->groupBy('peers.user_id')
|
||||
->get()
|
||||
->toArray();
|
||||
->select(DB::raw('count(DISTINCT(peers.hash)) as value'), 'peers.user_id')
|
||||
->join('torrents', 'torrents.id', 'peers.torrent_id')
|
||||
->where('peers.seeder', '=', 1)
|
||||
->whereRaw('torrents.created_at < date_sub(now(), Interval 6 month)')
|
||||
->whereRaw('torrents.created_at > date_sub(now(), interval 12 month)')
|
||||
->whereRaw('date_sub(peers.created_at,interval 30 minute) < now()')
|
||||
->groupBy('peers.user_id')
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
$huge = DB::table('peers')
|
||||
->select(DB::raw('count(DISTINCT(peers.hash)) as value'), 'peers.user_id')
|
||||
->join('torrents', 'torrents.id', 'peers.torrent_id')
|
||||
->where('peers.seeder', '=', 1)
|
||||
->where('torrents.size', '>=', 1073741824*100)
|
||||
->whereRaw('date_sub(peers.created_at,interval 30 minute) < now()')
|
||||
->groupBy('peers.user_id')
|
||||
->get()
|
||||
->toArray();
|
||||
->select(DB::raw('count(DISTINCT(peers.hash)) as value'), 'peers.user_id')
|
||||
->join('torrents', 'torrents.id', 'peers.torrent_id')
|
||||
->where('peers.seeder', '=', 1)
|
||||
->where('torrents.size', '>=', 1073741824 * 100)
|
||||
->whereRaw('date_sub(peers.created_at,interval 30 minute) < now()')
|
||||
->groupBy('peers.user_id')
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
$large = DB::table('peers')
|
||||
->select(DB::raw('count(DISTINCT(peers.hash)) as value'), 'peers.user_id')
|
||||
->join('torrents', 'torrents.id', 'peers.torrent_id')
|
||||
->where('peers.seeder', '=', 1)
|
||||
->where('torrents.size', '>=', 1073741824*25)
|
||||
->where('torrents.size', '<', 1073741824*100)
|
||||
->whereRaw('date_sub(peers.created_at,interval 30 minute) < now()')
|
||||
->groupBy('peers.user_id')
|
||||
->get()
|
||||
->toArray();
|
||||
->select(DB::raw('count(DISTINCT(peers.hash)) as value'), 'peers.user_id')
|
||||
->join('torrents', 'torrents.id', 'peers.torrent_id')
|
||||
->where('peers.seeder', '=', 1)
|
||||
->where('torrents.size', '>=', 1073741824 * 25)
|
||||
->where('torrents.size', '<', 1073741824 * 100)
|
||||
->whereRaw('date_sub(peers.created_at,interval 30 minute) < now()')
|
||||
->groupBy('peers.user_id')
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
$regular = DB::table('peers')
|
||||
->select(DB::raw('count(DISTINCT(peers.hash)) as value'), 'peers.user_id')
|
||||
->join('torrents', 'torrents.id', 'peers.torrent_id')
|
||||
->where('peers.seeder', '=', 1)
|
||||
->where('torrents.size', '>=', 1073741824)
|
||||
->where('torrents.size', '<', 1073741824*25)
|
||||
->whereRaw('date_sub(peers.created_at,interval 30 minute) < now()')
|
||||
->groupBy('peers.user_id')
|
||||
->get()
|
||||
->toArray();
|
||||
->select(DB::raw('count(DISTINCT(peers.hash)) as value'), 'peers.user_id')
|
||||
->join('torrents', 'torrents.id', 'peers.torrent_id')
|
||||
->where('peers.seeder', '=', 1)
|
||||
->where('torrents.size', '>=', 1073741824)
|
||||
->where('torrents.size', '<', 1073741824 * 25)
|
||||
->whereRaw('date_sub(peers.created_at,interval 30 minute) < now()')
|
||||
->groupBy('peers.user_id')
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
$participaint = DB::table('history')
|
||||
->select(DB::raw('count(DISTINCT(history.info_hash)) as value'), 'history.user_id')
|
||||
->join('torrents', 'torrents.info_hash', 'history.info_hash')
|
||||
->where('history.active', '=', 1)
|
||||
->where('history.seedtime', '>=', 2592000)
|
||||
->where('history.seedtime', '<', 2592000*2)
|
||||
->groupBy('history.user_id')
|
||||
->get()
|
||||
->toArray();
|
||||
->select(DB::raw('count(DISTINCT(history.info_hash)) as value'), 'history.user_id')
|
||||
->join('torrents', 'torrents.info_hash', 'history.info_hash')
|
||||
->where('history.active', '=', 1)
|
||||
->where('history.seedtime', '>=', 2592000)
|
||||
->where('history.seedtime', '<', 2592000 * 2)
|
||||
->groupBy('history.user_id')
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
|
||||
$teamplayer = DB::table('history')
|
||||
->select(DB::raw('count(DISTINCT(history.info_hash)) as value'), 'history.user_id')
|
||||
->join('torrents', 'torrents.info_hash', 'history.info_hash')
|
||||
->where('history.active', '=', 1)
|
||||
->where('history.seedtime', '>=', 2592000*2)
|
||||
->where('history.seedtime', '<', 2592000*3)
|
||||
->groupBy('history.user_id')
|
||||
->get()
|
||||
->toArray();
|
||||
->select(DB::raw('count(DISTINCT(history.info_hash)) as value'), 'history.user_id')
|
||||
->join('torrents', 'torrents.info_hash', 'history.info_hash')
|
||||
->where('history.active', '=', 1)
|
||||
->where('history.seedtime', '>=', 2592000 * 2)
|
||||
->where('history.seedtime', '<', 2592000 * 3)
|
||||
->groupBy('history.user_id')
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
$commited = DB::table('history')
|
||||
->select(DB::raw('count(DISTINCT(history.info_hash)) as value'), 'history.user_id')
|
||||
->join('torrents', 'torrents.info_hash', 'history.info_hash')
|
||||
->where('history.active', '=', 1)
|
||||
->where('history.seedtime', '>=', 2592000*3)
|
||||
->where('history.seedtime', '<', 2592000*6)
|
||||
->groupBy('history.user_id')
|
||||
->get()
|
||||
->toArray();
|
||||
->select(DB::raw('count(DISTINCT(history.info_hash)) as value'), 'history.user_id')
|
||||
->join('torrents', 'torrents.info_hash', 'history.info_hash')
|
||||
->where('history.active', '=', 1)
|
||||
->where('history.seedtime', '>=', 2592000 * 3)
|
||||
->where('history.seedtime', '<', 2592000 * 6)
|
||||
->groupBy('history.user_id')
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
$mvp = DB::table('history')
|
||||
->select(DB::raw('count(DISTINCT(history.info_hash)) as value'), 'history.user_id')
|
||||
->join('torrents', 'torrents.info_hash', 'history.info_hash')
|
||||
->where('history.active', '=', 1)
|
||||
->where('history.seedtime', '>=', 2592000*6)
|
||||
->where('history.seedtime', '<', 2592000*12)
|
||||
->groupBy('history.user_id')
|
||||
->get()
|
||||
->toArray();
|
||||
->select(DB::raw('count(DISTINCT(history.info_hash)) as value'), 'history.user_id')
|
||||
->join('torrents', 'torrents.info_hash', 'history.info_hash')
|
||||
->where('history.active', '=', 1)
|
||||
->where('history.seedtime', '>=', 2592000 * 6)
|
||||
->where('history.seedtime', '<', 2592000 * 12)
|
||||
->groupBy('history.user_id')
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
$legendary = DB::table('history')
|
||||
->select(DB::raw('count(DISTINCT(history.info_hash)) as value'), 'history.user_id')
|
||||
->join('torrents', 'torrents.info_hash', 'history.info_hash')
|
||||
->where('history.active', '=', 1)
|
||||
->where('history.seedtime', '>=', 2592000*12)
|
||||
->groupBy('history.user_id')
|
||||
->get()
|
||||
->toArray();
|
||||
->select(DB::raw('count(DISTINCT(history.info_hash)) as value'), 'history.user_id')
|
||||
->join('torrents', 'torrents.info_hash', 'history.info_hash')
|
||||
->where('history.active', '=', 1)
|
||||
->where('history.seedtime', '>=', 2592000 * 12)
|
||||
->groupBy('history.user_id')
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
//Move data from SQL to array
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\PrivateMessage;
|
||||
@@ -22,30 +22,30 @@ use Illuminate\Support\Facades\DB;
|
||||
class denyRights extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'denyRights';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Revokes download rights of users who have above x active warnings';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
User::where('group_id', '!=', '5')->where('group_id', '!=', '1')->where('group_id', '!=', '15')->update(['can_download' => '1', 'can_request'=>'1']);
|
||||
User::where('group_id', '=', '1')->update(['can_download' => '0','can_request' => '0']);
|
||||
User::where('group_id', '=', '5')->update(['can_download' => '0','can_request' => '0']);
|
||||
User::where('group_id', '=', '15')->update(['can_download' => '0','can_request' => '0']);
|
||||
User::where('group_id', '!=', '5')->where('group_id', '!=', '1')->where('group_id', '!=', '15')->update(['can_download' => '1', 'can_request' => '1']);
|
||||
User::where('group_id', '=', '1')->update(['can_download' => '0', 'can_request' => '0']);
|
||||
User::where('group_id', '=', '5')->update(['can_download' => '0', 'can_request' => '0']);
|
||||
User::where('group_id', '=', '15')->update(['can_download' => '0', 'can_request' => '0']);
|
||||
|
||||
$warning = Warning::with('warneduser')->select(DB::raw('user_id, count(*) as value'))->where('active', '=', '1')->groupBy('user_id')->having('value', '>=', '2')->get();
|
||||
|
||||
|
||||
@@ -25,31 +25,30 @@ use Illuminate\Support\Facades\DB;
|
||||
class removeFeaturedTorrent extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'removeFeaturedTorrent';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Automatically Removes Featured Torrents If Expired';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$current = Carbon::now();
|
||||
$featured_torrents = FeaturedTorrent::where('created_at','<', $current->copy()->subDays(7)->toDateTimeString())->get();
|
||||
$featured_torrents = FeaturedTorrent::where('created_at', '<', $current->copy()->subDays(7)->toDateTimeString())->get();
|
||||
|
||||
foreach($featured_torrents as $featured_torrent)
|
||||
{
|
||||
foreach ($featured_torrents as $featured_torrent) {
|
||||
// Find The Torrent
|
||||
$torrent = Torrent::where('featured', '=', 1)->where('id', '=', $featured_torrent->torrent_id)->first();
|
||||
$torrent->free = 0;
|
||||
@@ -58,7 +57,7 @@ class removeFeaturedTorrent extends Command
|
||||
$torrent->save();
|
||||
|
||||
// Auto Announce Featured Expired
|
||||
Shoutbox::create(['user' => "1", 'mentions' => "1", 'message' => "Ladies and Gents, [url={{ route('torrents') }}/" .$torrent->slug. "." .$torrent->id. "]" .$torrent->name. "[/url] is no longer featured. :poop:"]);
|
||||
Shoutbox::create(['user' => "1", 'mentions' => "1", 'message' => "Ladies and Gents, [url={{ route('torrents') }}/" . $torrent->slug . "." . $torrent->id . "]" . $torrent->name . "[/url] is no longer featured. :poop:"]);
|
||||
Cache::forget('shoutbox_messages');
|
||||
|
||||
// Delete The Record From DB
|
||||
|
||||
@@ -22,31 +22,30 @@ use Illuminate\Support\Facades\DB;
|
||||
class removeUserFreeleech extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'removeUserFreeleech';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Automatically Removes Users Personal Freeleech If Expired';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$current = Carbon::now();
|
||||
$personal_freeleech = UserFreeleech::where('created_at','<', $current->copy()->subDays(1)->toDateTimeString())->get();
|
||||
$personal_freeleech = UserFreeleech::where('created_at', '<', $current->copy()->subDays(1)->toDateTimeString())->get();
|
||||
|
||||
foreach($personal_freeleech as $pfl)
|
||||
{
|
||||
foreach ($personal_freeleech as $pfl) {
|
||||
// Delete The Record From DB
|
||||
$pfl->delete();
|
||||
|
||||
|
||||
@@ -22,37 +22,36 @@ use Illuminate\Support\Facades\DB;
|
||||
class removeWarning extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'removeWarning';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Automatically Remove User Warnings If Expired';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$current = Carbon::now();
|
||||
$warnings = Warning::with(['warneduser','torrenttitle'])->where('active','=','1')->where('expires_on' ,'<',$current)->get();
|
||||
$warnings = Warning::with(['warneduser', 'torrenttitle'])->where('active', '=', '1')->where('expires_on', '<', $current)->get();
|
||||
|
||||
foreach($warnings as $warning)
|
||||
{
|
||||
foreach ($warnings as $warning) {
|
||||
// Set Records Active To 0 in warnings table
|
||||
$warning->active = "0";
|
||||
$warning->save();
|
||||
|
||||
// PM User That Warning Has Expired
|
||||
PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $warning->warneduser->id, 'subject' => "Hit and Run Warning Removed", 'message' => "The [b]WARNING[/b] you received relating to Torrent ". $warning->torrenttitle->name ." has expired! Try not to get more! [color=red][b]THIS IS AN AUTOMATED SYSTEM MESSAGE, PLEASE DO NOT REPLY![/b][/color]"]);
|
||||
PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $warning->warneduser->id, 'subject' => "Hit and Run Warning Removed", 'message' => "The [b]WARNING[/b] you received relating to Torrent " . $warning->torrenttitle->name . " has expired! Try not to get more! [color=red][b]THIS IS AN AUTOMATED SYSTEM MESSAGE, PLEASE DO NOT REPLY![/b][/color]"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ class Kernel extends ConsoleKernel
|
||||
/**
|
||||
* Define the application's command schedule.
|
||||
*
|
||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||
* @return void
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
@@ -47,6 +47,7 @@ class Kernel extends ConsoleKernel
|
||||
$schedule->command('removeUserFreeleech')->hourly();
|
||||
$schedule->command('removeFeaturedTorrent')->hourly();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the Closure based commands for the application.
|
||||
*
|
||||
|
||||
+11
-10
@@ -14,11 +14,11 @@ class Handler extends ExceptionHandler
|
||||
* @var array
|
||||
*/
|
||||
protected $dontReport = [
|
||||
\Illuminate\Auth\AuthenticationException::class,
|
||||
\Illuminate\Auth\Access\AuthorizationException::class,
|
||||
\Illuminate\Validation\ValidationException::class,
|
||||
\Symfony\Component\HttpKernel\Exception\HttpException::class,
|
||||
\Illuminate\Database\Eloquent\ModelNotFoundException::class,
|
||||
\Illuminate\Auth\AuthenticationException::class,
|
||||
\Illuminate\Auth\Access\AuthorizationException::class,
|
||||
\Illuminate\Validation\ValidationException::class,
|
||||
\Symfony\Component\HttpKernel\Exception\HttpException::class,
|
||||
\Illuminate\Database\Eloquent\ModelNotFoundException::class,
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -36,7 +36,7 @@ class Handler extends ExceptionHandler
|
||||
*
|
||||
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
|
||||
*
|
||||
* @param \Exception $e
|
||||
* @param \Exception $e
|
||||
* @return void
|
||||
*/
|
||||
public function report(Exception $e)
|
||||
@@ -51,19 +51,20 @@ class Handler extends ExceptionHandler
|
||||
/**
|
||||
* Render an exception into an HTTP response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Exception $e
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Exception $e
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function render($request, Exception $e)
|
||||
{
|
||||
return parent::render($request, $e);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an authentication exception into an unauthenticated response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Illuminate\Auth\AuthenticationException $e
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Illuminate\Auth\AuthenticationException $e
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
protected function unauthenticated($request, AuthenticationException $e)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -23,9 +23,9 @@ class FailedLoginAttempt extends Model
|
||||
public static function record($user = null, $username, $ip)
|
||||
{
|
||||
return static::create([
|
||||
'user_id' => is_null($user) ? null : $user->id,
|
||||
'username' => $username,
|
||||
'ip_address' => $ip
|
||||
'user_id' => is_null($user) ? null : $user->id,
|
||||
'username' => $username,
|
||||
'ip_address' => $ip
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
+23
-23
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -24,28 +24,28 @@ class FeaturedTorrent extends Model
|
||||
protected $table = 'featured_torrents';
|
||||
|
||||
/**
|
||||
* Mass assignment fields
|
||||
*
|
||||
*/
|
||||
protected $fillable = ['user_id', 'torrent_id'];
|
||||
* Mass assignment fields
|
||||
*
|
||||
*/
|
||||
protected $fillable = ['user_id', 'torrent_id'];
|
||||
|
||||
/**
|
||||
* Belongs to torrent
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function torrent()
|
||||
{
|
||||
return $this->belongsTo(\App\Torrent::class);
|
||||
}
|
||||
/**
|
||||
* Belongs to torrent
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function torrent()
|
||||
{
|
||||
return $this->belongsTo(\App\Torrent::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs to user
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(\App\User::class);
|
||||
}
|
||||
/**
|
||||
* Belongs to user
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(\App\User::class);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
+8
-8
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -17,16 +17,16 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Graveyard extends Model
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = "graveyard";
|
||||
|
||||
/**
|
||||
* Mass assignment fields
|
||||
*
|
||||
*/
|
||||
* Mass assignment fields
|
||||
*
|
||||
*/
|
||||
protected $fillable = [
|
||||
'user_id', 'torrent_id', 'seedtime'
|
||||
];
|
||||
|
||||
+12
-12
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -17,18 +17,18 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Group extends Model
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = "groups";
|
||||
|
||||
/**
|
||||
* Mass assignment fields
|
||||
*
|
||||
*/
|
||||
* Mass assignment fields
|
||||
*
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name', 'color', 'icon'
|
||||
'name', 'color', 'icon'
|
||||
];
|
||||
|
||||
public $timestamps = false;
|
||||
@@ -52,9 +52,9 @@ class Group extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the requested row from the permissions table
|
||||
*
|
||||
*/
|
||||
* Returns the requested row from the permissions table
|
||||
*
|
||||
*/
|
||||
public function getPermissionsByForum($forum)
|
||||
{
|
||||
return Permission::whereRaw('forum_id = ? AND group_id = ?', [$forum->id, $this->id])->first();
|
||||
|
||||
@@ -20,19 +20,19 @@ class LogActivity
|
||||
|
||||
public static function addToLog($subject)
|
||||
{
|
||||
$log = [];
|
||||
$log['subject'] = $subject;
|
||||
$log['url'] = Request::fullUrl();
|
||||
$log['method'] = Request::method();
|
||||
$log['ip'] = Request::ip();
|
||||
$log['agent'] = Request::header('user-agent');
|
||||
$log['user_id'] = auth()->check() ? auth()->user()->id : 0;
|
||||
LogActivityModel::create($log);
|
||||
$log = [];
|
||||
$log['subject'] = $subject;
|
||||
$log['url'] = Request::fullUrl();
|
||||
$log['method'] = Request::method();
|
||||
$log['ip'] = Request::ip();
|
||||
$log['agent'] = Request::header('user-agent');
|
||||
$log['user_id'] = auth()->check() ? auth()->user()->id : 0;
|
||||
LogActivityModel::create($log);
|
||||
}
|
||||
|
||||
public static function logActivityLists()
|
||||
{
|
||||
return LogActivityModel::latest()->paginate(50);
|
||||
return LogActivityModel::latest()->paginate(50);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+213
-211
@@ -12,239 +12,241 @@
|
||||
|
||||
namespace App\Helpers;
|
||||
|
||||
class MakePrivate {
|
||||
class MakePrivate
|
||||
{
|
||||
|
||||
public $announce = null;
|
||||
public $comment = null;
|
||||
public $created_by = null;
|
||||
public $announce = null;
|
||||
public $comment = null;
|
||||
public $created_by = null;
|
||||
|
||||
function __construct() {
|
||||
// We can choose to load default announce URL, comment and created_by from a configuration file.
|
||||
}
|
||||
function __construct()
|
||||
{
|
||||
// We can choose to load default announce URL, comment and created_by from a configuration file.
|
||||
}
|
||||
|
||||
/**
|
||||
* Data Setter
|
||||
* @param array $data [array of public variables]
|
||||
*/
|
||||
public function set($data=array())
|
||||
{
|
||||
if ( is_array($data) ) {
|
||||
if ( isset($data['announce']) ) {
|
||||
$this->announce = $data['announce'];
|
||||
}
|
||||
if ( isset($data['comment']) ) {
|
||||
$this->comment = $data['comment'];
|
||||
}
|
||||
if ( isset($data['created_by']) ) {
|
||||
$this->created_by = $data['created_by'];
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Data Setter
|
||||
* @param array $data [array of public variables]
|
||||
*/
|
||||
public function set($data = array())
|
||||
{
|
||||
if (is_array($data)) {
|
||||
if (isset($data['announce'])) {
|
||||
$this->announce = $data['announce'];
|
||||
}
|
||||
if (isset($data['comment'])) {
|
||||
$this->comment = $data['comment'];
|
||||
}
|
||||
if (isset($data['created_by'])) {
|
||||
$this->created_by = $data['created_by'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode a torrent file into Bencoded data
|
||||
* @param string $s [link to torrent file]
|
||||
* @param integer $pos [file position pointer]
|
||||
* @return array/null [Array of Bencoded data]
|
||||
*/
|
||||
public function bdecode($s, &$pos=0)
|
||||
{
|
||||
if($pos>=strlen($s)) {
|
||||
return null;
|
||||
}
|
||||
switch($s[$pos]){
|
||||
case 'd':
|
||||
$pos++;
|
||||
$retval=array();
|
||||
while ($s[$pos]!='e'){
|
||||
$key=$this->bdecode($s, $pos);
|
||||
$val=$this->bdecode($s, $pos);
|
||||
if ($key===null || $val===null)
|
||||
break;
|
||||
$retval[$key]=$val;
|
||||
}
|
||||
$retval["isDct"]=true;
|
||||
$pos++;
|
||||
return $retval;
|
||||
/**
|
||||
* Decode a torrent file into Bencoded data
|
||||
* @param string $s [link to torrent file]
|
||||
* @param integer $pos [file position pointer]
|
||||
* @return array/null [Array of Bencoded data]
|
||||
*/
|
||||
public function bdecode($s, &$pos = 0)
|
||||
{
|
||||
if ($pos >= strlen($s)) {
|
||||
return null;
|
||||
}
|
||||
switch ($s[$pos]) {
|
||||
case 'd':
|
||||
$pos++;
|
||||
$retval = array();
|
||||
while ($s[$pos] != 'e') {
|
||||
$key = $this->bdecode($s, $pos);
|
||||
$val = $this->bdecode($s, $pos);
|
||||
if ($key === null || $val === null)
|
||||
break;
|
||||
$retval[$key] = $val;
|
||||
}
|
||||
$retval["isDct"] = true;
|
||||
$pos++;
|
||||
return $retval;
|
||||
|
||||
case 'l':
|
||||
$pos++;
|
||||
$retval=array();
|
||||
while ($s[$pos]!='e'){
|
||||
$val=$this->bdecode($s, $pos);
|
||||
if ($val===null)
|
||||
break;
|
||||
$retval[]=$val;
|
||||
}
|
||||
$pos++;
|
||||
return $retval;
|
||||
case 'l':
|
||||
$pos++;
|
||||
$retval = array();
|
||||
while ($s[$pos] != 'e') {
|
||||
$val = $this->bdecode($s, $pos);
|
||||
if ($val === null)
|
||||
break;
|
||||
$retval[] = $val;
|
||||
}
|
||||
$pos++;
|
||||
return $retval;
|
||||
|
||||
case 'i':
|
||||
$pos++;
|
||||
$digits=strpos($s, 'e', $pos)-$pos;
|
||||
$val=round((float)substr($s, $pos, $digits));
|
||||
$pos+=$digits+1;
|
||||
return $val;
|
||||
case 'i':
|
||||
$pos++;
|
||||
$digits = strpos($s, 'e', $pos) - $pos;
|
||||
$val = round((float)substr($s, $pos, $digits));
|
||||
$pos += $digits + 1;
|
||||
return $val;
|
||||
|
||||
// case "0": case "1": case "2": case "3": case "4":
|
||||
// case "5": case "6": case "7": case "8": case "9":
|
||||
default:
|
||||
$digits=strpos($s, ':', $pos)-$pos;
|
||||
if ($digits<0 || $digits >20)
|
||||
return null;
|
||||
$len=(int)substr($s, $pos, $digits);
|
||||
$pos+=$digits+1;
|
||||
$str=substr($s, $pos, $len);
|
||||
$pos+=$len;
|
||||
//echo "pos: $pos str: [$str] len: $len digits: $digits\n";
|
||||
return (string)$str;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
// case "0": case "1": case "2": case "3": case "4":
|
||||
// case "5": case "6": case "7": case "8": case "9":
|
||||
default:
|
||||
$digits = strpos($s, ':', $pos) - $pos;
|
||||
if ($digits < 0 || $digits > 20)
|
||||
return null;
|
||||
$len = (int)substr($s, $pos, $digits);
|
||||
$pos += $digits + 1;
|
||||
$str = substr($s, $pos, $len);
|
||||
$pos += $len;
|
||||
//echo "pos: $pos str: [$str] len: $len digits: $digits\n";
|
||||
return (string)$str;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Created Torrent file from Bencoded data
|
||||
* @param array $d [array data of a decoded torrent file]
|
||||
* @return string [data can be downloaded as torrent]
|
||||
*/
|
||||
public function bencode(&$d)
|
||||
{
|
||||
if(is_array($d)){
|
||||
$ret="l";
|
||||
$isDict = false;
|
||||
if( isset($d["isDct"]) && $d["isDct"]===true ){
|
||||
$isDict=1;
|
||||
$ret="d";
|
||||
// this is required by the specs, and BitTornado actualy chokes on unsorted dictionaries
|
||||
ksort($d, SORT_STRING);
|
||||
}
|
||||
foreach($d as $key=>$value) {
|
||||
if($isDict){
|
||||
// skip the isDct element, only if it's set by us
|
||||
if($key=="isDct" and is_bool($value)) continue;
|
||||
$ret.=strlen($key).":".$key;
|
||||
}
|
||||
if (is_int($value) || is_float($value)){
|
||||
$ret.="i${value}e";
|
||||
}else if (is_string($value)) {
|
||||
$ret.=strlen($value).":".$value;
|
||||
} else {
|
||||
$ret.=$this->bencode ($value);
|
||||
}
|
||||
}
|
||||
return $ret."e";
|
||||
} elseif (is_string($d)) // fallback if we're given a single bencoded string or int
|
||||
return strlen($d).":".$d;
|
||||
elseif (is_int($d) || is_float($d))
|
||||
return "i${d}e";
|
||||
else
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Created Torrent file from Bencoded data
|
||||
* @param array $d [array data of a decoded torrent file]
|
||||
* @return string [data can be downloaded as torrent]
|
||||
*/
|
||||
public function bencode(&$d)
|
||||
{
|
||||
if (is_array($d)) {
|
||||
$ret = "l";
|
||||
$isDict = false;
|
||||
if (isset($d["isDct"]) && $d["isDct"] === true) {
|
||||
$isDict = 1;
|
||||
$ret = "d";
|
||||
// this is required by the specs, and BitTornado actualy chokes on unsorted dictionaries
|
||||
ksort($d, SORT_STRING);
|
||||
}
|
||||
foreach ($d as $key => $value) {
|
||||
if ($isDict) {
|
||||
// skip the isDct element, only if it's set by us
|
||||
if ($key == "isDct" and is_bool($value)) continue;
|
||||
$ret .= strlen($key) . ":" . $key;
|
||||
}
|
||||
if (is_int($value) || is_float($value)) {
|
||||
$ret .= "i${value}e";
|
||||
} else if (is_string($value)) {
|
||||
$ret .= strlen($value) . ":" . $value;
|
||||
} else {
|
||||
$ret .= $this->bencode($value);
|
||||
}
|
||||
}
|
||||
return $ret . "e";
|
||||
} elseif (is_string($d)) // fallback if we're given a single bencoded string or int
|
||||
return strlen($d) . ":" . $d;
|
||||
elseif (is_int($d) || is_float($d))
|
||||
return "i${d}e";
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode a torrent file into Bencoded data
|
||||
* @param string $filename [File Path]
|
||||
* @return array/null [Array of Bencoded data]
|
||||
*/
|
||||
public function bdecode_file($filename)
|
||||
{
|
||||
if ( is_file($filename) ) {
|
||||
$f=file_get_contents($filename, FILE_BINARY);
|
||||
return $this->bdecode($f);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Decode a torrent file into Bencoded data
|
||||
* @param string $filename [File Path]
|
||||
* @return array/null [Array of Bencoded data]
|
||||
*/
|
||||
public function bdecode_file($filename)
|
||||
{
|
||||
if (is_file($filename)) {
|
||||
$f = file_get_contents($filename, FILE_BINARY);
|
||||
return $this->bdecode($f);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate list of files in a torrent
|
||||
* @param array $data [array data of a decoded torrent file]
|
||||
* @return array [list of files in an array]
|
||||
*/
|
||||
public function filelist($data)
|
||||
{
|
||||
$FileCount = 0;
|
||||
$FileList = array();
|
||||
if(!isset($data['info']['files']) ) // Single file mode
|
||||
{
|
||||
$FileCount = 1;
|
||||
$TotalSize = $data['info']['length'];
|
||||
$FileList[]= array($data['info']['length'], $data['info']['name']);
|
||||
} else { // Multiple file mode
|
||||
$FileNames = array();
|
||||
$TotalSize = 0;
|
||||
$Files = $data['info']['files'];
|
||||
foreach($Files as $File) {
|
||||
$FileCount++;
|
||||
$TotalSize+=$File['length'];
|
||||
$FileSize = $File['length'];
|
||||
/**
|
||||
* Generate list of files in a torrent
|
||||
* @param array $data [array data of a decoded torrent file]
|
||||
* @return array [list of files in an array]
|
||||
*/
|
||||
public function filelist($data)
|
||||
{
|
||||
$FileCount = 0;
|
||||
$FileList = array();
|
||||
if (!isset($data['info']['files'])) // Single file mode
|
||||
{
|
||||
$FileCount = 1;
|
||||
$TotalSize = $data['info']['length'];
|
||||
$FileList[] = array($data['info']['length'], $data['info']['name']);
|
||||
} else { // Multiple file mode
|
||||
$FileNames = array();
|
||||
$TotalSize = 0;
|
||||
$Files = $data['info']['files'];
|
||||
foreach ($Files as $File) {
|
||||
$FileCount++;
|
||||
$TotalSize += $File['length'];
|
||||
$FileSize = $File['length'];
|
||||
|
||||
$FileName = ltrim(implode('/',$File['path']), '/');
|
||||
$FileName = ltrim(implode('/', $File['path']), '/');
|
||||
|
||||
$FileList[] = array('size'=>$FileSize, 'name'=>$FileName);
|
||||
$FileNames[] = $FileName;
|
||||
}
|
||||
array_multisort($FileNames, $FileList);
|
||||
}
|
||||
return array('file_count'=>$FileCount, 'total_size'=>$TotalSize, 'files'=>$FileList);
|
||||
}
|
||||
$FileList[] = array('size' => $FileSize, 'name' => $FileName);
|
||||
$FileNames[] = $FileName;
|
||||
}
|
||||
array_multisort($FileNames, $FileList);
|
||||
}
|
||||
return array('file_count' => $FileCount, 'total_size' => $TotalSize, 'files' => $FileList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace array data on Decoded torrent data so that it can be bencoded into a private torrent file.
|
||||
* Provide the custom data using $this->set();
|
||||
* @param array $data [array data of a decoded torrent file]
|
||||
* @return array [array data for torrent file]
|
||||
*/
|
||||
public function make_private($data)
|
||||
{
|
||||
// Remove announce
|
||||
// announce-list is an unofficial extension to the protocol that allows for multiple trackers per torrent
|
||||
unset($data['announce']);
|
||||
unset($data['announce-list']);
|
||||
/**
|
||||
* Replace array data on Decoded torrent data so that it can be bencoded into a private torrent file.
|
||||
* Provide the custom data using $this->set();
|
||||
* @param array $data [array data of a decoded torrent file]
|
||||
* @return array [array data for torrent file]
|
||||
*/
|
||||
public function make_private($data)
|
||||
{
|
||||
// Remove announce
|
||||
// announce-list is an unofficial extension to the protocol that allows for multiple trackers per torrent
|
||||
unset($data['announce']);
|
||||
unset($data['announce-list']);
|
||||
|
||||
// Bitcomet & Azureus cache peers in here
|
||||
unset($data['nodes']);
|
||||
// Bitcomet & Azureus cache peers in here
|
||||
unset($data['nodes']);
|
||||
|
||||
// Azureus stores the dht_backup_enable flag here
|
||||
unset($data['azureus_properties']);
|
||||
// Azureus stores the dht_backup_enable flag here
|
||||
unset($data['azureus_properties']);
|
||||
|
||||
// Remove web-seeds
|
||||
unset($data['url-list']);
|
||||
// Remove web-seeds
|
||||
unset($data['url-list']);
|
||||
|
||||
// Remove libtorrent resume info
|
||||
unset($data['libtorrent_resume']);
|
||||
// Remove libtorrent resume info
|
||||
unset($data['libtorrent_resume']);
|
||||
|
||||
// Remove profiles / Media Infos
|
||||
unset($data['info']['profiles']);
|
||||
unset($data['info']['file-duration']);
|
||||
unset($data['info']['file-media']);
|
||||
// Remove profiles / Media Infos
|
||||
unset($data['info']['profiles']);
|
||||
unset($data['info']['file-duration']);
|
||||
unset($data['info']['file-media']);
|
||||
|
||||
// Add Announce URL
|
||||
if ( is_array($this->announce) ) {
|
||||
$data['announce'] = reset($this->announce);
|
||||
$data["announce-list"] = array();
|
||||
$announce_list = array();
|
||||
foreach ($this->announce as $announceUri) {
|
||||
$announce_list[] = $announceUri;
|
||||
}
|
||||
$data["announce-list"] = $announce_list;
|
||||
} else {
|
||||
$data['announce'] = $this->announce;
|
||||
}
|
||||
// Add Announce URL
|
||||
if (is_array($this->announce)) {
|
||||
$data['announce'] = reset($this->announce);
|
||||
$data["announce-list"] = array();
|
||||
$announce_list = array();
|
||||
foreach ($this->announce as $announceUri) {
|
||||
$announce_list[] = $announceUri;
|
||||
}
|
||||
$data["announce-list"] = $announce_list;
|
||||
} else {
|
||||
$data['announce'] = $this->announce;
|
||||
}
|
||||
|
||||
// Add Comment
|
||||
$data['comment'] = $this->comment;
|
||||
// Add Comment
|
||||
$data['comment'] = $this->comment;
|
||||
|
||||
// Created by and Created on
|
||||
$data['created by'] = $this->created_by;
|
||||
$data['creation date'] = time();
|
||||
// Created by and Created on
|
||||
$data['created by'] = $this->created_by;
|
||||
$data['creation date'] = time();
|
||||
|
||||
// Make Private
|
||||
$data['info']['private'] = 1;
|
||||
// Make Private
|
||||
$data['info']['private'] = 1;
|
||||
|
||||
// Sort by key to respect spec
|
||||
ksort($data['info']);
|
||||
ksort($data);
|
||||
// Sort by key to respect spec
|
||||
ksort($data['info']);
|
||||
ksort($data);
|
||||
|
||||
return $data;
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Helpers;
|
||||
|
||||
class MediaInfo
|
||||
@@ -294,13 +294,13 @@ class MediaInfo
|
||||
|
||||
private function computerSize($number, $size)
|
||||
{
|
||||
$bytes = (float) $number;
|
||||
$bytes = (float)$number;
|
||||
$size = strtolower($size);
|
||||
|
||||
$factors = ['b' => 0, 'kb' => 1, 'mb' => 2, 'gb' => 3, 'tb' => 4, 'pb' => 5, 'eb' => 6, 'zb' => 7, 'yb' => 8];
|
||||
|
||||
if (isset($factors[$size])) {
|
||||
return (float) number_format($bytes * pow(1024, $factors[$size]), 2, '.', '');
|
||||
return (float)number_format($bytes * pow(1024, $factors[$size]), 2, '.', '');
|
||||
}
|
||||
|
||||
return $bytes;
|
||||
|
||||
@@ -52,10 +52,10 @@ class StringHelper
|
||||
}
|
||||
|
||||
/**
|
||||
* @method timeElapsed
|
||||
* @param $seconds time in bigInt
|
||||
* @return String
|
||||
*/
|
||||
* @method timeElapsed
|
||||
* @param $seconds time in bigInt
|
||||
* @return String
|
||||
*/
|
||||
public static function timeElapsed($seconds)
|
||||
{
|
||||
$minutes = 0;
|
||||
@@ -92,13 +92,13 @@ class StringHelper
|
||||
$minutes++;
|
||||
$seconds -= 60;
|
||||
}
|
||||
$years = ($years == 0) ? "" : $years."Y ";
|
||||
$months = ($months == 0) ? "" : $months."M ";
|
||||
$weeks = ($weeks == 0) ? "" : $weeks."W ";
|
||||
$days = ($days == 0) ? "" : $days."D ";
|
||||
$hours = ($hours == 0) ? "" : $hours."h ";
|
||||
$minutes = ($minutes == 0) ? "" : $minutes."m ";
|
||||
$seconds = ($seconds == 0) ? "" : $seconds."s";
|
||||
$years = ($years == 0) ? "" : $years . "Y ";
|
||||
$months = ($months == 0) ? "" : $months . "M ";
|
||||
$weeks = ($weeks == 0) ? "" : $weeks . "W ";
|
||||
$days = ($days == 0) ? "" : $days . "D ";
|
||||
$hours = ($hours == 0) ? "" : $hours . "h ";
|
||||
$minutes = ($minutes == 0) ? "" : $minutes . "m ";
|
||||
$seconds = ($seconds == 0) ? "" : $seconds . "s";
|
||||
return $years . $months . $weeks . $days . $hours . $minutes . $seconds;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,9 +38,9 @@ class TorrentViewHelper
|
||||
$client = new MovieScrapper(config('api-keys.tmdb'), config('api-keys.tvdb'), config('api-keys.omdb'));
|
||||
|
||||
if ($list->category_id == 2) {
|
||||
$movie = $client->scrape('tv', 'tt'.$list->imdb);
|
||||
$movie = $client->scrape('tv', 'tt' . $list->imdb);
|
||||
} else {
|
||||
$movie = $client->scrape('movie', 'tt'.$list->imdb);
|
||||
$movie = $client->scrape('movie', 'tt' . $list->imdb);
|
||||
}
|
||||
|
||||
if ($user->show_poster == 1) {
|
||||
@@ -76,17 +76,17 @@ class TorrentViewHelper
|
||||
}
|
||||
|
||||
if ($user->ratings == 1) {
|
||||
$link = "https://anon.to?http://www.imdb.com/title/tt".$list->imdb;
|
||||
$rating = $movie->imdbRating;
|
||||
$votes = $movie->imdbVotes;
|
||||
$link = "https://anon.to?http://www.imdb.com/title/tt" . $list->imdb;
|
||||
$rating = $movie->imdbRating;
|
||||
$votes = $movie->imdbVotes;
|
||||
} else {
|
||||
$rating = $movie->tmdbRating;
|
||||
$votes = $movie->tmdbVotes;
|
||||
if ($list->category_id == '2') {
|
||||
$link = "https://www.themoviedb.org/tv/".$movie->tmdb;
|
||||
} else {
|
||||
$link = "https://www.themoviedb.org/movie/".$movie->tmdb;
|
||||
}
|
||||
$rating = $movie->tmdbRating;
|
||||
$votes = $movie->tmdbVotes;
|
||||
if ($list->category_id == '2') {
|
||||
$link = "https://www.themoviedb.org/tv/" . $movie->tmdb;
|
||||
} else {
|
||||
$link = "https://www.themoviedb.org/movie/" . $movie->tmdb;
|
||||
}
|
||||
}
|
||||
|
||||
$thank_count = $list->thanks()->count();
|
||||
@@ -97,14 +97,14 @@ class TorrentViewHelper
|
||||
$icons .= "<span class='badge-extra text-bold'><i class='fa fa-play text-red' data-toggle='tooltip' title='' data-original-title='Stream Optimized'></i> Stream Optimized</span>";
|
||||
}
|
||||
|
||||
if($list->featured == "0"){
|
||||
if ($list->doubleup == "1") {
|
||||
$icons .= "<span class='badge-extra text-bold'><i class='fa fa-diamond text-green' data-toggle='tooltip' title='' data-original-title='Double upload'></i> Double Upload</span>";
|
||||
}
|
||||
if ($list->featured == "0") {
|
||||
if ($list->doubleup == "1") {
|
||||
$icons .= "<span class='badge-extra text-bold'><i class='fa fa-diamond text-green' data-toggle='tooltip' title='' data-original-title='Double upload'></i> Double Upload</span>";
|
||||
}
|
||||
|
||||
if ($list->free == "1") {
|
||||
$icons .= "<span class='badge-extra text-bold'><i class='fa fa-star text-gold' data-toggle='tooltip' title='' data-original-title='100% Free'></i> 100% Free</span>";
|
||||
}
|
||||
if ($list->free == "1") {
|
||||
$icons .= "<span class='badge-extra text-bold'><i class='fa fa-star text-gold' data-toggle='tooltip' title='' data-original-title='100% Free'></i> 100% Free</span>";
|
||||
}
|
||||
}
|
||||
|
||||
if ($personal_freeleech) {
|
||||
@@ -153,8 +153,8 @@ class TorrentViewHelper
|
||||
$common_times = trans('common.times');
|
||||
|
||||
|
||||
$data[] = $sticky.
|
||||
"<td>".$poster."</td>
|
||||
$data[] = $sticky .
|
||||
"<td>" . $poster . "</td>
|
||||
<td>
|
||||
<center>
|
||||
<a href='{$category_link}'>{$category}</a>
|
||||
@@ -187,7 +187,7 @@ class TorrentViewHelper
|
||||
</td>
|
||||
|
||||
<td><time datetime='{$datetime}'>{$datetime_inner}</time></td>
|
||||
<td><span class='badge-extra text-blue text-bold'>".$list->getSize()."</span></td>
|
||||
<td><span class='badge-extra text-blue text-bold'>" . $list->getSize() . "</span></td>
|
||||
<td><span class='badge-extra text-orange text-bold'>{$list->times_completed} {$common_times}</span></td>
|
||||
<td><span class='badge-extra text-green text-bold'>{$list->seeders}</span></td>
|
||||
<td><span class='badge-extra text-red text-bold'>{$list->leechers}</span></td>
|
||||
|
||||
+2
-2
@@ -17,7 +17,7 @@ use Kyslik\ColumnSortable\Sortable;
|
||||
|
||||
class History extends Model
|
||||
{
|
||||
use Sortable;
|
||||
use Sortable;
|
||||
|
||||
public $sortable = ['id', 'agent', 'active', 'seeder', 'uploaded', 'downloaded', 'seedtime', 'created_at', 'updated_at', 'completed_at'];
|
||||
|
||||
@@ -29,7 +29,7 @@ class History extends Model
|
||||
*/
|
||||
protected $table = 'history';
|
||||
|
||||
protected $fillable = ['user_id','info_hash'];
|
||||
protected $fillable = ['user_id', 'info_hash'];
|
||||
|
||||
protected $dates = ['completed_at'];
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\User;
|
||||
@@ -18,11 +18,11 @@ class AchievementsController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Show User Achievements
|
||||
*
|
||||
* @access public
|
||||
* @return user.achievements
|
||||
*/
|
||||
* Show User Achievements
|
||||
*
|
||||
* @access public
|
||||
* @return user.achievements
|
||||
*/
|
||||
public function index($username, $id)
|
||||
{
|
||||
$user = User::findOrFail($id);
|
||||
|
||||
@@ -31,12 +31,12 @@ class AnnounceController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Announce code
|
||||
*
|
||||
* @access public
|
||||
* @param $Passkey User passkey
|
||||
* @return Bencoded response for the torrent client
|
||||
*/
|
||||
* Announce code
|
||||
*
|
||||
* @access public
|
||||
* @param $Passkey User passkey
|
||||
* @return Bencoded response for the torrent client
|
||||
*/
|
||||
public function announce(Request $request, $passkey)
|
||||
{
|
||||
// Browser safety check
|
||||
@@ -48,7 +48,7 @@ class AnnounceController extends Controller
|
||||
}
|
||||
|
||||
// If User Client Is Not Sending Required Data Return Error to Client
|
||||
if (! $request->has('info_hash') || ! $request->has('peer_id') || ! $request->has('port') || ! $request->has('left') || ! $request->has('uploaded') || ! $request->has('downloaded')) {
|
||||
if (!$request->has('info_hash') || !$request->has('peer_id') || !$request->has('port') || !$request->has('left') || !$request->has('uploaded') || !$request->has('downloaded')) {
|
||||
return response(Bencode::bencode(['failure reason' => 'Bad Data from client']), 200, ['Content-Type' => 'text/plain']);
|
||||
}
|
||||
|
||||
@@ -71,9 +71,9 @@ class AnnounceController extends Controller
|
||||
$peer_id = bin2hex($request->get('peer_id'));
|
||||
$md5_peer_id = md5($peer_id);
|
||||
$ip = $request->ip();
|
||||
$port = (int) $request->get('port');
|
||||
$left = (float) $request->get('left');
|
||||
$uploaded = (float) $request->get('uploaded');
|
||||
$port = (int)$request->get('port');
|
||||
$left = (float)$request->get('left');
|
||||
$uploaded = (float)$request->get('uploaded');
|
||||
$real_uploaded = $uploaded;
|
||||
$downloaded = (float )$request->get('downloaded');
|
||||
$real_downloaded = $downloaded;
|
||||
@@ -92,7 +92,7 @@ class AnnounceController extends Controller
|
||||
}
|
||||
|
||||
// If User Client Does Not Support Compact Return Error to Client
|
||||
if (! $compact) {
|
||||
if (!$compact) {
|
||||
return response(Bencode::bencode(['failure reason' => "Your client doesn't support compact, please update your client"]), 200, ['Content-Type' => 'text/plain']);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ class AnnounceController extends Controller
|
||||
}
|
||||
|
||||
unset($p['id'], $p['md5_peer_id'], $p['hash'], $p['agent'], $p['uploaded'], $p['downloaded'], $p['left'], $p['torrent_id'],
|
||||
$p['user_id'], $p['seeder'], $p['created_at'], $p['updated_at']);
|
||||
$p['user_id'], $p['seeder'], $p['created_at'], $p['updated_at']);
|
||||
}
|
||||
|
||||
// Pull Count On Users Peers Per Torrent
|
||||
@@ -134,9 +134,9 @@ class AnnounceController extends Controller
|
||||
$ghost = false;
|
||||
|
||||
// Creates a new client if not existing
|
||||
if (! $client && $event == 'completed') {
|
||||
if (!$client && $event == 'completed') {
|
||||
return response(Bencode::bencode(['failure reason' => 'Torrent is complete but no record found.']), 200, ['Content-Type' => 'text/plain']);
|
||||
} elseif (! $client) {
|
||||
} elseif (!$client) {
|
||||
if ($uploaded > 0 || $downloaded > 0) {
|
||||
$ghost = true;
|
||||
}
|
||||
@@ -146,7 +146,7 @@ class AnnounceController extends Controller
|
||||
// Get history information
|
||||
$history = History::where("info_hash", "=", $hash)->where("user_id", "=", $user->id)->first();
|
||||
|
||||
if (! $history) {
|
||||
if (!$history) {
|
||||
$history = new History([
|
||||
"user_id" => $user->id,
|
||||
"info_hash" => $hash
|
||||
@@ -382,7 +382,7 @@ class AnnounceController extends Controller
|
||||
$pcomp .= pack('Nn', ip2long($p['ip']), (int)$p['port']);
|
||||
}
|
||||
}
|
||||
return $pcomp ;
|
||||
return $pcomp;
|
||||
} elseif ($no_peer_id) {
|
||||
foreach ($peers as &$p) {
|
||||
unset($p['peer_id']);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Article;
|
||||
|
||||
@@ -23,8 +23,8 @@ class ActivationController extends Controller
|
||||
|
||||
public function activate($token)
|
||||
{
|
||||
$activation = UserActivation::with('user')->where('token', $token)->firstOrFail();
|
||||
if (!empty($activation->user->id) && $activation->user->group->id != 5 ) {
|
||||
$activation = UserActivation::with('user')->where('token', $token)->firstOrFail();
|
||||
if (!empty($activation->user->id) && $activation->user->group->id != 5) {
|
||||
$activation->user->active = true;
|
||||
$activation->user->group_id = $this->group_id;
|
||||
$activation->user->save();
|
||||
@@ -33,9 +33,9 @@ class ActivationController extends Controller
|
||||
\LogActivity::addToLog("Member " . $activation->user->username . " has successfully activated his/her account.");
|
||||
|
||||
$activation->delete();
|
||||
return redirect('login')->with(Toastr::success('Account Confirmed! You May Now Login!', 'Yay!', ['options']));
|
||||
} else {
|
||||
return redirect('login')->with(Toastr::warning('Banned or Invalid Token Or Account Already Confirmed!', 'Whoops!', ['options']));
|
||||
}
|
||||
return redirect('login')->with(Toastr::success('Account Confirmed! You May Now Login!', 'Yay!', ['options']));
|
||||
} else {
|
||||
return redirect('login')->with(Toastr::warning('Banned or Invalid Token Or Account Already Confirmed!', 'Whoops!', ['options']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,22 +75,22 @@ class RegisterController extends Controller
|
||||
$user->save();
|
||||
|
||||
if ($key) {
|
||||
// Update The Invite Record
|
||||
$key->accepted_by = $user->id;
|
||||
$key->accepted_at = new Carbon();
|
||||
$key->save();
|
||||
// Update The Invite Record
|
||||
$key->accepted_by = $user->id;
|
||||
$key->accepted_at = new Carbon();
|
||||
$key->save();
|
||||
}
|
||||
|
||||
// Handle The Activation System
|
||||
$token = hash_hmac('sha256', $user->username . $user->email . str_random(16), config('app.key'));
|
||||
UserActivation::create([
|
||||
'user_id' => $user->id,
|
||||
'token' => $token,
|
||||
'token' => $token,
|
||||
]);
|
||||
$this->dispatch(new SendActivationMail($user, $token));
|
||||
|
||||
// Post To Shoutbox
|
||||
Shoutbox::create(['user' => "1", 'mentions' => "1", 'message' => "Welcome [url={{ route('home') }}/" .$user->username. "." .$user->id. "]" .$user->username. "[/url] hope you enjoy the community :rocket:"]);
|
||||
Shoutbox::create(['user' => "1", 'mentions' => "1", 'message' => "Welcome [url={{ route('home') }}/" . $user->username . "." . $user->id . "]" . $user->username . "[/url] hope you enjoy the community :rocket:"]);
|
||||
Cache::forget('shoutbox_messages');
|
||||
|
||||
// Send Welcome PM
|
||||
|
||||
@@ -22,9 +22,9 @@ class ResetPasswordController extends Controller
|
||||
protected function resetPassword($user, $password)
|
||||
{
|
||||
$user->forceFill([
|
||||
'password' => bcrypt($password),
|
||||
'password' => bcrypt($password),
|
||||
'remember_token' => Str::random(60),
|
||||
'active' => true,
|
||||
'active' => true,
|
||||
])->save();
|
||||
|
||||
// Activity Log
|
||||
@@ -38,8 +38,8 @@ class ResetPasswordController extends Controller
|
||||
protected function rules()
|
||||
{
|
||||
return [
|
||||
'token' => 'required',
|
||||
'email' => 'required|email',
|
||||
'token' => 'required',
|
||||
'email' => 'required|email',
|
||||
'password' => 'required|confirmed|min:8',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -34,12 +34,12 @@ class BonusController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Bonus System
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return view::make bonus.bonus
|
||||
*/
|
||||
* Bonus System
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return view::make bonus.bonus
|
||||
*/
|
||||
public function bonus()
|
||||
{
|
||||
$user = Auth::user();
|
||||
@@ -79,28 +79,28 @@ class BonusController extends Controller
|
||||
|
||||
//Total points per hour
|
||||
$total =
|
||||
($dying * 2) + ($legendary * 1.5) + ($old * 1) + ($huge * 0.75) + ($large * 0.50) + ($regular * 0.25)
|
||||
+ ($participaint * 0.25) + ($teamplayer * 0.50) + ($commited * 0.75) + ($mvp * 1) + ($legendary * 2);
|
||||
($dying * 2) + ($legendary * 1.5) + ($old * 1) + ($huge * 0.75) + ($large * 0.50) + ($regular * 0.25)
|
||||
+ ($participaint * 0.25) + ($teamplayer * 0.50) + ($commited * 0.75) + ($mvp * 1) + ($legendary * 2);
|
||||
|
||||
return view('bonus.bonus', ['activefl' => $activefl , 'userbon' => $userbon , 'uploadOptions' => $uploadOptions ,
|
||||
'downloadOptions' => $downloadOptions , 'personalFreeleech' => $personalFreeleech , 'invite' => $invite,
|
||||
'dying' => $dying , 'legendary' => $legendary , 'old' => $old ,
|
||||
'huge' => $huge, 'large' => $large , 'regular' => $regular ,
|
||||
'participaint' => $participaint , 'teamplayer' => $teamplayer , 'commited' => $commited , 'mvp' => $mvp , 'legendary' => $legendary ,
|
||||
return view('bonus.bonus', ['activefl' => $activefl, 'userbon' => $userbon, 'uploadOptions' => $uploadOptions,
|
||||
'downloadOptions' => $downloadOptions, 'personalFreeleech' => $personalFreeleech, 'invite' => $invite,
|
||||
'dying' => $dying, 'legendary' => $legendary, 'old' => $old,
|
||||
'huge' => $huge, 'large' => $large, 'regular' => $regular,
|
||||
'participaint' => $participaint, 'teamplayer' => $teamplayer, 'commited' => $commited, 'mvp' => $mvp, 'legendary' => $legendary,
|
||||
'total' => $total]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @method exchange
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* This method is used when a USER exchanges their points into items
|
||||
*
|
||||
* @param $id This refers to the ID of the exchange item
|
||||
*
|
||||
* @return Redirect::to /bonus
|
||||
*/
|
||||
* @method exchange
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* This method is used when a USER exchanges their points into items
|
||||
*
|
||||
* @param $id This refers to the ID of the exchange item
|
||||
*
|
||||
* @return Redirect::to /bonus
|
||||
*/
|
||||
public function exchange($id)
|
||||
{
|
||||
$user = Auth::user();
|
||||
@@ -126,15 +126,15 @@ class BonusController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @method doItemExchange
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param $userID The person initiating the transaction
|
||||
* @param $itemID This is the exchange item ID
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
* @method doItemExchange
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param $userID The person initiating the transaction
|
||||
* @param $itemID This is the exchange item ID
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function doItemExchange($userID, $itemID)
|
||||
{
|
||||
$item = BonExchange::where('id', '=', $itemID)->get()->toArray()[0];
|
||||
@@ -163,9 +163,9 @@ class BonusController extends Controller
|
||||
}
|
||||
} elseif ($item['invite'] == true) {
|
||||
if ($user_acc->invites += $item['value']) {
|
||||
$user_acc->save();
|
||||
} else {
|
||||
return false;
|
||||
$user_acc->save();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,12 +181,12 @@ class BonusController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @method gift
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
* @method gift
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function gift()
|
||||
{
|
||||
$user = Auth::user();
|
||||
@@ -201,7 +201,7 @@ class BonusController extends Controller
|
||||
if ($v->passes()) {
|
||||
$recipient = User::where('username', 'LIKE', Request::get('to_username'))->first();
|
||||
|
||||
if (! $recipient || $recipient->id == $user->id) {
|
||||
if (!$recipient || $recipient->id == $user->id) {
|
||||
return Redirect::to('/bonus')->with(Toastr::error('Unable to find specified user', 'Gifting Failed', ['options']));
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ class BonusController extends Controller
|
||||
|
||||
$appurl = env('APP_URL', 'http://unit3d.site');
|
||||
Shoutbox::create(['user' => "1", 'mentions' => "1", 'message' => "User [url={$appurl}/" . $user->username . "." . $user->id . "]" . $user->username . "[/url] has gifted " . $value . "BON to [url={$appurl}/"
|
||||
.$recipient->username. "." .$recipient->id. "]" .$recipient->username. "[/url]"]);
|
||||
. $recipient->username . "." . $recipient->id . "]" . $recipient->username . "[/url]"]);
|
||||
Cache::forget('shoutbox_messages');
|
||||
|
||||
PrivateMessage::create(['sender_id' => $user->id, 'reciever_id' => $recipient->id, 'subject' => "You Have Recieved A Gift", 'message' => $transaction->comment]);
|
||||
@@ -240,51 +240,51 @@ class BonusController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @method tipUploader
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
* @method tipUploader
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function tipUploader($slug, $id)
|
||||
{
|
||||
$user = Auth::user();
|
||||
$torrent = Torrent::withAnyStatus()->findOrFail($id);
|
||||
$uploader = User::where('id', '=', $torrent->user_id)->first();
|
||||
|
||||
$tip_amount = Request::get('tip');
|
||||
if ($tip_amount > $user->seedbonus) {
|
||||
return Redirect::route('torrent', ['slug' => $torrent->slug, 'id' => $torrent->id])->with(Toastr::error('Your To Broke To Tip The Uploader!', 'Bro!', ['options']));
|
||||
}
|
||||
if ($user->id == $torrent->user_id) {
|
||||
return Redirect::route('torrent', ['slug' => $torrent->slug, 'id' => $torrent->id])->with(Toastr::error('You Cannot Tip Yourself!', 'Bro!', ['options']));
|
||||
}
|
||||
if ($tip_amount <= 0) {
|
||||
return Redirect::route('torrent', ['slug' => $torrent->slug, 'id' => $torrent->id])->with(Toastr::error('You Cannot Tip A Negitive Amount!', 'Bro!', ['options']));
|
||||
}
|
||||
$uploader->seedbonus += $tip_amount;
|
||||
$uploader->save();
|
||||
$tip_amount = Request::get('tip');
|
||||
if ($tip_amount > $user->seedbonus) {
|
||||
return Redirect::route('torrent', ['slug' => $torrent->slug, 'id' => $torrent->id])->with(Toastr::error('Your To Broke To Tip The Uploader!', 'Bro!', ['options']));
|
||||
}
|
||||
if ($user->id == $torrent->user_id) {
|
||||
return Redirect::route('torrent', ['slug' => $torrent->slug, 'id' => $torrent->id])->with(Toastr::error('You Cannot Tip Yourself!', 'Bro!', ['options']));
|
||||
}
|
||||
if ($tip_amount <= 0) {
|
||||
return Redirect::route('torrent', ['slug' => $torrent->slug, 'id' => $torrent->id])->with(Toastr::error('You Cannot Tip A Negitive Amount!', 'Bro!', ['options']));
|
||||
}
|
||||
$uploader->seedbonus += $tip_amount;
|
||||
$uploader->save();
|
||||
|
||||
$user->seedbonus -= $tip_amount;
|
||||
$user->save();
|
||||
$user->seedbonus -= $tip_amount;
|
||||
$user->save();
|
||||
|
||||
$transaction = new BonTransactions([
|
||||
'itemID' => 0,
|
||||
'name' => 'tip',
|
||||
'cost' => $tip_amount,
|
||||
'sender' => $user->id,
|
||||
'receiver' => $uploader->id,
|
||||
'comment' => 'tip',
|
||||
'torrent_id' => $torrent->id
|
||||
]);
|
||||
$transaction->save();
|
||||
$transaction = new BonTransactions([
|
||||
'itemID' => 0,
|
||||
'name' => 'tip',
|
||||
'cost' => $tip_amount,
|
||||
'sender' => $user->id,
|
||||
'receiver' => $uploader->id,
|
||||
'comment' => 'tip',
|
||||
'torrent_id' => $torrent->id
|
||||
]);
|
||||
$transaction->save();
|
||||
|
||||
// Insert the Recipient notification below
|
||||
PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $uploader->id, 'subject' => "You Have Recieved A BON Tip", 'message' => "Member " . $user->username . " has left a tip of " . $tip_amount . " BON on your upload " . $torrent->name . "."]);
|
||||
// End insert recipient notification here
|
||||
// Insert the Recipient notification below
|
||||
PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $uploader->id, 'subject' => "You Have Recieved A BON Tip", 'message' => "Member " . $user->username . " has left a tip of " . $tip_amount . " BON on your upload " . $torrent->name . "."]);
|
||||
// End insert recipient notification here
|
||||
|
||||
return Redirect::route('torrent', ['slug' => $torrent->slug, 'id' => $torrent->id])->with(Toastr::success('Your Tip Was Successfully Applied!', 'Yay!', ['options']));
|
||||
}
|
||||
return Redirect::route('torrent', ['slug' => $torrent->slug, 'id' => $torrent->id])->with(Toastr::success('Your Tip Was Successfully Applied!', 'Yay!', ['options']));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -299,13 +299,13 @@ class BonusController extends Controller
|
||||
$user = Auth::user();
|
||||
|
||||
return DB::table('peers')
|
||||
->select('peers.hash')->distinct()
|
||||
->join('torrents', 'torrents.id', '=', 'peers.torrent_id')
|
||||
->where('peers.seeder', '=', 1)
|
||||
->where('torrents.seeders', '=', 1)
|
||||
->where('torrents.times_completed', '>', 2)
|
||||
->where('peers.user_id', '=', $user->id)
|
||||
->count();
|
||||
->select('peers.hash')->distinct()
|
||||
->join('torrents', 'torrents.id', '=', 'peers.torrent_id')
|
||||
->where('peers.seeder', '=', 1)
|
||||
->where('torrents.seeders', '=', 1)
|
||||
->where('torrents.times_completed', '>', 2)
|
||||
->where('peers.user_id', '=', $user->id)
|
||||
->count();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -320,13 +320,13 @@ class BonusController extends Controller
|
||||
$user = Auth::user();
|
||||
|
||||
return DB::table('peers')
|
||||
->select('peers.hash')->distinct()
|
||||
->join('torrents', 'torrents.id', '=', 'peers.torrent_id')
|
||||
->whereRaw('torrents.created_at < date_sub(now(), interval 12 month)')
|
||||
->whereRaw('date_sub(peers.created_at,interval 30 minute) < now()')
|
||||
->where('peers.seeder', '=', 1)
|
||||
->where('peers.user_id', '=', $user->id)
|
||||
->count();
|
||||
->select('peers.hash')->distinct()
|
||||
->join('torrents', 'torrents.id', '=', 'peers.torrent_id')
|
||||
->whereRaw('torrents.created_at < date_sub(now(), interval 12 month)')
|
||||
->whereRaw('date_sub(peers.created_at,interval 30 minute) < now()')
|
||||
->where('peers.seeder', '=', 1)
|
||||
->where('peers.user_id', '=', $user->id)
|
||||
->count();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -341,14 +341,14 @@ class BonusController extends Controller
|
||||
$user = Auth::user();
|
||||
|
||||
return DB::table('peers')
|
||||
->select('peers.hash')->distinct()
|
||||
->join('torrents', 'torrents.id', '=', 'peers.torrent_id')
|
||||
->whereRaw('torrents.created_at < date_sub(now(), Interval 6 month)')
|
||||
->whereRaw('torrents.created_at > date_sub(now(), interval 12 month)')
|
||||
->whereRaw('date_sub(peers.created_at,interval 30 minute) < now()')
|
||||
->where('peers.seeder', '=', 1)
|
||||
->where('peers.user_id', '=', $user->id)
|
||||
->count();
|
||||
->select('peers.hash')->distinct()
|
||||
->join('torrents', 'torrents.id', '=', 'peers.torrent_id')
|
||||
->whereRaw('torrents.created_at < date_sub(now(), Interval 6 month)')
|
||||
->whereRaw('torrents.created_at > date_sub(now(), interval 12 month)')
|
||||
->whereRaw('date_sub(peers.created_at,interval 30 minute) < now()')
|
||||
->where('peers.seeder', '=', 1)
|
||||
->where('peers.user_id', '=', $user->id)
|
||||
->count();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -363,12 +363,12 @@ class BonusController extends Controller
|
||||
$user = Auth::user();
|
||||
|
||||
return DB::table('peers')
|
||||
->select('peers.hash')->distinct()
|
||||
->join('torrents', 'torrents.id', '=', 'peers.torrent_id')
|
||||
->where('peers.seeder', '=', 1)
|
||||
->where('torrents.size', '>=', 1073741824*100)
|
||||
->where('peers.user_id', '=', $user->id)
|
||||
->count();
|
||||
->select('peers.hash')->distinct()
|
||||
->join('torrents', 'torrents.id', '=', 'peers.torrent_id')
|
||||
->where('peers.seeder', '=', 1)
|
||||
->where('torrents.size', '>=', 1073741824 * 100)
|
||||
->where('peers.user_id', '=', $user->id)
|
||||
->count();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -383,13 +383,13 @@ class BonusController extends Controller
|
||||
$user = Auth::user();
|
||||
|
||||
return DB::table('peers')
|
||||
->select('peers.hash')->distinct()
|
||||
->join('torrents', 'torrents.id', '=', 'peers.torrent_id')
|
||||
->where('peers.seeder', '=', 1)
|
||||
->where('torrents.size', '>=', 1073741824*25)
|
||||
->where('torrents.size', '<', 1073741824*100)
|
||||
->where('peers.user_id', '=', $user->id)
|
||||
->count();
|
||||
->select('peers.hash')->distinct()
|
||||
->join('torrents', 'torrents.id', '=', 'peers.torrent_id')
|
||||
->where('peers.seeder', '=', 1)
|
||||
->where('torrents.size', '>=', 1073741824 * 25)
|
||||
->where('torrents.size', '<', 1073741824 * 100)
|
||||
->where('peers.user_id', '=', $user->id)
|
||||
->count();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -404,13 +404,13 @@ class BonusController extends Controller
|
||||
$user = Auth::user();
|
||||
|
||||
return DB::table('peers')
|
||||
->select('peers.hash')->distinct()
|
||||
->join('torrents', 'torrents.id', '=', 'peers.torrent_id')
|
||||
->where('peers.seeder', '=', 1)
|
||||
->where('torrents.size', '>=', 1073741824)
|
||||
->where('torrents.size', '<', 1073741824*25)
|
||||
->where('peers.user_id', '=', $user->id)
|
||||
->count();
|
||||
->select('peers.hash')->distinct()
|
||||
->join('torrents', 'torrents.id', '=', 'peers.torrent_id')
|
||||
->where('peers.seeder', '=', 1)
|
||||
->where('torrents.size', '>=', 1073741824)
|
||||
->where('torrents.size', '<', 1073741824 * 25)
|
||||
->where('peers.user_id', '=', $user->id)
|
||||
->count();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -425,13 +425,13 @@ class BonusController extends Controller
|
||||
$user = Auth::user();
|
||||
|
||||
return DB::table('history')
|
||||
->select('history.seedtime')->distinct()
|
||||
->join('torrents', 'torrents.info_hash', '=', 'history.info_hash')
|
||||
->where('history.active', '=', 1)
|
||||
->where('history.seedtime', '>=', 2592000)
|
||||
->where('history.seedtime', '<', 2592000*2)
|
||||
->where('history.user_id', '=', $user->id)
|
||||
->count();
|
||||
->select('history.seedtime')->distinct()
|
||||
->join('torrents', 'torrents.info_hash', '=', 'history.info_hash')
|
||||
->where('history.active', '=', 1)
|
||||
->where('history.seedtime', '>=', 2592000)
|
||||
->where('history.seedtime', '<', 2592000 * 2)
|
||||
->where('history.user_id', '=', $user->id)
|
||||
->count();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -446,13 +446,13 @@ class BonusController extends Controller
|
||||
$user = Auth::user();
|
||||
|
||||
return DB::table('history')
|
||||
->select('history.seedtime')->distinct()
|
||||
->join('torrents', 'torrents.info_hash', '=', 'history.info_hash')
|
||||
->where('history.active', '=', 1)
|
||||
->where('history.seedtime', '>=', 2592000*2)
|
||||
->where('history.seedtime', '<', 2592000*3)
|
||||
->where('history.user_id', '=', $user->id)
|
||||
->count();
|
||||
->select('history.seedtime')->distinct()
|
||||
->join('torrents', 'torrents.info_hash', '=', 'history.info_hash')
|
||||
->where('history.active', '=', 1)
|
||||
->where('history.seedtime', '>=', 2592000 * 2)
|
||||
->where('history.seedtime', '<', 2592000 * 3)
|
||||
->where('history.user_id', '=', $user->id)
|
||||
->count();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -467,13 +467,13 @@ class BonusController extends Controller
|
||||
$user = Auth::user();
|
||||
|
||||
return DB::table('history')
|
||||
->select('history.seedtime')->distinct()
|
||||
->join('torrents', 'torrents.info_hash', '=', 'history.info_hash')
|
||||
->where('history.active', '=', 1)
|
||||
->where('history.seedtime', '>=', 2592000*3)
|
||||
->where('history.seedtime', '<', 2592000*6)
|
||||
->where('history.user_id', '=', $user->id)
|
||||
->count();
|
||||
->select('history.seedtime')->distinct()
|
||||
->join('torrents', 'torrents.info_hash', '=', 'history.info_hash')
|
||||
->where('history.active', '=', 1)
|
||||
->where('history.seedtime', '>=', 2592000 * 3)
|
||||
->where('history.seedtime', '<', 2592000 * 6)
|
||||
->where('history.user_id', '=', $user->id)
|
||||
->count();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -488,13 +488,13 @@ class BonusController extends Controller
|
||||
$user = Auth::user();
|
||||
|
||||
return DB::table('history')
|
||||
->select('history.seedtime')->distinct()
|
||||
->join('torrents', 'torrents.info_hash', '=', 'history.info_hash')
|
||||
->where('history.active', '=', 1)
|
||||
->where('history.seedtime', '>=', 2592000*6)
|
||||
->where('history.seedtime', '<', 2592000*12)
|
||||
->where('history.user_id', '=', $user->id)
|
||||
->count();
|
||||
->select('history.seedtime')->distinct()
|
||||
->join('torrents', 'torrents.info_hash', '=', 'history.info_hash')
|
||||
->where('history.active', '=', 1)
|
||||
->where('history.seedtime', '>=', 2592000 * 6)
|
||||
->where('history.seedtime', '<', 2592000 * 12)
|
||||
->where('history.user_id', '=', $user->id)
|
||||
->count();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -509,12 +509,12 @@ class BonusController extends Controller
|
||||
$user = Auth::user();
|
||||
|
||||
return DB::table('history')
|
||||
->select('history.seedtime')->distinct()
|
||||
->join('torrents', 'torrents.info_hash', '=', 'history.info_hash')
|
||||
->where('history.active', '=', 1)
|
||||
->where('history.seedtime', '>=', 2592000*12)
|
||||
->where('history.user_id', '=', $user->id)
|
||||
->count();
|
||||
->select('history.seedtime')->distinct()
|
||||
->join('torrents', 'torrents.info_hash', '=', 'history.info_hash')
|
||||
->where('history.active', '=', 1)
|
||||
->where('history.seedtime', '>=', 2592000 * 12)
|
||||
->where('history.user_id', '=', $user->id)
|
||||
->count();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Bookmark;
|
||||
@@ -24,12 +24,12 @@ class BookmarkController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Bookmarks
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return view::make bookmark.bookmarks
|
||||
*/
|
||||
* Bookmarks
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return view::make bookmark.bookmarks
|
||||
*/
|
||||
public function bookmarks()
|
||||
{
|
||||
$myBookmarks = Auth::user()->bookmarks;
|
||||
@@ -38,11 +38,11 @@ class BookmarkController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* unBookmark a particular torrent
|
||||
*
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
* unBookmark a particular torrent
|
||||
*
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function unBookmark($id)
|
||||
{
|
||||
Auth::user()->bookmarks()->detach($id);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Group;
|
||||
@@ -25,27 +25,27 @@ class BugController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Bug Report
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return view::make bug.bug
|
||||
*/
|
||||
* Bug Report
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return view::make bug.bug
|
||||
*/
|
||||
public function bug()
|
||||
{
|
||||
// Fetch coder group
|
||||
$group = Group::where('slug', '=', 'coder')->first();
|
||||
// grab the admins
|
||||
$coders = User::where('group_id', '=', $group->id)->get();
|
||||
// Fetch coder group
|
||||
$group = Group::where('slug', '=', 'coder')->first();
|
||||
// grab the admins
|
||||
$coders = User::where('group_id', '=', $group->id)->get();
|
||||
|
||||
if (Request::getMethod() == 'POST') {
|
||||
$input = Request::all();
|
||||
// Send The Mail
|
||||
foreach ($coders as $user) {
|
||||
Mail::to($user->email, $user->username)->send(new Bug($input));
|
||||
}
|
||||
Toastr::success('Your Bug Was Succefully Sent To The Coders!', 'Success', ['options']);
|
||||
}
|
||||
if (Request::getMethod() == 'POST') {
|
||||
$input = Request::all();
|
||||
// Send The Mail
|
||||
foreach ($coders as $user) {
|
||||
Mail::to($user->email, $user->username)->send(new Bug($input));
|
||||
}
|
||||
Toastr::success('Your Bug Was Succefully Sent To The Coders!', 'Success', ['options']);
|
||||
}
|
||||
return view('bug.bug');
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\CatalogTorrent;
|
||||
@@ -22,11 +22,11 @@ class CatalogController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Display catalogs list
|
||||
*
|
||||
* @access public
|
||||
* @return catalogs.catalogs View
|
||||
*/
|
||||
* Display catalogs list
|
||||
*
|
||||
* @access public
|
||||
* @return catalogs.catalogs View
|
||||
*/
|
||||
public function catalogs()
|
||||
{
|
||||
$catalogs = Catalog::all();
|
||||
@@ -35,13 +35,13 @@ class CatalogController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays movies in catalog
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return catalogs.catalog View
|
||||
*/
|
||||
* Displays movies in catalog
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return catalogs.catalog View
|
||||
*/
|
||||
public function catalog($slug, $id)
|
||||
{
|
||||
$user = Auth::user();
|
||||
@@ -52,13 +52,13 @@ class CatalogController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays torrents
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return catalogs.torrents View
|
||||
*/
|
||||
* Displays torrents
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return catalogs.torrents View
|
||||
*/
|
||||
public function torrents($imdb)
|
||||
{
|
||||
$user = Auth::user();
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Category;
|
||||
@@ -20,13 +20,13 @@ class CategoryController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Displays torrents by category
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return category.category View
|
||||
*/
|
||||
* Displays torrents by category
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return category.category View
|
||||
*/
|
||||
public function category($slug, $id)
|
||||
{
|
||||
$user = Auth::user();
|
||||
@@ -37,11 +37,11 @@ class CategoryController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Display category list
|
||||
*
|
||||
* @access public
|
||||
* @return category.categories View
|
||||
*/
|
||||
* Display category list
|
||||
*
|
||||
* @access public
|
||||
* @return category.categories View
|
||||
*/
|
||||
public function categories()
|
||||
{
|
||||
$categories = Category::all();
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\User;
|
||||
@@ -49,12 +49,12 @@ class CommentController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Add a comment on a artical
|
||||
*
|
||||
* @param $slug
|
||||
* @param $id
|
||||
*
|
||||
*/
|
||||
* Add a comment on a artical
|
||||
*
|
||||
* @param $slug
|
||||
* @param $id
|
||||
*
|
||||
*/
|
||||
public function article($slug, $id)
|
||||
{
|
||||
$article = Article::findOrFail($id);
|
||||
@@ -83,11 +83,11 @@ class CommentController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a comment on a torrent
|
||||
*
|
||||
* @param $slug
|
||||
* @param $id
|
||||
*/
|
||||
* Add a comment on a torrent
|
||||
*
|
||||
* @param $slug
|
||||
* @param $id
|
||||
*/
|
||||
public function torrent($slug, $id)
|
||||
{
|
||||
$torrent = Torrent::findOrFail($id);
|
||||
@@ -126,9 +126,9 @@ class CommentController extends Controller
|
||||
|
||||
// Auto Shout
|
||||
$appurl = env('APP_URL', 'http://unit3d.site');
|
||||
if ($comment->anon == 0){
|
||||
if ($comment->anon == 0) {
|
||||
Shoutbox::create(['user' => "1", 'mentions' => "1", 'message' => "User [url={$appurl}/" . $user->username . "." . $user->id . "]" . $user->username . "[/url] has left a comment on Torrent [url={$appurl}/torrents/" . $torrent->slug . "." . $torrent->id . "]" . $torrent->name . "[/url]"]);
|
||||
Cache::forget('shoutbox_messages');
|
||||
Cache::forget('shoutbox_messages');
|
||||
} else {
|
||||
Shoutbox::create(['user' => "1", 'mentions' => "1", 'message' => "An anonymous user has left a comment on torrent [url={$appurl}/torrents/" . $torrent->slug . "." . $torrent->id . "]" . $torrent->name . "[/url]"]);
|
||||
Cache::forget('shoutbox_messages');
|
||||
@@ -140,11 +140,11 @@ class CommentController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a comment on a request
|
||||
*
|
||||
* @param $slug
|
||||
* @param $id
|
||||
*/
|
||||
* Add a comment on a request
|
||||
*
|
||||
* @param $slug
|
||||
* @param $id
|
||||
*/
|
||||
public function request($id)
|
||||
{
|
||||
$request = Requests::findOrFail($id);
|
||||
@@ -179,7 +179,7 @@ class CommentController extends Controller
|
||||
// Auto Shout
|
||||
$appurl = env('APP_URL', 'http://unit3d.site');
|
||||
Shoutbox::create(['user' => "1", 'mentions' => "1", 'message' => "User [url={$appurl}/" . $user->username . "." . $user->id . "]" . $user->username . "[/url] has left a comment on Request [url={$appurl}/request/" . $request->id . "]" . $request->name . "[/url]"]);
|
||||
Cache::forget('shoutbox_messages');
|
||||
Cache::forget('shoutbox_messages');
|
||||
// Auto PM
|
||||
PrivateMessage::create(['sender_id' => "0", 'reciever_id' => $request->user_id, 'subject' => "Your Request " . $request->name . " Has A New Comment!", 'message' => $comment->user->username . " Has Left A Comment On [url={$appurl}/request/" . $request->id . "]" . $request->name . "[/url]"]);
|
||||
} else {
|
||||
@@ -189,11 +189,11 @@ class CommentController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a comment on a torrent via quickthanks
|
||||
*
|
||||
* @param $slug
|
||||
* @param $id
|
||||
*/
|
||||
* Add a comment on a torrent via quickthanks
|
||||
*
|
||||
* @param $slug
|
||||
* @param $id
|
||||
*/
|
||||
public function quickthanks($id)
|
||||
{
|
||||
$torrent = Torrent::findOrFail($id);
|
||||
@@ -206,8 +206,8 @@ class CommentController extends Controller
|
||||
}
|
||||
|
||||
$comment = new Comment();
|
||||
$thankArray = ["Thanks for the upload! :thumbsup_tone2:","Time and effort is much appreciated :thumbsup_tone2:","Great upload! :fire:","Thankyou :smiley:"];
|
||||
$selected = mt_rand(0, count($thankArray) -1);
|
||||
$thankArray = ["Thanks for the upload! :thumbsup_tone2:", "Time and effort is much appreciated :thumbsup_tone2:", "Great upload! :fire:", "Thankyou :smiley:"];
|
||||
$selected = mt_rand(0, count($thankArray) - 1);
|
||||
$comment->content = $thankArray[$selected];
|
||||
$comment->user_id = $user->id;
|
||||
$comment->torrent_id = $torrent->id;
|
||||
@@ -237,31 +237,31 @@ class CommentController extends Controller
|
||||
Shoutbox::create(['user' => "1", 'mentions' => "1", 'message' => "User [url={$appurl}/" . $user->username . "." . $user->id . "]" . $user->username . "[/url] has left a comment on Torrent [url={$appurl}/torrents/" . $torrent->slug . "." . $torrent->id . "]" . $torrent->name . "[/url]"]);
|
||||
Cache::forget('shoutbox_messages');
|
||||
|
||||
} else {
|
||||
} else {
|
||||
Toastr::warning('A Error Has Occured And Your Comment Was Not Posted!', 'Sorry', ['options']);
|
||||
}
|
||||
}
|
||||
|
||||
return Redirect::route('torrent', ['slug' => $torrent->slug, 'id' => $torrent->id]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete a comment on a torrent
|
||||
*
|
||||
*
|
||||
* @param $comment_id
|
||||
*/
|
||||
* Delete a comment on a torrent
|
||||
*
|
||||
*
|
||||
* @param $comment_id
|
||||
*/
|
||||
public function deleteComment($comment_id)
|
||||
{
|
||||
$comment = Comment::findOrFail($comment_id);
|
||||
$comment = Comment::findOrFail($comment_id);
|
||||
|
||||
if(!$comment){
|
||||
return back()->with(Toastr::error('Comment Is Already Deleted', 'Attention', ['options']));
|
||||
if (!$comment) {
|
||||
return back()->with(Toastr::error('Comment Is Already Deleted', 'Attention', ['options']));
|
||||
}
|
||||
|
||||
$comment->delete();
|
||||
|
||||
return back()->with(Toastr::success('Comment Has Been Deleted.', 'Yay!', ['options']));
|
||||
}
|
||||
|
||||
$comment->delete();
|
||||
|
||||
return back()->with(Toastr::success('Comment Has Been Deleted.', 'Yay!', ['options']));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
@@ -23,6 +23,6 @@ class Controller extends BaseController
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\User;
|
||||
@@ -24,40 +24,40 @@ class FollowController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Follow A User
|
||||
*
|
||||
*
|
||||
* @param $user
|
||||
*/
|
||||
* Follow A User
|
||||
*
|
||||
*
|
||||
* @param $user
|
||||
*/
|
||||
public function follow(User $user)
|
||||
{
|
||||
if (!Auth::user()->isFollowing($user->id)) {
|
||||
// Create a new follow instance for the authenticated user
|
||||
Auth::user()->follows()->create([
|
||||
'target_id' => $user->id,
|
||||
]);
|
||||
return back()->with(Toastr::success('You are now following '. $user->username, 'Success!', ['options']));
|
||||
} else {
|
||||
return back()->with(Toastr::error('You are already following this user', 'Error!', ['options']));
|
||||
}
|
||||
if (!Auth::user()->isFollowing($user->id)) {
|
||||
// Create a new follow instance for the authenticated user
|
||||
Auth::user()->follows()->create([
|
||||
'target_id' => $user->id,
|
||||
]);
|
||||
return back()->with(Toastr::success('You are now following ' . $user->username, 'Success!', ['options']));
|
||||
} else {
|
||||
return back()->with(Toastr::error('You are already following this user', 'Error!', ['options']));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unfollow A User
|
||||
*
|
||||
*
|
||||
* @param $user
|
||||
*/
|
||||
* Unfollow A User
|
||||
*
|
||||
*
|
||||
* @param $user
|
||||
*/
|
||||
public function unfollow(User $user)
|
||||
{
|
||||
if (Auth::user()->isFollowing($user->id)) {
|
||||
$follow = Auth::user()->follows()->where('target_id', $user->id)->first();
|
||||
$follow->delete();
|
||||
if (Auth::user()->isFollowing($user->id)) {
|
||||
$follow = Auth::user()->follows()->where('target_id', $user->id)->first();
|
||||
$follow->delete();
|
||||
|
||||
return back()->with(Toastr::success('You are no longer following '. $user->username, 'Success!', ['options']));
|
||||
} else {
|
||||
return back()->with(Toastr::error('You are not following this user to begin with', 'Error!', ['options']));
|
||||
}
|
||||
return back()->with(Toastr::success('You are no longer following ' . $user->username, 'Success!', ['options']));
|
||||
} else {
|
||||
return back()->with(Toastr::error('You are not following this user to begin with', 'Error!', ['options']));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Forum;
|
||||
@@ -49,29 +49,29 @@ class ForumController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Search for topics
|
||||
*
|
||||
* @access public
|
||||
* @return View page.torrents
|
||||
*
|
||||
*/
|
||||
* Search for topics
|
||||
*
|
||||
* @access public
|
||||
* @return View page.torrents
|
||||
*
|
||||
*/
|
||||
public function search()
|
||||
{
|
||||
$user = Auth::user();
|
||||
$search = Request::get('name');
|
||||
$results = Topic::where([
|
||||
['name','like','%'.Request::get('name').'%'],
|
||||
])->orderBy('created_at', 'DESC')->paginate(25);
|
||||
$user = Auth::user();
|
||||
$search = Request::get('name');
|
||||
$results = Topic::where([
|
||||
['name', 'like', '%' . Request::get('name') . '%'],
|
||||
])->orderBy('created_at', 'DESC')->paginate(25);
|
||||
|
||||
$results->setPath('?name='.Request::get('name'));
|
||||
$results->setPath('?name=' . Request::get('name'));
|
||||
|
||||
return view('forum.results', ['results' => $results, 'user' => $user]);
|
||||
return view('forum.results', ['results' => $results, 'user' => $user]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the forum homepage
|
||||
*
|
||||
*/
|
||||
* Display the forum homepage
|
||||
*
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$categories = Forum::orderBy('position', 'ASC')->get();
|
||||
@@ -85,13 +85,13 @@ class ForumController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the requested category
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return void
|
||||
*/
|
||||
* Displays the requested category
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return void
|
||||
*/
|
||||
public function category($slug, $id)
|
||||
{
|
||||
$category = Forum::findOrFail($id);
|
||||
@@ -102,13 +102,13 @@ class ForumController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows forums and topics inside
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return View forum.display
|
||||
*/
|
||||
* Shows forums and topics inside
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return View forum.display
|
||||
*/
|
||||
public function display($slug, $id)
|
||||
{
|
||||
// Find the topic
|
||||
@@ -130,13 +130,13 @@ class ForumController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the topic
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return forum.topic
|
||||
*/
|
||||
* Show the topic
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return forum.topic
|
||||
*/
|
||||
public function topic($slug, $id)
|
||||
{
|
||||
// Find the topic
|
||||
@@ -156,7 +156,7 @@ class ForumController extends Controller
|
||||
|
||||
// The user can post a topic here ?
|
||||
if ($category->getPermission()->read_topic != true) {
|
||||
// Redirect him to the forum index
|
||||
// Redirect him to the forum index
|
||||
return Redirect::route('forum_index')->with(Toastr::warning('You Do Not Have Access To Read This Topic!', 'Sorry', ['options']));
|
||||
}
|
||||
|
||||
@@ -168,11 +168,11 @@ class ForumController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a reply to a topic
|
||||
*
|
||||
* @param $slug
|
||||
* @param $id
|
||||
*/
|
||||
* Add a reply to a topic
|
||||
*
|
||||
* @param $slug
|
||||
* @param $id
|
||||
*/
|
||||
public function reply($slug, $id)
|
||||
{
|
||||
$user = Auth::user();
|
||||
@@ -194,9 +194,9 @@ class ForumController extends Controller
|
||||
'content' => 'required',
|
||||
'user_id' => 'required',
|
||||
'topic_id' => 'required'
|
||||
]);
|
||||
]);
|
||||
if ($v->passes()) {
|
||||
// Save the reply
|
||||
// Save the reply
|
||||
$post->save();
|
||||
// Save last post user data to topic table
|
||||
$topic->last_post_user_id = $user->id;
|
||||
@@ -228,8 +228,8 @@ class ForumController extends Controller
|
||||
Cache::forget('shoutbox_messages');
|
||||
|
||||
// Mail Topic Creator Of New Reply
|
||||
if($post->user_id != $topic->first_post_user_id) {
|
||||
Mail::to($topicCreator->email)->send(new NewReply($user, $topic));
|
||||
if ($post->user_id != $topic->first_post_user_id) {
|
||||
Mail::to($topicCreator->email)->send(new NewReply($user, $topic));
|
||||
}
|
||||
|
||||
//Achievements
|
||||
@@ -253,11 +253,11 @@ class ForumController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new topic in the forum
|
||||
*
|
||||
* @param $slug
|
||||
* @param $id
|
||||
*/
|
||||
* Create a new topic in the forum
|
||||
*
|
||||
* @param $slug
|
||||
* @param $id
|
||||
*/
|
||||
public function newTopic($slug, $id)
|
||||
{
|
||||
$user = Auth::user();
|
||||
@@ -281,7 +281,7 @@ class ForumController extends Controller
|
||||
}
|
||||
|
||||
if (Request::getMethod() == 'POST' && Request::get('post') == true) {
|
||||
// Create The Topic
|
||||
// Create The Topic
|
||||
$topic = new Topic();
|
||||
$topic->name = Request::get('title');
|
||||
$topic->slug = str_slug(Request::get('title'));
|
||||
@@ -346,12 +346,12 @@ class ForumController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit user's post
|
||||
*
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @param $postId
|
||||
*/
|
||||
* Edit user's post
|
||||
*
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @param $postId
|
||||
*/
|
||||
public function postEdit($slug, $id, $postId)
|
||||
{
|
||||
$user = Auth::user();
|
||||
@@ -384,12 +384,12 @@ class ForumController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete user's post
|
||||
*
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @param $postId
|
||||
*/
|
||||
* Delete user's post
|
||||
*
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @param $postId
|
||||
*/
|
||||
public function postDelete($slug, $id, $postId)
|
||||
{
|
||||
$user = Auth::user();
|
||||
@@ -407,13 +407,13 @@ class ForumController extends Controller
|
||||
|
||||
|
||||
/**
|
||||
* Close The Topic
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return Redirect to forum_topic
|
||||
*/
|
||||
* Close The Topic
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return Redirect to forum_topic
|
||||
*/
|
||||
public function closeTopic($slug, $id)
|
||||
{
|
||||
$topic = Topic::findOrFail($id);
|
||||
@@ -424,13 +424,13 @@ class ForumController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Open The Topic
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return Redirect to forum_topic
|
||||
*/
|
||||
* Open The Topic
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return Redirect to forum_topic
|
||||
*/
|
||||
public function openTopic($slug, $id)
|
||||
{
|
||||
$topic = Topic::findOrFail($id);
|
||||
@@ -440,13 +440,13 @@ class ForumController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the topic and the posts
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return Redirect to forum_topic
|
||||
*/
|
||||
* Delete the topic and the posts
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return Redirect to forum_topic
|
||||
*/
|
||||
public function deleteTopic($slug, $id)
|
||||
{
|
||||
$user = Auth::user();
|
||||
@@ -462,13 +462,13 @@ class ForumController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Pin The Topic
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return Redirect to forum_topic
|
||||
*/
|
||||
* Pin The Topic
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return Redirect to forum_topic
|
||||
*/
|
||||
public function pinTopic($slug, $id)
|
||||
{
|
||||
$topic = Topic::findOrFail($id);
|
||||
@@ -478,13 +478,13 @@ class ForumController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpin The Topic
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return Redirect to forum_topic
|
||||
*/
|
||||
* Unpin The Topic
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return Redirect to forum_topic
|
||||
*/
|
||||
public function unpinTopic($slug, $id)
|
||||
{
|
||||
$topic = Topic::findOrFail($id);
|
||||
@@ -494,21 +494,21 @@ class ForumController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Forum Tag System
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return Redirect to forum_topic
|
||||
*/
|
||||
* Forum Tag System
|
||||
*
|
||||
* @access public
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return Redirect to forum_topic
|
||||
*/
|
||||
public function approvedTopic($slug, $id)
|
||||
{
|
||||
$topic = Topic::findOrFail($id);
|
||||
if ($topic->approved == 0) {
|
||||
$topic->approved = "1";
|
||||
} else {
|
||||
$topic->approved = "0";
|
||||
}
|
||||
if ($topic->approved == 0) {
|
||||
$topic->approved = "1";
|
||||
} else {
|
||||
$topic->approved = "0";
|
||||
}
|
||||
$topic->save();
|
||||
|
||||
return Redirect::route('forum_topic', ['slug' => $topic->slug, 'id' => $topic->id])->with(Toastr::info('Label Change Has Been Applied', 'Info', ['options']));
|
||||
@@ -517,11 +517,11 @@ class ForumController extends Controller
|
||||
public function deniedTopic($slug, $id)
|
||||
{
|
||||
$topic = Topic::findOrFail($id);
|
||||
if ($topic->denied == 0) {
|
||||
$topic->denied = "1";
|
||||
} else {
|
||||
$topic->denied = "0";
|
||||
}
|
||||
if ($topic->denied == 0) {
|
||||
$topic->denied = "1";
|
||||
} else {
|
||||
$topic->denied = "0";
|
||||
}
|
||||
$topic->save();
|
||||
|
||||
return Redirect::route('forum_topic', ['slug' => $topic->slug, 'id' => $topic->id])->with(Toastr::info('Label Change Has Been Applied', 'Info', ['options']));
|
||||
@@ -530,11 +530,11 @@ class ForumController extends Controller
|
||||
public function solvedTopic($slug, $id)
|
||||
{
|
||||
$topic = Topic::findOrFail($id);
|
||||
if ($topic->solved == 0) {
|
||||
$topic->solved = "1";
|
||||
} else {
|
||||
$topic->solved = "0";
|
||||
}
|
||||
if ($topic->solved == 0) {
|
||||
$topic->solved = "1";
|
||||
} else {
|
||||
$topic->solved = "0";
|
||||
}
|
||||
$topic->save();
|
||||
|
||||
return Redirect::route('forum_topic', ['slug' => $topic->slug, 'id' => $topic->id])->with(Toastr::info('Label Change Has Been Applied', 'Info', ['options']));
|
||||
@@ -543,11 +543,11 @@ class ForumController extends Controller
|
||||
public function invalidTopic($slug, $id)
|
||||
{
|
||||
$topic = Topic::findOrFail($id);
|
||||
if ($topic->invalid == 0) {
|
||||
$topic->invalid = "1";
|
||||
} else {
|
||||
$topic->invalid = "0";
|
||||
}
|
||||
if ($topic->invalid == 0) {
|
||||
$topic->invalid = "1";
|
||||
} else {
|
||||
$topic->invalid = "0";
|
||||
}
|
||||
$topic->save();
|
||||
|
||||
return Redirect::route('forum_topic', ['slug' => $topic->slug, 'id' => $topic->id])->with(Toastr::info('Label Change Has Been Applied', 'Info', ['options']));
|
||||
@@ -556,11 +556,11 @@ class ForumController extends Controller
|
||||
public function bugTopic($slug, $id)
|
||||
{
|
||||
$topic = Topic::findOrFail($id);
|
||||
if ($topic->bug == 0) {
|
||||
$topic->bug = "1";
|
||||
} else {
|
||||
$topic->bug = "0";
|
||||
}
|
||||
if ($topic->bug == 0) {
|
||||
$topic->bug = "1";
|
||||
} else {
|
||||
$topic->bug = "0";
|
||||
}
|
||||
$topic->save();
|
||||
|
||||
return Redirect::route('forum_topic', ['slug' => $topic->slug, 'id' => $topic->id])->with(Toastr::info('Label Change Has Been Applied', 'Info', ['options']));
|
||||
@@ -569,11 +569,11 @@ class ForumController extends Controller
|
||||
public function suggestionTopic($slug, $id)
|
||||
{
|
||||
$topic = Topic::findOrFail($id);
|
||||
if ($topic->suggestion == 0) {
|
||||
$topic->suggestion = "1";
|
||||
} else {
|
||||
$topic->suggestion = "0";
|
||||
}
|
||||
if ($topic->suggestion == 0) {
|
||||
$topic->suggestion = "1";
|
||||
} else {
|
||||
$topic->suggestion = "0";
|
||||
}
|
||||
$topic->save();
|
||||
|
||||
return Redirect::route('forum_topic', ['slug' => $topic->slug, 'id' => $topic->id])->with(Toastr::info('Label Change Has Been Applied', 'Info', ['options']));
|
||||
@@ -581,25 +581,25 @@ class ForumController extends Controller
|
||||
|
||||
public function likePost($postId)
|
||||
{
|
||||
$post = Post::findOrFail($postId);
|
||||
$user = Auth::user();
|
||||
$like = $user->likes()->where('post_id', '=', $post->id)->where('like', '=', 1)->first();
|
||||
$dislike = $user->likes()->where('post_id', '=', $post->id)->where('dislike', '=', 1)->first();
|
||||
$post = Post::findOrFail($postId);
|
||||
$user = Auth::user();
|
||||
$like = $user->likes()->where('post_id', '=', $post->id)->where('like', '=', 1)->first();
|
||||
$dislike = $user->likes()->where('post_id', '=', $post->id)->where('dislike', '=', 1)->first();
|
||||
|
||||
if($like || $dislike) {
|
||||
return back()->with(Toastr::error('You have already liked/disliked this post!', 'Bro', ['options']));
|
||||
} elseif($user->id == $post->user_id) {
|
||||
return back()->with(Toastr::error('You cannot like your own post!', 'Umm', ['options']));
|
||||
} else {
|
||||
$new = new Like();
|
||||
$new->user_id = $user->id;
|
||||
$new->post_id = $post->id;
|
||||
$new->like = 1;
|
||||
$new->save();
|
||||
if ($like || $dislike) {
|
||||
return back()->with(Toastr::error('You have already liked/disliked this post!', 'Bro', ['options']));
|
||||
} elseif ($user->id == $post->user_id) {
|
||||
return back()->with(Toastr::error('You cannot like your own post!', 'Umm', ['options']));
|
||||
} else {
|
||||
$new = new Like();
|
||||
$new->user_id = $user->id;
|
||||
$new->post_id = $post->id;
|
||||
$new->like = 1;
|
||||
$new->save();
|
||||
|
||||
return back()->with(Toastr::success('Like Successfully Applied!', 'Yay', ['options']));
|
||||
return back()->with(Toastr::success('Like Successfully Applied!', 'Yay', ['options']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function dislikePost($postId)
|
||||
{
|
||||
@@ -608,19 +608,19 @@ class ForumController extends Controller
|
||||
$like = $user->likes()->where('post_id', '=', $post->id)->where('like', '=', 1)->first();
|
||||
$dislike = $user->likes()->where('post_id', '=', $post->id)->where('dislike', '=', 1)->first();
|
||||
|
||||
if($like || $dislike) {
|
||||
if ($like || $dislike) {
|
||||
return back()->with(Toastr::error('You have already liked/disliked this post!', 'Bro', ['options']));
|
||||
} elseif($user->id == $post->user_id) {
|
||||
} elseif ($user->id == $post->user_id) {
|
||||
return back()->with(Toastr::error('You cannot dislike your own post!', 'Umm', ['options']));
|
||||
} else {
|
||||
$new = new Like();
|
||||
$new->user_id = $user->id;
|
||||
$new->post_id = $post->id;
|
||||
$new->dislike = 1;
|
||||
$new->save();
|
||||
$new = new Like();
|
||||
$new->user_id = $user->id;
|
||||
$new->post_id = $post->id;
|
||||
$new->dislike = 1;
|
||||
$new->save();
|
||||
|
||||
return back()->with(Toastr::success('Dislike Successfully Applied!', 'Yay', ['options']));
|
||||
return back()->with(Toastr::success('Dislike Successfully Applied!', 'Yay', ['options']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
@@ -36,32 +36,32 @@ class GraveyardController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$user = Auth::user();
|
||||
$dead = Torrent::where('seeders', '=', '0')->orderBy('leechers', 'desc')->paginate(50);
|
||||
$deadcount = Torrent::where('seeders', '=', '0')->count();
|
||||
$time = '2592000';
|
||||
$user = Auth::user();
|
||||
$dead = Torrent::where('seeders', '=', '0')->orderBy('leechers', 'desc')->paginate(50);
|
||||
$deadcount = Torrent::where('seeders', '=', '0')->count();
|
||||
$time = '2592000';
|
||||
|
||||
return view('graveyard.index', compact('dead','deadcount','user','time'));
|
||||
return view('graveyard.index', compact('dead', 'deadcount', 'user', 'time'));
|
||||
}
|
||||
|
||||
public function resurrect($id)
|
||||
{
|
||||
$user = Auth::user();
|
||||
$torrent = Torrent::findOrFail($id);
|
||||
$resurrected = Graveyard::where('torrent_id', '=', $torrent->id)->first();
|
||||
if ($resurrected) {
|
||||
return Redirect::route('graveyard')->with(Toastr::warning('Torrent Resurrection Failed! This torrent is already pending a resurrection.', 'Yay!', ['options']));
|
||||
}
|
||||
if ($user->id != $torrent->user_id) {
|
||||
$resurrection = Graveyard::create([
|
||||
'user_id' => $user->id,
|
||||
'torrent_id' => $torrent->id,
|
||||
'seedtime' => Request::get('seedtime')
|
||||
]);
|
||||
return Redirect::route('graveyard')->with(Toastr::success('Torrent Resurrection Complete! You will be rewarded automatically once seedtime requirements are met.', 'Yay!', ['options']));
|
||||
} else {
|
||||
return Redirect::route('graveyard')->with(Toastr::error('Torrent Resurrection Failed! You cannot resurrect your own uploads.', 'Yay!', ['options']));
|
||||
$user = Auth::user();
|
||||
$torrent = Torrent::findOrFail($id);
|
||||
$resurrected = Graveyard::where('torrent_id', '=', $torrent->id)->first();
|
||||
if ($resurrected) {
|
||||
return Redirect::route('graveyard')->with(Toastr::warning('Torrent Resurrection Failed! This torrent is already pending a resurrection.', 'Yay!', ['options']));
|
||||
}
|
||||
if ($user->id != $torrent->user_id) {
|
||||
$resurrection = Graveyard::create([
|
||||
'user_id' => $user->id,
|
||||
'torrent_id' => $torrent->id,
|
||||
'seedtime' => Request::get('seedtime')
|
||||
]);
|
||||
return Redirect::route('graveyard')->with(Toastr::success('Torrent Resurrection Complete! You will be rewarded automatically once seedtime requirements are met.', 'Yay!', ['options']));
|
||||
} else {
|
||||
return Redirect::route('graveyard')->with(Toastr::error('Torrent Resurrection Failed! You cannot resurrect your own uploads.', 'Yay!', ['options']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
/**
|
||||
@@ -18,5 +18,5 @@ namespace App\Http\Controllers;
|
||||
*/
|
||||
class GroupController extends Controller
|
||||
{
|
||||
//
|
||||
//
|
||||
}
|
||||
|
||||
@@ -14,5 +14,5 @@ namespace App\Http\Controllers;
|
||||
|
||||
class HistoryController extends Controller
|
||||
{
|
||||
//
|
||||
//
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
@@ -103,12 +103,12 @@ class HomeController extends Controller
|
||||
$terms = explode(' ', $search);
|
||||
$search = '';
|
||||
foreach ($terms as $term) {
|
||||
$search .= '%'.$term.'%';
|
||||
$search .= '%' . $term . '%';
|
||||
}
|
||||
$torrents = Torrent::where('name','like', $search)->orderBy('created_at', 'desc')->paginate(50);
|
||||
$torrents = Torrent::where('name', 'like', $search)->orderBy('created_at', 'desc')->paginate(50);
|
||||
$personal_freeleech = UserFreeleech::where('user_id', '=', $user->id)->first();
|
||||
|
||||
$torrents->setPath('?name='.Request::get('name'));
|
||||
$torrents->setPath('?name=' . Request::get('name'));
|
||||
|
||||
return view('home.search', ['torrents' => $torrents, 'user' => $user, 'personal_freeleech' => $personal_freeleech, 'categories' => Category::all(), 'types' => Type::all()]);
|
||||
}
|
||||
@@ -141,7 +141,7 @@ class HomeController extends Controller
|
||||
|
||||
public function landing()
|
||||
{
|
||||
return View::make('landing.christmas');
|
||||
return View::make('landing.christmas');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Mail\InviteUser;
|
||||
@@ -35,67 +35,66 @@ class InviteController extends Controller
|
||||
|
||||
public function invite()
|
||||
{
|
||||
$user = Auth::user();
|
||||
if (config('other.invite-only') == false) {
|
||||
Toastr::warning('Invitations Are Disabled Due To Open Registration!', 'Error!', ['options']);
|
||||
}
|
||||
if ($user->can_invite == 0) {
|
||||
Toastr::warning('Your Invite Rights Have Been Revoked!!!', 'Error!', ['options']);
|
||||
}
|
||||
return view('user.invite', ['user' => $user]);
|
||||
$user = Auth::user();
|
||||
if (config('other.invite-only') == false) {
|
||||
Toastr::warning('Invitations Are Disabled Due To Open Registration!', 'Error!', ['options']);
|
||||
}
|
||||
if ($user->can_invite == 0) {
|
||||
Toastr::warning('Your Invite Rights Have Been Revoked!!!', 'Error!', ['options']);
|
||||
}
|
||||
return view('user.invite', ['user' => $user]);
|
||||
}
|
||||
|
||||
public function process(Request $request)
|
||||
{
|
||||
$current = new Carbon();
|
||||
$user = Auth::user();
|
||||
$exsist = Invite::where('email', '=', $request->get('email'))->first();
|
||||
$member = User::where('email', '=', $request->get('email'))->first();
|
||||
if($exsist || $member){
|
||||
return Redirect::route('profil', ['username' => $user->username, 'id' => $user->id])->with(Toastr::error('The email address your trying to send a invite to has already been sent one or is a user already.', 'My Dude!', ['options']));
|
||||
}
|
||||
$current = new Carbon();
|
||||
$user = Auth::user();
|
||||
$exsist = Invite::where('email', '=', $request->get('email'))->first();
|
||||
$member = User::where('email', '=', $request->get('email'))->first();
|
||||
if ($exsist || $member) {
|
||||
return Redirect::route('profil', ['username' => $user->username, 'id' => $user->id])->with(Toastr::error('The email address your trying to send a invite to has already been sent one or is a user already.', 'My Dude!', ['options']));
|
||||
}
|
||||
|
||||
if ($user->invites > 0) {
|
||||
do {
|
||||
//generate a random string using Laravel's str_random helper
|
||||
$code = str_random();
|
||||
}
|
||||
//check if the token already exists and if it does, try again
|
||||
while (Invite::where('code', $code)->first());
|
||||
if ($user->invites > 0) {
|
||||
do {
|
||||
//generate a random string using Laravel's str_random helper
|
||||
$code = str_random();
|
||||
} //check if the token already exists and if it does, try again
|
||||
while (Invite::where('code', $code)->first());
|
||||
|
||||
//create a new invite record
|
||||
$invite = Invite::create([
|
||||
'user_id' => $user->id,
|
||||
'email' => $request->get('email'),
|
||||
'code' => $code,
|
||||
'expires_on' => $current->copy()->addDays(14),
|
||||
'custom' => $request->get('message'),
|
||||
]);
|
||||
//create a new invite record
|
||||
$invite = Invite::create([
|
||||
'user_id' => $user->id,
|
||||
'email' => $request->get('email'),
|
||||
'code' => $code,
|
||||
'expires_on' => $current->copy()->addDays(14),
|
||||
'custom' => $request->get('message'),
|
||||
]);
|
||||
|
||||
// send the email
|
||||
Mail::to($request->get('email'))->send(new InviteUser($invite));
|
||||
// send the email
|
||||
Mail::to($request->get('email'))->send(new InviteUser($invite));
|
||||
|
||||
// subtract 1 invite
|
||||
$user->invites -= 1;
|
||||
$user->save();
|
||||
// subtract 1 invite
|
||||
$user->invites -= 1;
|
||||
$user->save();
|
||||
|
||||
Toastr::success('Invitation Sent Successfully!', 'Yay!', ['options']);
|
||||
} else {
|
||||
Toastr::warning('You Dont Have Enough Invites!', 'Umm!', ['options']);
|
||||
}
|
||||
Toastr::success('Invitation Sent Successfully!', 'Yay!', ['options']);
|
||||
} else {
|
||||
Toastr::warning('You Dont Have Enough Invites!', 'Umm!', ['options']);
|
||||
}
|
||||
// redirect back where we came from
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
public function inviteTree($username, $id)
|
||||
{
|
||||
if(Auth::user()->group->is_modo){
|
||||
$user = User::findOrFail($id);
|
||||
$records = Invite::with('sender')->where('user_id', $user->id)->orderBy('created_at', 'desc')->get();
|
||||
} else {
|
||||
$user = Auth::user();
|
||||
$records = Invite::with('sender')->where('user_id', $user->id)->orderBy('created_at', 'desc')->get();
|
||||
}
|
||||
if (Auth::user()->group->is_modo) {
|
||||
$user = User::findOrFail($id);
|
||||
$records = Invite::with('sender')->where('user_id', $user->id)->orderBy('created_at', 'desc')->get();
|
||||
} else {
|
||||
$user = Auth::user();
|
||||
$records = Invite::with('sender')->where('user_id', $user->id)->orderBy('created_at', 'desc')->get();
|
||||
}
|
||||
return view('user.invitetree', ['user' => $user, 'records' => $records]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
@@ -43,7 +43,7 @@ class LockAccountController extends Controller
|
||||
'password' => 'required|string',
|
||||
]);
|
||||
|
||||
if(\Hash::check($password, \Auth::user()->password)){
|
||||
if (\Hash::check($password, \Auth::user()->password)) {
|
||||
$request->session()->forget('locked');
|
||||
return redirect()->route('home')->with(Toastr::success('Your Account Has Been Unlocked Successfully!', 'Yay!', ['options']));
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Page;
|
||||
@@ -18,10 +18,10 @@ class PageController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Displays the requested page
|
||||
*
|
||||
*
|
||||
*/
|
||||
* Displays the requested page
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function page($slug, $id)
|
||||
{
|
||||
$page = Page::findOrFail($id);
|
||||
@@ -30,20 +30,20 @@ class PageController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Credits Page
|
||||
*
|
||||
*
|
||||
*/
|
||||
* Credits Page
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function credits()
|
||||
{
|
||||
return view('page.credits');
|
||||
}
|
||||
|
||||
/**
|
||||
* About Us Page
|
||||
*
|
||||
*
|
||||
*/
|
||||
* About Us Page
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function about()
|
||||
{
|
||||
return view('page.aboutus');
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Poll;
|
||||
@@ -42,7 +42,7 @@ class PollController extends Controller
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(Request $request, $slug)
|
||||
@@ -63,9 +63,9 @@ class PollController extends Controller
|
||||
|
||||
if (Voter::where('user_id', '=', $user->id)->where('poll_id', '=', $poll->id)->exists()) {
|
||||
|
||||
Toastr::error('Bro have already vote on this poll. Your vote has not been counted.', 'Whoops!', ['options']);
|
||||
Toastr::error('Bro have already vote on this poll. Your vote has not been counted.', 'Whoops!', ['options']);
|
||||
|
||||
return redirect('poll/' . $poll->slug . '/result');
|
||||
return redirect('poll/' . $poll->slug . '/result');
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\PrivateMessage;
|
||||
@@ -26,31 +26,31 @@ use Carbon\Carbon;
|
||||
class PrivateMessageController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Search pm by username
|
||||
*
|
||||
* @access public
|
||||
* @return View pm.inbox
|
||||
*
|
||||
*/
|
||||
public function searchPM(Request $request, $username, $id)
|
||||
{
|
||||
$user = Auth::user();
|
||||
$search = $request->input('subject');
|
||||
$pms = PrivateMessage::where('reciever_id', '=', $request->user()->id)->where([
|
||||
['subject','like','%'.$search.'%'],
|
||||
])->orderBy('created_at', 'DESC')->paginate(20);
|
||||
/**
|
||||
* Search pm by username
|
||||
*
|
||||
* @access public
|
||||
* @return View pm.inbox
|
||||
*
|
||||
*/
|
||||
public function searchPM(Request $request, $username, $id)
|
||||
{
|
||||
$user = Auth::user();
|
||||
$search = $request->input('subject');
|
||||
$pms = PrivateMessage::where('reciever_id', '=', $request->user()->id)->where([
|
||||
['subject', 'like', '%' . $search . '%'],
|
||||
])->orderBy('created_at', 'DESC')->paginate(20);
|
||||
|
||||
return view('pm.inbox', ['pms' => $pms, 'user' => $user]);
|
||||
}
|
||||
return view('pm.inbox', ['pms' => $pms, 'user' => $user]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Private Messages
|
||||
*
|
||||
* @access public
|
||||
* @return View pm.inbox
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* Get Private Messages
|
||||
*
|
||||
* @access public
|
||||
* @return View pm.inbox
|
||||
*
|
||||
*/
|
||||
public function getPrivateMessages(Request $request, $username, $id)
|
||||
{
|
||||
$user = Auth::user();
|
||||
@@ -90,8 +90,8 @@ class PrivateMessageController extends Controller
|
||||
{
|
||||
$user = Auth::user();
|
||||
$pms = PrivateMessage::where('sender_id', $request->user()->id)
|
||||
->orderBy('created_at', 'desc')
|
||||
->paginate(20);
|
||||
->orderBy('created_at', 'desc')
|
||||
->paginate(20);
|
||||
|
||||
return view('pm.outbox', ['pms' => $pms, 'user' => $user]);
|
||||
}
|
||||
@@ -149,13 +149,13 @@ class PrivateMessageController extends Controller
|
||||
$pm = PrivateMessage::where('id', $pmid)->firstOrFail();
|
||||
|
||||
$attributes = [
|
||||
'sender_id' => $user->id,
|
||||
'reciever_id' => $pm->sender_id,
|
||||
'subject' => $pm->subject,
|
||||
'message' => $request->input('message'),
|
||||
'related_to' => $pm->id,
|
||||
'read' => 0,
|
||||
];
|
||||
'sender_id' => $user->id,
|
||||
'reciever_id' => $pm->sender_id,
|
||||
'subject' => $pm->subject,
|
||||
'message' => $request->input('message'),
|
||||
'related_to' => $pm->id,
|
||||
'read' => 0,
|
||||
];
|
||||
|
||||
$pm = PrivateMessage::create($attributes);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Report;
|
||||
@@ -24,20 +24,20 @@ use \Toastr;
|
||||
class ReportController extends Controller
|
||||
{
|
||||
/**
|
||||
* Reports System
|
||||
*
|
||||
*
|
||||
*/
|
||||
* Reports System
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function postReport()
|
||||
{
|
||||
$user = Auth::user();
|
||||
|
||||
$v = Validator::make(Request::all(), [
|
||||
'type'=>'required',
|
||||
'reporter_id'=>'required|numeric',
|
||||
'title'=>'required',
|
||||
'message'=>'required',
|
||||
'solved'=>'required|numeric'
|
||||
'type' => 'required',
|
||||
'reporter_id' => 'required|numeric',
|
||||
'title' => 'required',
|
||||
'message' => 'required',
|
||||
'solved' => 'required|numeric'
|
||||
]);
|
||||
|
||||
$report = new Report();
|
||||
|
||||
@@ -42,39 +42,39 @@ use Cache;
|
||||
|
||||
class RequestController extends Controller
|
||||
{
|
||||
/**
|
||||
* Search for requests
|
||||
*
|
||||
* @access public
|
||||
* @return View page.requests
|
||||
*
|
||||
*/
|
||||
public function search()
|
||||
{
|
||||
$user = Auth::user();
|
||||
$num_req = Requests::count();
|
||||
$num_fil = Requests::whereNotNull('filled_by')->count();
|
||||
$num_unfil = Requests::whereNull('filled_by')->count();
|
||||
$total_bounty = Requests::all()->sum('bounty');
|
||||
$claimed_bounty = Requests::whereNotNull('filled_by')->sum('bounty');
|
||||
$unclaimed_bounty = Requests::whereNull('filled_by')->sum('bounty');
|
||||
$requests = Requests::where([
|
||||
['name','like','%'.Request::get('name').'%'],
|
||||
['category_id','=',Request::get('category_id')],
|
||||
])->orderBy('created_at', 'DESC')->paginate(25);
|
||||
/**
|
||||
* Search for requests
|
||||
*
|
||||
* @access public
|
||||
* @return View page.requests
|
||||
*
|
||||
*/
|
||||
public function search()
|
||||
{
|
||||
$user = Auth::user();
|
||||
$num_req = Requests::count();
|
||||
$num_fil = Requests::whereNotNull('filled_by')->count();
|
||||
$num_unfil = Requests::whereNull('filled_by')->count();
|
||||
$total_bounty = Requests::all()->sum('bounty');
|
||||
$claimed_bounty = Requests::whereNotNull('filled_by')->sum('bounty');
|
||||
$unclaimed_bounty = Requests::whereNull('filled_by')->sum('bounty');
|
||||
$requests = Requests::where([
|
||||
['name', 'like', '%' . Request::get('name') . '%'],
|
||||
['category_id', '=', Request::get('category_id')],
|
||||
])->orderBy('created_at', 'DESC')->paginate(25);
|
||||
|
||||
$requests->setPath('?name='.Request::get('name').'&category_id='.Request::get('category_id'));
|
||||
$requests->setPath('?name=' . Request::get('name') . '&category_id=' . Request::get('category_id'));
|
||||
|
||||
return view('requests.requests', ['requests' => $requests, 'user' => $user, 'num_req' => $num_req, 'num_fil' => $num_fil, 'num_unfil' => $num_unfil, 'total_bounty' => $total_bounty, 'claimed_bounty' => $claimed_bounty, 'unclaimed_bounty' => $unclaimed_bounty, 'categories' => Category::all()]);
|
||||
}
|
||||
return view('requests.requests', ['requests' => $requests, 'user' => $user, 'num_req' => $num_req, 'num_fil' => $num_fil, 'num_unfil' => $num_unfil, 'total_bounty' => $total_bounty, 'claimed_bounty' => $claimed_bounty, 'unclaimed_bounty' => $unclaimed_bounty, 'categories' => Category::all()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Torrent Requests
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return view::make requests.requests
|
||||
*/
|
||||
* Torrent Requests
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return view::make requests.requests
|
||||
*/
|
||||
public function requests()
|
||||
{
|
||||
$user = Auth::user();
|
||||
@@ -85,30 +85,27 @@ class RequestController extends Controller
|
||||
$claimed_bounty = Requests::whereNotNull('filled_by')->sum('bounty');
|
||||
$unclaimed_bounty = Requests::whereNull('filled_by')->sum('bounty');
|
||||
if (Request::get('filled_requests') == true) {
|
||||
$requests = Requests::whereNotNull('filled_by')->orderBy('created_at', 'DESC')->paginate(20);
|
||||
$requests->setPath('?filled_requests=true');
|
||||
}
|
||||
elseif (Request::get('unfilled_requests') == true) {
|
||||
$requests = Requests::whereNull('filled_by')->orderBy('created_at', 'DESC')->paginate(20);
|
||||
$requests->setPath('?unfilled_requests=true');
|
||||
}
|
||||
elseif (Request::get('my_requests') == true) {
|
||||
$requests = Requests::where('user_id', '=', $user->id)->orderBy('created_at', 'DESC')->paginate(20);
|
||||
$requests->setPath('?my_requests=true');
|
||||
}
|
||||
else {
|
||||
$requests = Requests::orderBy('created_at', 'DESC')->paginate(20);
|
||||
$requests = Requests::whereNotNull('filled_by')->orderBy('created_at', 'DESC')->paginate(20);
|
||||
$requests->setPath('?filled_requests=true');
|
||||
} elseif (Request::get('unfilled_requests') == true) {
|
||||
$requests = Requests::whereNull('filled_by')->orderBy('created_at', 'DESC')->paginate(20);
|
||||
$requests->setPath('?unfilled_requests=true');
|
||||
} elseif (Request::get('my_requests') == true) {
|
||||
$requests = Requests::where('user_id', '=', $user->id)->orderBy('created_at', 'DESC')->paginate(20);
|
||||
$requests->setPath('?my_requests=true');
|
||||
} else {
|
||||
$requests = Requests::orderBy('created_at', 'DESC')->paginate(20);
|
||||
}
|
||||
return view('requests.requests', ['requests' => $requests, 'user' => $user, 'num_req' => $num_req, 'num_fil' => $num_fil, 'num_unfil' => $num_unfil, 'total_bounty' => $total_bounty, 'claimed_bounty' => $claimed_bounty, 'unclaimed_bounty' => $unclaimed_bounty, 'categories' => Category::all()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Torrent Request
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return view::make requests.request
|
||||
*/
|
||||
* Torrent Request
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return view::make requests.request
|
||||
*/
|
||||
public function request($id)
|
||||
{
|
||||
// Find the torrent in the database
|
||||
@@ -118,22 +115,22 @@ class RequestController extends Controller
|
||||
$voters = $request->requestBounty()->get();
|
||||
$comments = $request->comments()->orderBy('created_at', 'DESC')->get();
|
||||
$carbon = Carbon::now()->addDay();
|
||||
$client = new \App\Services\MovieScrapper(config('api-keys.tmdb') , config('api-keys.tvdb') , config('api-keys.omdb'));
|
||||
if($request->category_id ==2) {
|
||||
$movie = $client->scrape('tv', 'tt'.$request->imdb);
|
||||
$client = new \App\Services\MovieScrapper(config('api-keys.tmdb'), config('api-keys.tvdb'), config('api-keys.omdb'));
|
||||
if ($request->category_id == 2) {
|
||||
$movie = $client->scrape('tv', 'tt' . $request->imdb);
|
||||
} else {
|
||||
$movie = $client->scrape('movie', 'tt'.$request->imdb);
|
||||
$movie = $client->scrape('movie', 'tt' . $request->imdb);
|
||||
}
|
||||
return view('requests.request', ['request' => $request, 'voters' => $voters, 'user' => $user, 'comments' => $comments, 'carbon' => $carbon, 'movie' => $movie, 'requestClaim' => $requestClaim]);
|
||||
return view('requests.request', ['request' => $request, 'voters' => $voters, 'user' => $user, 'comments' => $comments, 'carbon' => $carbon, 'movie' => $movie, 'requestClaim' => $requestClaim]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add Torrent Request
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return Redirect::to
|
||||
*/
|
||||
* Add Torrent Request
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return Redirect::to
|
||||
*/
|
||||
public function addrequest()
|
||||
{
|
||||
$user = Auth::user();
|
||||
@@ -185,7 +182,7 @@ class RequestController extends Controller
|
||||
'cost' => Request::get('bounty'),
|
||||
'sender' => $user->id,
|
||||
'receiver' => 0,
|
||||
'comment' => "new request - ".Request::get('name').""
|
||||
'comment' => "new request - " . Request::get('name') . ""
|
||||
]);
|
||||
$BonTransactions->save();
|
||||
|
||||
@@ -210,19 +207,19 @@ class RequestController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit Torrent Request
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return Redirect::to
|
||||
*/
|
||||
* Edit Torrent Request
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return Redirect::to
|
||||
*/
|
||||
public function editrequest($id)
|
||||
{
|
||||
$user = Auth::user();
|
||||
$request = Requests::findOrFail($id);
|
||||
if ($user->group->is_modo || $user->id == $request->user_id) {
|
||||
// Post the Request
|
||||
if (Request::isMethod('post')) {
|
||||
// Post the Request
|
||||
if (Request::isMethod('post')) {
|
||||
// Find the right category
|
||||
$name = Request::get('name');
|
||||
$imdb = Request::get('imdb');
|
||||
@@ -247,17 +244,17 @@ class RequestController extends Controller
|
||||
} else {
|
||||
return view('requests.edit_request', ['categories' => Category::all(), 'types' => Type::all(), 'user' => $user, 'request' => $request]);
|
||||
}
|
||||
} else {
|
||||
return Redirect::route('requests', ['id' => $request->id])->with(Toastr::warning('You Dont Have Access To This Operation!', 'Error!', ['options']));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return Redirect::route('requests', ['id' => $request->id])->with(Toastr::warning('You Dont Have Access To This Operation!', 'Error!', ['options']));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add Bounty to a request
|
||||
*
|
||||
* @access public
|
||||
* @return Redirect::route
|
||||
*/
|
||||
* Add Bounty to a request
|
||||
*
|
||||
* @access public
|
||||
* @return Redirect::route
|
||||
*/
|
||||
public function addBonus($id)
|
||||
{
|
||||
$user = Auth::user();
|
||||
@@ -311,12 +308,12 @@ class RequestController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Fill a request
|
||||
* @method fillRequest
|
||||
*
|
||||
* @param $id ID of the request
|
||||
*
|
||||
*/
|
||||
* Fill a request
|
||||
* @method fillRequest
|
||||
*
|
||||
* @param $id ID of the request
|
||||
*
|
||||
*/
|
||||
public function fillRequest($id)
|
||||
{
|
||||
$user = Auth::user();
|
||||
@@ -350,12 +347,12 @@ class RequestController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that handles the actual filling of requests
|
||||
* @method addRequestModeration
|
||||
*
|
||||
* @param $request_id ID of the Request being handled
|
||||
* @param $info_hash Hash of the torrent filling the hash
|
||||
*/
|
||||
* Function that handles the actual filling of requests
|
||||
* @method addRequestModeration
|
||||
*
|
||||
* @param $request_id ID of the Request being handled
|
||||
* @param $info_hash Hash of the torrent filling the hash
|
||||
*/
|
||||
public function addRequestModeration($request_id, $info_hash)
|
||||
{
|
||||
$user = Auth::user();
|
||||
@@ -374,10 +371,10 @@ class RequestController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Approves the filled torrent on a request
|
||||
* @method approveRequest
|
||||
*
|
||||
*/
|
||||
* Approves the filled torrent on a request
|
||||
* @method approveRequest
|
||||
*
|
||||
*/
|
||||
public function approveRequest($id)
|
||||
{
|
||||
$user = Auth::user();
|
||||
@@ -424,10 +421,10 @@ class RequestController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Rejects the filling torrent on a request
|
||||
* @method rejectRequest
|
||||
*
|
||||
*/
|
||||
* Rejects the filling torrent on a request
|
||||
* @method rejectRequest
|
||||
*
|
||||
*/
|
||||
public function rejectRequest($id)
|
||||
{
|
||||
$user = Auth::user();
|
||||
@@ -448,10 +445,10 @@ class RequestController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a specific request
|
||||
* @method deleteRequest
|
||||
*
|
||||
*/
|
||||
* Deletes a specific request
|
||||
* @method deleteRequest
|
||||
*
|
||||
*/
|
||||
public function deleteRequest($id)
|
||||
{
|
||||
$user = Auth::user();
|
||||
@@ -468,10 +465,10 @@ class RequestController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* User can claim a specific request
|
||||
* @method claimRequest
|
||||
*
|
||||
*/
|
||||
* User can claim a specific request
|
||||
* @method claimRequest
|
||||
*
|
||||
*/
|
||||
public function claimRequest($id)
|
||||
{
|
||||
$user = Auth::user();
|
||||
@@ -496,32 +493,32 @@ class RequestController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* User can claim a specific request
|
||||
* @method claimRequest
|
||||
*
|
||||
*/
|
||||
* User can claim a specific request
|
||||
* @method claimRequest
|
||||
*
|
||||
*/
|
||||
public function unclaimRequest($id)
|
||||
{
|
||||
$user = Auth::user();
|
||||
$request = Requests::findOrFail($id);
|
||||
$claimer = RequestsClaims::where('request_id', '=', $id)->first();
|
||||
|
||||
if($user->group->is_modo || $user->username == $claimer->username){
|
||||
if ($user->group->is_modo || $user->username == $claimer->username) {
|
||||
|
||||
if ($request->claimed == 1) {
|
||||
if ($request->claimed == 1) {
|
||||
|
||||
$requestClaim = RequestsClaims::where('request_id', '=', $id)->firstOrFail();
|
||||
$requestClaim->delete();
|
||||
$requestClaim = RequestsClaims::where('request_id', '=', $id)->firstOrFail();
|
||||
$requestClaim->delete();
|
||||
|
||||
$request->claimed = 0;
|
||||
$request->save();
|
||||
$request->claimed = 0;
|
||||
$request->save();
|
||||
|
||||
return Redirect::route('request', ['id' => $id])->with(Toastr::success("Request Successfuly Un-Claimed", 'Request Claimed', ['options']));
|
||||
return Redirect::route('request', ['id' => $id])->with(Toastr::success("Request Successfuly Un-Claimed", 'Request Claimed', ['options']));
|
||||
} else {
|
||||
return Redirect::route('request', ['id' => $id])->with(Toastr::error("Nothing To Unclaim.", 'Whoops!', ['options']));
|
||||
}
|
||||
} else {
|
||||
return Redirect::route('request', ['id' => $id])->with(Toastr::error("Nothing To Unclaim.", 'Whoops!', ['options']));
|
||||
abort(403, 'Unauthorized action.');
|
||||
}
|
||||
} else {
|
||||
abort(403, 'Unauthorized action.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,10 +54,10 @@ class RssController extends Controller
|
||||
$catArray = $this->getUserData();
|
||||
|
||||
$torrents = Torrent::select('id', 'name', 'slug', 'size', 'seeders', 'leechers', 'info_hash', 'created_at')
|
||||
->whereIn('category', $catArray)
|
||||
->with('category')
|
||||
->orderBy('created_at', 'DESC')
|
||||
->take(25)->toArray();
|
||||
->whereIn('category', $catArray)
|
||||
->with('category')
|
||||
->orderBy('created_at', 'DESC')
|
||||
->take(25)->toArray();
|
||||
|
||||
return $torrents;
|
||||
}
|
||||
@@ -80,6 +80,7 @@ class RssController extends Controller
|
||||
|
||||
return abort(404);
|
||||
}
|
||||
|
||||
public function setView()
|
||||
{
|
||||
Redirect::to();
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Shoutbox;
|
||||
@@ -29,151 +29,151 @@ use \Toastr;
|
||||
class ShoutboxController extends Controller
|
||||
{
|
||||
/**
|
||||
* Send Shout
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function send()
|
||||
{
|
||||
$checkSendRate = Shoutbox::where('user', '=', Auth::user()->id)->where('created_at', '>=', Carbon::now()->subSeconds(2))->first();
|
||||
if ($checkSendRate) {
|
||||
return 'Wait 2 Seconds Between Posts Please';
|
||||
}
|
||||
* Send Shout
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function send()
|
||||
{
|
||||
$checkSendRate = Shoutbox::where('user', '=', Auth::user()->id)->where('created_at', '>=', Carbon::now()->subSeconds(2))->first();
|
||||
if ($checkSendRate) {
|
||||
return 'Wait 2 Seconds Between Posts Please';
|
||||
}
|
||||
|
||||
if (Auth::user()->can_chat == 0) {
|
||||
return 'Your Chat Banned';
|
||||
}
|
||||
if (Auth::user()->can_chat == 0) {
|
||||
return 'Your Chat Banned';
|
||||
}
|
||||
|
||||
$v = Validator::make(Request::all(), [
|
||||
'message'=>'required|min:1|regex:/^[(a-zA-Z\-)]+$/u'
|
||||
]);
|
||||
if ($v->fails()) {
|
||||
Toastr::error('There was a error with your input!', 'Error!', ['options']);
|
||||
}
|
||||
if (Request::ajax()) {
|
||||
preg_match_all('/(@\w+)/', Request::get('message'), $mentions);
|
||||
$mentionIDs = [];
|
||||
foreach ($mentions[0] as $mention) {
|
||||
$findUser = User::where('username', 'LIKE', '%' . str_replace('@', '', $mention) . '%')->first();
|
||||
if (!empty($findUser->id)) {
|
||||
$mentionIDs[] = $findUser['id'];
|
||||
}
|
||||
}
|
||||
$mentions = implode(',', $mentionIDs);
|
||||
if (count($mentions) > 0) {
|
||||
$insertMessage = Shoutbox::create(['user' => Auth::user()->id, 'message' => Request::get('message'), 'mentions' => $mentions]);
|
||||
} else {
|
||||
$insertMessage = Shoutbox::create(['user' => Auth::user()->id, 'message' => Request::get('message')]);
|
||||
}
|
||||
$v = Validator::make(Request::all(), [
|
||||
'message' => 'required|min:1|regex:/^[(a-zA-Z\-)]+$/u'
|
||||
]);
|
||||
if ($v->fails()) {
|
||||
Toastr::error('There was a error with your input!', 'Error!', ['options']);
|
||||
}
|
||||
if (Request::ajax()) {
|
||||
preg_match_all('/(@\w+)/', Request::get('message'), $mentions);
|
||||
$mentionIDs = [];
|
||||
foreach ($mentions[0] as $mention) {
|
||||
$findUser = User::where('username', 'LIKE', '%' . str_replace('@', '', $mention) . '%')->first();
|
||||
if (!empty($findUser->id)) {
|
||||
$mentionIDs[] = $findUser['id'];
|
||||
}
|
||||
}
|
||||
$mentions = implode(',', $mentionIDs);
|
||||
if (count($mentions) > 0) {
|
||||
$insertMessage = Shoutbox::create(['user' => Auth::user()->id, 'message' => Request::get('message'), 'mentions' => $mentions]);
|
||||
} else {
|
||||
$insertMessage = Shoutbox::create(['user' => Auth::user()->id, 'message' => Request::get('message')]);
|
||||
}
|
||||
|
||||
if (Auth::user()->image != null) {
|
||||
$flag = true;
|
||||
$avatar = '<img class="profile-avatar tiny pull-left" src="/files/img/' . Auth::user()->image .'">';
|
||||
} else {
|
||||
$flag = true;
|
||||
$avatar = '<img class="profile-avatar tiny pull-left" src="/img/profil.png">';
|
||||
}
|
||||
if (Auth::user()->image != null) {
|
||||
$flag = true;
|
||||
$avatar = '<img class="profile-avatar tiny pull-left" src="/files/img/' . Auth::user()->image . '">';
|
||||
} else {
|
||||
$flag = true;
|
||||
$avatar = '<img class="profile-avatar tiny pull-left" src="/img/profil.png">';
|
||||
}
|
||||
|
||||
if (Auth::user()->isOnline()) {
|
||||
$flag = true;
|
||||
$online = '<i class="fa fa-circle text-green" data-toggle="tooltip" title="" data-original-title="User Is Online!"></i>';
|
||||
} else {
|
||||
$flag = true;
|
||||
$online = '<i class="fa fa-circle text-red" data-toggle="tooltip" title="" data-original-title="User Is Offline!"></i>';
|
||||
}
|
||||
if (Auth::user()->isOnline()) {
|
||||
$flag = true;
|
||||
$online = '<i class="fa fa-circle text-green" data-toggle="tooltip" title="" data-original-title="User Is Online!"></i>';
|
||||
} else {
|
||||
$flag = true;
|
||||
$online = '<i class="fa fa-circle text-red" data-toggle="tooltip" title="" data-original-title="User Is Offline!"></i>';
|
||||
}
|
||||
|
||||
$appurl = env('APP_URL', 'http://unit3d.site');
|
||||
$data = '<li class="list-group-item">
|
||||
'.($flag ? $avatar : "").'
|
||||
$appurl = env('APP_URL', 'http://unit3d.site');
|
||||
$data = '<li class="list-group-item">
|
||||
' . ($flag ? $avatar : "") . '
|
||||
<h4 class="list-group-item-heading"><span class="badge-user text-bold"><i class="' . (Auth::user()->group->icon) . '" data-toggle="tooltip" title="" data-original-title="' . (Auth::user()->group->name) . '"></i> <a style="color:' . (Auth::user()->group->color) . ';" href=\'' . $appurl . '/' . Auth::user()->username . '.' . Auth::user()->id . '\'>'
|
||||
. Auth::user()->username . '</a>
|
||||
'.($flag ? $online : "").'
|
||||
. Auth::user()->username . '</a>
|
||||
' . ($flag ? $online : "") . '
|
||||
</span> <span class="text-muted"><small><em>' . Carbon::now()->diffForHumans() . '</em></small></span>
|
||||
</h4>
|
||||
<p class="message-content">' . e(Request::get('message')) . '</p>
|
||||
</li>';
|
||||
|
||||
Cache::forget('shoutbox_messages');
|
||||
return Response::json(['success' => true, 'data' => $data]);
|
||||
}
|
||||
}
|
||||
Cache::forget('shoutbox_messages');
|
||||
return Response::json(['success' => true, 'data' => $data]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch Shout
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function fetch()
|
||||
{
|
||||
if (Request::ajax()) {
|
||||
$getData = Cache::remember('shoutbox_messages', 1440, function () {
|
||||
return Shoutbox::orderBy('created_at', 'desc')->take(50)->get();
|
||||
});
|
||||
$getData = $getData->reverse();
|
||||
$data = [];
|
||||
$flag = false;
|
||||
foreach ($getData as $messages) {
|
||||
$class = '';
|
||||
if (in_array(Auth::user()->id, explode(',', $messages->mentions))) {
|
||||
$class = 'mentioned';
|
||||
}
|
||||
/**
|
||||
* Fetch Shout
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function fetch()
|
||||
{
|
||||
if (Request::ajax()) {
|
||||
$getData = Cache::remember('shoutbox_messages', 1440, function () {
|
||||
return Shoutbox::orderBy('created_at', 'desc')->take(50)->get();
|
||||
});
|
||||
$getData = $getData->reverse();
|
||||
$data = [];
|
||||
$flag = false;
|
||||
foreach ($getData as $messages) {
|
||||
$class = '';
|
||||
if (in_array(Auth::user()->id, explode(',', $messages->mentions))) {
|
||||
$class = 'mentioned';
|
||||
}
|
||||
|
||||
if ($messages->poster->image != null) {
|
||||
$flag = true;
|
||||
$avatar = '<img class="profile-avatar tiny pull-left" src="/files/img/' . $messages->poster->image .'">';
|
||||
} else {
|
||||
$flag = true;
|
||||
$avatar = '<img class="profile-avatar tiny pull-left" src="img/profil.png">';
|
||||
}
|
||||
if ($messages->poster->image != null) {
|
||||
$flag = true;
|
||||
$avatar = '<img class="profile-avatar tiny pull-left" src="/files/img/' . $messages->poster->image . '">';
|
||||
} else {
|
||||
$flag = true;
|
||||
$avatar = '<img class="profile-avatar tiny pull-left" src="img/profil.png">';
|
||||
}
|
||||
|
||||
if (Auth::user()->group->is_modo) {
|
||||
$flag = true;
|
||||
$appurl = env('APP_URL', 'http://unit3d.site');
|
||||
$delete = '<a title="Delete Shout" href=\''.$appurl.'/shoutbox/delete/' .$messages->id. '\'><i class="pull-right fa fa-lg fa-times"></i></a>';
|
||||
} else {
|
||||
$flag = true;
|
||||
$delete = '';
|
||||
}
|
||||
if (Auth::user()->group->is_modo) {
|
||||
$flag = true;
|
||||
$appurl = env('APP_URL', 'http://unit3d.site');
|
||||
$delete = '<a title="Delete Shout" href=\'' . $appurl . '/shoutbox/delete/' . $messages->id . '\'><i class="pull-right fa fa-lg fa-times"></i></a>';
|
||||
} else {
|
||||
$flag = true;
|
||||
$delete = '';
|
||||
}
|
||||
|
||||
if ($messages->poster->isOnline()) {
|
||||
$flag = true;
|
||||
$online = '<i class="fa fa-circle text-green" data-toggle="tooltip" title="" data-original-title="User Is Online!"></i>';
|
||||
} else {
|
||||
$flag = true;
|
||||
$online = '<i class="fa fa-circle text-red" data-toggle="tooltip" title="" data-original-title="User Is Offline!"></i>';
|
||||
}
|
||||
if ($messages->poster->isOnline()) {
|
||||
$flag = true;
|
||||
$online = '<i class="fa fa-circle text-green" data-toggle="tooltip" title="" data-original-title="User Is Online!"></i>';
|
||||
} else {
|
||||
$flag = true;
|
||||
$online = '<i class="fa fa-circle text-red" data-toggle="tooltip" title="" data-original-title="User Is Offline!"></i>';
|
||||
}
|
||||
|
||||
$appurl = env('APP_URL', 'http://unit3d.site');
|
||||
$data[] = '<li class="list-group-item ' . $class . '">
|
||||
'.($flag ? $avatar : "").'
|
||||
$appurl = env('APP_URL', 'http://unit3d.site');
|
||||
$data[] = '<li class="list-group-item ' . $class . '">
|
||||
' . ($flag ? $avatar : "") . '
|
||||
<h4 class="list-group-item-heading"><span class="badge-user text-bold"><i class="' . ($messages->poster->group->icon) . '" data-toggle="tooltip" title="" data-original-title="' . ($messages->poster->group->name) . '"></i> <a style="color:' . ($messages->poster->group->color) . ';" href=\'' . $appurl . '/' . e($messages->poster->username) . '.' . e($messages->poster->id) . '\'>'
|
||||
. e($messages->poster->username) . '</a>
|
||||
'.($flag ? $online : "").'
|
||||
. e($messages->poster->username) . '</a>
|
||||
' . ($flag ? $online : "") . '
|
||||
</span> <span class="text-muted"><small><em>' . ($messages->created_at->diffForHumans()) . '</em></small></span>
|
||||
</h4>
|
||||
<p class="message-content">
|
||||
'. \LaravelEmojiOne::toImage(Shoutbox::getMessageHtml($messages->message)) . '
|
||||
'.($flag ? $delete : "").'
|
||||
' . \LaravelEmojiOne::toImage(Shoutbox::getMessageHtml($messages->message)) . '
|
||||
' . ($flag ? $delete : "") . '
|
||||
</p></li>';
|
||||
}
|
||||
return Response::json(['success' => true, 'data' => $data]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Shout
|
||||
*
|
||||
* @param $id
|
||||
*/
|
||||
public function deleteShout($id)
|
||||
{
|
||||
if (Auth::user()->group->is_modo) {
|
||||
$shout = Shoutbox::find($id);
|
||||
Shoutbox::where('id', '=', $id)->delete();
|
||||
Cache::forget('shoutbox_messages');
|
||||
return redirect()->back()->with(Toastr::success('Shout Has Been Deleted.', 'Yay!', ['options']));
|
||||
} else {
|
||||
return redirect()->back()->with(Toastr::error('This is not your shout to delete.', 'Bro!', ['options']));
|
||||
}
|
||||
return Response::json(['success' => true, 'data' => $data]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Shout
|
||||
*
|
||||
* @param $id
|
||||
*/
|
||||
public function deleteShout($id)
|
||||
{
|
||||
if (Auth::user()->group->is_modo) {
|
||||
$shout = Shoutbox::find($id);
|
||||
Shoutbox::where('id', '=', $id)->delete();
|
||||
Cache::forget('shoutbox_messages');
|
||||
return redirect()->back()->with(Toastr::success('Shout Has Been Deleted.', 'Yay!', ['options']));
|
||||
} else {
|
||||
return redirect()->back()->with(Toastr::error('This is not your shout to delete.', 'Bro!', ['options']));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,14 +17,14 @@ use App\Http\Controllers\Controller;
|
||||
class ActivityLogController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Show the application dashboard.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function activityLog()
|
||||
{
|
||||
$logs = \LogActivity::logActivityLists();
|
||||
return view('Staff.activity.index',compact('logs'));
|
||||
}
|
||||
/**
|
||||
* Show the application dashboard.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function activityLog()
|
||||
{
|
||||
$logs = \LogActivity::logActivityLists();
|
||||
return view('Staff.activity.index', compact('logs'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,9 +53,9 @@ class ArticleController extends Controller
|
||||
$post->user_id = Auth::user()->id;
|
||||
// Verify that an image was upload
|
||||
if (Request::hasFile('image') && Request::file('image')->getError() == 0) {
|
||||
// The file is an image
|
||||
// The file is an image
|
||||
if (in_array(Request::file('image')->getClientOriginalExtension(), ['jpg', 'jpeg', 'bmp', 'png', 'tiff'])) {
|
||||
// Move and add the name to the object that will be saved
|
||||
// Move and add the name to the object that will be saved
|
||||
$post->image = 'article-' . uniqid() . '.' . Request::file('image')->getClientOriginalExtension();
|
||||
Request::file('image')->move(getcwd() . '/files/img/', $post->image);
|
||||
} else {
|
||||
@@ -69,7 +69,7 @@ class ArticleController extends Controller
|
||||
|
||||
$v = Validator::make($post->toArray(), $post->rules);
|
||||
if ($v->fails()) {
|
||||
// Delete the image because the validation failed
|
||||
// Delete the image because the validation failed
|
||||
if (file_exists(Request::file('image')->move(getcwd() . '/files/img/' . $post->image))) {
|
||||
unlink(Request::file('image')->move(getcwd() . '/files/img/' . $post->image));
|
||||
}
|
||||
@@ -92,7 +92,7 @@ class ArticleController extends Controller
|
||||
*/
|
||||
public function edit($slug, $id)
|
||||
{
|
||||
$post = Article::findOrFail($id);
|
||||
$post = Article::findOrFail($id);
|
||||
if (Request::isMethod('post')) {
|
||||
$input = Request::all();
|
||||
$post->title = $input['title'];
|
||||
@@ -102,9 +102,9 @@ class ArticleController extends Controller
|
||||
|
||||
// Verify that an image was upload
|
||||
if (Request::hasFile('image') && Request::file('image')->getError() == 0) {
|
||||
// The file is an image
|
||||
// The file is an image
|
||||
if (in_array(Request::file('image')->getClientOriginalExtension(), ['jpg', 'jpeg', 'bmp', 'png', 'tiff'])) {
|
||||
// Move and add the name to the object that will be saved
|
||||
// Move and add the name to the object that will be saved
|
||||
$post->image = 'article-' . uniqid() . '.' . Request::file('image')->getClientOriginalExtension();
|
||||
Request::file('image')->move(getcwd() . '/files/img/', $post->image);
|
||||
} else {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license https://choosealicense.com/licenses/gpl-3.0/ GNU General Public License v3.0
|
||||
* @author BluCrew
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Http\Controllers\Staff;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
@@ -34,82 +34,82 @@ class BanController extends Controller
|
||||
return view('Staff.bans.index', ['bans' => $bans]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ban the user (current_group -> banned)
|
||||
*
|
||||
* @access public
|
||||
* @param $username
|
||||
* @param $id
|
||||
*
|
||||
*/
|
||||
public function ban($username, $id)
|
||||
{
|
||||
$user = User::findOrFail($id);
|
||||
$user->group_id = 5;
|
||||
$user->can_upload = 0;
|
||||
$user->can_download = 0;
|
||||
$user->can_comment = 0;
|
||||
$user->can_invite = 0;
|
||||
$user->can_request = 0;
|
||||
$user->can_chat = 0;
|
||||
$user->save();
|
||||
/**
|
||||
* Ban the user (current_group -> banned)
|
||||
*
|
||||
* @access public
|
||||
* @param $username
|
||||
* @param $id
|
||||
*
|
||||
*/
|
||||
public function ban($username, $id)
|
||||
{
|
||||
$user = User::findOrFail($id);
|
||||
$user->group_id = 5;
|
||||
$user->can_upload = 0;
|
||||
$user->can_download = 0;
|
||||
$user->can_comment = 0;
|
||||
$user->can_invite = 0;
|
||||
$user->can_request = 0;
|
||||
$user->can_chat = 0;
|
||||
$user->save();
|
||||
|
||||
$staff = Auth::user();
|
||||
$v = Validator::make(Request::all(), [
|
||||
'owned_by'=>'required',
|
||||
'created_by'=>'required|numeric',
|
||||
'ban_reason'=>'required',
|
||||
]);
|
||||
$staff = Auth::user();
|
||||
$v = Validator::make(Request::all(), [
|
||||
'owned_by' => 'required',
|
||||
'created_by' => 'required|numeric',
|
||||
'ban_reason' => 'required',
|
||||
]);
|
||||
|
||||
$ban = new Ban();
|
||||
$ban->owned_by = $user->id;
|
||||
$ban->created_by = $staff->id;
|
||||
$ban->ban_reason = Request::get('ban_reason');
|
||||
$ban->save();
|
||||
$ban = new Ban();
|
||||
$ban->owned_by = $user->id;
|
||||
$ban->created_by = $staff->id;
|
||||
$ban->ban_reason = Request::get('ban_reason');
|
||||
$ban->save();
|
||||
|
||||
// Activity Log
|
||||
\LogActivity::addToLog("Staff Member " . $staff->username . " has banned member " . $user->username . ".");
|
||||
// Activity Log
|
||||
\LogActivity::addToLog("Staff Member " . $staff->username . " has banned member " . $user->username . ".");
|
||||
|
||||
return redirect()->back()->with(Toastr::success('User Is Now Banned!', 'Alert', ['options']));
|
||||
}
|
||||
return redirect()->back()->with(Toastr::success('User Is Now Banned!', 'Alert', ['options']));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unban the user (banned -> new group)
|
||||
*
|
||||
* @access public
|
||||
* @param $username
|
||||
* @param $id
|
||||
*
|
||||
*/
|
||||
public function unban($username, $id)
|
||||
{
|
||||
$user = User::findOrFail($id);
|
||||
$user->group_id = Request::get('group_id');
|
||||
$user->can_upload = 1;
|
||||
$user->can_download = 1;
|
||||
$user->can_comment = 1;
|
||||
$user->can_invite = 1;
|
||||
$user->can_request = 1;
|
||||
$user->can_chat = 1;
|
||||
$user->save();
|
||||
/**
|
||||
* Unban the user (banned -> new group)
|
||||
*
|
||||
* @access public
|
||||
* @param $username
|
||||
* @param $id
|
||||
*
|
||||
*/
|
||||
public function unban($username, $id)
|
||||
{
|
||||
$user = User::findOrFail($id);
|
||||
$user->group_id = Request::get('group_id');
|
||||
$user->can_upload = 1;
|
||||
$user->can_download = 1;
|
||||
$user->can_comment = 1;
|
||||
$user->can_invite = 1;
|
||||
$user->can_request = 1;
|
||||
$user->can_chat = 1;
|
||||
$user->save();
|
||||
|
||||
$staff = Auth::user();
|
||||
$v = Validator::make(Request::all(), [
|
||||
'unban_reason'=>'required',
|
||||
'removed_at'=>'required'
|
||||
]);
|
||||
$staff = Auth::user();
|
||||
$v = Validator::make(Request::all(), [
|
||||
'unban_reason' => 'required',
|
||||
'removed_at' => 'required'
|
||||
]);
|
||||
|
||||
$ban = new Ban();
|
||||
$ban->owned_by = $user->id;
|
||||
$ban->created_by = $staff->id;
|
||||
$ban->unban_reason = Request::get('unban_reason');
|
||||
$ban->removed_at = Carbon::now();
|
||||
$ban->save();
|
||||
$ban = new Ban();
|
||||
$ban->owned_by = $user->id;
|
||||
$ban->created_by = $staff->id;
|
||||
$ban->unban_reason = Request::get('unban_reason');
|
||||
$ban->removed_at = Carbon::now();
|
||||
$ban->save();
|
||||
|
||||
// Activity Log
|
||||
\LogActivity::addToLog("Staff Member " . $staff->username . " has unbanned member " . $user->username . ".");
|
||||
// Activity Log
|
||||
\LogActivity::addToLog("Staff Member " . $staff->username . " has unbanned member " . $user->username . ".");
|
||||
|
||||
return redirect()->back()->with(Toastr::success('User Is Now Relieved Of His Ban!', 'Alert', ['options']));
|
||||
}
|
||||
return redirect()->back()->with(Toastr::success('User Is Now Relieved Of His Ban!', 'Alert', ['options']));
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user