Menu

[r13]: / installation / fixFilesSize.php  Maximize  Restore  History

Download this file

38 lines (31 with data), 993 Bytes

 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
<?php
#Application name: PhpCollab
#Status page: 0
#_fixFilesSize.php
$checkSession = "false";
include_once('../includes/library.php');
echo "Script to remove file size labels in database: <a href='$PHP_SELF?action=update'>launch</a><br/><br/>";
if ($action == "update") {
$tmpquery = "";
$listFiles = new request();
$listFiles->openFiles($tmpquery);
$comptListFiles = count($listFiles->fil_id);
if ($comptListFiles != "0") {
for ($i=0;$i<$comptListFiles;$i++) {
$sizeNew = $listFiles->fil_size[$i];
$sizeNew = str_replace('o','',$sizeNew);
$sizeNew = str_replace('O','',$sizeNew);
$sizeNew = str_replace('b','',$sizeNew);
$sizeNew = str_replace('B','',$sizeNew);
$sizeNew = str_replace('K','',$sizeNew);
$sizeNew = str_replace('M','',$sizeNew);
$sizeNew = str_replace('G','',$sizeNew);
$tmpquery = "UPDATE ".$tableCollab["files"]." SET size='$sizeNew' WHERE id='".$listFiles->fil_id[$i]."'";
connectSql($tmpquery);
}
echo "$comptListFiles fixed :o)";
} else {
echo "no results";
}
}
?>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.