aboutsummaryrefslogtreecommitdiffstats
path: root/mod/profile_photo.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-07-07 06:29:32 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-07-07 06:29:32 -0700
commitdea552b74f5146f8b36a23fd2074de055ab960cb (patch)
tree9cec10ff1e8b251e8f26e9aa109a5c6d624b0275 /mod/profile_photo.php
parentc10e7723185c608217d0944fe62a36995e552322 (diff)
downloadvolse-hubzilla-dea552b74f5146f8b36a23fd2074de055ab960cb.tar.gz
volse-hubzilla-dea552b74f5146f8b36a23fd2074de055ab960cb.tar.bz2
volse-hubzilla-dea552b74f5146f8b36a23fd2074de055ab960cb.zip
some fixes after cloning to a new site
Diffstat (limited to 'mod/profile_photo.php')
-rw-r--r--mod/profile_photo.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/mod/profile_photo.php b/mod/profile_photo.php
index f7e6825ae..8b536c2aa 100644
--- a/mod/profile_photo.php
+++ b/mod/profile_photo.php
@@ -88,9 +88,19 @@ function profile_photo_post(&$a) {
$r = q("UPDATE `profile` SET `photo` = '%s', `thumb` = '%s' WHERE `id` = %d LIMIT 1",
dbesc($a->get_baseurl() . '/photo/' . $image_id . '-4.jpg'),
dbesc($a->get_baseurl() . '/photo/' . $image_id . '-5.jpg'),
- intval($profile_id));
- if($r === NULL)
+ intval($profile_id)
+ );
+ if($r === false)
$_SESSION['sysmsg'] .= "Failed to add image to profile." . EOL;
+// We should really only do this if requested, or if it is the default profile. The contact
+//table images are used in coversations.
+ $r = q("UPDATE `contact` SET `photo` = '%s', `thumb` = '%s' WHERE `uid` = %d AND `self` = 1 LIMIT 1",
+ dbesc($a->get_baseurl() . '/photo/' . $image_id . '-4.jpg'),
+ dbesc($a->get_baseurl() . '/photo/' . $image_id . '-5.jpg'),
+ intval($_SESSION['uid'])
+ );
+ if($r ===false)
+ notice("Failed to add photo to contact table." .EOL );
}
goaway($a->get_baseurl() . '/profiles');