Skip to content

Commit

Permalink
fix new torrent email notification
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomlove committed Dec 23, 2024
1 parent edadbf0 commit 2ca703c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
9 changes: 3 additions & 6 deletions app/Console/Commands/Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,9 @@ public function __construct()
*/
public function handle()
{
$file = resource_path("geoip/GeoLite2-ASN.mmdb");
$file = resource_path("geoip/GeoLite2-City.mmdb");
$reader = new Reader($file);
$asn = $reader->asn("94.16.120.0");
// $result = \Nexus\Plugin\Plugin::listEnabled();
dd($asn);
$torrent = Torrent::query()->find(12, ['info_hash']);
$infoHash = $torrent->info_hash;
dd($infoHash === rawurldecode("%15%24%f3%e6%91e%f6%fbT%be%3f%b8%f3%f7_%f5%f6%aa%3fv"));
}

}
2 changes: 1 addition & 1 deletion include/constants.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.15');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2024-12-10');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2024-12-23');
defined('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
Expand Down
13 changes: 10 additions & 3 deletions public/takeupload.php
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ function checkTorrentDict($dict, $key, $type = null)
$description = format_comment($descr);

//dirty code, change later

$baseUrl = getSchemeAndHttpHost();
$langfolder_array = array("en", "chs", "cht", "ko", "ja");
$body_arr = array("en" => "", "chs" => "", "cht" => "", "ko" => "", "ja" => "");
$i = 0;
Expand All @@ -515,7 +515,7 @@ function checkTorrentDict($dict, $key, $type = null)
-------------------------------------------------------------------------------------------------------------------------
{$lang_takeupload_target[$langfolder_array[$i]]['mail_torrent']}<b><a href="javascript:void(null)" onclick="window.open('http://$BASEURL/details.php?id=$id&hit=1')">{$lang_takeupload_target[$langfolder_array[$i]]['mail_here']}</a></b><br />
http://$BASEURL/details.php?id=$id&hit=1
$baseUrl/details.php?id=$id&hit=1
------{$lang_takeupload_target[$langfolder_array[$i]]['mail_yours']}
{$lang_takeupload_target[$langfolder_array[$i]]['mail_team']}
Expand All @@ -530,7 +530,14 @@ function checkTorrentDict($dict, $key, $type = null)
$current_lang = $arr["lang"];
$to = $arr["email"];

sent_mail($to,$SITENAME,$SITEEMAIL,change_email_encode(validlang($current_lang),$lang_takeupload_target[validlang($current_lang)]['mail_title'].$torrent),change_email_encode(validlang($current_lang),$body_arr[validlang($current_lang)]),"torrent upload",false,false,'',get_email_encode(validlang($current_lang)), "eYou");
sent_mail(
$to,$SITENAME,$SITEEMAIL,
$lang_takeupload_target[validlang($current_lang)]['mail_title'],
$torrent,
validlang($current_lang),
$body_arr[validlang($current_lang)],
"torrent upload",false,false,'',
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
<td>{{$record->email}}</td>
<td></td>
</tr>
<tr>
<th>Passkey</th>
<td>{{$record->passkey}}</td>
<td></td>
</tr>
<tr>
<th>{{__('label.status')}}</th>
<td>{{$record->status}}</td>
Expand Down

0 comments on commit 2ca703c

Please sign in to comment.