forked from DAEM-IT/synathina
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate_images.php_
76 lines (60 loc) · 2.07 KB
/
update_images.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!doctype html>
<html class="no-js" lang="el">
<body>
<?php
//header('Content-type: application/json; charset=UTF-8');
/**
* @package Core.Site
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* Define the application's minimum supported PHP version as a constant so it can be referenced within the application.
*/
define('JOOMLA_MINIMUM_PHP', '5.3.10');
if (version_compare(PHP_VERSION, JOOMLA_MINIMUM_PHP, '<'))
{
die('Your host needs to use PHP ' . JOOMLA_MINIMUM_PHP . ' or higher to run this version of Core');
}
// Saves the start time and memory usage.
$startTime = microtime(1);
$startMem = memory_get_usage();
/**
* Constant that is checked in included files to prevent direct access.
* define() is used in the installation folder rather than "const" to not error for PHP 5.2 and lower
*/
define('_JEXEC', 1);
if (file_exists(__DIR__ . '/defines.php'))
{
include_once __DIR__ . '/defines.php';
}
if (!defined('_JDEFINES'))
{
define('JPATH_BASE', __DIR__);
require_once JPATH_BASE . '/includes/defines.php';
}
require_once JPATH_BASE . '/includes/framework.php';
// Set profiler start time and memory usage and mark afterLoad in the profiler.
JDEBUG ? $_PROFILER->setStart($startTime, $startMem)->mark('afterLoad') : null;
$db = JFactory::getDbo();
foreach (glob("images/actions/wrong_images/*.jpg") as $filename) {
//echo "$filename size " . filesize($filename) . "\n";
$filename_array=explode('.',$filename);
$action_id = str_replace('images/actions/wrong_images/','',$filename_array[0]);
echo $action_id.'<br />';
$query="UPDATE #__actions SET image='' WHERE id='".$action_id."' LIMIT 1";
$db->setQuery($query);
$db->execute();
}
$query = "SELECT * FROM #__actions WHERE action_id=0 ";
$db->setQuery($query);
$activities = $db->loadObjectList();
foreach($activities as $activity){
//$query="UPDATE #__actions SET image='".$image."' WHERE id='".$activity->id."' LIMIT 1";
//$db->setQuery($query);
//$db->execute();
}
?>
</body>
</html>