finish plugin: sticky promotion
1
.gitignore
vendored
@@ -26,3 +26,4 @@ yarn-error.log
|
||||
/resources/geoip
|
||||
.DS_Store
|
||||
/plugins
|
||||
auth.json
|
||||
|
||||
@@ -40,6 +40,7 @@ use League\Flysystem\StorageAttributes;
|
||||
use Nexus\Database\NexusDB;
|
||||
use Nexus\Imdb\Imdb;
|
||||
use NexusPlugin\PostLike\PostLike;
|
||||
use NexusPlugin\StickyPromotion\Models\StickyPromotion;
|
||||
use Rhilip\Bencode\Bencode;
|
||||
|
||||
class Test extends Command
|
||||
@@ -75,9 +76,10 @@ class Test extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$postLike = new PostLike();
|
||||
$postLike->install();
|
||||
// $postLike->uninstall();
|
||||
$torrent = Torrent::query()->find(2);
|
||||
$torrent = apply_filter('torrent_detail', $torrent);
|
||||
$user = \App\Models\User::query()->find(10001);
|
||||
do_action('announced', $torrent->toArray(), $user->toArray());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -53,4 +53,5 @@ class Controller extends BaseController
|
||||
}
|
||||
return Str::slug("$title.$action", '.');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,11 +15,13 @@ class BonusLogs extends NexusModel
|
||||
const BUSINESS_TYPE_CANCEL_HIT_AND_RUN = 1;
|
||||
const BUSINESS_TYPE_BUY_MEDAL = 2;
|
||||
const BUSINESS_TYPE_BUY_ATTENDANCE_CARD = 3;
|
||||
const BUSINESS_TYPE_STICKY_PROMOTION = 4;
|
||||
|
||||
public static array $businessTypes = [
|
||||
self::BUSINESS_TYPE_CANCEL_HIT_AND_RUN => ['text' => 'Cancel H&R'],
|
||||
self::BUSINESS_TYPE_BUY_MEDAL => ['text' => 'Buy medal'],
|
||||
self::BUSINESS_TYPE_BUY_ATTENDANCE_CARD => ['text' => 'Buy attendance card'],
|
||||
self::BUSINESS_TYPE_STICKY_PROMOTION => ['text' => 'Buy torrent sticky promotion'],
|
||||
];
|
||||
|
||||
public static function getBonusForCancelHitAndRun()
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Models;
|
||||
|
||||
use App\Repositories\TagRepository;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use JeroenG\Explorer\Application\Explored;
|
||||
use Laravel\Scout\Searchable;
|
||||
|
||||
@@ -27,6 +28,7 @@ class Torrent extends NexusModel
|
||||
protected $casts = [
|
||||
'added' => 'datetime',
|
||||
'pt_gen' => 'array',
|
||||
'promotion_until' => 'datetime',
|
||||
];
|
||||
|
||||
public static $commentFields = [
|
||||
@@ -156,6 +158,10 @@ class Torrent extends NexusModel
|
||||
$spState = $this->sp_state;
|
||||
$global = self::getGlobalPromotionState();
|
||||
$log = sprintf('torrent: %s sp_state: %s, global sp state: %s', $this->id, $spState, $global);
|
||||
if ($this->__ignore_global_sp_state) {
|
||||
$log .= "[IGNORE_GLOBAL_SP_STATE]";
|
||||
$global = self::PROMOTION_NORMAL;
|
||||
}
|
||||
if ($global != self::PROMOTION_NORMAL) {
|
||||
$spState = $global;
|
||||
$log .= sprintf(", global != %s, set sp_state to global: %s", self::PROMOTION_NORMAL, $global);
|
||||
@@ -168,6 +174,13 @@ class Torrent extends NexusModel
|
||||
return $spState;
|
||||
}
|
||||
|
||||
public function posStateText(): Attribute
|
||||
{
|
||||
return new Attribute(
|
||||
get: fn($value, $attributes) => nexus_trans('torrent.pos_state_' . $attributes['pos_state'])
|
||||
);
|
||||
}
|
||||
|
||||
public static function getGlobalPromotionState()
|
||||
{
|
||||
if (is_null(self::$globalPromotionState)) {
|
||||
@@ -180,6 +193,18 @@ class Torrent extends NexusModel
|
||||
return self::$globalPromotionState;
|
||||
}
|
||||
|
||||
public static function getFieldsForList($appendTableName = false): array|bool
|
||||
{
|
||||
$fields = 'id, sp_state, promotion_time_type, promotion_until, banned, picktype, pos_state, category, source, medium, codec, standard, processing, team, audiocodec, leechers, seeders, name, small_descr, times_completed, size, added, comments,anonymous,owner,url,cache_stamp, pt_gen, hr';
|
||||
$fields = preg_split('/[,\s]+/', $fields);
|
||||
if ($appendTableName) {
|
||||
foreach ($fields as &$value) {
|
||||
$value = "torrents." . $value;
|
||||
}
|
||||
}
|
||||
return $fields;
|
||||
}
|
||||
|
||||
public function getHrAttribute(): string
|
||||
{
|
||||
$hrMode = Setting::get('hr.mode');
|
||||
|
||||
@@ -11,6 +11,7 @@ use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
use Nexus\Database\NexusDB;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
@@ -127,6 +128,7 @@ class User extends Authenticatable
|
||||
protected $fillable = [
|
||||
'username', 'email', 'passhash', 'secret', 'stylesheet', 'editsecret', 'added', 'modcomment', 'enabled', 'status',
|
||||
'leechwarn', 'leechwarnuntil', 'page', 'class', 'uploaded', 'downloaded', 'clientselect', 'showclienterror', 'last_home',
|
||||
'seedbonus', 'bonuscomment',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -396,15 +398,20 @@ class User extends Authenticatable
|
||||
}
|
||||
|
||||
public function updateWithModComment(array $update, $modComment): bool
|
||||
{
|
||||
return $this->updateWithComment($update, $modComment, 'modcomment');
|
||||
}
|
||||
|
||||
public function updateWithComment(array $update, $comment, $commentField): bool
|
||||
{
|
||||
if (!$this->exists) {
|
||||
throw new \RuntimeException('This method only works when user exists!');
|
||||
throw new \RuntimeException('This method only works when user exists !');
|
||||
}
|
||||
//@todo how to do prepare bindings here ?
|
||||
$modComment = addslashes($modComment);
|
||||
$update['modcomment'] = DB::raw("concat_ws('\n', '$modComment', modcomment)");
|
||||
do_log("update: " . json_encode($update) . ", modcomment: $modComment", 'notice');
|
||||
return $this->update($update);
|
||||
$comment = addslashes($comment);
|
||||
do_log("update: " . json_encode($update) . ", $commentField: $comment", 'notice');
|
||||
$update[$commentField] = NexusDB::raw("if($commentField = '', '$comment', concat_ws('\n', '$comment', $commentField))");
|
||||
return $this->update($update);
|
||||
}
|
||||
|
||||
public function canAccessAdmin()
|
||||
|
||||
@@ -23,6 +23,9 @@ class BonusRepository extends BaseRepository
|
||||
if ($hitAndRun->uid != $uid) {
|
||||
throw new \LogicException("H&R: $hitAndRunId not belongs to user: $uid.");
|
||||
}
|
||||
if ($hitAndRun->status == HitAndRun::STATUS_PARDONED) {
|
||||
throw new \LogicException("H&R: $hitAndRunId already pardoned.");
|
||||
}
|
||||
$requireBonus = BonusLogs::getBonusForCancelHitAndRun();
|
||||
NexusDB::transaction(function () use ($user, $hitAndRun, $requireBonus) {
|
||||
$comment = nexus_trans('hr.bonus_cancel_comment', [
|
||||
@@ -92,8 +95,11 @@ class BonusRepository extends BaseRepository
|
||||
|
||||
}
|
||||
|
||||
private function consumeUserBonus($user, $requireBonus, $logBusinessType, $logComment = '')
|
||||
public function consumeUserBonus($user, $requireBonus, $logBusinessType, $logComment = '')
|
||||
{
|
||||
if ($requireBonus <= 0) {
|
||||
return;
|
||||
}
|
||||
if ($user->seedbonus < $requireBonus) {
|
||||
do_log("user: {$user->id}, bonus: {$user->seedbonus} < requireBonus: $requireBonus", 'error');
|
||||
throw new \LogicException("User bonus point not enough.");
|
||||
|
||||
@@ -110,7 +110,7 @@ class HitAndRunRepository extends BaseRepository
|
||||
->with([
|
||||
'torrent' => function ($query) {$query->select(['id', 'size', 'name']);},
|
||||
'snatch',
|
||||
'user' => function ($query) {$query->select(['id', 'username', 'lang', 'class', 'donoruntil']);},
|
||||
'user' => function ($query) {$query->select(['id', 'username', 'lang', 'class', 'donoruntil', 'enabled']);},
|
||||
'user.language',
|
||||
]);
|
||||
if (!is_null($uid)) {
|
||||
@@ -309,6 +309,10 @@ class HitAndRunRepository extends BaseRepository
|
||||
do_log("[DO_NOT_DISABLE_USER], return");
|
||||
return true;
|
||||
}
|
||||
if ($hitAndRun->user->enabled == 'no') {
|
||||
do_log("[USER_ALREADY_DISABLED], return");
|
||||
return true;
|
||||
}
|
||||
//disable user
|
||||
/** @var User $user */
|
||||
$user = $hitAndRun->user;
|
||||
@@ -370,7 +374,7 @@ class HitAndRunRepository extends BaseRepository
|
||||
public function pardon($id, User $user): bool
|
||||
{
|
||||
$model = HitAndRun::query()->findOrFail($id);
|
||||
if (!in_array($model->status, [HitAndRun::STATUS_INSPECTING, HitAndRun::STATUS_UNREACHED])) {
|
||||
if (!in_array($model->status, $this->getCanPardonStatus())) {
|
||||
throw new \LogicException("Can't be pardoned due to status is: " . $model->status_text . " !");
|
||||
}
|
||||
$model->status = HitAndRun::STATUS_PARDONED;
|
||||
@@ -381,7 +385,7 @@ class HitAndRunRepository extends BaseRepository
|
||||
|
||||
public function bulkPardon(array $params, User $user): int
|
||||
{
|
||||
$query = $this->getBulkQuery($params)->where('status', HitAndRun::STATUS_INSPECTING);
|
||||
$query = $this->getBulkQuery($params)->whereIn('status', $this->getCanPardonStatus());
|
||||
$update = [
|
||||
'status' => HitAndRun::STATUS_PARDONED,
|
||||
'comment' => $this->getCommentUpdateRaw(addslashes('Pardon by ' . $user->username)),
|
||||
@@ -398,4 +402,9 @@ class HitAndRunRepository extends BaseRepository
|
||||
{
|
||||
return DB::raw(sprintf("if (comment = '', '%s', concat('\n', '%s', comment))", $comment, $comment));
|
||||
}
|
||||
|
||||
private function getCanPardonStatus(): array
|
||||
{
|
||||
return [HitAndRun::STATUS_INSPECTING, HitAndRun::STATUS_UNREACHED];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -676,10 +676,11 @@ class SearchRepository extends BaseRepository
|
||||
foreach ($response['hits']['hits'] as $value) {
|
||||
$torrentIdArr[] = $value['_source']['torrent_id'];
|
||||
}
|
||||
$fieldStr = 'id, sp_state, promotion_time_type, promotion_until, banned, picktype, pos_state, category, source, medium, codec, standard, processing, team, audiocodec, leechers, seeders, name, small_descr, times_completed, size, added, comments,anonymous,owner,url,cache_stamp, pt_gen, hr';
|
||||
// $fieldStr = 'id, sp_state, promotion_time_type, promotion_until, banned, picktype, pos_state, category, source, medium, codec, standard, processing, team, audiocodec, leechers, seeders, name, small_descr, times_completed, size, added, comments,anonymous,owner,url,cache_stamp, pt_gen, hr';
|
||||
$fields = Torrent::getFieldsForList();
|
||||
$idStr = implode(',', $torrentIdArr);
|
||||
$result['data'] = Torrent::query()
|
||||
->selectRaw($fieldStr)
|
||||
->select($fields)
|
||||
->whereIn('id', $torrentIdArr)
|
||||
->orderByRaw("field(id,$idStr)")
|
||||
->get()
|
||||
|
||||
@@ -15,6 +15,7 @@ use App\Models\Setting;
|
||||
use App\Models\Snatch;
|
||||
use App\Models\Torrent;
|
||||
use App\Models\User;
|
||||
use App\Models\UserBanLog;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -134,6 +135,9 @@ class TrackerRepository extends BaseRepository
|
||||
}
|
||||
}
|
||||
$repDict = $this->generateSuccessAnnounceResponse($torrent, $queries, $user, $withPeers);
|
||||
if ($isReAnnounce == self::ANNOUNCE_FIRST) {
|
||||
do_action('announced', $torrent->toArray(), $user->toArray(), $queries);
|
||||
}
|
||||
} catch (ClientNotAllowedException $exception) {
|
||||
do_log("[ClientNotAllowedException] " . $exception->getMessage());
|
||||
if (isset($user) && $user->showclienterror == 'no') {
|
||||
@@ -368,7 +372,7 @@ class TrackerRepository extends BaseRepository
|
||||
return $user;
|
||||
}
|
||||
|
||||
protected function checkTorrent($queries, User $user)
|
||||
protected function checkTorrent($queries, User $user): Torrent
|
||||
{
|
||||
// Check Info Hash Against Torrents Table
|
||||
$torrent = $this->getTorrentByInfoHash($queries['info_hash']);
|
||||
@@ -381,8 +385,7 @@ class TrackerRepository extends BaseRepository
|
||||
if ($torrent->banned == 'yes' && $user->class < Setting::get('authority.seebanned')) {
|
||||
throw new TrackerException("torrent banned");
|
||||
}
|
||||
|
||||
return $torrent;
|
||||
return array_filter('torrent_detail', $torrent);
|
||||
}
|
||||
|
||||
protected function checkPeer(Torrent $torrent, array $queries, User $user): void
|
||||
@@ -518,6 +521,12 @@ class TrackerRepository extends BaseRepository
|
||||
Cheater::query()->insert($data);
|
||||
$modComment = "We believe you're trying to cheat. And your account is disabled.";
|
||||
$user->updateWithModComment(['enabled' => User::ENABLED_NO], $modComment);
|
||||
$userBanLog = [
|
||||
'uid' => $user->id,
|
||||
'username' => $user->username,
|
||||
'reason' => "$comment(Upload speed:" . mksize($upSpeed) . "/s)"
|
||||
];
|
||||
UserBanLog::query()->insert($userBanLog);
|
||||
throw new TrackerException($modComment);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@ require dirname(__DIR__) . '/include/functions.php';
|
||||
if (!RUNNING_IN_OCTANE) {
|
||||
\Nexus\Nexus::boot();
|
||||
}
|
||||
|
||||
$hook = new \Nexus\Plugin\Hook();
|
||||
$plugin = new \Nexus\Plugin\Plugin();
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Create The Application
|
||||
|
||||
@@ -357,18 +357,14 @@ function docleanup($forceAll = 0, $printProgress = false) {
|
||||
|
||||
//4.update count of seeders, leechers, comments for torrents
|
||||
$torrents = array();
|
||||
/**
|
||||
* move to announce request to do this
|
||||
* @since 1.7.4
|
||||
*/
|
||||
// $res = sql_query("SELECT torrent, seeder, COUNT(*) AS c FROM peers GROUP BY torrent, seeder") or sqlerr(__FILE__, __LINE__);
|
||||
// while ($row = mysql_fetch_assoc($res)) {
|
||||
// if ($row["seeder"] == "yes")
|
||||
// $key = "seeders";
|
||||
// else
|
||||
// $key = "leechers";
|
||||
// $torrents[$row["torrent"]][$key] = $row["c"];
|
||||
// }
|
||||
$res = sql_query("SELECT torrent, seeder, COUNT(*) AS c FROM peers GROUP BY torrent, seeder") or sqlerr(__FILE__, __LINE__);
|
||||
while ($row = mysql_fetch_assoc($res)) {
|
||||
if ($row["seeder"] == "yes")
|
||||
$key = "seeders";
|
||||
else
|
||||
$key = "leechers";
|
||||
$torrents[$row["torrent"]][$key] = $row["c"];
|
||||
}
|
||||
|
||||
$res = sql_query("SELECT torrent, COUNT(*) AS c FROM comments GROUP BY torrent") or sqlerr(__FILE__, __LINE__);
|
||||
while ($row = mysql_fetch_assoc($res)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.7.14');
|
||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-06-03');
|
||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-06-08');
|
||||
defined('IN_TRACKER') || define('IN_TRACKER', true);
|
||||
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
||||
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
||||
|
||||
@@ -283,10 +283,10 @@ function formatTextAlign($text, $align): string
|
||||
function format_urls($text, $newWindow = false) {
|
||||
// return preg_replace("/((https?|ftp|gopher|news|telnet|mms|rtsp):\/\/[^()\[\]<>\s]+)/ei", "formatUrl('\\1', ".($newWindow==true ? 1 : 0).", '', 'faqlink')", $text);
|
||||
return preg_replace_callback("/((https?|ftp|gopher|news|telnet|mms|rtsp):\/\/[^()\[\]<>\s]+)/i", function ($matches) use ($newWindow) {
|
||||
return formatUrl($matches[1], ".($newWindow==true ? 1 : 0).", '', 'faqlink');
|
||||
return formatUrl($matches[1], $newWindow, '', 'faqlink');
|
||||
}, $text);
|
||||
}
|
||||
function format_comment($text, $strip_html = true, $xssclean = false, $newtab = false, $imageresizer = true, $image_max_width = 700, $enableimage = true, $enableflash = true , $imagenum = -1, $image_max_height = 0, $adid = 0)
|
||||
function format_comment($text, $strip_html = true, $xssclean = false, $newtab = true, $imageresizer = true, $image_max_width = 700, $enableimage = true, $enableflash = true , $imagenum = -1, $image_max_height = 0, $adid = 0)
|
||||
{
|
||||
global $lang_functions;
|
||||
global $CURUSER, $SITENAME, $BASEURL, $enableattach_attachment;
|
||||
@@ -378,14 +378,14 @@ function format_comment($text, $strip_html = true, $xssclean = false, $newtab =
|
||||
} else {
|
||||
// $s = preg_replace("/\[url=([^\[\s]+?)\](.+?)\[\/url\]/ei", "formatUrl('\\1', ".($newtab==true ? 1 : 0).", '\\2', 'faqlink')", $s);
|
||||
$s = preg_replace_callback("/\[url=([^\[\s]+?)\](.+?)\[\/url\]/i", function ($matches) use ($newtab) {
|
||||
return formatUrl($matches[1], ".($newtab==true ? 1 : 0).", $matches[2], 'faqlink');
|
||||
return formatUrl($matches[1], $newtab, $matches[2], 'faqlink');
|
||||
}, $s);
|
||||
}
|
||||
|
||||
// [url]http://www.example.com[/url]
|
||||
// $s = preg_replace("/\[url\]([^\[\s]+?)\[\/url\]/ei", "formatUrl('\\1', ".($newtab==true ? 1 : 0).", '', 'faqlink')", $s);
|
||||
$s = preg_replace_callback("/\[url\]([^\[\s]+?)\[\/url\]/i", function ($matches) use ($newtab) {
|
||||
return formatUrl($matches[1], ".($newtab==true ? 1 : 0).", '', 'faqlink');
|
||||
return formatUrl($matches[1], $newtab, '', 'faqlink');
|
||||
}, $s);
|
||||
|
||||
// [left]Left text[/left]
|
||||
@@ -2481,6 +2481,7 @@ if ($CURUSER){
|
||||
<script type="text/javascript" src="js/domTT_drag.js<?php echo $cssupdatedate?>"></script>
|
||||
<script type="text/javascript" src="js/fadomatic.js<?php echo $cssupdatedate?>"></script>
|
||||
<?php
|
||||
do_action('nexus_header');
|
||||
foreach (\Nexus\Nexus::getAppendHeaders() as $value) {
|
||||
print($value);
|
||||
}
|
||||
@@ -2816,6 +2817,7 @@ function stdfoot() {
|
||||
print("</div>");
|
||||
if ($analyticscode_tweak)
|
||||
print("\n".$analyticscode_tweak."\n");
|
||||
do_action('nexus_footer');
|
||||
foreach (\Nexus\Nexus::getAppendFooters() as $value) {
|
||||
print($value);
|
||||
}
|
||||
@@ -3055,7 +3057,7 @@ function pager($rpp, $count, $href, $opts = array(), $pagename = "page") {
|
||||
|
||||
$start = $page * $rpp;
|
||||
$add_key_shortcut = key_shortcut($page,$pages-1);
|
||||
return array($pagertop, $pagerbottom, "LIMIT $start,$rpp", $start, $rpp);
|
||||
return array($pagertop, $pagerbottom, "LIMIT $start,$rpp", $start, $rpp, $page);
|
||||
}
|
||||
|
||||
function commenttable($rows, $type, $parent_id, $review = false)
|
||||
@@ -3412,7 +3414,8 @@ foreach ($rows as $row)
|
||||
} else {
|
||||
$stickyicon = "";
|
||||
}
|
||||
$sp_torrent = get_torrent_promotion_append($row['sp_state'],"",true,$row["added"], $row['promotion_time_type'], $row['promotion_until']);
|
||||
$stickyicon = apply_filter('sticky_icon', $stickyicon, $row);
|
||||
$sp_torrent = get_torrent_promotion_append($row['sp_state'],"",true,$row["added"], $row['promotion_time_type'], $row['promotion_until'], $row['__ignore_global_sp_state'] ?? false);
|
||||
$hrImg = get_hr_img($row);
|
||||
|
||||
print("<td class=\"rowfollow\" width=\"100%\" align=\"left\"><table class=\"torrentname\" width=\"100%\"><tr" . $sphighlight . "><td class=\"embedded\">".$stickyicon."<a $short_torrent_name_alt $mouseovertorrent href=\"details.php?id=".$id."&hit=1\"><b>".htmlspecialchars($dispname)."</b></a>");
|
||||
@@ -3429,8 +3432,10 @@ foreach ($rows as $row)
|
||||
print("<b> (<font class='new'>".$lang_functions['text_new_uppercase']."</font>)</b>");
|
||||
|
||||
$banned_torrent = ($row["banned"] == 'yes' ? " <b>(<font class=\"striking\">".$lang_functions['text_banned']."</font>)</b>" : "");
|
||||
$sp_torrent_sub = get_torrent_promotion_append_sub($row['sp_state'],"",true,$row['added'], $row['promotion_time_type'], $row['promotion_until']);
|
||||
print($banned_torrent.$picked_torrent.$sp_torrent.$sp_torrent_sub. $hrImg);
|
||||
$sp_torrent_sub = get_torrent_promotion_append_sub($row['sp_state'],"",true,$row['added'], $row['promotion_time_type'], $row['promotion_until'], $row['__ignore_global_sp_state'] ?? false);
|
||||
$titleSuffix = $banned_torrent.$picked_torrent.$sp_torrent.$sp_torrent_sub. $hrImg;
|
||||
$titleSuffix = apply_filter('torrent_title_suffix', $titleSuffix, $row);
|
||||
print($titleSuffix);
|
||||
//$tags = torrentTags($row['tags'], 'span');
|
||||
/**
|
||||
* render tags
|
||||
@@ -4127,15 +4132,20 @@ function get_torrent_bg_color($promotion = 1, $posState = "")
|
||||
return (string)$sphighlight;
|
||||
}
|
||||
|
||||
function get_torrent_promotion_append($promotion = 1,$forcemode = "",$showtimeleft = false, $added = "", $promotionTimeType = 0, $promotionUntil = ''){
|
||||
function get_torrent_promotion_append($promotion = 1,$forcemode = "",$showtimeleft = false, $added = "", $promotionTimeType = 0, $promotionUntil = '', $ignoreGlobal = false){
|
||||
global $CURUSER,$lang_functions;
|
||||
global $expirehalfleech_torrent, $expirefree_torrent, $expiretwoup_torrent, $expiretwoupfree_torrent, $expiretwouphalfleech_torrent, $expirethirtypercentleech_torrent;
|
||||
|
||||
$globalSpState = get_global_sp_state();
|
||||
$sp_torrent = "";
|
||||
$onmouseover = "";
|
||||
$log = "[GET_PROMOTION], promotion: $promotion, forcemode: $forcemode, showtimeleft: $showtimeleft, added: $added, promotionTimeType: $promotionTimeType, promotionUntil: $promotionUntil";
|
||||
$log .= ", get_global_sp_state() == " . get_global_sp_state();
|
||||
if (get_global_sp_state() == 1) {
|
||||
if ($ignoreGlobal) {
|
||||
$globalSpState = 1;
|
||||
$log .= ", [IGNORE_GLOBAL]";
|
||||
}
|
||||
$log .= ", globalSpState == " . $globalSpState;
|
||||
if ($globalSpState == 1) {
|
||||
switch ($promotion){
|
||||
case 2:
|
||||
{
|
||||
@@ -4237,54 +4247,54 @@ function get_torrent_promotion_append($promotion = 1,$forcemode = "",$showtimele
|
||||
}
|
||||
if (($CURUSER['appendpromotion'] == 'word' && $forcemode == "" ) || $forcemode == 'word'){
|
||||
$log .= ", user appendpromotion = word";
|
||||
if(($promotion==2 && get_global_sp_state() == 1) || get_global_sp_state() == 2){
|
||||
if(($promotion==2 && $globalSpState == 1) || $globalSpState == 2){
|
||||
$log .= ", promotion or global_sp_state = 2";
|
||||
$sp_torrent = " <b>[<font class='free' ".$onmouseover.">".$lang_functions['text_free']."</font>]</b>";
|
||||
}
|
||||
elseif(($promotion==3 && get_global_sp_state() == 1) || get_global_sp_state() == 3){
|
||||
elseif(($promotion==3 && $globalSpState == 1) || $globalSpState == 3){
|
||||
$log .= ", promotion or global_sp_state = 3";
|
||||
$sp_torrent = " <b>[<font class='twoup' ".$onmouseover.">".$lang_functions['text_two_times_up']."</font>]</b>";
|
||||
}
|
||||
elseif(($promotion==4 && get_global_sp_state() == 1) || get_global_sp_state() == 4){
|
||||
elseif(($promotion==4 && $globalSpState == 1) || $globalSpState == 4){
|
||||
$log .= ", promotion or global_sp_state = 4";
|
||||
$sp_torrent = " <b>[<font class='twoupfree' ".$onmouseover.">".$lang_functions['text_free_two_times_up']."</font>]</b>";
|
||||
}
|
||||
elseif(($promotion==5 && get_global_sp_state() == 1) || get_global_sp_state() == 5){
|
||||
elseif(($promotion==5 && $globalSpState == 1) || $globalSpState == 5){
|
||||
$log .= ", promotion or global_sp_state = 5";
|
||||
$sp_torrent = " <b>[<font class='halfdown' ".$onmouseover.">".$lang_functions['text_half_down']."</font>]</b>";
|
||||
}
|
||||
elseif(($promotion==6 && get_global_sp_state() == 1) || get_global_sp_state() == 6){
|
||||
elseif(($promotion==6 && $globalSpState == 1) || $globalSpState == 6){
|
||||
$log .= ", promotion or global_sp_state = 6";
|
||||
$sp_torrent = " <b>[<font class='twouphalfdown' ".$onmouseover.">".$lang_functions['text_half_down_two_up']."</font>]</b>";
|
||||
}
|
||||
elseif(($promotion==7 && get_global_sp_state() == 1) || get_global_sp_state() == 7){
|
||||
elseif(($promotion==7 && $globalSpState == 1) || $globalSpState == 7){
|
||||
$log .= ", promotion or global_sp_state = 7";
|
||||
$sp_torrent = " <b>[<font class='thirtypercent' ".$onmouseover.">".$lang_functions['text_thirty_percent_down']."</font>]</b>";
|
||||
}
|
||||
}
|
||||
elseif (($CURUSER['appendpromotion'] == 'icon' && $forcemode == "") || $forcemode == 'icon'){
|
||||
$log .= ", user appendpromotion = icon";
|
||||
if(($promotion==2 && get_global_sp_state() == 1) || get_global_sp_state() == 2) {
|
||||
if(($promotion==2 && $globalSpState == 1) || $globalSpState == 2) {
|
||||
$log .= ", promotion or global_sp_state = 2";
|
||||
$sp_torrent = " <img class=\"pro_free\" src=\"pic/trans.gif\" alt=\"Free\" ".($onmouseover ? $onmouseover : "title=\"".$lang_functions['text_free']."\"")." />";
|
||||
}
|
||||
elseif(($promotion==3 && get_global_sp_state() == 1) || get_global_sp_state() == 3) {
|
||||
elseif(($promotion==3 && $globalSpState == 1) || $globalSpState == 3) {
|
||||
$log .= ", promotion or global_sp_state = 3";
|
||||
$sp_torrent = " <img class=\"pro_2up\" src=\"pic/trans.gif\" alt=\"2X\" ".($onmouseover ? $onmouseover : "title=\"".$lang_functions['text_two_times_up']."\"")." />";
|
||||
}
|
||||
elseif(($promotion==4 && get_global_sp_state() == 1) || get_global_sp_state() == 4) {
|
||||
elseif(($promotion==4 && $globalSpState == 1) || $globalSpState == 4) {
|
||||
$log .= ", promotion or global_sp_state = 4";
|
||||
$sp_torrent = " <img class=\"pro_free2up\" src=\"pic/trans.gif\" alt=\"2X Free\" ".($onmouseover ? $onmouseover : "title=\"".$lang_functions['text_free_two_times_up']."\"")." />";
|
||||
}
|
||||
elseif(($promotion==5 && get_global_sp_state() == 1) || get_global_sp_state() == 5) {
|
||||
elseif(($promotion==5 && $globalSpState == 1) || $globalSpState == 5) {
|
||||
$log .= ", promotion or global_sp_state = 5";
|
||||
$sp_torrent = " <img class=\"pro_50pctdown\" src=\"pic/trans.gif\" alt=\"50%\" ".($onmouseover ? $onmouseover : "title=\"".$lang_functions['text_half_down']."\"")." />";
|
||||
}
|
||||
elseif(($promotion==6 && get_global_sp_state() == 1) || get_global_sp_state() == 6) {
|
||||
elseif(($promotion==6 && $globalSpState == 1) || $globalSpState == 6) {
|
||||
$log .= ", promotion or global_sp_state = 6";
|
||||
$sp_torrent = " <img class=\"pro_50pctdown2up\" src=\"pic/trans.gif\" alt=\"2X 50%\" ".($onmouseover ? $onmouseover : "title=\"".$lang_functions['text_half_down_two_up']."\"")." />";
|
||||
}
|
||||
elseif(($promotion==7 && get_global_sp_state() == 1) || get_global_sp_state() == 7) {
|
||||
elseif(($promotion==7 && $globalSpState == 1) || $globalSpState == 7) {
|
||||
$log .= ", promotion or global_sp_state = 7";
|
||||
$sp_torrent = " <img class=\"pro_30pctdown\" src=\"pic/trans.gif\" alt=\"30%\" ".($onmouseover ? $onmouseover : "title=\"".$lang_functions['text_thirty_percent_down']."\"")." />";
|
||||
}
|
||||
@@ -4293,15 +4303,20 @@ function get_torrent_promotion_append($promotion = 1,$forcemode = "",$showtimele
|
||||
return $sp_torrent;
|
||||
}
|
||||
|
||||
function get_torrent_promotion_append_sub($promotion = 1,$forcemode = "",$showtimeleft = false, $added = "", $promotionTimeType = 0, $promotionUntil = ''){
|
||||
function get_torrent_promotion_append_sub($promotion = 1,$forcemode = "",$showtimeleft = false, $added = "", $promotionTimeType = 0, $promotionUntil = '', $ignoreGlobal = false){
|
||||
global $CURUSER,$lang_functions;
|
||||
global $expirehalfleech_torrent, $expirefree_torrent, $expiretwoup_torrent, $expiretwoupfree_torrent, $expiretwouphalfleech_torrent, $expirethirtypercentleech_torrent;
|
||||
|
||||
$globalSpState = get_global_sp_state();
|
||||
$sp_torrent = "";
|
||||
$onmouseover = "";
|
||||
$log = "[GET_PROMOTION], promotion: $promotion, forcemode: $forcemode, showtimeleft: $showtimeleft, added: $added, promotionTimeType: $promotionTimeType, promotionUntil: $promotionUntil";
|
||||
$log .= ", get_global_sp_state() == " . get_global_sp_state();
|
||||
if (get_global_sp_state() == 1) {
|
||||
if ($ignoreGlobal) {
|
||||
$globalSpState = 1;
|
||||
$log .= ", [IGNORE_GLOBAL]";
|
||||
}
|
||||
$log .= ", globalSpState == " . $globalSpState;
|
||||
if ($globalSpState == 1) {
|
||||
switch ($promotion){
|
||||
case 2:
|
||||
{
|
||||
@@ -4403,54 +4418,54 @@ function get_torrent_promotion_append_sub($promotion = 1,$forcemode = "",$showti
|
||||
}
|
||||
if (($CURUSER['appendpromotion'] == 'word' && $forcemode == "" ) || $forcemode == 'word'){
|
||||
$log .= ", user appendpromotion = word";
|
||||
if(($promotion==2 && get_global_sp_state() == 1) || get_global_sp_state() == 2){
|
||||
if(($promotion==2 && $globalSpState == 1) || $globalSpState == 2){
|
||||
$log .= ", promotion or global_sp_state = 2";
|
||||
$sp_torrent = $onmouseover;
|
||||
}
|
||||
elseif(($promotion==3 && get_global_sp_state() == 1) || get_global_sp_state() == 3){
|
||||
elseif(($promotion==3 && $globalSpState == 1) || $globalSpState == 3){
|
||||
$log .= ", promotion or global_sp_state = 3";
|
||||
$sp_torrent = $onmouseover;
|
||||
}
|
||||
elseif(($promotion==4 && get_global_sp_state() == 1) || get_global_sp_state() == 4){
|
||||
elseif(($promotion==4 && $globalSpState == 1) || $globalSpState == 4){
|
||||
$log .= ", promotion or global_sp_state = 4";
|
||||
$sp_torrent = $onmouseover;
|
||||
}
|
||||
elseif(($promotion==5 && get_global_sp_state() == 1) || get_global_sp_state() == 5){
|
||||
elseif(($promotion==5 && $globalSpState == 1) || $globalSpState == 5){
|
||||
$log .= ", promotion or global_sp_state = 5";
|
||||
$sp_torrent = $onmouseover;
|
||||
}
|
||||
elseif(($promotion==6 && get_global_sp_state() == 1) || get_global_sp_state() == 6){
|
||||
elseif(($promotion==6 && $globalSpState == 1) || $globalSpState == 6){
|
||||
$log .= ", promotion or global_sp_state = 6";
|
||||
$sp_torrent = $onmouseover;
|
||||
}
|
||||
elseif(($promotion==7 && get_global_sp_state() == 1) || get_global_sp_state() == 7){
|
||||
elseif(($promotion==7 && $globalSpState == 1) || $globalSpState == 7){
|
||||
$log .= ", promotion or global_sp_state = 7";
|
||||
$sp_torrent = $onmouseover;
|
||||
}
|
||||
}
|
||||
elseif (($CURUSER['appendpromotion'] == 'icon' && $forcemode == "") || $forcemode == 'icon'){
|
||||
$log .= ", user appendpromotion = icon";
|
||||
if(($promotion==2 && get_global_sp_state() == 1) || get_global_sp_state() == 2) {
|
||||
if(($promotion==2 && $globalSpState == 1) || $globalSpState == 2) {
|
||||
$log .= ", promotion or global_sp_state = 2";
|
||||
$sp_torrent = $onmouseover;
|
||||
}
|
||||
elseif(($promotion==3 && get_global_sp_state() == 1) || get_global_sp_state() == 3) {
|
||||
elseif(($promotion==3 && $globalSpState == 1) || $globalSpState == 3) {
|
||||
$log .= ", promotion or global_sp_state = 3";
|
||||
$sp_torrent = $onmouseover;
|
||||
}
|
||||
elseif(($promotion==4 && get_global_sp_state() == 1) || get_global_sp_state() == 4) {
|
||||
elseif(($promotion==4 && $globalSpState == 1) || $globalSpState == 4) {
|
||||
$log .= ", promotion or global_sp_state = 4";
|
||||
$sp_torrent = $onmouseover;
|
||||
}
|
||||
elseif(($promotion==5 && get_global_sp_state() == 1) || get_global_sp_state() == 5) {
|
||||
elseif(($promotion==5 && $globalSpState == 1) || $globalSpState == 5) {
|
||||
$log .= ", promotion or global_sp_state = 5";
|
||||
$sp_torrent = $onmouseover;
|
||||
}
|
||||
elseif(($promotion==6 && get_global_sp_state() == 1) || get_global_sp_state() == 6) {
|
||||
elseif(($promotion==6 && $globalSpState == 1) || $globalSpState == 6) {
|
||||
$log .= ", promotion or global_sp_state = 6";
|
||||
$sp_torrent = $onmouseover;
|
||||
}
|
||||
elseif(($promotion==7 && get_global_sp_state() == 1) || get_global_sp_state() == 7) {
|
||||
elseif(($promotion==7 && $globalSpState == 1) || $globalSpState == 7) {
|
||||
$log .= ", promotion or global_sp_state = 7";
|
||||
$sp_torrent = $onmouseover;
|
||||
}
|
||||
@@ -5064,10 +5079,15 @@ function canDoLogin()
|
||||
|
||||
function displayHotAndClassic()
|
||||
{
|
||||
global $showextinfo, $showmovies, $Cache, $lang_functions;
|
||||
global $showextinfo, $showmovies, $Cache, $lang_functions, $browsecatmode, $specialcatmode;
|
||||
|
||||
if ($showmovies['hot'] == "yes" || $showmovies['classic'] == "yes")
|
||||
{
|
||||
if (nexus()->getScript() == 'special') {
|
||||
$mode = $specialcatmode;
|
||||
} else {
|
||||
$mode = $browsecatmode;
|
||||
}
|
||||
$imdb = new \Nexus\Imdb\Imdb();
|
||||
$type = array('hot', 'classic');
|
||||
foreach($type as $type_each)
|
||||
@@ -5079,7 +5099,7 @@ function displayHotAndClassic()
|
||||
{
|
||||
$Cache->add_whole_row();
|
||||
|
||||
$res = sql_query("SELECT sp_state, url, id, name, small_descr, cover FROM torrents WHERE picktype = " . sqlesc($type_each) . " AND seeders > 0 AND (url != '' OR cover != '') ORDER BY id DESC LIMIT 30") or sqlerr(__FILE__, __LINE__);
|
||||
$res = sql_query("SELECT torrents.sp_state, torrents.url, torrents.id, torrents.name, torrents.small_descr, torrents.cover FROM torrents LEFT JOIN categories ON torrents.category = categories.id WHERE categories.mode = $mode AND picktype = " . sqlesc($type_each) . " AND seeders > 0 AND (url != '' OR cover != '') ORDER BY id DESC LIMIT 30") or sqlerr(__FILE__, __LINE__);
|
||||
if (mysql_num_rows($res) > 0)
|
||||
{
|
||||
$movies_list = "";
|
||||
@@ -5089,7 +5109,7 @@ function displayHotAndClassic()
|
||||
$height = 140;
|
||||
while($array = mysql_fetch_array($res))
|
||||
{
|
||||
$pro_torrent = get_torrent_promotion_append($array['sp_state'],'word');
|
||||
$pro_torrent = get_torrent_promotion_append($array['sp_state'],'word', false, '', 0, '', $array['__ignore_global_sp_state'] ?? false);
|
||||
if (!empty($array['cover'])) {
|
||||
$thumbnail = "<img width=\"{$width}\" height=\"{$height}\" src=\"".$array['cover']."\" border=\"0\" alt=\"poster\" />";
|
||||
} elseif ($imdb_id = parse_imdb_id($array["url"])) {
|
||||
@@ -5225,7 +5245,7 @@ function strip_all_tags($text)
|
||||
return trim($text);
|
||||
}
|
||||
|
||||
function format_description(string $description)
|
||||
function format_description($description)
|
||||
{
|
||||
//替换附件
|
||||
$pattern = '/(\[attach\](.*)\[\/attach\])/isU';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
# IMPORTANT: Do not edit below unless you know what you are doing!
|
||||
|
||||
if(!defined('IN_TRACKER'))
|
||||
die('Hacking attempt!');
|
||||
|
||||
@@ -64,7 +65,7 @@ function err($msg, $userid = 0, $torrentid = 0)
|
||||
exit();
|
||||
}
|
||||
function check_cheater($userid, $torrentid, $uploaded, $downloaded, $anctime, $seeders=0, $leechers=0){
|
||||
global $cheaterdet_security,$nodetect_security;
|
||||
global $cheaterdet_security,$nodetect_security, $CURUSER;
|
||||
|
||||
$time = date("Y-m-d H:i:s");
|
||||
$upspeed = ($uploaded > 0 ? $uploaded / $anctime : 0);
|
||||
@@ -77,6 +78,12 @@ function check_cheater($userid, $torrentid, $uploaded, $downloaded, $anctime, $s
|
||||
mysql_query("INSERT INTO cheaters (added, userid, torrentid, uploaded, downloaded, anctime, seeders, leechers, comment) VALUES (".sqlesc($time).", $userid, $torrentid, $uploaded, $downloaded, $anctime, $seeders, $leechers, ".sqlesc($comment).")") or err("Tracker error 51");
|
||||
mysql_query("UPDATE users SET enabled = 'no' WHERE id=$userid") or err("Tracker error 50"); //automatically disable user account;
|
||||
err("We believe you're trying to cheat. And your account is disabled.");
|
||||
$userBanLog = [
|
||||
'uid' => $userid,
|
||||
'username' => $CURUSER['username'],
|
||||
'reason' => "$comment(Upload speed:" . mksize($upspeed) . "/s)"
|
||||
];
|
||||
\App\Models\UserBanLog::query()->insert($userBanLog);
|
||||
return true;
|
||||
}
|
||||
if ($uploaded > 1073741824 && $upspeed > ($mayBeCheaterSpeed/$cheaterdet_security)) //Uploaded more than 1 GB with uploading rate higher than 25 MByte/S (For Consertive level). This is likely cheating.
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
|
||||
function get_global_sp_state()
|
||||
{
|
||||
global $Cache;
|
||||
@@ -733,11 +731,11 @@ function add_filter($name, $function, $priority = 10, $argc = 1)
|
||||
$hook->addFilter($name, $function, $priority, $argc);
|
||||
}
|
||||
|
||||
function apply_filter($name, $value)
|
||||
function apply_filter($name, ...$args)
|
||||
{
|
||||
global $hook;
|
||||
do_log("[APPLY_FILTER]: $name");
|
||||
return $hook->applyFilter($name, func_get_args());
|
||||
return $hook->applyFilter(...func_get_args());
|
||||
}
|
||||
|
||||
function add_action($name, $function, $priority = 10, $argc = 1)
|
||||
@@ -750,7 +748,7 @@ function do_action($name, ...$args)
|
||||
{
|
||||
global $hook;
|
||||
do_log("[DO_ACTION]: $name");
|
||||
return $hook->doAction($name, ...$args);
|
||||
return $hook->doAction(...func_get_args());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -26,4 +26,5 @@ $lang_complains = [
|
||||
'no_pending_complaints' => '暂无待处理的申诉',
|
||||
'complaints_processed' => '已处理申诉',
|
||||
'no_complaints_have_been_processed' => '暂无已处理的申诉',
|
||||
'text_view_band_log' => '查看封禁记录',
|
||||
];
|
||||
|
||||
@@ -304,9 +304,9 @@ $lang_settings = array
|
||||
'row_promote_to_one' => "升级至",
|
||||
'row_promote_to_two' => "",
|
||||
'text_member_longer_than' => "注册时间大于",
|
||||
'text_downloaded_more_than' => "周,下载量大于",
|
||||
'text_with_ratio_above' => " 且分享率大于",
|
||||
'text_seed_points_more_than' => 'GB,做种积分大于',
|
||||
'text_downloaded_more_than' => ",下载量大于",
|
||||
'text_with_ratio_above' => "GB, 且分享率大于",
|
||||
'text_seed_points_more_than' => '周,做种积分大于',
|
||||
'text_be_promoted_to' => "的用户,将升级为",
|
||||
'text_promote_to_default_one' => "。默认",
|
||||
'text_promote_to_default_two' => ",他将被降级。默认",
|
||||
|
||||
@@ -26,4 +26,5 @@ $lang_complains = [
|
||||
'no_pending_complaints' => '暫無待處理的申訴',
|
||||
'complaints_processed' => '已處理申訴',
|
||||
'no_complaints_have_been_processed' => '暫無已處理的申訴',
|
||||
'text_view_band_log' => '查看封禁記錄',
|
||||
];
|
||||
|
||||
@@ -305,8 +305,9 @@ $lang_settings = array
|
||||
'row_promote_to_one' => "升級至",
|
||||
'row_promote_to_two' => "",
|
||||
'text_member_longer_than' => "註冊時間大于",
|
||||
'text_downloaded_more_than' => "周,下載量大于",
|
||||
'text_with_ratio_above' => " GB且分享率大于",
|
||||
'text_downloaded_more_than' => ",下載量大于",
|
||||
'text_with_ratio_above' => "GB, 且分享率大于",
|
||||
'text_seed_points_more_than' => '周,做種積分大於',
|
||||
'text_be_promoted_to' => "的用戶,將升級為",
|
||||
'text_promote_to_default_one' => "。預設",
|
||||
'text_promote_to_default_two' => ",他將被降級。預設",
|
||||
|
||||
@@ -26,4 +26,5 @@ $lang_complains = [
|
||||
'no_pending_complaints' => 'No pending complaints',
|
||||
'complaints_processed' => 'Complaints processed',
|
||||
'no_complaints_have_been_processed' => 'No complaints have been processed',
|
||||
'text_view_band_log' => 'View ban log',
|
||||
];
|
||||
|
||||
@@ -304,8 +304,9 @@ $lang_settings = array
|
||||
'row_promote_to_one' => "Promote to ",
|
||||
'row_promote_to_two' => "",
|
||||
'text_member_longer_than' => "Users, who have been a member longer than ",
|
||||
'text_downloaded_more_than' => " weeks and downloaded more than ",
|
||||
'text_with_ratio_above' => " GB with ratio above ",
|
||||
'text_downloaded_more_than' => ", and downloaded more than ",
|
||||
'text_with_ratio_above' => "GB, with ratio above ",
|
||||
'text_seed_points_more_than' => 'week, seed points above',
|
||||
'text_be_promoted_to' => ", would be promoted to ",
|
||||
'text_promote_to_default_one' => ". Default ",
|
||||
'text_promote_to_default_two' => ". Default ",
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<?php
|
||||
namespace Nexus\Plugin;
|
||||
|
||||
use App\Repositories\BaseRepository;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
|
||||
abstract class BasePlugin
|
||||
abstract class BasePlugin extends BaseRepository
|
||||
{
|
||||
abstract function install();
|
||||
|
||||
|
||||
@@ -37,11 +37,11 @@ class Hook
|
||||
{
|
||||
if (!isset(self::$callbacks[$name])) {
|
||||
do_log("No this hook: $name");
|
||||
return null;
|
||||
return $value;
|
||||
}
|
||||
$args = func_get_args();
|
||||
reset(self::$callbacks[$name]);
|
||||
do_log("name: $name, args: " . json_encode($args));
|
||||
do_log("name: $name, argc: " . (func_num_args() - 1));
|
||||
do {
|
||||
foreach ((array)current(self::$callbacks[$name]) as $callback) {
|
||||
$args[1] = $value;
|
||||
|
||||
@@ -8,9 +8,7 @@ class Plugin
|
||||
public function __construct()
|
||||
{
|
||||
$this->loadProviders();
|
||||
if (!isRunningInConsole()) {
|
||||
$this->bootPlugins();
|
||||
}
|
||||
$this->bootPlugins();
|
||||
}
|
||||
|
||||
public function enabled($name): bool
|
||||
@@ -22,7 +20,7 @@ class Plugin
|
||||
{
|
||||
if (isset(self::$providers[$name]['providers'][0])) {
|
||||
$className = self::$providers[$name]['providers'][0];
|
||||
$className = str_replace('ServiceProvider', '', $className);
|
||||
$className = str_replace('ServiceProvider', 'Repository', $className);
|
||||
if (class_exists($className)) {
|
||||
return new $className;
|
||||
}
|
||||
@@ -35,7 +33,7 @@ class Plugin
|
||||
$provider = $providers['providers'][0];
|
||||
$parts = explode('\\', $provider);
|
||||
if ($parts[0] == 'NexusPlugin') {
|
||||
$className = str_replace('ServiceProvider', '', $provider);
|
||||
$className = str_replace('ServiceProvider', 'Repository', $provider);
|
||||
call_user_func([new $className, 'boot']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ $seeder = ($left == 0) ? "yes" : "no";
|
||||
|
||||
// check passkey
|
||||
if (!$az = $Cache->get_value('user_passkey_'.$passkey.'_content')){
|
||||
$res = sql_query("SELECT id, downloadpos, enabled, uploaded, downloaded, class, parked, clientselect, showclienterror, passkey, donor, donoruntil FROM users WHERE passkey=". sqlesc($passkey)." LIMIT 1");
|
||||
$res = sql_query("SELECT id, username, downloadpos, enabled, uploaded, downloaded, class, parked, clientselect, showclienterror, passkey, donor, donoruntil FROM users WHERE passkey=". sqlesc($passkey)." LIMIT 1");
|
||||
$az = mysql_fetch_array($res);
|
||||
do_log("[check passkey], currentUser: " . nexus_json_encode($az));
|
||||
$Cache->cache_value('user_passkey_'.$passkey.'_content', $az, 950);
|
||||
@@ -174,6 +174,8 @@ elseif ($torrent['banned'] == 'yes' && $az['class'] < $seebanned_class) err("tor
|
||||
$torrentid = $torrent["id"];
|
||||
$numpeers = $torrent["seeders"]+$torrent["leechers"];
|
||||
|
||||
$torrent = apply_filter('torrent_detail', $torrent);
|
||||
|
||||
if ($seeder == 'yes'){ //Don't report seeds to other seeders
|
||||
$only_leech_query = " AND seeder = 'no' ";
|
||||
$newnumpeers = $torrent["leechers"];
|
||||
@@ -346,6 +348,10 @@ else // continue an existing session
|
||||
if (!$is_cheater && ($trueupthis > 0 || $truedownthis > 0))
|
||||
{
|
||||
$global_promotion_state = get_global_sp_state();
|
||||
if (isset($torrent['__ignore_global_sp_state']) && $torrent['__ignore_global_sp_state']) {
|
||||
do_log("[IGNORE_GLOBAL_SP_STATE], sp_state: {$torrent['sp_state']}");
|
||||
$global_promotion_state = 1;
|
||||
}
|
||||
if($global_promotion_state == 1)// Normal, see individual torrent
|
||||
{
|
||||
if($torrent['sp_state']==3) //2X
|
||||
@@ -469,6 +475,7 @@ elseif(isset($self))
|
||||
->first();
|
||||
if ($snatchInfo) {
|
||||
sql_query("UPDATE snatched SET uploaded = uploaded + $trueupthis, downloaded = downloaded + $truedownthis, to_go = $left, $announcetime, last_action = ".$dt." $finished_snatched WHERE torrentid = $torrentid AND userid = $userid") or err("SL Err 2");
|
||||
do_action('snatched_saved', $torrent, $snatchInfo->toArray());
|
||||
if (
|
||||
$event == 'completed'
|
||||
&& $az['class'] < \App\Models\HitAndRun::MINIMUM_IGNORE_USER_CLASS
|
||||
@@ -561,5 +568,6 @@ if(count($USERUPDATESET) && $userid)
|
||||
{
|
||||
sql_query("UPDATE users SET " . join(",", $USERUPDATESET) . " WHERE id = ".$userid);
|
||||
}
|
||||
do_action('announced', $torrent, $az, $_REQUEST);
|
||||
benc_resp($rep_dict);
|
||||
?>
|
||||
|
||||
@@ -84,6 +84,7 @@ if($_SERVER['REQUEST_METHOD'] === 'POST'){
|
||||
$res = sql_query(sprintf('SELECT * FROM complains WHERE uuid = %s', sqlesc($uuid))) or sqlerr(__FILE__, __LINE__);
|
||||
$complain = mysql_fetch_assoc($res);
|
||||
if(!$complain) permissiondenied();
|
||||
$user = \App\Models\User::query()->where('email', $complain['email'])->first();
|
||||
stdhead($lang_complains['text_complain']);
|
||||
begin_main_frame();
|
||||
if(!$isLogin){
|
||||
@@ -93,7 +94,12 @@ if($_SERVER['REQUEST_METHOD'] === 'POST'){
|
||||
}
|
||||
begin_frame($lang_complains['text_new_body']);
|
||||
printf('%s:%s<br />%s %s', $lang_complains['text_added'], gettime($complain['added']), $lang_complains['text_new_email'], htmlspecialchars($complain['email']));
|
||||
if($isAdmin) printf(' [<a href="usersearch.php?em=%s" class="faqlink">%s</a>]', urlencode($complain['email']), $lang_complains['text_search_account']);
|
||||
if($isAdmin) {
|
||||
printf(' [<a href="usersearch.php?em=%s" class="faqlink" target="_blank">%s</a>]', urlencode($complain['email']), $lang_complains['text_search_account']);
|
||||
if ($user) {
|
||||
printf(' [<a href="user-ban-log.php?q=%s" class="faqlink" target="_blank">%s</a>]', urlencode($user->username), $lang_complains['text_view_band_log']);
|
||||
}
|
||||
}
|
||||
echo '<hr />', format_comment($complain['body']);
|
||||
end_frame();
|
||||
// REPLIES
|
||||
|
||||
@@ -6,7 +6,6 @@ require_once(get_langfile_path());
|
||||
loggedinorreturn();
|
||||
$id = intval($_GET["id"] ?? 0);
|
||||
$customField = new \Nexus\Field\Field();
|
||||
|
||||
int_check($id);
|
||||
if (!isset($id) || !$id)
|
||||
die();
|
||||
@@ -38,6 +37,7 @@ if (!$row) {
|
||||
) {
|
||||
permissiondenied();
|
||||
} else {
|
||||
$row = apply_filter('torrent_detail', $row);
|
||||
$owner = \App\Models\User::query()->with(['wearing_medals'])->find($row['owner']);
|
||||
if (!$owner) {
|
||||
$owner = \App\Models\User::defaultUser();
|
||||
@@ -69,8 +69,8 @@ if (!$row) {
|
||||
if (isset($_GET["returnto"]))
|
||||
print("<p><b>".$lang_details['text_go_back'] . "<a href=\"".htmlspecialchars($_GET["returnto"])."\">" . $lang_details['text_whence_you_came']."</a></b></p>");
|
||||
}
|
||||
$sp_torrent = get_torrent_promotion_append($row['sp_state'],'word');
|
||||
$sp_torrent_sub = get_torrent_promotion_append_sub($row['sp_state'],"",true,$row['added'], $row['promotion_time_type'], $row['promotion_until']);
|
||||
$sp_torrent = get_torrent_promotion_append($row['sp_state'],'word', false, '', 0, '', $row['__ignore_global_sp_state'] ?? false);
|
||||
$sp_torrent_sub = get_torrent_promotion_append_sub($row['sp_state'],"",true,$row['added'], $row['promotion_time_type'], $row['promotion_until'], $row['__ignore_global_sp_state'] ?? false);
|
||||
$hrImg = get_hr_img($row);
|
||||
$s=htmlspecialchars($row["name"]).($sp_torrent ? " ".$sp_torrent : "").($sp_torrent_sub) . $hrImg;
|
||||
print("<h1 align=\"center\" id=\"top\">".$s."</h1>\n");
|
||||
@@ -128,17 +128,20 @@ if (!$row) {
|
||||
$audiocodec_info = " <b>".$lang_details['text_audio_codec']." </b>".$row['audiocodec_name'];
|
||||
|
||||
tr($lang_details['row_basic_info'], $size_info.$type_info.$source_info . $medium_info. $codec_info . $audiocodec_info. $standard_info . $processing_info . $team_info, 1);
|
||||
if ($CURUSER["downloadpos"] != "no")
|
||||
$download = "<a title=\"".$lang_details['title_download_torrent']."\" href=\"download.php?id=".$id."\"><img class=\"dt_download\" src=\"pic/trans.gif\" alt=\"download\" /> <b><font class=\"small\">".$lang_details['text_download_torrent']."</font></b></a> | ";
|
||||
else $download = "";
|
||||
|
||||
tr(
|
||||
$lang_details['row_action'],
|
||||
$download.($owned == 1 ? "<$editlink><img class=\"dt_edit\" src=\"pic/trans.gif\" alt=\"edit\" /> <b><font class=\"small\">".$lang_details['text_edit_torrent'] . "</font></b></a> | " : "")
|
||||
.(get_user_class() >= $askreseed_class && $row['seeders'] == 0 ? "<a title=\"".$lang_details['title_ask_for_reseed']."\" href=\"takereseed.php?reseedid=$id\"><img class=\"dt_reseed\" src=\"pic/trans.gif\" alt=\"reseed\"> <b><font class=\"small\">".$lang_details['text_ask_for_reseed'] ."</font></b></a> | " : "")
|
||||
."<a title=\"".$lang_details['title_report_torrent']."\" href=\"report.php?torrent=$id\"><img class=\"dt_report\" src=\"pic/trans.gif\" alt=\"report\" /> <b><font class=\"small\">".$lang_details['text_report_torrent']."</font></b></a>"
|
||||
, 1
|
||||
);
|
||||
$actions = [];
|
||||
if ($CURUSER["downloadpos"] != "no") {
|
||||
$actions[] = "<a title=\"".$lang_details['title_download_torrent']."\" href=\"download.php?id=".$id."\"><img class=\"dt_download\" src=\"pic/trans.gif\" alt=\"download\" /> <b><font class=\"small\">".$lang_details['text_download_torrent']."</font></b></a>";
|
||||
}
|
||||
if ($owned == 1) {
|
||||
$actions[] = "<$editlink><img class=\"dt_edit\" src=\"pic/trans.gif\" alt=\"edit\" /> <b><font class=\"small\">".$lang_details['text_edit_torrent'] . "</font></b></a>";
|
||||
}
|
||||
if (get_user_class() >= $askreseed_class && $row['seeders'] == 0) {
|
||||
$actions[] = "<a title=\"".$lang_details['title_ask_for_reseed']."\" href=\"takereseed.php?reseedid=$id\"><img class=\"dt_reseed\" src=\"pic/trans.gif\" alt=\"reseed\"> <b><font class=\"small\">".$lang_details['text_ask_for_reseed'] ."</font></b></a>";
|
||||
}
|
||||
$actions[] = "<a title=\"".$lang_details['title_report_torrent']."\" href=\"report.php?torrent=$id\"><img class=\"dt_report\" src=\"pic/trans.gif\" alt=\"report\" /> <b><font class=\"small\">".$lang_details['text_report_torrent']."</font></b></a>";
|
||||
$actions = apply_filter('torrent_detail_actions', $actions, $row);
|
||||
tr($lang_details['row_action'], implode(' | ', $actions), 1);
|
||||
|
||||
// ------------- start claim block ------------------//
|
||||
$claimTorrentTTL = \App\Models\Claim::getConfigTorrentTTL();
|
||||
@@ -237,7 +240,9 @@ JS;
|
||||
|
||||
if ($CURUSER['showdescription'] != 'no' && !empty($row["descr"])){
|
||||
$torrentdetailad=$Advertisement->get_ad('torrentdetail');
|
||||
tr("<a href=\"javascript: klappe_news('descr')\"><span class=\"nowrap\"><img class=\"minus\" src=\"pic/trans.gif\" alt=\"Show/Hide\" id=\"picdescr\" title=\"".($lang_details['title_show_or_hide'] ?? '')."\" /> ".$lang_details['row_description']."</span></a>", "<div id='kdescr'>".($Advertisement->enable_ad() && $torrentdetailad ? "<div align=\"left\" style=\"margin-bottom: 10px\" id=\"\">".$torrentdetailad[0]."</div>" : "").format_comment($row["descr"])."</div>", 1);
|
||||
$desc = format_comment($row['descr']);
|
||||
$desc = apply_filter('torrent_detail_description', $desc, $row['id'], $CURUSER['id']);
|
||||
tr("<a href=\"javascript: klappe_news('descr')\"><span class=\"nowrap\"><img class=\"minus\" src=\"pic/trans.gif\" alt=\"Show/Hide\" id=\"picdescr\" title=\"".($lang_details['title_show_or_hide'] ?? '')."\" /> ".$lang_details['row_description']."</span></a>", "<div id='kdescr'>".($Advertisement->enable_ad() && $torrentdetailad ? "<div align=\"left\" style=\"margin-bottom: 10px\" id=\"\">".$torrentdetailad[0]."</div>" : "").$desc."</div>", 1);
|
||||
}
|
||||
|
||||
if (get_user_class() >= $viewnfo_class && $CURUSER['shownfo'] != 'no' && $row["nfosz"] > 0){
|
||||
@@ -356,7 +361,7 @@ JS;
|
||||
$other_processing_info = $copy_row['processing_name'].", ";
|
||||
|
||||
$sphighlight = get_torrent_bg_color($copy_row['sp_state']);
|
||||
$sp_info = get_torrent_promotion_append($copy_row['sp_state']);
|
||||
$sp_info = get_torrent_promotion_append($copy_row['sp_state'], '', false, '', 0, '', $copy_row['__ignore_global_sp_state'] ?? false);
|
||||
$hrImg = get_hr_img($copy_row);
|
||||
|
||||
$s .= "<tr". $sphighlight."><td class=\"rowfollow nowrap\" valign=\"middle\" style='padding: 0px'>".return_category_image($copy_row["catid"], "torrents.php?allsec=1&")."</td><td class=\"rowfollow\" align=\"left\"><a href=\"" . htmlspecialchars(get_protocol_prefix() . $BASEURL . "/details.php?id=" . $copy_row["id"]. "&hit=1")."\">" . $dispname ."</a>". $sp_info. $hrImg ."</td>" .
|
||||
|
||||
@@ -99,7 +99,7 @@ function maketable($res, $mode = 'seeding')
|
||||
$catname = htmlspecialchars($arr["catname"]);
|
||||
|
||||
$sphighlight = get_torrent_bg_color($arr['sp_state']);
|
||||
$sp_torrent = get_torrent_promotion_append($arr['sp_state']);
|
||||
$sp_torrent = get_torrent_promotion_append($arr['sp_state'], '', false, '', 0, '', $arr['__ignore_global_sp_state'] ?? false);
|
||||
//Total size
|
||||
if ($showtotalsize){
|
||||
$total_size += $arr['size'];
|
||||
|
||||
@@ -153,7 +153,7 @@ if ($showshoutbox_main == "yes") {
|
||||
}
|
||||
// ------------- end: shoutbox ------------------//
|
||||
// ------------- start: latest forum posts ------------------//
|
||||
/*
|
||||
|
||||
if ($showlastxforumposts_main == "yes" && $CURUSER)
|
||||
{
|
||||
$res = sql_query("SELECT posts.id AS pid, posts.userid AS userpost, posts.added, topics.id AS tid, topics.subject, topics.forumid, topics.views, forums.name FROM posts, topics, forums WHERE posts.topicid = topics.id AND topics.forumid = forums.id AND minclassread <=" . sqlesc(get_user_class()) . " ORDER BY posts.id DESC LIMIT 5") or sqlerr(__FILE__,__LINE__);
|
||||
@@ -169,7 +169,7 @@ if ($showlastxforumposts_main == "yes" && $CURUSER)
|
||||
print("</table>");
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// ------------- end: latest forum posts ------------------//
|
||||
// ------------- start: latest torrents ------------------//
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ if ($action == "edituser")
|
||||
$updateset[] = "stafffor = " . sqlesc($stafffor);
|
||||
$updateset[] = "pickfor = " . sqlesc($pickfor);
|
||||
$updateset[] = "picker = " . sqlesc($moviepicker);
|
||||
// $updateset[] = "enabled = " . sqlesc($enabled);
|
||||
$updateset[] = "enabled = " . sqlesc($enabled);
|
||||
$updateset[] = "uploadpos = " . sqlesc($uploadpos);
|
||||
$updateset[] = "downloadpos = " . sqlesc($downloadpos);
|
||||
$updateset[] = "forumpost = " . sqlesc($forumpost);
|
||||
@@ -117,34 +117,34 @@ if ($action == "edituser")
|
||||
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_username_changed_from'].$arr['username'].$lang_modtask_target[get_user_lang($userid)]['msg_to_new'] . $username .$lang_modtask_target[get_user_lang($userid)]['msg_by'].$CURUSER['username']);
|
||||
sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES(0, $userid, $subject, $msg, $added)") or sqlerr(__FILE__, __LINE__);
|
||||
}
|
||||
// if ($ori_downloaded != $downloaded){
|
||||
// $updateset[] = "downloaded = " . sqlesc($downloaded);
|
||||
// $modcomment = date("Y-m-d") . " - Downloaded amount changed from $arr[downloaded] to $downloaded by {$CURUSER['username']}.\n". $modcomment;
|
||||
// $subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_downloaded_change']);
|
||||
// $msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_downloaded_changed_from'].mksize($arr['downloaded']).$lang_modtask_target[get_user_lang($userid)]['msg_to_new'] . mksize($downloaded) .$lang_modtask_target[get_user_lang($userid)]['msg_by'].$CURUSER['username']);
|
||||
// sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES(0, $userid, $subject, $msg, $added)") or sqlerr(__FILE__, __LINE__);
|
||||
// }
|
||||
// if ($ori_uploaded != $uploaded){
|
||||
// $updateset[] = "uploaded = " . sqlesc($uploaded);
|
||||
// $modcomment = date("Y-m-d") . " - Uploaded amount changed from $arr[uploaded] to $uploaded by {$CURUSER['username']}.\n". $modcomment;
|
||||
// $subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_uploaded_change']);
|
||||
// $msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_uploaded_changed_from'].mksize($arr['uploaded']).$lang_modtask_target[get_user_lang($userid)]['msg_to_new'] . mksize($uploaded) .$lang_modtask_target[get_user_lang($userid)]['msg_by'].$CURUSER['username']);
|
||||
// sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES(0, $userid, $subject, $msg, $added)") or sqlerr(__FILE__, __LINE__);
|
||||
// }
|
||||
// if ($ori_bonus != $bonus){
|
||||
// $updateset[] = "seedbonus = " . sqlesc($bonus);
|
||||
// $modcomment = date("Y-m-d") . " - Bonus amount changed from $arr[seedbonus] to $bonus by {$CURUSER['username']}.\n". $modcomment;
|
||||
// $subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_bonus_change']);
|
||||
// $msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_bonus_changed_from'].$arr['seedbonus'].$lang_modtask_target[get_user_lang($userid)]['msg_to_new'] . $bonus .$lang_modtask_target[get_user_lang($userid)]['msg_by'].$CURUSER['username']);
|
||||
// sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES(0, $userid, $subject, $msg, $added)") or sqlerr(__FILE__, __LINE__);
|
||||
// }
|
||||
// if ($arr['invites'] != $invites){
|
||||
// $updateset[] = "invites = " . sqlesc($invites);
|
||||
// $modcomment = date("Y-m-d") . " - Invite amount changed from $arr[invites] to $invites by {$CURUSER['username']}.\n". $modcomment;
|
||||
// $subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_invite_change']);
|
||||
// $msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_invite_changed_from'].$arr['invites'].$lang_modtask_target[get_user_lang($userid)]['msg_to_new'] . $invites .$lang_modtask_target[get_user_lang($userid)]['msg_by'].$CURUSER['username']);
|
||||
// sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES(0, $userid, $subject, $msg, $added)") or sqlerr(__FILE__, __LINE__);
|
||||
// }
|
||||
if ($ori_downloaded != $downloaded){
|
||||
$updateset[] = "downloaded = " . sqlesc($downloaded);
|
||||
$modcomment = date("Y-m-d") . " - Downloaded amount changed from $arr[downloaded] to $downloaded by {$CURUSER['username']}.\n". $modcomment;
|
||||
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_downloaded_change']);
|
||||
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_downloaded_changed_from'].mksize($arr['downloaded']).$lang_modtask_target[get_user_lang($userid)]['msg_to_new'] . mksize($downloaded) .$lang_modtask_target[get_user_lang($userid)]['msg_by'].$CURUSER['username']);
|
||||
sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES(0, $userid, $subject, $msg, $added)") or sqlerr(__FILE__, __LINE__);
|
||||
}
|
||||
if ($ori_uploaded != $uploaded){
|
||||
$updateset[] = "uploaded = " . sqlesc($uploaded);
|
||||
$modcomment = date("Y-m-d") . " - Uploaded amount changed from $arr[uploaded] to $uploaded by {$CURUSER['username']}.\n". $modcomment;
|
||||
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_uploaded_change']);
|
||||
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_uploaded_changed_from'].mksize($arr['uploaded']).$lang_modtask_target[get_user_lang($userid)]['msg_to_new'] . mksize($uploaded) .$lang_modtask_target[get_user_lang($userid)]['msg_by'].$CURUSER['username']);
|
||||
sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES(0, $userid, $subject, $msg, $added)") or sqlerr(__FILE__, __LINE__);
|
||||
}
|
||||
if ($ori_bonus != $bonus){
|
||||
$updateset[] = "seedbonus = " . sqlesc($bonus);
|
||||
$modcomment = date("Y-m-d") . " - Bonus amount changed from $arr[seedbonus] to $bonus by {$CURUSER['username']}.\n". $modcomment;
|
||||
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_bonus_change']);
|
||||
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_bonus_changed_from'].$arr['seedbonus'].$lang_modtask_target[get_user_lang($userid)]['msg_to_new'] . $bonus .$lang_modtask_target[get_user_lang($userid)]['msg_by'].$CURUSER['username']);
|
||||
sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES(0, $userid, $subject, $msg, $added)") or sqlerr(__FILE__, __LINE__);
|
||||
}
|
||||
if ($arr['invites'] != $invites){
|
||||
$updateset[] = "invites = " . sqlesc($invites);
|
||||
$modcomment = date("Y-m-d") . " - Invite amount changed from $arr[invites] to $invites by {$CURUSER['username']}.\n". $modcomment;
|
||||
$subject = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_invite_change']);
|
||||
$msg = sqlesc($lang_modtask_target[get_user_lang($userid)]['msg_your_invite_changed_from'].$arr['invites'].$lang_modtask_target[get_user_lang($userid)]['msg_to_new'] . $invites .$lang_modtask_target[get_user_lang($userid)]['msg_by'].$CURUSER['username']);
|
||||
sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES(0, $userid, $subject, $msg, $added)") or sqlerr(__FILE__, __LINE__);
|
||||
}
|
||||
}
|
||||
if(get_user_class() == UC_STAFFLEADER)
|
||||
{
|
||||
@@ -242,28 +242,28 @@ if ($action == "edituser")
|
||||
sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES (0, $userid, $subject, $msg, $added)") or sqlerr(__FILE__, __LINE__);
|
||||
$updateset[] = "warned = 'yes', timeswarned = timeswarned+1, lastwarned=$added, warnedby={$CURUSER['id']}";
|
||||
}
|
||||
// if ($enabled != $curenabled)
|
||||
// {
|
||||
// if ($enabled == 'yes') {
|
||||
// $modcomment = date("Y-m-d") . " - Enabled by " . $CURUSER['username']. ".\n". $modcomment;
|
||||
// if (get_single_value("users","class","WHERE id = ".sqlesc($userid)) == UC_PEASANT){
|
||||
// $length = 30*86400; // warn users until 30 days
|
||||
// $until = sqlesc(date("Y-m-d H:i:s",(strtotime(date("Y-m-d H:i:s")) + $length)));
|
||||
// sql_query("UPDATE users SET enabled='yes', leechwarn='yes', leechwarnuntil=$until WHERE id = ".sqlesc($userid));
|
||||
// }
|
||||
// else{
|
||||
// sql_query("UPDATE users SET enabled='yes', leechwarn='no' WHERE id = ".sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
|
||||
// }
|
||||
// } else {
|
||||
// $modcomment = date("Y-m-d") . " - Disabled by " . $CURUSER['username']. ".\n". $modcomment;
|
||||
// $banLog = [
|
||||
// 'uid' => $userid,
|
||||
// 'username' => $user->username,
|
||||
// 'operator' => $CURUSER['id'],
|
||||
// 'reason' => nexus_trans('user.edit_ban_reason', [], $user->locale),
|
||||
// ];
|
||||
// }
|
||||
// }
|
||||
if ($enabled != $curenabled)
|
||||
{
|
||||
if ($enabled == 'yes') {
|
||||
$modcomment = date("Y-m-d") . " - Enabled by " . $CURUSER['username']. ".\n". $modcomment;
|
||||
if (get_single_value("users","class","WHERE id = ".sqlesc($userid)) == UC_PEASANT){
|
||||
$length = 30*86400; // warn users until 30 days
|
||||
$until = sqlesc(date("Y-m-d H:i:s",(strtotime(date("Y-m-d H:i:s")) + $length)));
|
||||
sql_query("UPDATE users SET enabled='yes', leechwarn='yes', leechwarnuntil=$until WHERE id = ".sqlesc($userid));
|
||||
}
|
||||
else{
|
||||
sql_query("UPDATE users SET enabled='yes', leechwarn='no' WHERE id = ".sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
|
||||
}
|
||||
} else {
|
||||
$modcomment = date("Y-m-d") . " - Disabled by " . $CURUSER['username']. ".\n". $modcomment;
|
||||
$banLog = [
|
||||
'uid' => $userid,
|
||||
'username' => $user->username,
|
||||
'operator' => $CURUSER['id'],
|
||||
'reason' => nexus_trans('user.edit_ban_reason', [], $user->locale),
|
||||
];
|
||||
}
|
||||
}
|
||||
if ($arr['noad'] != $noad){
|
||||
$updateset[]='noad = '.sqlesc($noad);
|
||||
$modcomment = date("Y-m-d") . " - No Ad set to ".$noad." by ". $CURUSER['username']. ".\n". $modcomment;
|
||||
|
||||
@@ -153,6 +153,7 @@ elseif($action == 'savesettings_torrent') // save account
|
||||
'download_support_passkey', 'claim_enabled', 'claim_torrent_ttl', 'claim_torrent_user_counts_up_limit', 'claim_user_torrent_counts_up_limit', 'claim_remove_deduct_user_bonus',
|
||||
'claim_give_up_deduct_user_bonus', 'claim_bonus_multiplier', 'claim_reach_standard_seed_time', 'claim_reach_standard_uploaded'
|
||||
);
|
||||
$validConfig = apply_filter('setting_valid_config', $validConfig);
|
||||
GetVar($validConfig);
|
||||
$TORRENT = [];
|
||||
foreach($validConfig as $config) {
|
||||
@@ -629,8 +630,8 @@ elseif ($action == 'accountsettings'){
|
||||
$x = $lang_settings['row_promote_to_one'].get_user_class_name($class,false,false,true).$lang_settings['row_promote_to_two'];
|
||||
$y = $lang_settings['text_alias'] . "<input type='text' style=\"width: 60px\" name='".$inputAlias."' value='".(isset($ACCOUNT[$inputAlias]) ? $ACCOUNT[$inputAlias] : $defaultAlias )."'><br/>"
|
||||
.$lang_settings['text_member_longer_than']."<input type='text' style=\"width: 50px\" name='".$inputtime."' value='".(isset($ACCOUNT[$inputtime]) ? $ACCOUNT[$inputtime] : $time )."'>"
|
||||
.$lang_settings['text_downloaded_more_than']."<input type='text' style=\"width: 50px\" name='".$inputdl."' value='".(isset($ACCOUNT[$inputdl]) ? $ACCOUNT[$inputdl] : $dl )."'>"
|
||||
.$lang_settings['text_seed_points_more_than']."<input type='text' style=\"width: 60px\" name='".$inputSeedPoints."' value='".(isset($ACCOUNT[$inputSeedPoints]) ? $ACCOUNT[$inputSeedPoints] : $defaultSeedPoints )."'>"
|
||||
.$lang_settings['text_downloaded_more_than']."<input type='text' style=\"width: 50px\" name='".$inputdl."' value='".(isset($ACCOUNT[$inputdl]) ? $ACCOUNT[$inputdl] : $dl )."'>"
|
||||
.$lang_settings['text_with_ratio_above']."<input type='text' style=\"width: 50px\" name='".$inputprratio."' value='".(isset($ACCOUNT[$inputprratio]) ? $ACCOUNT[$inputprratio] : $prratio )."'>"
|
||||
.$lang_settings['text_be_promoted_to'].get_user_class_name($class,false,true,true).$lang_settings['text_promote_to_default_one']."'".$time."', '".$dl."', '".$defaultSeedPoints."', '".$prratio."'.<br />"
|
||||
.$lang_settings['text_demote_with_ratio_below']."<input type='text' style=\"width: 50px\" name='".$inputderatio."' value='".(isset($ACCOUNT[$inputderatio]) ? $ACCOUNT[$inputderatio] : $deratio )."'>".$lang_settings['text_promote_to_default_two']."'".$deratio."'.<br />"
|
||||
@@ -690,6 +691,8 @@ elseif ($action == 'torrentsettings')
|
||||
<li>".sprintf($lang_settings['claim_reach_standard'], sprintf('<input type="number" name="claim_reach_standard_seed_time" value="%s" style="width: 50px"/>', $TORRENT['claim_reach_standard_seed_time'] ?? \App\Models\Claim::STANDARD_SEED_TIME_HOURS), sprintf('<input type="number" name="claim_reach_standard_uploaded" value="%s" style="width: 50px"/>', $TORRENT['claim_reach_standard_uploaded'] ?? \App\Models\Claim::STANDARD_UPLOADED_TIMES))."</li>
|
||||
</ul>", 1);
|
||||
|
||||
do_action('setting_fields', $TORRENT);
|
||||
|
||||
tr($lang_settings['row_auto_pick_hot'], $lang_settings['text_torrents_uploaded_within']."<input type='text' style=\"width: 50px\" name=hotdays value='".(isset($TORRENT["hotdays"]) ? $TORRENT["hotdays"] : 7 )."'>".$lang_settings['text_days_with_more_than']."<input type='text' style=\"width: 50px\" name=hotseeder value='".(isset($TORRENT["hotseeder"]) ? $TORRENT["hotseeder"] : 10 )."'>".$lang_settings['text_be_picked_as_hot']."<br />".$lang_settings['text_auto_pick_hot_default'], 1);
|
||||
tr($lang_settings['row_uploader_get_double'], $lang_settings['text_torrent_uploader_gets']."<input type='text' style=\"width: 50px\" name=uploaderdouble value='".(isset($TORRENT["uploaderdouble"]) ? $TORRENT["uploaderdouble"] : 1 )."'>".$lang_settings['text_times_uploading_credit'].$lang_settings['text_uploader_get_double_default'], 1);
|
||||
tr($lang_settings['row_delete_dead_torrents'], $lang_settings['text_torrents_being_dead_for']."<input type='text' style=\"width: 50px\" name=deldeadtorrent value='".(isset($TORRENT["deldeadtorrent"]) ? $TORRENT["deldeadtorrent"] : 0 )."'>".$lang_settings['text_days_be_deleted']."<br />".$lang_settings['row_delete_dead_torrents_note'], 1);
|
||||
|
||||
@@ -894,12 +894,12 @@ if ($count)
|
||||
//stderr("addparam",$addparam);
|
||||
//echo $addparam;
|
||||
|
||||
list($pagertop, $pagerbottom, $limit) = pager($torrentsperpage, $count, "?" . $addparam);
|
||||
if ($allsec == 1 || $enablespecial != 'yes'){
|
||||
$query = "SELECT torrents.id, torrents.sp_state, torrents.promotion_time_type, torrents.promotion_until, torrents.banned, torrents.picktype, torrents.pos_state, torrents.category, torrents.source, torrents.medium, torrents.codec, torrents.standard, torrents.processing, torrents.team, torrents.audiocodec, torrents.leechers, torrents.seeders, torrents.name, torrents.small_descr, torrents.times_completed, torrents.size, torrents.added, torrents.comments,torrents.anonymous,torrents.owner,torrents.url,torrents.cache_stamp,torrents.pt_gen,torrents.hr FROM torrents ".($search_area == 3 || $column == "owner" ? "LEFT JOIN users ON torrents.owner = users.id " : "")." $tagFilter $where $orderby $limit";
|
||||
}
|
||||
else{
|
||||
$query = "SELECT torrents.id, torrents.sp_state, torrents.promotion_time_type, torrents.promotion_until, torrents.banned, torrents.picktype, torrents.pos_state, torrents.category, torrents.source, torrents.medium, torrents.codec, torrents.standard, torrents.processing, torrents.team, torrents.audiocodec, torrents.leechers, torrents.seeders, torrents.name, torrents.small_descr, torrents.times_completed, torrents.size, torrents.added, torrents.comments,torrents.anonymous,torrents.owner,torrents.url,torrents.cache_stamp,torrents.pt_gen,torrents.hr FROM torrents ".($search_area == 3 || $column == "owner" ? "LEFT JOIN users ON torrents.owner = users.id " : "")." LEFT JOIN categories ON torrents.category=categories.id $tagFilter $where $orderby $limit";
|
||||
list($pagertop, $pagerbottom, $limit, $offset, $size, $page) = pager($torrentsperpage, $count, "?" . $addparam);
|
||||
$fieldsStr = implode(', ', \App\Models\Torrent::getFieldsForList(true));
|
||||
if ($allsec == 1 || $enablespecial != 'yes') {
|
||||
$query = "SELECT $fieldsStr FROM torrents ".($search_area == 3 || $column == "owner" ? "LEFT JOIN users ON torrents.owner = users.id " : "")." $tagFilter $where $orderby $limit";
|
||||
} else {
|
||||
$query = "SELECT $fieldsStr FROM torrents ".($search_area == 3 || $column == "owner" ? "LEFT JOIN users ON torrents.owner = users.id " : "")." LEFT JOIN categories ON torrents.category=categories.id $tagFilter $where $orderby $limit";
|
||||
}
|
||||
do_log("[TORRENT_LIST_SQL] $query", 'debug');
|
||||
if (!$elasticsearchEnabled) {
|
||||
@@ -1142,6 +1142,7 @@ if ($count) {
|
||||
$rows[] = $row;
|
||||
}
|
||||
}
|
||||
$rows = apply_filter('torrent_list', $rows, $page, 'list');
|
||||
print($pagertop);
|
||||
if ($sectiontype == $browsecatmode)
|
||||
torrenttable($rows, "torrents");
|
||||
|
||||
@@ -496,8 +496,8 @@ JS;
|
||||
print("<td class=\"rowfollow\">".$lang_userdetails['text_no_warned']."</td></tr>\n");
|
||||
}
|
||||
print("</table></td></tr>");
|
||||
// tr($lang_userdetails['row_enabled'], "<input name=\"enabled\" value=\"yes\" type=\"radio\"" . ($enabled ? " checked=\"checked\"" : "") . " />".$lang_userdetails['radio_yes']."<input name=\"enabled\" value=\"no\" type=\"radio\"" . (!$enabled ? " checked=\"checked\"" : "") . " />".$lang_userdetails['radio_no'], 1);
|
||||
tr($lang_userdetails['row_enabled'], $lang_userdetails['disable_user_migrated'], 1);
|
||||
tr($lang_userdetails['row_enabled'], "<input name=\"enabled\" value=\"yes\" type=\"radio\"" . ($enabled ? " checked=\"checked\"" : "") . " />".$lang_userdetails['radio_yes']."<input name=\"enabled\" value=\"no\" type=\"radio\"" . (!$enabled ? " checked=\"checked\"" : "") . " />".$lang_userdetails['radio_no'], 1);
|
||||
// tr($lang_userdetails['row_enabled'], $lang_userdetails['disable_user_migrated'], 1);
|
||||
tr($lang_userdetails['row_forum_post_possible'], "<input type=\"radio\" name=\"forumpost\" value=\"yes\"" .($user["forumpost"]=="yes" ? " checked=\"checked\"" : "") . " />".$lang_userdetails['radio_yes']."<input type=\"radio\" name=\"forumpost\" value=\"no\"" .($user["forumpost"]=="no" ? " checked=\"checked\"" : "") . " />".$lang_userdetails['radio_no'], 1);
|
||||
tr($lang_userdetails['row_upload_possible'], "<input type=\"radio\" name=\"uploadpos\" value=\"yes\"" .($user["uploadpos"]=="yes" ? " checked=\"checked\"" : "") . " />".$lang_userdetails['radio_yes']."<input type=\"radio\" name=\"uploadpos\" value=\"no\"" .($user["uploadpos"]=="no" ? " checked=\"checked\"" : "") . " />".$lang_userdetails['radio_no'], 1);
|
||||
tr($lang_userdetails['row_download_possible'], "<input type=\"radio\" name=\"downloadpos\" value=\"yes\"" .($user["downloadpos"]=="yes" ? " checked=\"checked\"" : "") . " />".$lang_userdetails['radio_yes']."<input type=\"radio\" name=\"downloadpos\" value=\"no\"" .($user["downloadpos"]=="no" ? " checked=\"checked\"" : "") . " />".$lang_userdetails['radio_no'], 1);
|
||||
@@ -515,10 +515,15 @@ JS;
|
||||
|
||||
if (get_user_class() >= $cruprfmanage_class)
|
||||
{
|
||||
tr($lang_userdetails['row_amount_uploaded'], "<input disabled type=\"text\" size=\"60\" name=\"uploaded\" value=\"" . htmlspecialchars($user['uploaded']) . "\" /><input type=\"hidden\" name=\"ori_uploaded\" value=\"" . htmlspecialchars($user['uploaded']) . "\" />".$lang_userdetails['change_field_value_migrated'], 1);
|
||||
tr($lang_userdetails['row_amount_downloaded'], "<input disabled type=\"text\" size=\"60\" name=\"downloaded\" value=\"" .htmlspecialchars($user['downloaded']) . "\" /><input type=\"hidden\" name=\"ori_downloaded\" value=\"" .htmlspecialchars($user['downloaded']) . "\" />".$lang_userdetails['change_field_value_migrated'], 1);
|
||||
tr($lang_userdetails['row_seeding_karma'], "<input disabled type=\"text\" size=\"60\" name=\"bonus\" value=\"" .number_format($user['seedbonus'], 1) . "\" /><input type=\"hidden\" name=\"ori_bonus\" value=\"" .number_format($user['seedbonus'], 1) . "\" />".$lang_userdetails['change_field_value_migrated'], 1);
|
||||
tr($lang_userdetails['row_invites'], "<input disabled type=\"text\" size=\"60\" name=\"invites\" value=\"" .htmlspecialchars($user['invites']) . "\" />".$lang_userdetails['change_field_value_migrated'], 1);
|
||||
// tr($lang_userdetails['row_amount_uploaded'], "<input disabled type=\"text\" size=\"60\" name=\"uploaded\" value=\"" . htmlspecialchars($user['uploaded']) . "\" /><input type=\"hidden\" name=\"ori_uploaded\" value=\"" . htmlspecialchars($user['uploaded']) . "\" />".$lang_userdetails['change_field_value_migrated'], 1);
|
||||
// tr($lang_userdetails['row_amount_downloaded'], "<input disabled type=\"text\" size=\"60\" name=\"downloaded\" value=\"" .htmlspecialchars($user['downloaded']) . "\" /><input type=\"hidden\" name=\"ori_downloaded\" value=\"" .htmlspecialchars($user['downloaded']) . "\" />".$lang_userdetails['change_field_value_migrated'], 1);
|
||||
// tr($lang_userdetails['row_seeding_karma'], "<input disabled type=\"text\" size=\"60\" name=\"bonus\" value=\"" .number_format($user['seedbonus'], 1) . "\" /><input type=\"hidden\" name=\"ori_bonus\" value=\"" .number_format($user['seedbonus'], 1) . "\" />".$lang_userdetails['change_field_value_migrated'], 1);
|
||||
// tr($lang_userdetails['row_invites'], "<input disabled type=\"text\" size=\"60\" name=\"invites\" value=\"" .htmlspecialchars($user['invites']) . "\" />".$lang_userdetails['change_field_value_migrated'], 1);
|
||||
|
||||
tr($lang_userdetails['row_amount_uploaded'], "<input type=\"text\" size=\"60\" name=\"uploaded\" value=\"" . htmlspecialchars($user['uploaded']) . "\" /><input type=\"hidden\" name=\"ori_uploaded\" value=\"" . htmlspecialchars($user['uploaded']) . "\" />", 1);
|
||||
tr($lang_userdetails['row_amount_downloaded'], "<input type=\"text\" size=\"60\" name=\"downloaded\" value=\"" .htmlspecialchars($user['downloaded']) . "\" /><input type=\"hidden\" name=\"ori_downloaded\" value=\"" .htmlspecialchars($user['downloaded']) . "\" />", 1);
|
||||
tr($lang_userdetails['row_seeding_karma'], "<input type=\"text\" size=\"60\" name=\"bonus\" value=\"" .number_format($user['seedbonus'], 1) . "\" /><input type=\"hidden\" name=\"ori_bonus\" value=\"" .number_format($user['seedbonus'], 1) . "\" />", 1);
|
||||
tr($lang_userdetails['row_invites'], "<input type=\"text\" size=\"60\" name=\"invites\" value=\"" .htmlspecialchars($user['invites']) . "\" />", 1);
|
||||
}
|
||||
tr($lang_userdetails['row_passkey'], "<input name=\"resetkey\" value=\"yes\" type=\"checkbox\" />".$lang_userdetails['checkbox_reset_passkey'], 1);
|
||||
|
||||
|
||||
2
public/vendor/layer-v3.5.1/layer/layer.js
vendored
Normal file
2
public/vendor/layer-v3.5.1/layer/mobile/layer.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/*! layer mobile-v2.0.0 Web 通用弹出层组件 MIT License */
|
||||
;!function(e){"use strict";var t=document,n="querySelectorAll",i="getElementsByClassName",a=function(e){return t[n](e)},s={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},l={extend:function(e){var t=JSON.parse(JSON.stringify(s));for(var n in e)t[n]=e[n];return t},timer:{},end:{}};l.touch=function(e,t){e.addEventListener("click",function(e){t.call(this,e)},!1)};var r=0,o=["layui-m-layer"],c=function(e){var t=this;t.config=l.extend(e),t.view()};c.prototype.view=function(){var e=this,n=e.config,s=t.createElement("div");e.id=s.id=o[0]+r,s.setAttribute("class",o[0]+" "+o[0]+(n.type||0)),s.setAttribute("index",r);var l=function(){var e="object"==typeof n.title;return n.title?'<h3 style="'+(e?n.title[1]:"")+'">'+(e?n.title[0]:n.title)+"</h3>":""}(),c=function(){"string"==typeof n.btn&&(n.btn=[n.btn]);var e,t=(n.btn||[]).length;return 0!==t&&n.btn?(e='<span yes type="1">'+n.btn[0]+"</span>",2===t&&(e='<span no type="0">'+n.btn[1]+"</span>"+e),'<div class="layui-m-layerbtn">'+e+"</div>"):""}();if(n.fixed||(n.top=n.hasOwnProperty("top")?n.top:100,n.style=n.style||"",n.style+=" top:"+(t.body.scrollTop+n.top)+"px"),2===n.type&&(n.content='<i></i><i class="layui-m-layerload"></i><i></i><p>'+(n.content||"")+"</p>"),n.skin&&(n.anim="up"),"msg"===n.skin&&(n.shade=!1),s.innerHTML=(n.shade?"<div "+("string"==typeof n.shade?'style="'+n.shade+'"':"")+' class="layui-m-layershade"></div>':"")+'<div class="layui-m-layermain" '+(n.fixed?"":'style="position:static;"')+'><div class="layui-m-layersection"><div class="layui-m-layerchild '+(n.skin?"layui-m-layer-"+n.skin+" ":"")+(n.className?n.className:"")+" "+(n.anim?"layui-m-anim-"+n.anim:"")+'" '+(n.style?'style="'+n.style+'"':"")+">"+l+'<div class="layui-m-layercont">'+n.content+"</div>"+c+"</div></div></div>",!n.type||2===n.type){var d=t[i](o[0]+n.type),y=d.length;y>=1&&layer.close(d[0].getAttribute("index"))}document.body.appendChild(s);var u=e.elem=a("#"+e.id)[0];n.success&&n.success(u),e.index=r++,e.action(n,u)},c.prototype.action=function(e,t){var n=this;e.time&&(l.timer[n.index]=setTimeout(function(){layer.close(n.index)},1e3*e.time));var a=function(){var t=this.getAttribute("type");0==t?(e.no&&e.no(),layer.close(n.index)):e.yes?e.yes(n.index):layer.close(n.index)};if(e.btn)for(var s=t[i]("layui-m-layerbtn")[0].children,r=s.length,o=0;o<r;o++)l.touch(s[o],a);if(e.shade&&e.shadeClose){var c=t[i]("layui-m-layershade")[0];l.touch(c,function(){layer.close(n.index,e.end)})}e.end&&(l.end[n.index]=e.end)},e.layer={v:"2.0",index:r,open:function(e){var t=new c(e||{});return t.index},close:function(e){var n=a("#"+o[0]+e)[0];n&&(n.innerHTML="",t.body.removeChild(n),clearTimeout(l.timer[e]),delete l.timer[e],"function"==typeof l.end[e]&&l.end[e](),delete l.end[e])},closeAll:function(){for(var e=t[i](o[0]),n=0,a=e.length;n<a;n++)layer.close(0|e[0].getAttribute("index"))}},"function"==typeof define?define(function(){return layer}):function(){var e=document.scripts,n=e[e.length-1],i=n.src,a=i.substring(0,i.lastIndexOf("/")+1);n.getAttribute("merge")||document.head.appendChild(function(){var e=t.createElement("link");return e.href=a+"need/layer.css?2.0",e.type="text/css",e.rel="styleSheet",e.id="layermcss",e}())}()}(window);
|
||||
1
public/vendor/layer-v3.5.1/layer/mobile/need/layer.css
vendored
Normal file
BIN
public/vendor/layer-v3.5.1/layer/theme/default/icon-ext.png
vendored
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
public/vendor/layer-v3.5.1/layer/theme/default/icon.png
vendored
Normal file
|
After Width: | Height: | Size: 11 KiB |
1
public/vendor/layer-v3.5.1/layer/theme/default/layer.css
vendored
Normal file
BIN
public/vendor/layer-v3.5.1/layer/theme/default/loading-0.gif
vendored
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
public/vendor/layer-v3.5.1/layer/theme/default/loading-1.gif
vendored
Normal file
|
After Width: | Height: | Size: 701 B |
BIN
public/vendor/layer-v3.5.1/layer/theme/default/loading-2.gif
vendored
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
76
public/vendor/layer-v3.5.1/test.html
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>layer-更懂你的 Web 弹窗解决方案</title>
|
||||
|
||||
<style>
|
||||
html{background-color:#E3E3E3; font-size:14px; color:#000; font-family:Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif}
|
||||
a,a:hover{ text-decoration:none;}
|
||||
pre{font-family:Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif}
|
||||
.box{padding:20px; background-color:#fff; margin:50px 100px; border-radius:5px;}
|
||||
.box a{padding-right:15px;}
|
||||
#about_hide{display:none}
|
||||
.layer_text{background-color:#fff; padding:20px;}
|
||||
.layer_text p{margin-bottom: 10px; text-indent: 2em; line-height: 23px;}
|
||||
.button{display:inline-block; *display:inline; *zoom:1; line-height:30px; padding:0 20px; background-color:#56B4DC; color:#fff; font-size:14px; border-radius:3px; cursor:pointer; font-weight:normal;}
|
||||
.photos-demo img{width:200px;}
|
||||
</style>
|
||||
|
||||
<script src="http://cdn.bootcss.com/jquery/1.12.3/jquery.min.js"></script>
|
||||
<script src="layer/layer.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="box">
|
||||
<pre>
|
||||
@Name:layer
|
||||
@Version:v<script>document.write(layer.v)</script>
|
||||
@Description:通用 Web 弹层组件
|
||||
|
||||
|
||||
<strong>【注意事项】</strong>
|
||||
一、使用时,请把文件夹 layer 整个放置在您站点的任何一个目录,只需引入 layer.js 即可,除 jQuery 外,其它文件无需再引入。
|
||||
二、如果您的 js 引入是通过合并处理或者您不想采用layer自动获取的绝对路径,您可以通过 layer.config() 来配置(详见官网 API 页)
|
||||
三、jQuery 需 1.8+
|
||||
四、更多使用说明与演示,请参见 layer 官网。
|
||||
五、使用时请务必保留来源,请勿用于违反我国法律法规的 Web 平台。
|
||||
六、layer 是一款无偿的公益性项目,遵循 MIT 开源协议。
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="box" style="text-align:center">
|
||||
<a href="http://layer.layui.com/" target="_blank">更多示例</a>
|
||||
<a href="http://www.layui.com/doc/modules/layer.html" target="_blank">使用文档</a>
|
||||
<a href="javascript:;" id="about">关于</a>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
;!function(){
|
||||
|
||||
|
||||
//页面一打开就执行,放入ready是为了layer所需配件(css、扩展模块)加载完毕
|
||||
layer.ready(function(){
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '欢迎页',
|
||||
maxmin: true,
|
||||
area: ['800px', '500px'],
|
||||
content: 'http://layer.layui.com/test/welcome.html',
|
||||
end: function(){
|
||||
layer.tips('Hi', '#about', {tips: 1})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//关于
|
||||
$('#about').on('click', function(){
|
||||
layer.alert('layui 出品');
|
||||
});
|
||||
|
||||
}();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
6
public/vendor/layer-v3.5.1/免责声明.url
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
[{000214A0-0000-0000-C000-000000000046}]
|
||||
Prop3=19,11
|
||||
[InternetShortcut]
|
||||
URL=https://www.layui.com/about/disclaimer.html
|
||||
IDList=
|
||||
HotKey=0
|
||||
6
public/vendor/layer-v3.5.1/文档/jquery下载.url
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
[{000214A0-0000-0000-C000-000000000046}]
|
||||
Prop3=19,2
|
||||
[InternetShortcut]
|
||||
URL=http://code.jquery.com/jquery-1.11.3.min.js
|
||||
IDList=
|
||||
HotKey=0
|
||||
6
public/vendor/layer-v3.5.1/文档/layer官网.url
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
[{000214A0-0000-0000-C000-000000000046}]
|
||||
Prop3=19,2
|
||||
[InternetShortcut]
|
||||
URL=http://layer.layui.com/
|
||||
IDList=
|
||||
HotKey=0
|
||||
1
public/vendor/layui/css/layui.css
vendored
Normal file
1
public/vendor/layui/css/modules/code.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-view{display:block;position:relative;margin:10px 0;padding:0;border:1px solid #eee;border-left-width:6px;background-color:#fafafa;color:#333;font-family:Courier New;font-size:12px}.layui-code-h3{position:relative;padding:0 10px;height:40px;line-height:40px;border-bottom:1px solid #eee;font-size:12px}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 10px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view .layui-code-ol li:first-child{padding-top:10px}.layui-code-view .layui-code-ol li:last-child{padding-bottom:10px}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0c0c0c;border-left-color:#3f3f3f;background-color:#0c0c0c;color:#c2be9e}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3f3f3f;border-left:none}.layui-code-demo .layui-code{visibility:visible!important;margin:-15px;border-top:none;border-right:none;border-bottom:none}.layui-code-demo .layui-tab-content{padding:15px;border-top:none}
|
||||
1
public/vendor/layui/css/modules/laydate/default/laydate.css
vendored
Normal file
BIN
public/vendor/layui/css/modules/layer/default/icon-ext.png
vendored
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
public/vendor/layui/css/modules/layer/default/icon.png
vendored
Normal file
|
After Width: | Height: | Size: 11 KiB |
1
public/vendor/layui/css/modules/layer/default/layer.css
vendored
Normal file
BIN
public/vendor/layui/css/modules/layer/default/loading-0.gif
vendored
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
public/vendor/layui/css/modules/layer/default/loading-1.gif
vendored
Normal file
|
After Width: | Height: | Size: 701 B |
BIN
public/vendor/layui/css/modules/layer/default/loading-2.gif
vendored
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
public/vendor/layui/font/iconfont.eot
vendored
Normal file
554
public/vendor/layui/font/iconfont.svg
vendored
Normal file
|
After Width: | Height: | Size: 299 KiB |