-
Notifications
You must be signed in to change notification settings - Fork 9
/
scan-snd.php
46 lines (43 loc) · 1.82 KB
/
scan-snd.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
require_once 'mysql.inc.php';
pdo_select_db($DBsta);
echo 'Scanning SND...';
$res = $DB->query("SELECT *
FROM ressnd
WHERE resfolder NOT LIKE '5QDemo/%'
AND resfolder NOT LIKE '%Mb84'
AND resfolder NOT LIKE '%Mb85'
AND resfolder NOT LIKE '%Mc85'
AND resfolder NOT LIKE '%Mh23'
AND resfolder NOT LIKE '%Md42'
AND resfolder NOT LIKE '%Md70'
AND resfolder NOT LIKE '%Md71'
AND resfolder NOT LIKE '%Md72'
AND resfolder NOT LIKE '%Me13'
AND resfolder NOT LIKE '%Me21'
AND resfolder NOT LIKE '%Me22'
AND resfolder NOT LIKE '%Me23'
AND resfolder NOT LIKE '%Mf21'
AND resfolder NOT LIKE '%Mg40'
AND resfolder NOT LIKE '%Mh42'");
while ($rs = $res->fetch()) {
$list = scandir('../res-full/'.$rs['resfolder']);
if (sizeof($list)) {
$IDlist = array();
foreach($list as $file) if (strpos($file,'.ogg') !== FALSE) {
$ID = str_replace('.ogg','',$file);
if ($ID < 1000) $IDlist[$ID] = 1;
}
ksort($IDlist);
if (sizeof($IDlist) > 0) {
$IDlist = implode(',', array_keys($IDlist));
$DB->query("UPDATE ressnd
SET val = '" . addslashes($IDlist) . "'
WHERE grp = '" . addslashes($rs['grp']) . "'
AND name = '" . addslashes($rs['name']) . "'
AND variantType = '".addslashes($rs['variantType'])."'
AND variantValue = '".addslashes($rs['variantValue'])."'");
}
} else echo $rs['resfolder']." doesn't exists;";
}
echo 'OK<br/>';