· 4 years ago · Apr 26, 2021, 07:46 PM
1<?php
2// PRESS CONTROL + U TO VIEW THE SOURCE CODE
3// ONCE YOU THERE REMOVE DIE AND REFRESH THE PAGE YOU JUST OPENED SHOULD BE view-source:
4die();
5
6// $array[file_number][['SPOILER NAME', 'SHORT NAME TO DISPLAY IN TABLE']]
7$array = [0 => ['Spiked Targe', 'ST'],
8 33 => ['Wooden Buckler', 'WB'],
9 62 => ['Round Shield', 'RS'],
10 103 => ['Skeleton Shield', 'SS'],
11 150 => ['Reinforced Buckler', 'RB'],
12 182 => ['Diamond Aegies','DA'],
13 196 => ['Bladed Shield', 'BL'],
14 236 => ['Ornate Buckler', 'OB'],
15 267 => ['Shield Of The Wing', 'SW'],
16 297 => ['Bronze Shield', 'BS'],
17 329 => ['Aegis', 'A'],
18 354 => ['Defender', 'D'],
19 379 => ['Tall Shield','TS'],
20 416 => ['Other Shield', 'OTH']];
21
22// glob("./images/*.jpg") will take all jpg pictures that are in the folder images
23$files = glob("./images/*.jpg");
24
25// TO GET A CLIENT ID YOU NEED TO REGISTER THERE : https://api.imgbb.com/
26// SIGN IN AND GO BACK TO https://api.imgbb.com/
27// CLICK ON ADD API KEY
28$client_id = "XXXXXXXXX";
29
30$j=1;
31
32//419 is the number of images that you need to upload => you have 420 in total cause 0 count
33for($i = 0; $i <= 419; $i++){
34 //IF YOU GET TIME OUT, COUNT HOW MANY IMAGES YOU DID UPLOAD
35 // REMOVE COMMENT BELLOW AND CHANGE THE NUMBER TO UPLOAD THE MISSING ONES
36 //if($i >= 297){
37 $filename = $files[$i];
38 $handle = fopen($filename, "r");
39 $data = fread($handle, filesize($filename));
40 $pvars = array('image' => base64_encode($data));
41 $timeout = 30;
42
43 $API_KEY = 'e0d32f6b2a95b33ec67c8ba13091f68c';
44 $ch = curl_init();
45 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
46 curl_setopt($ch, CURLOPT_URL, 'https://api.imgbb.com/1/upload?key='.$API_KEY);
47 curl_setopt($ch, CURLOPT_POST, 1);
48 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
49 curl_setopt($ch, CURLOPT_POSTFIELDS, $pvars);
50 $out = curl_exec($ch);
51 curl_close ($ch);
52 $pms = json_decode($out,true);
53 $url = $pms['data']['url'];
54
55 if($j == 1 && isset($array[$i])){
56 $storedI = $i;
57 echo "<woltlab-spoiler data-label='{$array[$storedI][0]}'><table><tbody><tr><td></td><td>C/O</td><td>R/B</td><td>B/O</td><tr>";
58 }
59
60 $name = $array[$storedI][1].$j;
61 echo "<tr><td><img src='{$url}'>{$name}</td><td></td><td></td><td></td></tr>";
62 $j++;
63
64 if(isset($array[$i+1])){
65 $j = 1;
66 echo "</tbody></table></woltlab-spoiler>";
67 }
68 //}
69
70}
71
72// ONCE SOURCE CODE IS FULLY DISPLAYED, YOU CAN COPY PAST IT TO LEGACY