Menu

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

Download this file

48 lines (39 with data), 1.4 kB

 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
#Application name: PhpCollab
#Status page: 0
#_fixFilesSize.php
$checkSession = "false";
include_once('../includes/library.php');
echo "Script to update published values with files updates and reviews: <a href=\"$PHP_SELF?action=update\">launch</a><br/><br/>";
if ($action == "update") {
$tmpquery = "WHERE fil.published = '0'";
$filesPublished = new request();
$filesPublished->openFiles($tmpquery);
$comptFilesPublished = count($filesPublished->fil_id);
if ($comptFilesPublished != "0") {
for ($i=0;$i<$comptFilesPublished;$i++) {
$filesPublishedValue .= $filesPublished->fil_id[$i];
if ($i != $comptFilesPublished-1) {
$filesPublishedValue .= ",";
}
}
$tmpquery1 = "UPDATE ".$tableCollab["files"]." SET published='0' WHERE vc_parent IN ($filesPublishedValue)";
connectSql("$tmpquery1");
}
$tmpquery = "WHERE fil.published = '1'";
$filesPublishedNo = new request();
$filesPublishedNo->openFiles($tmpquery);
$comptFilesPublishedNo = count($filesPublishedNo->fil_id);
if ($comptFilesPublishedNo != "0") {
for ($i=0;$i<$comptFilesPublishedNo;$i++) {
$filesPublishedNoValue .= $filesPublishedNo->fil_id[$i];
if ($i != $comptFilesPublishedNo-1) {
$filesPublishedNoValue .= ",";
}
}
$tmpquery1 = "UPDATE ".$tableCollab["files"]." SET published='1' WHERE vc_parent IN ($filesPublishedNoValue)";
connectSql("$tmpquery1");
}
echo "fixed :o)";
}
?>
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.