fix contact photo updates - a result of baseurl being wrong for cmdline processes
This commit is contained in:
parent
147d7f3bbf
commit
b96d6c015b
3 changed files with 44 additions and 13 deletions
16
update.php
16
update.php
|
@ -348,4 +348,18 @@ function update_1035() {
|
|||
|
||||
q("ALTER TABLE `contact` ADD `success_update` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `last-update` ");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function update_1036() {
|
||||
|
||||
$r = dbq("SELECT * FROM `contact` WHERE `network` = 'dfrn' && `photo` LIKE '%include/photo%' ");
|
||||
if(count($r)) {
|
||||
foreach($r as $rr) {
|
||||
q("UPDATE `contact` SET `photo` = '%s', `thumb` = '%s', `micro` = '%s' WHERE `id` = %d LIMIT 1",
|
||||
dbesc(str_replace('include/photo','photo',$rr['photo'])),
|
||||
dbesc(str_replace('include/photo','photo',$rr['thumb'])),
|
||||
dbesc(str_replace('include/photo','photo',$rr['micro'])),
|
||||
intval($rr['id']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue