more photo progress
This commit is contained in:
parent
3540ada84f
commit
d090033a0a
|
@ -217,9 +217,9 @@ CREATE TABLE IF NOT EXISTS `photo` (
|
||||||
`data` mediumblob NOT NULL,
|
`data` mediumblob NOT NULL,
|
||||||
`scale` tinyint(3) NOT NULL,
|
`scale` tinyint(3) NOT NULL,
|
||||||
`profile` tinyint(1) NOT NULL DEFAULT '0',
|
`profile` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
`allow_uid` mediumtext NOT NULL,
|
`allow_cid` mediumtext NOT NULL,
|
||||||
`allow_gid` mediumtext NOT NULL,
|
`allow_gid` mediumtext NOT NULL,
|
||||||
`deny_uid` mediumtext NOT NULL,
|
`deny_cid` mediumtext NOT NULL,
|
||||||
`deny_gid` mediumtext NOT NULL,
|
`deny_gid` mediumtext NOT NULL,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
|
@ -167,5 +167,32 @@ class Photo {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function store($uid, $cid, $rid, $filename, $album, $scale, $profile = 0) {
|
||||||
|
|
||||||
|
$r = q("INSERT INTO `photo`
|
||||||
|
( `uid`, `contact-id`, `resource-id`, `created`, `edited`, `filename`, `album`, `height`, `width`, `data`, `scale`, `profile` )
|
||||||
|
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d, %d )",
|
||||||
|
intval($uid),
|
||||||
|
intval($cid),
|
||||||
|
dbesc($rid),
|
||||||
|
dbesc(datetime_convert()),
|
||||||
|
dbesc(datetime_convert()),
|
||||||
|
dbesc(basename($filename)),
|
||||||
|
dbesc($album),
|
||||||
|
intval($this->height),
|
||||||
|
intval($this->width),
|
||||||
|
dbesc($this->imageString()),
|
||||||
|
intval($scale),
|
||||||
|
intval($profile)
|
||||||
|
);
|
||||||
|
return $r;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -91,36 +91,14 @@ function dfrn_confirm_post(&$a) {
|
||||||
|
|
||||||
$hash = hash('md5',uniqid(mt_rand(),true));
|
$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` )
|
$r = $img->store($local_uid, $dfrn_record, $hash, $filename, t('Contact Photos') , 4);
|
||||||
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())
|
|
||||||
);
|
|
||||||
if($r === false)
|
if($r === false)
|
||||||
$photo_failure = true;
|
$photo_failure = true;
|
||||||
|
|
||||||
$img->scaleImage(80);
|
$img->scaleImage(80);
|
||||||
$r = q("INSERT INTO `photo` ( `uid`, `contact-id`, `resource-id`, `created`, `edited`, `filename`, `album`, `height`, `width`, `data`, `scale` )
|
$r = $img->store($local_uid, $dfrn_record, $hash, $filename, t('Contact Photos') , 5);
|
||||||
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())
|
|
||||||
);
|
|
||||||
if($r === false)
|
if($r === false)
|
||||||
$photo_failure = true;
|
$photo_failure = true;
|
||||||
|
|
||||||
|
@ -319,33 +297,14 @@ function dfrn_confirm_post(&$a) {
|
||||||
|
|
||||||
$hash = hash('md5',uniqid(mt_rand(),true));
|
$hash = hash('md5',uniqid(mt_rand(),true));
|
||||||
|
|
||||||
$r = q("INSERT INTO `photo` ( `uid`, `resource-id`, `created`, `edited`, `filename`, `album`, `height`, `width`, `data`, `scale` )
|
$r = $img->store($local_uid, $contact_id, $hash, $filename, t('Contact Photos'), 4 );
|
||||||
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())
|
|
||||||
);
|
|
||||||
if($r === false)
|
if($r === false)
|
||||||
$photo_failure = true;
|
$photo_failure = true;
|
||||||
$img->scaleImage(80);
|
$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 )",
|
$r = $img->store($local_uid, $contact_id, $hash, $filename, t('Contact Photos'), 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())
|
|
||||||
);
|
|
||||||
if($r === false)
|
if($r === false)
|
||||||
$photo_failure = true;
|
$photo_failure = true;
|
||||||
|
|
||||||
|
|
18
mod/item.php
18
mod/item.php
|
@ -23,7 +23,7 @@ function item_post(&$a) {
|
||||||
intval($parent)
|
intval($parent)
|
||||||
);
|
);
|
||||||
if(! count($r)) {
|
if(! count($r)) {
|
||||||
notice("Unable to locate original post." . EOL);
|
notice( t('Unable to locate original post.') . EOL);
|
||||||
goaway($a->get_baseurl() . "/" . $_POST['return'] );
|
goaway($a->get_baseurl() . "/" . $_POST['return'] );
|
||||||
}
|
}
|
||||||
$parent_item = $r[0];
|
$parent_item = $r[0];
|
||||||
|
@ -68,7 +68,7 @@ function item_post(&$a) {
|
||||||
$body = escape_tags(trim($_POST['body']));
|
$body = escape_tags(trim($_POST['body']));
|
||||||
|
|
||||||
if(! strlen($body)) {
|
if(! strlen($body)) {
|
||||||
notice("Empty post discarded." . EOL );
|
notice( t('Empty post discarded.') . EOL );
|
||||||
goaway($a->get_baseurl() . "/" . $_POST['return'] );
|
goaway($a->get_baseurl() . "/" . $_POST['return'] );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -221,6 +221,19 @@ function item_content(&$a) {
|
||||||
intval($item['id'])
|
intval($item['id'])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// If item is a link to a photo resource, nuke all the associated photos
|
||||||
|
// (visitors will not have photo resources)
|
||||||
|
// This only applies to photos uploaded from the photos page. Photos inserted into a post do not
|
||||||
|
// generate a resource-id and therefore aren't intimately linked to the item.
|
||||||
|
|
||||||
|
if(strlen($item['resource-id'])) {
|
||||||
|
$q("DELETE FROM `photo` WHERE `resource-id` = '%s' AND `uid` = %d ",
|
||||||
|
dbesc($item['resource-id']),
|
||||||
|
intval($item['uid'])
|
||||||
|
);
|
||||||
|
// ignore the result
|
||||||
|
}
|
||||||
|
|
||||||
// If it's the parent of a comment thread, kill all the kids
|
// If it's the parent of a comment thread, kill all the kids
|
||||||
|
|
||||||
if($item['uri'] == $item['parent-uri']) {
|
if($item['uri'] == $item['parent-uri']) {
|
||||||
|
@ -230,6 +243,7 @@ function item_content(&$a) {
|
||||||
dbesc($item['parent-uri']),
|
dbesc($item['parent-uri']),
|
||||||
intval($item['uid'])
|
intval($item['uid'])
|
||||||
);
|
);
|
||||||
|
// ignore the result
|
||||||
}
|
}
|
||||||
|
|
||||||
$url = $a->get_baseurl();
|
$url = $a->get_baseurl();
|
||||||
|
|
|
@ -44,6 +44,7 @@ function photo_init(&$a) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
$resolution = 0;
|
$resolution = 0;
|
||||||
$photo = str_replace('.jpg','',$photo);
|
$photo = str_replace('.jpg','',$photo);
|
||||||
|
|
||||||
|
@ -52,14 +53,58 @@ function photo_init(&$a) {
|
||||||
$photo = substr($photo,0,-2);
|
$photo = substr($photo,0,-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = q("SELECT * FROM `photo` WHERE `resource-id` = '%s' AND `scale` = %d LIMIT 1",
|
$r = q("SELECT `uid` FROM `photo` WHERE `resource-id` = '%s' AND `scale` = %d LIMIT 1",
|
||||||
dbesc($photo),
|
dbesc($photo),
|
||||||
intval($resolution)
|
intval($resolution)
|
||||||
);
|
);
|
||||||
|
if(count($r)) {
|
||||||
|
|
||||||
|
$owner = $r[0]['uid'];
|
||||||
|
|
||||||
|
$sql_extra = " AND `allow_cid` = '' AND `allow_gid` = '' AND `deny_cid` = '' AND `deny_gid` = '' ";
|
||||||
|
|
||||||
|
if(local_user() && ($owner == $_SESSION['uid'])) {
|
||||||
|
|
||||||
|
// Owner can always see his/her photos
|
||||||
|
$sql_extra = '';
|
||||||
|
|
||||||
|
}
|
||||||
|
elseif(remote_user()) {
|
||||||
|
|
||||||
|
// authenticated visitor - here lie dragons
|
||||||
|
|
||||||
|
$groups = init_groups_visitor($_SESSION['visitor_id']);
|
||||||
|
$gs = '<<>>'; // should be impossible to match
|
||||||
|
if(count($groups)) {
|
||||||
|
foreach($groups as $g)
|
||||||
|
$gs .= '|<' . intval($g) . '>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql_extra = sprintf(
|
||||||
|
" AND ( `allow_cid` = '' OR `allow_cid` REGEXP '<%d>' )
|
||||||
|
AND ( `deny_cid` = '' OR NOT `deny_cid` REGEXP '<%d>' )
|
||||||
|
AND ( `allow_gid` = '' OR `allow_gid` REGEXP '%s' )
|
||||||
|
AND ( `deny_gid` = '' OR NOT `deny_gid` REGEXP '%s') ",
|
||||||
|
|
||||||
|
intval($_SESSION['visitor_id']),
|
||||||
|
intval($_SESSION['visitor_id']),
|
||||||
|
dbesc($gs),
|
||||||
|
dbesc($gs)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now we'll see if we can access the photo
|
||||||
|
|
||||||
|
$r = q("SELECT * FROM `photo` WHERE `resource-id` = '%s' AND `scale` = %d $sql_extra LIMIT 1",
|
||||||
|
dbesc($photo),
|
||||||
|
intval($resolution)
|
||||||
|
);
|
||||||
|
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
$data = $r[0]['data'];
|
$data = $r[0]['data'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(x($data) === false) {
|
if(x($data) === false) {
|
||||||
killme();
|
killme();
|
||||||
|
|
|
@ -42,7 +42,7 @@ function profile_photo_post(&$a) {
|
||||||
$srcY = $_POST['ystart'];
|
$srcY = $_POST['ystart'];
|
||||||
$srcW = $_POST['xfinal'] - $srcX;
|
$srcW = $_POST['xfinal'] - $srcX;
|
||||||
$srcH = $_POST['yfinal'] - $srcY;
|
$srcH = $_POST['yfinal'] - $srcY;
|
||||||
|
//dbg(3);
|
||||||
$r = q("SELECT * FROM `photo` WHERE `resource-id` = '%s' AND `uid` = %d AND `scale` = %d LIMIT 1",
|
$r = q("SELECT * FROM `photo` WHERE `resource-id` = '%s' AND `uid` = %d AND `scale` = %d LIMIT 1",
|
||||||
dbesc($image_id),
|
dbesc($image_id),
|
||||||
dbesc($_SESSION['uid']),
|
dbesc($_SESSION['uid']),
|
||||||
|
@ -55,38 +55,14 @@ function profile_photo_post(&$a) {
|
||||||
$im = new Photo($base_image['data']);
|
$im = new Photo($base_image['data']);
|
||||||
$im->cropImage(175,$srcX,$srcY,$srcW,$srcH);
|
$im->cropImage(175,$srcX,$srcY,$srcW,$srcH);
|
||||||
|
|
||||||
$ret = q("INSERT INTO `photo` ( `uid`, `resource-id`, `created`, `edited`, `filename`, `album`,
|
$r = $im->store($_SESSION['uid'], 0, $base_image['resource-id'],$base_image['filename'], t('Profile Photos'), 4, 1);
|
||||||
`height`, `width`, `data`, `scale`, `profile` )
|
|
||||||
VALUES ( %d, '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', 4, 1 )",
|
|
||||||
intval($_SESSION['uid']),
|
|
||||||
dbesc($base_image['resource-id']),
|
|
||||||
datetime_convert(),
|
|
||||||
datetime_convert(),
|
|
||||||
dbesc($base_image['filename']),
|
|
||||||
dbesc( t('Profile Photos') ),
|
|
||||||
intval($im->getHeight()),
|
|
||||||
intval($im->getWidth()),
|
|
||||||
dbesc($im->imageString())
|
|
||||||
);
|
|
||||||
|
|
||||||
if($r === false)
|
if($r === false)
|
||||||
notice ( t('Image size reduction (175) failed.') . EOL );
|
notice ( t('Image size reduction (175) failed.') . EOL );
|
||||||
|
|
||||||
$im->scaleImage(80);
|
$im->scaleImage(80);
|
||||||
|
|
||||||
$ret = q("INSERT INTO `photo` ( `uid`, `resource-id`, `created`, `edited`, `filename`, `album`,
|
$r = $im->store($_SESSION['uid'], 0, $base_image['resource-id'],$base_image['filename'], t('Profile Photos'), 5, 1);
|
||||||
`height`, `width`, `data`, `scale`, `profile` )
|
|
||||||
VALUES ( %d, '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', 5, 1 )",
|
|
||||||
intval($_SESSION['uid']),
|
|
||||||
dbesc($base_image['resource-id']),
|
|
||||||
datetime_convert(),
|
|
||||||
datetime_convert(),
|
|
||||||
dbesc($base_image['filename']),
|
|
||||||
dbesc( t('Profile Photos') ),
|
|
||||||
intval($im->getHeight()),
|
|
||||||
intval($im->getWidth()),
|
|
||||||
dbesc($im->imageString())
|
|
||||||
);
|
|
||||||
|
|
||||||
if($r === false)
|
if($r === false)
|
||||||
notice( t('Image size reduction (80) failed.') . EOL );
|
notice( t('Image size reduction (80) failed.') . EOL );
|
||||||
|
@ -129,21 +105,11 @@ function profile_photo_post(&$a) {
|
||||||
|
|
||||||
$hash = hash('md5',uniqid(mt_rand(),true));
|
$hash = hash('md5',uniqid(mt_rand(),true));
|
||||||
|
|
||||||
$str_image = $ph->imageString();
|
|
||||||
$smallest = 0;
|
$smallest = 0;
|
||||||
|
|
||||||
$r = q("INSERT INTO `photo` ( `uid`, `resource-id`, `created`, `edited`, `filename`, `album`,
|
$r = $ph->store($_SESSION['uid'], 0 , $hash, $filename, t('Profile Photos'), 0 );
|
||||||
`height`, `width`, `data`, `scale` )
|
|
||||||
VALUES ( %d, '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', 0 )",
|
|
||||||
intval($_SESSION['uid']),
|
|
||||||
dbesc($hash),
|
|
||||||
datetime_convert(),
|
|
||||||
datetime_convert(),
|
|
||||||
dbesc(basename($filename)),
|
|
||||||
dbesc( t('Profile Photos') ),
|
|
||||||
intval($height),
|
|
||||||
intval($width),
|
|
||||||
dbesc($str_image));
|
|
||||||
if($r)
|
if($r)
|
||||||
notice( t('Image uploaded successfully.') . EOL );
|
notice( t('Image uploaded successfully.') . EOL );
|
||||||
else
|
else
|
||||||
|
@ -151,23 +117,8 @@ function profile_photo_post(&$a) {
|
||||||
|
|
||||||
if($width > 640 || $height > 640) {
|
if($width > 640 || $height > 640) {
|
||||||
$ph->scaleImage(640);
|
$ph->scaleImage(640);
|
||||||
$str_image = $ph->imageString();
|
$r = $ph->store($_SESSION['uid'], 0 , $hash, $filename, t('Profile Photos'), 1 );
|
||||||
$width = $ph->getWidth();
|
|
||||||
$height = $ph->getHeight();
|
|
||||||
|
|
||||||
$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', 1 )",
|
|
||||||
intval($_SESSION['uid']),
|
|
||||||
dbesc($hash),
|
|
||||||
datetime_convert(),
|
|
||||||
datetime_convert(),
|
|
||||||
dbesc(basename($filename)),
|
|
||||||
dbesc( t('Profile Photos') ),
|
|
||||||
intval($ph->getHeight()),
|
|
||||||
intval($ph->getWidth()),
|
|
||||||
dbesc($ph->imageString())
|
|
||||||
);
|
|
||||||
if($r === false)
|
if($r === false)
|
||||||
notice( t('Image size reduction (640) failed.') . EOL );
|
notice( t('Image size reduction (640) failed.') . EOL );
|
||||||
else
|
else
|
||||||
|
|
|
@ -5,7 +5,7 @@ require_once('Photo.php');
|
||||||
function wall_upload_post(&$a) {
|
function wall_upload_post(&$a) {
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
echo ( "Permission denied." . EOL );
|
echo ( t('Permission denied.') . EOL );
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ function wall_upload_post(&$a) {
|
||||||
$ph = new Photo($imagedata);
|
$ph = new Photo($imagedata);
|
||||||
|
|
||||||
if(! ($image = $ph->getImage())) {
|
if(! ($image = $ph->getImage())) {
|
||||||
echo ("Unable to process image." . EOL);
|
echo ( t('Unable to process image.') . EOL);
|
||||||
@unlink($src);
|
@unlink($src);
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
@ -32,62 +32,25 @@ function wall_upload_post(&$a) {
|
||||||
|
|
||||||
$hash = hash('md5',uniqid(mt_rand(),true));
|
$hash = hash('md5',uniqid(mt_rand(),true));
|
||||||
|
|
||||||
$str_image = $ph->imageString();
|
|
||||||
$smallest = 0;
|
$smallest = 0;
|
||||||
|
|
||||||
$r = q("INSERT INTO `photo` ( `uid`, `resource-id`, `created`, `edited`, `filename`, `album`,
|
$r = $ph->store($_SESSION['uid'], 0, $hash, $filename, t('Wall Photos'), 0 );
|
||||||
`height`, `width`, `data`, `scale` )
|
|
||||||
VALUES ( %d, '%s', '%s', '%s', '%s', %d, %d, '%s', 0 )",
|
|
||||||
intval($_SESSION['uid']),
|
|
||||||
dbesc($hash),
|
|
||||||
datetime_convert(),
|
|
||||||
datetime_convert(),
|
|
||||||
dbesc(basename($filename)),
|
|
||||||
dbesc( t('Wall Photos')),
|
|
||||||
intval($height),
|
|
||||||
intval($width),
|
|
||||||
dbesc($str_image));
|
|
||||||
if(! $r) {
|
if(! $r) {
|
||||||
echo ("Image upload failed." . EOL);
|
echo ( t('Image upload failed.') . EOL);
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($width > 640 || $height > 640) {
|
if($width > 640 || $height > 640) {
|
||||||
$ph->scaleImage(640);
|
$ph->scaleImage(640);
|
||||||
|
$r = $ph->store($_SESSION['uid'], 0, $hash, $filename, t('Wall Photos'), 1 );
|
||||||
$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', 1 )",
|
|
||||||
intval($_SESSION['uid']),
|
|
||||||
dbesc($hash),
|
|
||||||
datetime_convert(),
|
|
||||||
datetime_convert(),
|
|
||||||
dbesc(basename($filename)),
|
|
||||||
dbesc( t('Wall Photos') ),
|
|
||||||
intval($ph->getHeight()),
|
|
||||||
intval($ph->getWidth()),
|
|
||||||
dbesc($ph->imageString())
|
|
||||||
);
|
|
||||||
if($r)
|
if($r)
|
||||||
$smallest = 1;
|
$smallest = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($width > 320 || $height > 320) {
|
if($width > 320 || $height > 320) {
|
||||||
$ph->scaleImage(320);
|
$ph->scaleImage(320);
|
||||||
|
$r = $ph->store($_SESSION['uid'], 0, $hash, $filename, t('Wall Photos'), 2 );
|
||||||
$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', 2 )",
|
|
||||||
intval($_SESSION['uid']),
|
|
||||||
dbesc($hash),
|
|
||||||
datetime_convert(),
|
|
||||||
datetime_convert(),
|
|
||||||
dbesc(basename($filename)),
|
|
||||||
dbesc( t('Wall Photos') ),
|
|
||||||
intval($ph->getHeight()),
|
|
||||||
intval($ph->getWidth()),
|
|
||||||
dbesc($ph->imageString())
|
|
||||||
);
|
|
||||||
if($r)
|
if($r)
|
||||||
$smallest = 2;
|
$smallest = 2;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ tinyMCE.init({
|
||||||
name: 'userfile',
|
name: 'userfile',
|
||||||
onSubmit: function(file,ext) { $('#profile-rotator').show(); },
|
onSubmit: function(file,ext) { $('#profile-rotator').show(); },
|
||||||
onComplete: function(file,response) {
|
onComplete: function(file,response) {
|
||||||
alert(response); tinyMCE.execCommand('mceInsertRawHTML',false,response);
|
tinyMCE.execCommand('mceInsertRawHTML',false,response);
|
||||||
$('#profile-rotator').hide();
|
$('#profile-rotator').hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue