aboutsummaryrefslogtreecommitdiffstats
path: root/mod/dfrn_confirm.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-08-04 20:03:38 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-08-04 20:03:38 -0700
commitd090033a0aab7197af9dc7f3e2cf21ebdf042b21 (patch)
treedb177b9ce7292b8972a29efcb85f83a3b2dc6470 /mod/dfrn_confirm.php
parent3540ada84ff9c64a0c4f8354cbc69032281907f2 (diff)
downloadvolse-hubzilla-d090033a0aab7197af9dc7f3e2cf21ebdf042b21.tar.gz
volse-hubzilla-d090033a0aab7197af9dc7f3e2cf21ebdf042b21.tar.bz2
volse-hubzilla-d090033a0aab7197af9dc7f3e2cf21ebdf042b21.zip
more photo progress
Diffstat (limited to 'mod/dfrn_confirm.php')
-rw-r--r--mod/dfrn_confirm.php61
1 files changed, 10 insertions, 51 deletions
diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php
index e5a550cd9..263c88f67 100644
--- a/mod/dfrn_confirm.php
+++ b/mod/dfrn_confirm.php
@@ -91,36 +91,14 @@ function dfrn_confirm_post(&$a) {
$hash = hash('md5',uniqid(mt_rand(),true));
- $r = q("INSERT INTO `photo` ( `uid`, `contact-id`, `resource-id`, `created`, `edited`, `filename`, `album`, `height`, `width`, `data`, `scale` )
- VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', 4 )",
- intval($local_uid),
- intval($dfrn_record),
- dbesc($hash),
- datetime_convert(),
- datetime_convert(),
- dbesc(basename($r[0]['photo'])),
- dbesc( t('Contact Photos') ),
- intval($img->getHeight()),
- intval($img->getWidth()),
- dbesc($img->imageString())
- );
+ $r = $img->store($local_uid, $dfrn_record, $hash, $filename, t('Contact Photos') , 4);
+
if($r === false)
$photo_failure = true;
$img->scaleImage(80);
- $r = q("INSERT INTO `photo` ( `uid`, `contact-id`, `resource-id`, `created`, `edited`, `filename`, `album`, `height`, `width`, `data`, `scale` )
- VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', 5 )",
- intval($local_uid),
- intval($dfrn_record),
- dbesc($hash),
- datetime_convert(),
- datetime_convert(),
- dbesc(basename($r[0]['photo'])),
- dbesc( t('Contact Photos')),
- intval($img->getHeight()),
- intval($img->getWidth()),
- dbesc($img->imageString())
- );
+ $r = $img->store($local_uid, $dfrn_record, $hash, $filename, t('Contact Photos') , 5);
+
if($r === false)
$photo_failure = true;
@@ -190,7 +168,7 @@ function dfrn_confirm_post(&$a) {
$uid = $_SESSION['uid'];
if(! $uid) {
- notice(t("Permission denied.") . EOL );
+ notice( t("Permission denied.") . EOL );
return;
}
@@ -319,33 +297,14 @@ function dfrn_confirm_post(&$a) {
$hash = hash('md5',uniqid(mt_rand(),true));
- $r = q("INSERT INTO `photo` ( `uid`, `resource-id`, `created`, `edited`, `filename`, `album`, `height`, `width`, `data`, `scale` )
- VALUES ( %d, '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', 4 )",
- intval($local_uid),
- dbesc($hash),
- datetime_convert(),
- datetime_convert(),
- dbesc(basename($r[0]['photo'])),
- dbesc( t('Contact Photos') ),
- intval($img->getHeight()),
- intval($img->getWidth()),
- dbesc($img->imageString())
- );
+ $r = $img->store($local_uid, $contact_id, $hash, $filename, t('Contact Photos'), 4 );
+
if($r === false)
$photo_failure = true;
$img->scaleImage(80);
- $r = q("INSERT INTO `photo` ( `uid`, `resource-id`, `created`, `edited`, `filename`, `album`, `height`, `width`, `data`, `scale` )
- VALUES ( %d, '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', 5 )",
- intval($local_uid),
- dbesc($hash),
- datetime_convert(),
- datetime_convert(),
- dbesc(basename($r[0]['photo'])),
- dbesc( t('Contact Photos') ),
- intval($img->getHeight()),
- intval($img->getWidth()),
- dbesc($img->imageString())
- );
+
+ $r = $img->store($local_uid, $contact_id, $hash, $filename, t('Contact Photos'), 5 );
+
if($r === false)
$photo_failure = true;