Skip to content

Commit bac2f17

Browse files
committed
Switch to IDs
1 parent 8546928 commit bac2f17

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

resources/views/components/finishing.blade.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
<?php
1+
<?php
22
use Illuminate\Database\Migrations\Migration;
33
use Illuminate\Database\Schema\Blueprint;
44
use Illuminate\Support\Facades\Schema;
5+
use Illuminate\Support\Facades\DB;
6+
use Illuminate\Support\Facades\File;
57
68
//run before finishing:
79
if(EnvEditor::keyExists('JOIN_BETA')){ /* Do nothing if key already exists */
@@ -117,5 +119,23 @@ function getStringBetween($string, $start, $end) {
117119
]);
118120
} catch (exception $e) {}
119121
122+
123+
// Changes saved profile images from littlelink_name to IDs.
124+
// This runs every time the updater runs.
125+
// Not sure if this will cause any issues.
126+
// If it works, I won't touch it.
127+
try {
128+
$users = DB::table('users')->get();
129+
foreach ($users as $user) {
130+
$oldName = $user->littlelink_name . '.png';
131+
$newName = $user->id . '.png';
132+
$oldPath = base_path('img/' . $oldName);
133+
$newPath = base_path('img/' . $newName);
134+
135+
if (File::exists($oldPath)) {
136+
File::move($oldPath, $newPath);
137+
}}} catch (exception $e) {}
138+
139+
120140
echo "<meta http-equiv=\"refresh\" content=\"0; " . url()->current() . "?success\" />";
121141
?>

0 commit comments

Comments
 (0)