diff --git a/app/Console/Commands/UserResetIdAutoIncrement.php b/app/Console/Commands/UserResetIdAutoIncrement.php
new file mode 100644
index 00000000..456e189f
--- /dev/null
+++ b/app/Console/Commands/UserResetIdAutoIncrement.php
@@ -0,0 +1,90 @@
+options();
+ $requires = ['auto_increment', 'admin', 'password', 'email'];
+ foreach ($requires as $option) {
+ if (empty($options[$option])) {
+ $this->error("Require --$option");
+ return 1;
+ }
+ }
+ $log = "options: " . json_encode($options);
+ $this->info($log);
+
+ $tablesToTruncate = [
+ 'adclicks', 'attachments', 'attendance', 'attendance_logs', 'bitbucket', 'blocks', 'bonus_logs', 'bookmarks', 'cheaters', 'chronicle',
+ 'claims', 'comments', 'complain_replies', 'complains', 'exam_progress', 'exam_users', 'forummods', 'friends', 'fun', 'funds', 'funvotes',
+ 'hit_and_runs', 'invites', 'iplog', 'loginattempts', 'lucky_draw_winning_records', 'magic', 'messages', 'offers', 'offervotes', 'peers',
+ 'pmboxes', 'pollanswers', 'posts', 'prolinkclicks', 'readposts', 'reports', 'requests', 'seed_box_records', 'shoutbox', 'snatched',
+ 'staffmessages', 'sticky_promotion_appends', 'sticky_promotion_participators', 'sticky_promotions', 'subs', 'suggest', 'thanks', 'topics',
+ 'torrent_operation_logs', 'torrent_secrets', 'torrents', 'user_ban_logs', 'user_medals', 'user_metas', 'user_permissions', 'user_roles',
+ 'username_change_logs', 'users',
+ ];
+ $allTables = DB::select('show tables');
+ foreach ($allTables as $tableObj) {
+ $tableName = current($tableObj);
+ if (in_array($tableName, $tablesToTruncate)) {
+ $this->info("truncate table: $tableName ...");
+ DB::table($tableName)->truncate();
+ }
+ }
+ $statement = "alter table users auto_increment = " . $options['auto_increment'];
+ $this->info($statement);
+ $result = DB::statement($statement);
+
+ $userRep = new UserRepository();
+ $insert = [
+ 'username' => $options['admin'],
+ 'email' => $options['email'],
+ 'password' => $options['password'],
+ 'password_confirmation' => $options['password'],
+ 'class' => User::CLASS_STAFF_LEADER,
+ 'id' => 1,
+ ];
+ $userRep->store($insert);
+
+ $log = sprintf('[%s], %s, result: %s', nexus()->getRequestId(), __METHOD__, var_export($result, true));
+ $this->info($log);
+ do_log($log);
+ }
+}
diff --git a/include/constants.php b/include/constants.php
index 1dfb8182..09fd47be 100644
--- a/include/constants.php
+++ b/include/constants.php
@@ -1,12 +1,13 @@
".PROJECTNAME."");
defined('THISTRACKER') || define("THISTRACKER","General");
+defined('CONTENT_WIDTH') || define("CONTENT_WIDTH", 1200);
defined('ROOT_PATH') || define('ROOT_PATH', dirname(__DIR__) . '/');
defined('DEFAULT_TRACKER_URI') || define('DEFAULT_TRACKER_URI', '/announce.php');
if (!defined('RUNNING_IN_OCTANE')) {
diff --git a/include/functions.php b/include/functions.php
index 7688c170..1317c560 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -615,7 +615,7 @@ function begin_main_frame($caption = "", $center = false, $width = 100)
$tdextra .= " align=\"center\"";
if (!str_ends_with($width, '%')) {
- $width = 1200 * $width / 100;
+ $width = CONTENT_WIDTH * $width / 100;
}
print("
" .
@@ -2551,7 +2551,7 @@ foreach (\Nexus\Nexus::getAppendHeaders() as $value) {
-
+
-
+
/
diff --git a/public/ipsearch.php b/public/ipsearch.php
index e5018cef..9fe6bfe6 100644
--- a/public/ipsearch.php
+++ b/public/ipsearch.php
@@ -117,7 +117,7 @@ $limit";
print("".$count.$lang_ipsearch['text_users_used_the_ip'].$ip."");
- print("\n");
+ print("\n");
print("| ".$lang_ipsearch['col_username']." | ".
"".$lang_ipsearch['col_last_ip']." | ".
"".$lang_ipsearch['col_last_access']." | ".
diff --git a/public/usercp.php b/public/usercp.php
index 3537aebf..b85a4b3b 100644
--- a/public/usercp.php
+++ b/public/usercp.php
@@ -161,7 +161,7 @@ if ($action){
}
usercpmenu ("personal");
- print ("");
+ print ("");
if ($type == 'saved')
print("| ".$lang_usercp['text_saved']." | \n");
@@ -395,7 +395,7 @@ if ($showprocessing) $processings = searchbox_item_list("processings");
if ($showteam) $teams = searchbox_item_list("teams");
if ($showaudiocodec) $audiocodecs = searchbox_item_list("audiocodecs");
}
- print (" |