here's where the heavy lifting begins - everything is likely to be broken for quite some time as we add location and db independence to items and conversations and work through the rest of the permissions and how to federate the buggers.
This commit is contained in:
parent
d261fe271f
commit
846a9813b2
13
boot.php
13
boot.php
@ -538,6 +538,14 @@ if(! class_exists('App')) {
|
|||||||
if($this->pager['start'] < 0)
|
if($this->pager['start'] < 0)
|
||||||
$this->pager['start'] = 0;
|
$this->pager['start'] = 0;
|
||||||
$this->pager['total'] = 0;
|
$this->pager['total'] = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Detect mobile devices
|
||||||
|
*/
|
||||||
|
|
||||||
|
$mobile_detect = new Mobile_Detect();
|
||||||
|
$this->is_mobile = $mobile_detect->isMobile();
|
||||||
|
$this->is_tablet = $mobile_detect->isTablet();
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_baseurl($ssl = false) {
|
function get_baseurl($ssl = false) {
|
||||||
@ -1544,8 +1552,9 @@ if(! function_exists('current_theme')) {
|
|||||||
|
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
|
|
||||||
$mobile_detect = new Mobile_Detect();
|
// $mobile_detect = new Mobile_Detect();
|
||||||
$is_mobile = $mobile_detect->isMobile() || $mobile_detect->isTablet();
|
// $is_mobile = $mobile_detect->isMobile() || $mobile_detect->isTablet();
|
||||||
|
$is_mobile = $a->is_mobile || $a->is_tablet;
|
||||||
|
|
||||||
if($is_mobile) {
|
if($is_mobile) {
|
||||||
$system_theme = ((isset($a->config['system']['mobile-theme'])) ? $a->config['system']['mobile-theme'] : '');
|
$system_theme = ((isset($a->config['system']['mobile-theme'])) ? $a->config['system']['mobile-theme'] : '');
|
||||||
|
43
database.sql
43
database.sql
@ -447,6 +447,7 @@ CREATE TABLE IF NOT EXISTS `hubloc` (
|
|||||||
`hubloc_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
`hubloc_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`hubloc_guid` char(255) NOT NULL DEFAULT '',
|
`hubloc_guid` char(255) NOT NULL DEFAULT '',
|
||||||
`hubloc_guid_sig` char(255) NOT NULL,
|
`hubloc_guid_sig` char(255) NOT NULL,
|
||||||
|
`hubloc_hash` char(255) NOT NULL,
|
||||||
`hubloc_flags` int(10) unsigned NOT NULL DEFAULT '0',
|
`hubloc_flags` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
`hubloc_url` char(255) NOT NULL DEFAULT '',
|
`hubloc_url` char(255) NOT NULL DEFAULT '',
|
||||||
`hubloc_url_sig` char(255) NOT NULL,
|
`hubloc_url_sig` char(255) NOT NULL,
|
||||||
@ -489,24 +490,19 @@ CREATE TABLE IF NOT EXISTS `item` (
|
|||||||
`uri` char(255) CHARACTER SET ascii NOT NULL,
|
`uri` char(255) CHARACTER SET ascii NOT NULL,
|
||||||
`aid` int(10) unsigned NOT NULL DEFAULT '0',
|
`aid` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
`uid` int(10) unsigned NOT NULL DEFAULT '0',
|
`uid` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
`contact-id` int(10) unsigned NOT NULL DEFAULT '0',
|
|
||||||
`type` char(255) NOT NULL,
|
`type` char(255) NOT NULL,
|
||||||
`wall` tinyint(1) NOT NULL DEFAULT '0',
|
`wall` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
`gravity` tinyint(1) NOT NULL DEFAULT '0',
|
`gravity` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
`parent` int(10) unsigned NOT NULL DEFAULT '0',
|
`parent` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
`parent_uri` char(255) CHARACTER SET ascii NOT NULL,
|
`parent_uri` char(255) CHARACTER SET ascii NOT NULL,
|
||||||
`thr-parent` char(255) NOT NULL,
|
`thr_parent` char(255) NOT NULL,
|
||||||
`created` datetime NOT NULL,
|
`created` datetime NOT NULL,
|
||||||
`edited` datetime NOT NULL,
|
`edited` datetime NOT NULL,
|
||||||
`commented` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
`commented` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||||
`received` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
`received` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||||
`changed` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
`changed` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||||
`owner-name` char(255) NOT NULL,
|
`owner_xchan` char(255) NOT NULL DEFAULT '',
|
||||||
`owner-link` char(255) NOT NULL,
|
`author_xchan` char(255) NOT NULL,
|
||||||
`owner-avatar` char(255) NOT NULL,
|
|
||||||
`author-name` char(255) NOT NULL,
|
|
||||||
`author-link` char(255) NOT NULL,
|
|
||||||
`author-avatar` char(255) NOT NULL,
|
|
||||||
`title` char(255) NOT NULL,
|
`title` char(255) NOT NULL,
|
||||||
`body` mediumtext NOT NULL,
|
`body` mediumtext NOT NULL,
|
||||||
`app` char(255) NOT NULL,
|
`app` char(255) NOT NULL,
|
||||||
@ -518,7 +514,7 @@ CREATE TABLE IF NOT EXISTS `item` (
|
|||||||
`target` text NOT NULL,
|
`target` text NOT NULL,
|
||||||
`postopts` text NOT NULL,
|
`postopts` text NOT NULL,
|
||||||
`plink` char(255) NOT NULL,
|
`plink` char(255) NOT NULL,
|
||||||
`resource-id` char(255) NOT NULL,
|
`resource_id` char(255) NOT NULL,
|
||||||
`event-id` int(11) NOT NULL,
|
`event-id` int(11) NOT NULL,
|
||||||
`attach` mediumtext NOT NULL,
|
`attach` mediumtext NOT NULL,
|
||||||
`inform` mediumtext NOT NULL,
|
`inform` mediumtext NOT NULL,
|
||||||
@ -542,7 +538,6 @@ CREATE TABLE IF NOT EXISTS `item` (
|
|||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
KEY `uri` (`uri`),
|
KEY `uri` (`uri`),
|
||||||
KEY `uid` (`uid`),
|
KEY `uid` (`uid`),
|
||||||
KEY `contact-id` (`contact-id`),
|
|
||||||
KEY `type` (`type`),
|
KEY `type` (`type`),
|
||||||
KEY `parent` (`parent`),
|
KEY `parent` (`parent`),
|
||||||
KEY `created` (`created`),
|
KEY `created` (`created`),
|
||||||
@ -555,16 +550,16 @@ CREATE TABLE IF NOT EXISTS `item` (
|
|||||||
KEY `origin` (`origin`),
|
KEY `origin` (`origin`),
|
||||||
KEY `wall` (`wall`),
|
KEY `wall` (`wall`),
|
||||||
KEY `forum_mode` (`forum_mode`),
|
KEY `forum_mode` (`forum_mode`),
|
||||||
KEY `author-link` (`author-link`),
|
|
||||||
KEY `bookmark` (`bookmark`),
|
KEY `bookmark` (`bookmark`),
|
||||||
KEY `moderated` (`moderated`),
|
KEY `moderated` (`moderated`),
|
||||||
KEY `spam` (`spam`),
|
KEY `spam` (`spam`),
|
||||||
KEY `author-name` (`author-name`),
|
|
||||||
KEY `uid_commented` (`uid`,`commented`),
|
KEY `uid_commented` (`uid`,`commented`),
|
||||||
KEY `uid_created` (`uid`,`created`),
|
KEY `uid_created` (`uid`,`created`),
|
||||||
KEY `uid_unseen` (`uid`,`unseen`),
|
KEY `uid_unseen` (`uid`,`unseen`),
|
||||||
KEY `parent_uri` (`parent_uri`),
|
KEY `parent_uri` (`parent_uri`),
|
||||||
KEY `aid` (`aid`),
|
KEY `aid` (`aid`),
|
||||||
|
KEY `owner_xchan` (`owner_xchan`),
|
||||||
|
KEY `author_xchan` (`author_xchan`),
|
||||||
FULLTEXT KEY `title` (`title`),
|
FULLTEXT KEY `title` (`title`),
|
||||||
FULLTEXT KEY `body` (`body`),
|
FULLTEXT KEY `body` (`body`),
|
||||||
FULLTEXT KEY `allow_cid` (`allow_cid`),
|
FULLTEXT KEY `allow_cid` (`allow_cid`),
|
||||||
@ -688,7 +683,7 @@ CREATE TABLE IF NOT EXISTS `photo` (
|
|||||||
`uid` int(10) unsigned NOT NULL,
|
`uid` int(10) unsigned NOT NULL,
|
||||||
`contact-id` int(10) unsigned NOT NULL DEFAULT '0',
|
`contact-id` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
`guid` char(64) NOT NULL,
|
`guid` char(64) NOT NULL,
|
||||||
`resource-id` char(255) NOT NULL,
|
`resource_id` char(255) NOT NULL,
|
||||||
`created` datetime NOT NULL,
|
`created` datetime NOT NULL,
|
||||||
`edited` datetime NOT NULL,
|
`edited` datetime NOT NULL,
|
||||||
`title` char(255) NOT NULL,
|
`title` char(255) NOT NULL,
|
||||||
@ -707,7 +702,7 @@ CREATE TABLE IF NOT EXISTS `photo` (
|
|||||||
`deny_gid` mediumtext NOT NULL,
|
`deny_gid` mediumtext NOT NULL,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
KEY `uid` (`uid`),
|
KEY `uid` (`uid`),
|
||||||
KEY `resource-id` (`resource-id`),
|
KEY `resource-id` (`resource_id`),
|
||||||
KEY `album` (`album`),
|
KEY `album` (`album`),
|
||||||
KEY `scale` (`scale`),
|
KEY `scale` (`scale`),
|
||||||
KEY `profile` (`profile`),
|
KEY `profile` (`profile`),
|
||||||
@ -939,3 +934,23 @@ CREATE TABLE IF NOT EXISTS `userd` (
|
|||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
KEY `username` (`username`)
|
KEY `username` (`username`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `xchan` (
|
||||||
|
`xchan_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`xchan_guid` char(255) NOT NULL DEFAULT '',
|
||||||
|
`xchan_sig` char(255) NOT NULL DEFAULT '',
|
||||||
|
`xchan_hash` char(255) NOT NULL DEFAULT '',
|
||||||
|
`xchan_photo` char(255) NOT NULL DEFAULT '',
|
||||||
|
`xchan_addr` char(255) NOT NULL DEFAULT '',
|
||||||
|
`xchan_profile` char(255) NOT NULL DEFAULT '',
|
||||||
|
`xchan_name` char(255) NOT NULL DEFAULT '',
|
||||||
|
`xchan_network` char(255) NOT NULL DEFAULT '',
|
||||||
|
PRIMARY KEY (`xchan_id`),
|
||||||
|
KEY `xchan_guid` (`xchan_guid`),
|
||||||
|
KEY `xchan_sig` (`xchan_sig`),
|
||||||
|
KEY `xchan_hash` (`xchan_hash`),
|
||||||
|
KEY `xchan_addr` (`xchan_addr`),
|
||||||
|
KEY `xchan_profile` (`xchan_profile`),
|
||||||
|
KEY `xchan_name` (`xchan_name`),
|
||||||
|
KEY `xchan_network` (`xchan_network`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
@ -179,19 +179,6 @@ class Photo {
|
|||||||
if(!$this->is_valid())
|
if(!$this->is_valid())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if($this->is_imagick()) {
|
|
||||||
/**
|
|
||||||
* If it is not animated, there will be only one iteration here,
|
|
||||||
* so don't bother checking
|
|
||||||
*/
|
|
||||||
// Don't forget to go back to the first frame
|
|
||||||
$this->image->setFirstIterator();
|
|
||||||
do {
|
|
||||||
$this->image->resizeImage($max, $max, imagick::FILTER_LANCZOS, 1, true);
|
|
||||||
} while ($this->image->nextImage());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$width = $this->width;
|
$width = $this->width;
|
||||||
$height = $this->height;
|
$height = $this->height;
|
||||||
|
|
||||||
@ -201,7 +188,18 @@ class Photo {
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if($width > $max && $height > $max) {
|
if($width > $max && $height > $max) {
|
||||||
if($width > $height) {
|
|
||||||
|
// very tall image (greater than 16:9)
|
||||||
|
// constrain the width - let the height float.
|
||||||
|
|
||||||
|
if((($height * 9) / 16) > $width) {
|
||||||
|
$dest_width = $max;
|
||||||
|
$dest_height = intval(( $height * $max ) / $width);
|
||||||
|
}
|
||||||
|
|
||||||
|
// else constrain both dimensions
|
||||||
|
|
||||||
|
elseif($width > $height) {
|
||||||
$dest_width = $max;
|
$dest_width = $max;
|
||||||
$dest_height = intval(( $height * $max ) / $width);
|
$dest_height = intval(( $height * $max ) / $width);
|
||||||
}
|
}
|
||||||
@ -217,9 +215,19 @@ class Photo {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if( $height > $max ) {
|
if( $height > $max ) {
|
||||||
|
|
||||||
|
// very tall image (greater than 16:9)
|
||||||
|
// but width is OK - don't do anything
|
||||||
|
|
||||||
|
if((($height * 9) / 16) > $width) {
|
||||||
|
$dest_width = $width;
|
||||||
|
$dest_height = $height;
|
||||||
|
}
|
||||||
|
else {
|
||||||
$dest_width = intval(( $width * $max ) / $height);
|
$dest_width = intval(( $width * $max ) / $height);
|
||||||
$dest_height = $max;
|
$dest_height = $max;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
$dest_width = $width;
|
$dest_width = $width;
|
||||||
$dest_height = $height;
|
$dest_height = $height;
|
||||||
@ -228,6 +236,28 @@ class Photo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if($this->is_imagick()) {
|
||||||
|
/**
|
||||||
|
* If it is not animated, there will be only one iteration here,
|
||||||
|
* so don't bother checking
|
||||||
|
*/
|
||||||
|
// Don't forget to go back to the first frame
|
||||||
|
$this->image->setFirstIterator();
|
||||||
|
do {
|
||||||
|
|
||||||
|
// FIXME - implement horizantal bias for scaling as in followin GD functions
|
||||||
|
// to allow very tall images to be constrained only horizontally.
|
||||||
|
|
||||||
|
$this->image->scaleImage($dest_width, $dest_height);
|
||||||
|
} while ($this->image->nextImage());
|
||||||
|
|
||||||
|
// FIXME - also we need to copy the new dimensions to $this->height, $this->width as other functions
|
||||||
|
// may rely on it.
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$dest = imagecreatetruecolor( $dest_width, $dest_height );
|
$dest = imagecreatetruecolor( $dest_width, $dest_height );
|
||||||
imagealphablending($dest, false);
|
imagealphablending($dest, false);
|
||||||
imagesavealpha($dest, true);
|
imagesavealpha($dest, true);
|
||||||
@ -341,8 +371,6 @@ class Photo {
|
|||||||
if(!$this->is_valid())
|
if(!$this->is_valid())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if($this->is_imagick())
|
|
||||||
return $this->scaleImage($min);
|
|
||||||
|
|
||||||
$width = $this->width;
|
$width = $this->width;
|
||||||
$height = $this->height;
|
$height = $this->height;
|
||||||
@ -379,6 +407,8 @@ class Photo {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($this->is_imagick())
|
||||||
|
return $this->scaleImage($dest_width,$dest_height);
|
||||||
|
|
||||||
$dest = imagecreatetruecolor( $dest_width, $dest_height );
|
$dest = imagecreatetruecolor( $dest_width, $dest_height );
|
||||||
imagealphablending($dest, false);
|
imagealphablending($dest, false);
|
||||||
@ -401,7 +431,7 @@ class Photo {
|
|||||||
if($this->is_imagick()) {
|
if($this->is_imagick()) {
|
||||||
$this->image->setFirstIterator();
|
$this->image->setFirstIterator();
|
||||||
do {
|
do {
|
||||||
$this->image->resizeImage($dim, $dim, imagick::FILTER_LANCZOS, 1, false);
|
$this->image->scaleImage($dim, $dim);
|
||||||
} while ($this->image->nextImage());
|
} while ($this->image->nextImage());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -495,7 +525,7 @@ class Photo {
|
|||||||
|
|
||||||
public function store($uid, $cid, $rid, $filename, $album, $scale, $profile = 0, $allow_cid = '', $allow_gid = '', $deny_cid = '', $deny_gid = '') {
|
public function store($uid, $cid, $rid, $filename, $album, $scale, $profile = 0, $allow_cid = '', $allow_gid = '', $deny_cid = '', $deny_gid = '') {
|
||||||
|
|
||||||
$x = q("select id from photo where `resource-id` = '%s' and uid = %d and `contact-id` = %d and `scale` = %d limit 1",
|
$x = q("select id from photo where `resource_id` = '%s' and uid = %d and `contact-id` = %d and `scale` = %d limit 1",
|
||||||
dbesc($rid),
|
dbesc($rid),
|
||||||
intval($uid),
|
intval($uid),
|
||||||
intval($cid),
|
intval($cid),
|
||||||
@ -505,7 +535,7 @@ class Photo {
|
|||||||
$r = q("UPDATE `photo`
|
$r = q("UPDATE `photo`
|
||||||
set `uid` = %d,
|
set `uid` = %d,
|
||||||
`contact-id` = %d,
|
`contact-id` = %d,
|
||||||
`resource-id` = '%s',
|
`resource_id` = '%s',
|
||||||
`created` = '%s',
|
`created` = '%s',
|
||||||
`edited` = '%s',
|
`edited` = '%s',
|
||||||
`filename` = '%s',
|
`filename` = '%s',
|
||||||
@ -544,7 +574,7 @@ class Photo {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$r = q("INSERT INTO `photo`
|
$r = q("INSERT INTO `photo`
|
||||||
( `uid`, `contact-id`, `resource-id`, `created`, `edited`, `filename`, type, `album`, `height`, `width`, `data`, `scale`, `profile`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid` )
|
( `uid`, `contact-id`, `resource_id`, `created`, `edited`, `filename`, type, `album`, `height`, `width`, `data`, `scale`, `profile`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid` )
|
||||||
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d, %d, '%s', '%s', '%s', '%s' )",
|
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d, %d, '%s', '%s', '%s', '%s' )",
|
||||||
intval($uid),
|
intval($uid),
|
||||||
intval($cid),
|
intval($cid),
|
||||||
@ -618,12 +648,12 @@ function import_profile_photo($photo,$uid,$cid) {
|
|||||||
|
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
|
|
||||||
$r = q("select `resource-id` from photo where `uid` = %d and `contact-id` = %d and `scale` = 4 and `album` = 'Contact Photos' limit 1",
|
$r = q("select `resource_id` from photo where `uid` = %d and `contact-id` = %d and `scale` = 4 and `album` = 'Contact Photos' limit 1",
|
||||||
intval($uid),
|
intval($uid),
|
||||||
intval($cid)
|
intval($cid)
|
||||||
);
|
);
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
$hash = $r[0]['resource-id'];
|
$hash = $r[0]['resource_id'];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$hash = photo_new_resource();
|
$hash = photo_new_resource();
|
||||||
|
@ -438,10 +438,10 @@ function probe_url($url, $mode = PROBE_NORMAL) {
|
|||||||
$poll = 'email ' . random_string();
|
$poll = 'email ' . random_string();
|
||||||
$priority = 0;
|
$priority = 0;
|
||||||
$x = email_msg_meta($mbox,$msgs[0]);
|
$x = email_msg_meta($mbox,$msgs[0]);
|
||||||
if(stristr($x->from,$orig_url))
|
if(stristr($x[0]->from,$orig_url))
|
||||||
$adr = imap_rfc822_parse_adrlist($x->from,'');
|
$adr = imap_rfc822_parse_adrlist($x[0]->from,'');
|
||||||
elseif(stristr($x->to,$orig_url))
|
elseif(stristr($x[0]->to,$orig_url))
|
||||||
$adr = imap_rfc822_parse_adrlist($x->to,'');
|
$adr = imap_rfc822_parse_adrlist($x[0]->to,'');
|
||||||
if(isset($adr)) {
|
if(isset($adr)) {
|
||||||
foreach($adr as $feadr) {
|
foreach($adr as $feadr) {
|
||||||
if((strcasecmp($feadr->mailbox,$name) == 0)
|
if((strcasecmp($feadr->mailbox,$name) == 0)
|
||||||
@ -523,6 +523,13 @@ function probe_url($url, $mode = PROBE_NORMAL) {
|
|||||||
logger('probe_url: scrape_vcard: ' . print_r($vcard,true), LOGGER_DATA);
|
logger('probe_url: scrape_vcard: ' . print_r($vcard,true), LOGGER_DATA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($diaspora && $addr) {
|
||||||
|
// Diaspora returns the name as the nick. As the nick will never be updated,
|
||||||
|
// let's use the Diaspora nickname (the first part of the handle) as the nick instead
|
||||||
|
$addr_parts = explode('@', $addr);
|
||||||
|
$vcard['nick'] = $addr_parts[0];
|
||||||
|
}
|
||||||
|
|
||||||
if($twitter) {
|
if($twitter) {
|
||||||
logger('twitter: setup');
|
logger('twitter: setup');
|
||||||
$tid = basename($url);
|
$tid = basename($url);
|
||||||
|
@ -111,7 +111,7 @@ function localize_item(&$item){
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if($obj['resource-id']){
|
if($obj['resource_id']){
|
||||||
$post_type = t('photo');
|
$post_type = t('photo');
|
||||||
$m=array(); preg_match("/\[url=([^]]*)\]/", $obj['body'], $m);
|
$m=array(); preg_match("/\[url=([^]]*)\]/", $obj['body'], $m);
|
||||||
$rr['plink'] = $m[1];
|
$rr['plink'] = $m[1];
|
||||||
@ -239,7 +239,7 @@ function localize_item(&$item){
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if($obj['resource-id']){
|
if($obj['resource_id']){
|
||||||
$post_type = t('photo');
|
$post_type = t('photo');
|
||||||
$m=array(); preg_match("/\[url=([^]]*)\]/", $obj['body'], $m);
|
$m=array(); preg_match("/\[url=([^]]*)\]/", $obj['body'], $m);
|
||||||
$rr['plink'] = $m[1];
|
$rr['plink'] = $m[1];
|
||||||
@ -329,11 +329,14 @@ function count_descendants($item) {
|
|||||||
|
|
||||||
function visible_activity($item) {
|
function visible_activity($item) {
|
||||||
|
|
||||||
if(activity_match($child['verb'],ACTIVITY_LIKE) || activity_match($child['verb'],ACTIVITY_DISLIKE))
|
if(activity_match($item['verb'],ACTIVITY_LIKE) || activity_match($item['verb'],ACTIVITY_DISLIKE))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(activity_match($item['verb'],ACTIVITY_FOLLOW) && $item['object-type'] === ACTIVITY_OBJ_NOTE && $item['uid'] != local_user())
|
if(activity_match($item['verb'],ACTIVITY_FOLLOW) && $item['object-type'] === ACTIVITY_OBJ_NOTE) {
|
||||||
|
if(! (($item['self']) && ($item['uid'] == local_user()))) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1372,6 +1375,7 @@ function item_photo_menu($item){
|
|||||||
if(! count($a->contacts))
|
if(! count($a->contacts))
|
||||||
load_contact_links(local_user());
|
load_contact_links(local_user());
|
||||||
}
|
}
|
||||||
|
$sub_link="";
|
||||||
$poke_link="";
|
$poke_link="";
|
||||||
$contact_url="";
|
$contact_url="";
|
||||||
$pm_url="";
|
$pm_url="";
|
||||||
@ -1379,6 +1383,10 @@ function item_photo_menu($item){
|
|||||||
$photos_link="";
|
$photos_link="";
|
||||||
$posts_link="";
|
$posts_link="";
|
||||||
|
|
||||||
|
if((local_user()) && local_user() == $item['uid'] && $item['parent'] == $item['id'] && (! $item['self'])) {
|
||||||
|
$sub_link = 'javascript:dosubthread(' . $item['id'] . '); return false;';
|
||||||
|
}
|
||||||
|
|
||||||
$sparkle = false;
|
$sparkle = false;
|
||||||
$profile_link = best_link_url($item,$sparkle,$ssl_state);
|
$profile_link = best_link_url($item,$sparkle,$ssl_state);
|
||||||
|
|
||||||
@ -1417,6 +1425,7 @@ function item_photo_menu($item){
|
|||||||
}
|
}
|
||||||
|
|
||||||
$menu = Array(
|
$menu = Array(
|
||||||
|
t("Follow Thread") => $sub_link,
|
||||||
t("View Status") => $status_link,
|
t("View Status") => $status_link,
|
||||||
t("View Profile") => $profile_link,
|
t("View Profile") => $profile_link,
|
||||||
t("View Photos") => $photos_link,
|
t("View Photos") => $photos_link,
|
||||||
@ -1435,7 +1444,11 @@ function item_photo_menu($item){
|
|||||||
|
|
||||||
$o = "";
|
$o = "";
|
||||||
foreach($menu as $k=>$v){
|
foreach($menu as $k=>$v){
|
||||||
if ($v!="") $o .= "<li><a href=\"$v\">$k</a></li>\n";
|
if(strpos($v,'javascript:') === 0) {
|
||||||
|
$v = substr($v,11);
|
||||||
|
$o .= "<li><a href=\"#\" onclick=\"$v\">$k</a></li>\n";
|
||||||
|
}
|
||||||
|
elseif ($v!="") $o .= "<li><a href=\"$v\">$k</a></li>\n";
|
||||||
}
|
}
|
||||||
return $o;
|
return $o;
|
||||||
}}
|
}}
|
||||||
@ -1456,16 +1469,16 @@ function like_puller($a,$item,&$arr,$mode) {
|
|||||||
else
|
else
|
||||||
$url = zrl($url);
|
$url = zrl($url);
|
||||||
|
|
||||||
if(! $item['thr-parent'])
|
if(! $item['thr_parent'])
|
||||||
$item['thr-parent'] = $item['parent_uri'];
|
$item['thr_parent'] = $item['parent_uri'];
|
||||||
|
|
||||||
if(! ((isset($arr[$item['thr-parent'] . '-l'])) && (is_array($arr[$item['thr-parent'] . '-l']))))
|
if(! ((isset($arr[$item['thr_parent'] . '-l'])) && (is_array($arr[$item['thr_parent'] . '-l']))))
|
||||||
$arr[$item['thr-parent'] . '-l'] = array();
|
$arr[$item['thr_parent'] . '-l'] = array();
|
||||||
if(! isset($arr[$item['thr-parent']]))
|
if(! isset($arr[$item['thr_parent']]))
|
||||||
$arr[$item['thr-parent']] = 1;
|
$arr[$item['thr_parent']] = 1;
|
||||||
else
|
else
|
||||||
$arr[$item['thr-parent']] ++;
|
$arr[$item['thr_parent']] ++;
|
||||||
$arr[$item['thr-parent'] . '-l'][] = '<a href="'. $url . '"'. $sparkle .'>' . $item['author-name'] . '</a>';
|
$arr[$item['thr_parent'] . '-l'][] = '<a href="'. $url . '"'. $sparkle .'>' . $item['author-name'] . '</a>';
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}}
|
}}
|
||||||
@ -1603,8 +1616,8 @@ function get_item_children($arr, $parent) {
|
|||||||
foreach($arr as $item) {
|
foreach($arr as $item) {
|
||||||
if($item['id'] != $item['parent']) {
|
if($item['id'] != $item['parent']) {
|
||||||
if(get_config('system','thread_allow')) {
|
if(get_config('system','thread_allow')) {
|
||||||
// Fallback to parent_uri if thr-parent is not set
|
// Fallback to parent_uri if thr_parent is not set
|
||||||
$thr_parent = $item['thr-parent'];
|
$thr_parent = $item['thr_parent'];
|
||||||
if($thr_parent == '')
|
if($thr_parent == '')
|
||||||
$thr_parent = $item['parent_uri'];
|
$thr_parent = $item['parent_uri'];
|
||||||
|
|
||||||
|
@ -48,8 +48,8 @@ function construct_mailbox_name($mailacct) {
|
|||||||
|
|
||||||
|
|
||||||
function email_msg_meta($mbox,$uid) {
|
function email_msg_meta($mbox,$uid) {
|
||||||
$ret = (($mbox && $uid) ? @imap_fetch_overview($mbox,$uid,FT_UID) : array(array()));
|
$ret = (($mbox && $uid) ? @imap_fetch_overview($mbox,$uid,FT_UID) : array(array())); // POSSIBLE CLEANUP --> array(array()) is probably redundant now
|
||||||
return ((count($ret)) ? $ret[0] : array());
|
return ((count($ret)) ? $ret : array());
|
||||||
}
|
}
|
||||||
|
|
||||||
function email_msg_headers($mbox,$uid) {
|
function email_msg_headers($mbox,$uid) {
|
||||||
|
@ -40,7 +40,7 @@ function group_add($uid,$name) {
|
|||||||
function group_rmv($uid,$name) {
|
function group_rmv($uid,$name) {
|
||||||
$ret = false;
|
$ret = false;
|
||||||
if(x($uid) && x($name)) {
|
if(x($uid) && x($name)) {
|
||||||
$r = q("SELECT * FROM `group` WHERE `uid` = %d AND `name` = '%s' LIMIT 1",
|
$r = q("SELECT id FROM `group` WHERE `uid` = %d AND `name` = '%s' LIMIT 1",
|
||||||
intval($uid),
|
intval($uid),
|
||||||
dbesc($name)
|
dbesc($name)
|
||||||
);
|
);
|
||||||
@ -49,6 +49,37 @@ function group_rmv($uid,$name) {
|
|||||||
if(! $group_id)
|
if(! $group_id)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// remove group from default posting lists
|
||||||
|
$r = q("SELECT def_gid, allow_gid, deny_gid FROM user WHERE uid = %d LIMIT 1",
|
||||||
|
intval($uid)
|
||||||
|
);
|
||||||
|
if($r) {
|
||||||
|
$user_info = $r[0];
|
||||||
|
$change = false;
|
||||||
|
|
||||||
|
if($user_info['def_gid'] == $group_id) {
|
||||||
|
$user_info['def_gid'] = 0;
|
||||||
|
$change = true;
|
||||||
|
}
|
||||||
|
if(strpos($user_info['allow_gid'], '<' . $group_id . '>') !== false) {
|
||||||
|
$user_info['allow_gid'] = str_replace('<' . $group_id . '>', '', $user_info['allow_gid']);
|
||||||
|
$change = true;
|
||||||
|
}
|
||||||
|
if(strpos($user_info['deny_gid'], '<' . $group_id . '>') !== false) {
|
||||||
|
$user_info['deny_gid'] = str_replace('<' . $group_id . '>', '', $user_info['deny_gid']);
|
||||||
|
$change = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($change) {
|
||||||
|
q("UPDATE user SET def_gid = %d, allow_gid = '%s', deny_gid = '%s' WHERE uid = %d",
|
||||||
|
intval($user_info['def_gid']),
|
||||||
|
dbesc($user_info['allow_gid']),
|
||||||
|
dbesc($user_info['deny_gid']),
|
||||||
|
intval($uid)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// remove all members
|
// remove all members
|
||||||
$r = q("DELETE FROM `group_member` WHERE `uid` = %d AND `gid` = %d ",
|
$r = q("DELETE FROM `group_member` WHERE `uid` = %d AND `gid` = %d ",
|
||||||
intval($uid),
|
intval($uid),
|
||||||
@ -103,7 +134,7 @@ function group_add_member($uid,$name,$member,$gid = 0) {
|
|||||||
if((! $gid) || (! $uid) || (! $member))
|
if((! $gid) || (! $uid) || (! $member))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$r = q("SELECT * FROM `group_member` WHERE `uid` = %d AND `id` = %d AND `contact-id` = %d LIMIT 1",
|
$r = q("SELECT * FROM `group_member` WHERE `uid` = %d AND `gid` = %d AND `contact-id` = %d LIMIT 1",
|
||||||
intval($uid),
|
intval($uid),
|
||||||
intval($gid),
|
intval($gid),
|
||||||
intval($member)
|
intval($member)
|
||||||
|
@ -1000,7 +1000,7 @@ function item_store($arr,$force_parent = false) {
|
|||||||
$arr['origin'] = ((x($arr,'origin')) ? intval($arr['origin']) : 0 );
|
$arr['origin'] = ((x($arr,'origin')) ? intval($arr['origin']) : 0 );
|
||||||
|
|
||||||
|
|
||||||
$arr['thr-parent'] = $arr['parent_uri'];
|
$arr['thr_parent'] = $arr['parent_uri'];
|
||||||
if($arr['parent_uri'] === $arr['uri']) {
|
if($arr['parent_uri'] === $arr['uri']) {
|
||||||
$parent_id = 0;
|
$parent_id = 0;
|
||||||
$parent_deleted = 0;
|
$parent_deleted = 0;
|
||||||
@ -1670,12 +1670,12 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
|
|||||||
$photo_failure = false;
|
$photo_failure = false;
|
||||||
$have_photo = false;
|
$have_photo = false;
|
||||||
|
|
||||||
$r = q("SELECT `resource-id` FROM `photo` WHERE `contact-id` = %d AND `uid` = %d LIMIT 1",
|
$r = q("SELECT `resource_id` FROM `photo` WHERE `contact-id` = %d AND `uid` = %d LIMIT 1",
|
||||||
intval($contact['id']),
|
intval($contact['id']),
|
||||||
intval($contact['uid'])
|
intval($contact['uid'])
|
||||||
);
|
);
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
$resource_id = $r[0]['resource-id'];
|
$resource_id = $r[0]['resource_id'];
|
||||||
$have_photo = true;
|
$have_photo = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1690,7 +1690,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
|
|||||||
$img = new Photo($img_str, $type);
|
$img = new Photo($img_str, $type);
|
||||||
if($img->is_valid()) {
|
if($img->is_valid()) {
|
||||||
if($have_photo) {
|
if($have_photo) {
|
||||||
q("DELETE FROM `photo` WHERE `resource-id` = '%s' AND `contact-id` = %d AND `uid` = %d",
|
q("DELETE FROM `photo` WHERE `resource_id` = '%s' AND `contact-id` = %d AND `uid` = %d",
|
||||||
dbesc($resource_id),
|
dbesc($resource_id),
|
||||||
intval($contact['id']),
|
intval($contact['id']),
|
||||||
intval($contact['uid'])
|
intval($contact['uid'])
|
||||||
@ -1985,7 +1985,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
|
|||||||
$datarray['type'] = 'activity';
|
$datarray['type'] = 'activity';
|
||||||
$datarray['gravity'] = GRAVITY_LIKE;
|
$datarray['gravity'] = GRAVITY_LIKE;
|
||||||
// only one like or dislike per person
|
// only one like or dislike per person
|
||||||
$r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 and (`parent_uri` = '%s' OR `thr-parent` = '%s') limit 1",
|
$r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 and (`parent_uri` = '%s' OR `thr_parent` = '%s') limit 1",
|
||||||
intval($datarray['uid']),
|
intval($datarray['uid']),
|
||||||
intval($datarray['contact-id']),
|
intval($datarray['contact-id']),
|
||||||
dbesc($datarray['verb']),
|
dbesc($datarray['verb']),
|
||||||
@ -2216,12 +2216,12 @@ function local_delivery($importer,$data) {
|
|||||||
$photo_failure = false;
|
$photo_failure = false;
|
||||||
$have_photo = false;
|
$have_photo = false;
|
||||||
|
|
||||||
$r = q("SELECT `resource-id` FROM `photo` WHERE `contact-id` = %d AND `uid` = %d LIMIT 1",
|
$r = q("SELECT `resource_id` FROM `photo` WHERE `contact-id` = %d AND `uid` = %d LIMIT 1",
|
||||||
intval($importer['id']),
|
intval($importer['id']),
|
||||||
intval($importer['importer_uid'])
|
intval($importer['importer_uid'])
|
||||||
);
|
);
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
$resource_id = $r[0]['resource-id'];
|
$resource_id = $r[0]['resource_id'];
|
||||||
$have_photo = true;
|
$have_photo = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -2236,7 +2236,7 @@ function local_delivery($importer,$data) {
|
|||||||
$img = new Photo($img_str, $type);
|
$img = new Photo($img_str, $type);
|
||||||
if($img->is_valid()) {
|
if($img->is_valid()) {
|
||||||
if($have_photo) {
|
if($have_photo) {
|
||||||
q("DELETE FROM `photo` WHERE `resource-id` = '%s' AND `contact-id` = %d AND `uid` = %d",
|
q("DELETE FROM `photo` WHERE `resource_id` = '%s' AND `contact-id` = %d AND `uid` = %d",
|
||||||
dbesc($resource_id),
|
dbesc($resource_id),
|
||||||
intval($importer['id']),
|
intval($importer['id']),
|
||||||
intval($importer['importer_uid'])
|
intval($importer['importer_uid'])
|
||||||
@ -2536,7 +2536,7 @@ function local_delivery($importer,$data) {
|
|||||||
$r = q("select `item`.`id`, `item`.`uri`, `item`.`forum_mode`,`item`.`origin`,`item`.`wall`,
|
$r = q("select `item`.`id`, `item`.`uri`, `item`.`forum_mode`,`item`.`origin`,`item`.`wall`,
|
||||||
`contact`.`name`, `contact`.`url`, `contact`.`thumb` from `item`
|
`contact`.`name`, `contact`.`url`, `contact`.`thumb` from `item`
|
||||||
LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
||||||
WHERE `item`.`uri` = '%s' AND (`item`.`parent_uri` = '%s' or `item`.`thr-parent` = '%s')
|
WHERE `item`.`uri` = '%s' AND (`item`.`parent_uri` = '%s' or `item`.`thr_parent` = '%s')
|
||||||
AND `item`.`uid` = %d
|
AND `item`.`uid` = %d
|
||||||
$sql_extra
|
$sql_extra
|
||||||
LIMIT 1",
|
LIMIT 1",
|
||||||
@ -2678,7 +2678,7 @@ function local_delivery($importer,$data) {
|
|||||||
$r = q("select `item`.`id`, `item`.`uri`, `item`.`forum_mode`,`item`.`origin`,`item`.`wall`,
|
$r = q("select `item`.`id`, `item`.`uri`, `item`.`forum_mode`,`item`.`origin`,`item`.`wall`,
|
||||||
`contact`.`name`, `contact`.`url`, `contact`.`thumb` from `item`
|
`contact`.`name`, `contact`.`url`, `contact`.`thumb` from `item`
|
||||||
LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
||||||
WHERE `item`.`uri` = '%s' AND (`item`.`parent_uri` = '%s' or `item`.`thr-parent` = '%s')
|
WHERE `item`.`uri` = '%s' AND (`item`.`parent_uri` = '%s' or `item`.`thr_parent` = '%s')
|
||||||
AND `item`.`uid` = %d
|
AND `item`.`uid` = %d
|
||||||
$sql_extra
|
$sql_extra
|
||||||
LIMIT 1",
|
LIMIT 1",
|
||||||
@ -2762,7 +2762,7 @@ function local_delivery($importer,$data) {
|
|||||||
$datarray['gravity'] = GRAVITY_LIKE;
|
$datarray['gravity'] = GRAVITY_LIKE;
|
||||||
|
|
||||||
// only one like or dislike per person
|
// only one like or dislike per person
|
||||||
$r = q("select id from item where uid = %d and `contact-id` = %d and verb = '%s' and (`thr-parent` = '%s' or `parent_uri` = '%s') and deleted = 0 limit 1",
|
$r = q("select id from item where uid = %d and `contact-id` = %d and verb = '%s' and (`thr_parent` = '%s' or `parent_uri` = '%s') and deleted = 0 limit 1",
|
||||||
intval($datarray['uid']),
|
intval($datarray['uid']),
|
||||||
intval($datarray['contact-id']),
|
intval($datarray['contact-id']),
|
||||||
dbesc($datarray['verb']),
|
dbesc($datarray['verb']),
|
||||||
@ -2916,7 +2916,7 @@ function local_delivery($importer,$data) {
|
|||||||
$datarray['type'] = 'activity';
|
$datarray['type'] = 'activity';
|
||||||
$datarray['gravity'] = GRAVITY_LIKE;
|
$datarray['gravity'] = GRAVITY_LIKE;
|
||||||
// only one like or dislike per person
|
// only one like or dislike per person
|
||||||
$r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 and (`parent_uri` = '%s' OR `thr-parent` = '%s') limit 1",
|
$r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 and (`parent_uri` = '%s' OR `thr_parent` = '%s') limit 1",
|
||||||
intval($datarray['uid']),
|
intval($datarray['uid']),
|
||||||
intval($datarray['contact-id']),
|
intval($datarray['contact-id']),
|
||||||
dbesc($datarray['verb']),
|
dbesc($datarray['verb']),
|
||||||
@ -3316,8 +3316,8 @@ function atom_entry($item,$type,$author,$owner,$comment = false,$cid = 0) {
|
|||||||
if(strlen($item['owner-name']))
|
if(strlen($item['owner-name']))
|
||||||
$o .= atom_author('dfrn:owner',$item['owner-name'],$item['owner-link'],80,80,$item['owner-avatar']);
|
$o .= atom_author('dfrn:owner',$item['owner-name'],$item['owner-link'],80,80,$item['owner-avatar']);
|
||||||
|
|
||||||
if(($item['parent'] != $item['id']) || ($item['parent_uri'] !== $item['uri']) || (($item['thr-parent'] !== '') && ($item['thr-parent'] !== $item['uri']))) {
|
if(($item['parent'] != $item['id']) || ($item['parent_uri'] !== $item['uri']) || (($item['thr_parent'] !== '') && ($item['thr_parent'] !== $item['uri']))) {
|
||||||
$parent_item = (($item['thr-parent']) ? $item['thr-parent'] : $item['parent_uri']);
|
$parent_item = (($item['thr_parent']) ? $item['thr_parent'] : $item['parent_uri']);
|
||||||
$o .= '<thr:in-reply-to ref="' . xmlify($parent_item) . '" type="text/html" href="' . xmlify($a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['parent']) . '" />' . "\r\n";
|
$o .= '<thr:in-reply-to ref="' . xmlify($parent_item) . '" type="text/html" href="' . xmlify($a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['parent']) . '" />' . "\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3403,7 +3403,7 @@ function fix_private_photos($s, $uid, $item = null, $cid = 0) {
|
|||||||
if($x) {
|
if($x) {
|
||||||
$res = substr($i,$x+1);
|
$res = substr($i,$x+1);
|
||||||
$i = substr($i,0,$x);
|
$i = substr($i,0,$x);
|
||||||
$r = q("SELECT * FROM `photo` WHERE `resource-id` = '%s' AND `scale` = %d AND `uid` = %d",
|
$r = q("SELECT * FROM `photo` WHERE `resource_id` = '%s' AND `scale` = %d AND `uid` = %d",
|
||||||
dbesc($i),
|
dbesc($i),
|
||||||
intval($res),
|
intval($res),
|
||||||
intval($uid)
|
intval($uid)
|
||||||
@ -3597,7 +3597,7 @@ function item_expire($uid,$days) {
|
|||||||
|
|
||||||
// Only expire posts, not photos and photo comments
|
// Only expire posts, not photos and photo comments
|
||||||
|
|
||||||
if($expire_photos==0 && strlen($item['resource-id']))
|
if($expire_photos==0 && strlen($item['resource_id']))
|
||||||
continue;
|
continue;
|
||||||
if($expire_starred==0 && intval($item['starred']))
|
if($expire_starred==0 && intval($item['starred']))
|
||||||
continue;
|
continue;
|
||||||
@ -3702,11 +3702,11 @@ function drop_item($id,$interactive = true) {
|
|||||||
// If item is a link to a photo resource, nuke all the associated photos
|
// If item is a link to a photo resource, nuke all the associated photos
|
||||||
// (visitors will not have photo resources)
|
// (visitors will not have photo resources)
|
||||||
// This only applies to photos uploaded from the photos page. Photos inserted into a post do not
|
// 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.
|
// generate a resource_id and therefore aren't intimately linked to the item.
|
||||||
|
|
||||||
if(strlen($item['resource-id'])) {
|
if(strlen($item['resource_id'])) {
|
||||||
q("DELETE FROM `photo` WHERE `resource-id` = '%s' AND `uid` = %d ",
|
q("DELETE FROM `photo` WHERE `resource_id` = '%s' AND `uid` = %d ",
|
||||||
dbesc($item['resource-id']),
|
dbesc($item['resource_id']),
|
||||||
intval($item['uid'])
|
intval($item['uid'])
|
||||||
);
|
);
|
||||||
// ignore the result
|
// ignore the result
|
||||||
|
@ -138,7 +138,7 @@ function send_message($recipient=0, $body='', $subject='', $replyto=''){
|
|||||||
$image_uri = substr($image,strrpos($image,'/') + 1);
|
$image_uri = substr($image,strrpos($image,'/') + 1);
|
||||||
$image_uri = substr($image_uri,0, strpos($image_uri,'-'));
|
$image_uri = substr($image_uri,0, strpos($image_uri,'-'));
|
||||||
$r = q("UPDATE `photo` SET `allow_cid` = '%s'
|
$r = q("UPDATE `photo` SET `allow_cid` = '%s'
|
||||||
WHERE `resource-id` = '%s' AND `album` = '%s' AND `uid` = %d ",
|
WHERE `resource_id` = '%s' AND `album` = '%s' AND `uid` = %d ",
|
||||||
dbesc('<' . $recipient . '>'),
|
dbesc('<' . $recipient . '>'),
|
||||||
dbesc($image_uri),
|
dbesc($image_uri),
|
||||||
dbesc( t('Wall Photos')),
|
dbesc( t('Wall Photos')),
|
||||||
|
@ -274,7 +274,7 @@ function permissions_sql($owner_id,$remote_verified = false,$groups = null) {
|
|||||||
$gs .= '|<' . intval($g) . '>';
|
$gs .= '|<' . intval($g) . '>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = sprintf(
|
/*$sql = sprintf(
|
||||||
" AND ( allow_cid = '' OR allow_cid REGEXP '<%d>' )
|
" AND ( allow_cid = '' OR allow_cid REGEXP '<%d>' )
|
||||||
AND ( deny_cid = '' OR NOT deny_cid REGEXP '<%d>' )
|
AND ( deny_cid = '' OR NOT deny_cid REGEXP '<%d>' )
|
||||||
AND ( allow_gid = '' OR allow_gid REGEXP '%s' )
|
AND ( allow_gid = '' OR allow_gid REGEXP '%s' )
|
||||||
@ -284,6 +284,16 @@ function permissions_sql($owner_id,$remote_verified = false,$groups = null) {
|
|||||||
intval($remote_user),
|
intval($remote_user),
|
||||||
dbesc($gs),
|
dbesc($gs),
|
||||||
dbesc($gs)
|
dbesc($gs)
|
||||||
|
);*/
|
||||||
|
$sql = sprintf(
|
||||||
|
" AND ( NOT (deny_cid REGEXP '<%d>' OR deny_gid REGEXP '%s')
|
||||||
|
AND ( allow_cid REGEXP '<%d>' OR allow_gid REGEXP '%s' OR ( allow_cid = '' AND allow_gid = '') )
|
||||||
|
)
|
||||||
|
",
|
||||||
|
intval($remote_user),
|
||||||
|
dbesc($gs),
|
||||||
|
intval($remote_user),
|
||||||
|
dbesc($gs)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -378,7 +378,7 @@ function photo_new_resource() {
|
|||||||
do {
|
do {
|
||||||
$found = false;
|
$found = false;
|
||||||
$resource = hash('md5',uniqid(mt_rand(),true));
|
$resource = hash('md5',uniqid(mt_rand(),true));
|
||||||
$r = q("SELECT `id` FROM `photo` WHERE `resource-id` = '%s' LIMIT 1",
|
$r = q("SELECT `id` FROM `photo` WHERE `resource_id` = '%s' LIMIT 1",
|
||||||
dbesc($resource)
|
dbesc($resource)
|
||||||
);
|
);
|
||||||
if(count($r))
|
if(count($r))
|
||||||
@ -1325,7 +1325,7 @@ function reltoabs($text, $base)
|
|||||||
function item_post_type($item) {
|
function item_post_type($item) {
|
||||||
if(intval($item['event-id']))
|
if(intval($item['event-id']))
|
||||||
return t('event');
|
return t('event');
|
||||||
if(strlen($item['resource-id']))
|
if(strlen($item['resource_id']))
|
||||||
return t('photo');
|
return t('photo');
|
||||||
if(strlen($item['verb']) && $item['verb'] !== ACTIVITY_POST)
|
if(strlen($item['verb']) && $item['verb'] !== ACTIVITY_POST)
|
||||||
return t('activity');
|
return t('activity');
|
||||||
|
@ -304,7 +304,7 @@ function create_user($arr) {
|
|||||||
$photo_failure = true;
|
$photo_failure = true;
|
||||||
|
|
||||||
if(! $photo_failure) {
|
if(! $photo_failure) {
|
||||||
q("UPDATE `photo` SET `profile` = 1 WHERE `resource-id` = '%s' ",
|
q("UPDATE `photo` SET `profile` = 1 WHERE `resource_id` = '%s' ",
|
||||||
dbesc($hash)
|
dbesc($hash)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
13
index.php
13
index.php
@ -380,6 +380,19 @@ if(count($arr)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($a->is_mobile || $a->is_tablet) {
|
||||||
|
if(isset($_SESSION['show-mobile']) && !$_SESSION['show-mobile']) {
|
||||||
|
$link = $a->get_baseurl() . '/toggle_mobile?address=' . curPageURL();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$link = $a->get_baseurl() . '/toggle_mobile?off=1&address=' . curPageURL();
|
||||||
|
}
|
||||||
|
$a->page['footer'] = replace_macros(get_markup_template("toggle_mobile_footer.tpl"), array(
|
||||||
|
'$toggle_link' => $link,
|
||||||
|
'$toggle_text' => t('toggle mobile')
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
$page = $a->page;
|
$page = $a->page;
|
||||||
$profile = $a->profile;
|
$profile = $a->profile;
|
||||||
|
|
||||||
|
10
js/main.js
10
js/main.js
@ -533,11 +533,17 @@ function updateConvItems(mode,data) {
|
|||||||
unpause();
|
unpause();
|
||||||
$('#like-rotator-' + ident.toString()).show();
|
$('#like-rotator-' + ident.toString()).show();
|
||||||
$.get('like/' + ident.toString() + '?verb=' + verb, NavUpdate );
|
$.get('like/' + ident.toString() + '?verb=' + verb, NavUpdate );
|
||||||
// if(timer) clearTimeout(timer);
|
|
||||||
// timer = setTimeout(NavUpdate,3000);
|
|
||||||
liking = 1;
|
liking = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function dosubthread(ident) {
|
||||||
|
unpause();
|
||||||
|
$('#like-rotator-' + ident.toString()).show();
|
||||||
|
$.get('subthread/' + ident.toString(), NavUpdate );
|
||||||
|
liking = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function dostar(ident) {
|
function dostar(ident) {
|
||||||
ident = ident.toString();
|
ident = ident.toString();
|
||||||
$('#like-rotator-' + ident).show();
|
$('#like-rotator-' + ident).show();
|
||||||
|
@ -45,9 +45,9 @@ function fbrowser_content($a){
|
|||||||
$path[]=array($a->get_baseurl()."/fbrowser/image/".$a->argv[2]."/", $album);
|
$path[]=array($a->get_baseurl()."/fbrowser/image/".$a->argv[2]."/", $album);
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = q("SELECT `resource-id`, `id`, `filename`, type, min(`scale`) AS `hiq`,max(`scale`) AS `loq`, `desc`
|
$r = q("SELECT `resource_id`, `id`, `filename`, type, min(`scale`) AS `hiq`,max(`scale`) AS `loq`, `desc`
|
||||||
FROM `photo` WHERE `uid` = %d $sql_extra
|
FROM `photo` WHERE `uid` = %d $sql_extra
|
||||||
GROUP BY `resource-id` $sql_extra2",
|
GROUP BY `resource_id` $sql_extra2",
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -56,9 +56,9 @@ function fbrowser_content($a){
|
|||||||
$types = Photo::supportedTypes();
|
$types = Photo::supportedTypes();
|
||||||
$ext = $types[$rr['type']];
|
$ext = $types[$rr['type']];
|
||||||
return array(
|
return array(
|
||||||
$a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['hiq'] . '.' .$ext,
|
$a->get_baseurl() . '/photo/' . $rr['resource_id'] . '-' . $rr['hiq'] . '.' .$ext,
|
||||||
template_escape($rr['filename']),
|
template_escape($rr['filename']),
|
||||||
$a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['loq'] . '.'. $ext
|
$a->get_baseurl() . '/photo/' . $rr['resource_id'] . '-' . $rr['loq'] . '.'. $ext
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$files = array_map("files1", $r);
|
$files = array_map("files1", $r);
|
||||||
|
@ -487,7 +487,7 @@ function what_next() {
|
|||||||
."<p>".t('IMPORTANT: You will need to [manually] setup a scheduled task for the poller.')
|
."<p>".t('IMPORTANT: You will need to [manually] setup a scheduled task for the poller.')
|
||||||
.t('Please see the file "INSTALL.txt".')
|
.t('Please see the file "INSTALL.txt".')
|
||||||
."</p><p>"
|
."</p><p>"
|
||||||
.t("Go to your new Friendica node <a href='$baseurl/register'>registration page</a> and register as new user. Remember to use the same email you have entered as administrator email. This will allow you to enter the site admin panel.")
|
.t("Go to your new Friendica node <a href='$baseurl/zregister'>registration page</a> and register as new user. Remember to use the same email you have entered as administrator email. This will allow you to enter the site admin panel.")
|
||||||
."</p>";
|
."</p>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
35
mod/item.php
35
mod/item.php
@ -360,7 +360,7 @@ function item_post(&$a) {
|
|||||||
$srch = '<' . intval($contact_id) . '>';
|
$srch = '<' . intval($contact_id) . '>';
|
||||||
|
|
||||||
$r = q("SELECT `id` FROM `photo` WHERE `allow_cid` = '%s' AND `allow_gid` = '' AND `deny_cid` = '' AND `deny_gid` = ''
|
$r = q("SELECT `id` FROM `photo` WHERE `allow_cid` = '%s' AND `allow_gid` = '' AND `deny_cid` = '' AND `deny_gid` = ''
|
||||||
AND `resource-id` = '%s' AND `uid` = %d LIMIT 1",
|
AND `resource_id` = '%s' AND `uid` = %d LIMIT 1",
|
||||||
dbesc($srch),
|
dbesc($srch),
|
||||||
dbesc($image_uri),
|
dbesc($image_uri),
|
||||||
intval($profile_uid)
|
intval($profile_uid)
|
||||||
@ -371,7 +371,7 @@ function item_post(&$a) {
|
|||||||
|
|
||||||
|
|
||||||
$r = q("UPDATE `photo` SET `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s'
|
$r = q("UPDATE `photo` SET `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s'
|
||||||
WHERE `resource-id` = '%s' AND `uid` = %d AND `album` = '%s' ",
|
WHERE `resource_id` = '%s' AND `uid` = %d AND `album` = '%s' ",
|
||||||
dbesc($str_contact_allow),
|
dbesc($str_contact_allow),
|
||||||
dbesc($str_group_allow),
|
dbesc($str_group_allow),
|
||||||
dbesc($str_contact_deny),
|
dbesc($str_contact_deny),
|
||||||
@ -540,7 +540,7 @@ function item_post(&$a) {
|
|||||||
|
|
||||||
$uri = item_new_uri($a->get_hostname(),$profile_uid);
|
$uri = item_new_uri($a->get_hostname(),$profile_uid);
|
||||||
|
|
||||||
// Fallback so that we alway have a thr-parent
|
// Fallback so that we alway have a thr_parent
|
||||||
|
|
||||||
if(!$thr_parent)
|
if(!$thr_parent)
|
||||||
$thr_parent = $uri;
|
$thr_parent = $uri;
|
||||||
@ -577,7 +577,7 @@ function item_post(&$a) {
|
|||||||
$datarray['deny_gid'] = $str_group_deny;
|
$datarray['deny_gid'] = $str_group_deny;
|
||||||
$datarray['private'] = $private;
|
$datarray['private'] = $private;
|
||||||
$datarray['attach'] = $attachments;
|
$datarray['attach'] = $attachments;
|
||||||
$datarray['thr-parent'] = $thr_parent;
|
$datarray['thr_parent'] = $thr_parent;
|
||||||
$datarray['postopts'] = '';
|
$datarray['postopts'] = '';
|
||||||
$datarray['origin'] = $origin;
|
$datarray['origin'] = $origin;
|
||||||
$datarray['moderated'] = $allow_moderated;
|
$datarray['moderated'] = $allow_moderated;
|
||||||
@ -672,7 +672,7 @@ function item_post(&$a) {
|
|||||||
|
|
||||||
|
|
||||||
$r = q("INSERT INTO `item` (`uid`,`type`,`wall`,`gravity`,`contact-id`,`owner-name`,`owner-link`,`owner-avatar`,
|
$r = q("INSERT INTO `item` (`uid`,`type`,`wall`,`gravity`,`contact-id`,`owner-name`,`owner-link`,`owner-avatar`,
|
||||||
`author-name`, `author-link`, `author-avatar`, `created`, `edited`, `commented`, `received`, `changed`, `uri`, `thr-parent`, `title`, `body`, `app`, `lang`, `location`, `coord`,
|
`author-name`, `author-link`, `author-avatar`, `created`, `edited`, `commented`, `received`, `changed`, `uri`, `thr_parent`, `title`, `body`, `app`, `lang`, `location`, `coord`,
|
||||||
`inform`, `verb`, `postopts`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`, `private`, `attach`,`origin`, `moderated`)
|
`inform`, `verb`, `postopts`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`, `private`, `attach`,`origin`, `moderated`)
|
||||||
VALUES( %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', %d, %d )",
|
VALUES( %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', %d, %d )",
|
||||||
intval($datarray['uid']),
|
intval($datarray['uid']),
|
||||||
@ -692,7 +692,7 @@ function item_post(&$a) {
|
|||||||
dbesc($datarray['received']),
|
dbesc($datarray['received']),
|
||||||
dbesc($datarray['changed']),
|
dbesc($datarray['changed']),
|
||||||
dbesc($datarray['uri']),
|
dbesc($datarray['uri']),
|
||||||
dbesc($datarray['thr-parent']),
|
dbesc($datarray['thr_parent']),
|
||||||
dbesc($datarray['title']),
|
dbesc($datarray['title']),
|
||||||
dbesc($datarray['body']),
|
dbesc($datarray['body']),
|
||||||
dbesc($datarray['app']),
|
dbesc($datarray['app']),
|
||||||
@ -979,7 +979,26 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag) {
|
|||||||
intval($tagcid),
|
intval($tagcid),
|
||||||
intval($profile_uid)
|
intval($profile_uid)
|
||||||
);
|
);
|
||||||
} elseif(strstr($name,'_') || strstr($name,' ')) { //no id
|
}
|
||||||
|
else {
|
||||||
|
$newname = str_replace('_',' ',$name);
|
||||||
|
|
||||||
|
//select someone from this user's contacts by name
|
||||||
|
$r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
|
||||||
|
dbesc($newname),
|
||||||
|
intval($profile_uid)
|
||||||
|
);
|
||||||
|
|
||||||
|
if(! $r) {
|
||||||
|
//select someone by attag or nick and the name passed in
|
||||||
|
$r = q("SELECT * FROM `contact` WHERE `attag` = '%s' OR `nick` = '%s' AND `uid` = %d ORDER BY `attag` DESC LIMIT 1",
|
||||||
|
dbesc($name),
|
||||||
|
dbesc($name),
|
||||||
|
intval($profile_uid)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* } elseif(strstr($name,'_') || strstr($name,' ')) { //no id
|
||||||
//get the real name
|
//get the real name
|
||||||
$newname = str_replace('_',' ',$name);
|
$newname = str_replace('_',' ',$name);
|
||||||
//select someone from this user's contacts by name
|
//select someone from this user's contacts by name
|
||||||
@ -994,7 +1013,7 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag) {
|
|||||||
dbesc($name),
|
dbesc($name),
|
||||||
intval($profile_uid)
|
intval($profile_uid)
|
||||||
);
|
);
|
||||||
}
|
}*/
|
||||||
//$r is set, if someone could be selected
|
//$r is set, if someone could be selected
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
$profile = $r[0]['url'];
|
$profile = $r[0]['url'];
|
||||||
|
@ -106,7 +106,7 @@ function like_content(&$a) {
|
|||||||
|
|
||||||
|
|
||||||
$r = q("SELECT * FROM `item` WHERE `verb` = '%s' AND `deleted` = 0
|
$r = q("SELECT * FROM `item` WHERE `verb` = '%s' AND `deleted` = 0
|
||||||
AND `contact-id` = %d AND ( `parent` = '%s' OR `parent_uri` = '%s' OR `thr-parent` = '%s') LIMIT 1",
|
AND `contact-id` = %d AND ( `parent` = '%s' OR `parent_uri` = '%s' OR `thr_parent` = '%s') LIMIT 1",
|
||||||
dbesc($activity),
|
dbesc($activity),
|
||||||
intval($contact['id']),
|
intval($contact['id']),
|
||||||
dbesc($item_id),
|
dbesc($item_id),
|
||||||
@ -129,8 +129,8 @@ function like_content(&$a) {
|
|||||||
|
|
||||||
$uri = item_new_uri($a->get_hostname(),$owner_uid);
|
$uri = item_new_uri($a->get_hostname(),$owner_uid);
|
||||||
|
|
||||||
$post_type = (($item['resource-id']) ? t('photo') : t('status'));
|
$post_type = (($item['resource_id']) ? t('photo') : t('status'));
|
||||||
$objtype = (($item['resource-id']) ? ACTIVITY_OBJ_PHOTO : ACTIVITY_OBJ_NOTE );
|
$objtype = (($item['resource_id']) ? ACTIVITY_OBJ_PHOTO : ACTIVITY_OBJ_NOTE );
|
||||||
$link = xmlify('<link rel="alternate" type="text/html" href="' . $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ;
|
$link = xmlify('<link rel="alternate" type="text/html" href="' . $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ;
|
||||||
$body = $item['body'];
|
$body = $item['body'];
|
||||||
|
|
||||||
@ -164,7 +164,7 @@ EOT;
|
|||||||
$arr['gravity'] = GRAVITY_LIKE;
|
$arr['gravity'] = GRAVITY_LIKE;
|
||||||
$arr['parent'] = $item['id'];
|
$arr['parent'] = $item['id'];
|
||||||
$arr['parent_uri'] = $item['uri'];
|
$arr['parent_uri'] = $item['uri'];
|
||||||
$arr['thr-parent'] = $item['uri'];
|
$arr['thr_parent'] = $item['uri'];
|
||||||
$arr['owner-name'] = $remote_owner['name'];
|
$arr['owner-name'] = $remote_owner['name'];
|
||||||
$arr['owner-link'] = $remote_owner['url'];
|
$arr['owner-link'] = $remote_owner['url'];
|
||||||
$arr['owner-avatar'] = $remote_owner['thumb'];
|
$arr['owner-avatar'] = $remote_owner['thumb'];
|
||||||
|
@ -28,11 +28,6 @@ function lockview_content(&$a) {
|
|||||||
killme();
|
killme();
|
||||||
|
|
||||||
|
|
||||||
$allowed_users = expand_acl($item['allow_cid']);
|
|
||||||
$allowed_groups = expand_acl($item['allow_gid']);
|
|
||||||
$deny_users = expand_acl($item['deny_cid']);
|
|
||||||
$deny_groups = expand_acl($item['deny_gid']);
|
|
||||||
|
|
||||||
if(($item['private'] == 1) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid']))
|
if(($item['private'] == 1) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid']))
|
||||||
&& (! strlen($item['deny_cid'])) && (! strlen($item['deny_gid']))) {
|
&& (! strlen($item['deny_cid'])) && (! strlen($item['deny_gid']))) {
|
||||||
|
|
||||||
@ -40,6 +35,11 @@ function lockview_content(&$a) {
|
|||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$allowed_users = expand_acl($item['allow_cid']);
|
||||||
|
$allowed_groups = expand_acl($item['allow_gid']);
|
||||||
|
$deny_users = expand_acl($item['deny_cid']);
|
||||||
|
$deny_groups = expand_acl($item['deny_gid']);
|
||||||
|
|
||||||
$o = t('Visible to:') . '<br />';
|
$o = t('Visible to:') . '<br />';
|
||||||
$l = array();
|
$l = array();
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ function photo_init(&$a) {
|
|||||||
$photo = substr($photo,0,-2);
|
$photo = substr($photo,0,-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = q("SELECT `uid` 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)
|
||||||
);
|
);
|
||||||
@ -93,7 +93,7 @@ function photo_init(&$a) {
|
|||||||
|
|
||||||
// Now we'll see if we can access the photo
|
// 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",
|
$r = q("SELECT * FROM `photo` WHERE `resource_id` = '%s' AND `scale` = %d $sql_extra LIMIT 1",
|
||||||
dbesc($photo),
|
dbesc($photo),
|
||||||
intval($resolution)
|
intval($resolution)
|
||||||
);
|
);
|
||||||
@ -112,7 +112,7 @@ function photo_init(&$a) {
|
|||||||
// they won't have the photo link, so there's a reasonable chance that the person
|
// they won't have the photo link, so there's a reasonable chance that the person
|
||||||
// might be able to obtain permission to view it.
|
// might be able to obtain permission to view it.
|
||||||
|
|
||||||
$r = q("SELECT * FROM `photo` WHERE `resource-id` = '%s' AND `scale` = %d LIMIT 1",
|
$r = q("SELECT * FROM `photo` WHERE `resource_id` = '%s' AND `scale` = %d LIMIT 1",
|
||||||
dbesc($photo),
|
dbesc($photo),
|
||||||
intval($resolution)
|
intval($resolution)
|
||||||
);
|
);
|
||||||
|
118
mod/photos.php
118
mod/photos.php
@ -27,7 +27,7 @@ function photos_init(&$a) {
|
|||||||
|
|
||||||
$sql_extra = permissions_sql($a->data['user']['uid']);
|
$sql_extra = permissions_sql($a->data['user']['uid']);
|
||||||
|
|
||||||
$albums = q("SELECT distinct(`album`) AS `album` FROM `photo` WHERE `uid` = %d $sql_extra ",
|
$albums = q("SELECT distinct(`album`) AS `album` FROM `photo` WHERE `uid` = %d $sql_extra order by created desc",
|
||||||
intval($a->data['user']['uid'])
|
intval($a->data['user']['uid'])
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -200,14 +200,14 @@ function photos_post(&$a) {
|
|||||||
// get the list of photos we are about to delete
|
// get the list of photos we are about to delete
|
||||||
|
|
||||||
if($visitor) {
|
if($visitor) {
|
||||||
$r = q("SELECT distinct(`resource-id`) as `rid` FROM `photo` WHERE `contact-id` = %d AND `uid` = %d AND `album` = '%s'",
|
$r = q("SELECT distinct(`resource_id`) as `rid` FROM `photo` WHERE `contact-id` = %d AND `uid` = %d AND `album` = '%s'",
|
||||||
intval($visitor),
|
intval($visitor),
|
||||||
intval($page_owner_uid),
|
intval($page_owner_uid),
|
||||||
dbesc($album)
|
dbesc($album)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$r = q("SELECT distinct(`resource-id`) as `rid` FROM `photo` WHERE `uid` = %d AND `album` = '%s'",
|
$r = q("SELECT distinct(`resource_id`) as `rid` FROM `photo` WHERE `uid` = %d AND `album` = '%s'",
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
dbesc($album)
|
dbesc($album)
|
||||||
);
|
);
|
||||||
@ -226,13 +226,13 @@ function photos_post(&$a) {
|
|||||||
|
|
||||||
// remove the associated photos
|
// remove the associated photos
|
||||||
|
|
||||||
q("DELETE FROM `photo` WHERE `resource-id` IN ( $str_res ) AND `uid` = %d",
|
q("DELETE FROM `photo` WHERE `resource_id` IN ( $str_res ) AND `uid` = %d",
|
||||||
intval($page_owner_uid)
|
intval($page_owner_uid)
|
||||||
);
|
);
|
||||||
|
|
||||||
// find and delete the corresponding item with all the comments and likes/dislikes
|
// find and delete the corresponding item with all the comments and likes/dislikes
|
||||||
|
|
||||||
$r = q("SELECT `parent_uri` FROM `item` WHERE `resource-id` IN ( $str_res ) AND `uid` = %d",
|
$r = q("SELECT `parent_uri` FROM `item` WHERE `resource_id` IN ( $str_res ) AND `uid` = %d",
|
||||||
intval($page_owner_uid)
|
intval($page_owner_uid)
|
||||||
);
|
);
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
@ -261,25 +261,25 @@ function photos_post(&$a) {
|
|||||||
// same as above but remove single photo
|
// same as above but remove single photo
|
||||||
|
|
||||||
if($visitor) {
|
if($visitor) {
|
||||||
$r = q("SELECT `id`, `resource-id` FROM `photo` WHERE `contact-id` = %d AND `uid` = %d AND `resource-id` = '%s' LIMIT 1",
|
$r = q("SELECT `id`, `resource_id` FROM `photo` WHERE `contact-id` = %d AND `uid` = %d AND `resource_id` = '%s' LIMIT 1",
|
||||||
intval($visitor),
|
intval($visitor),
|
||||||
intval($page_owner_uid),
|
intval($page_owner_uid),
|
||||||
dbesc($a->argv[2])
|
dbesc($a->argv[2])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$r = q("SELECT `id`, `resource-id` FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s' LIMIT 1",
|
$r = q("SELECT `id`, `resource_id` FROM `photo` WHERE `uid` = %d AND `resource_id` = '%s' LIMIT 1",
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
dbesc($a->argv[2])
|
dbesc($a->argv[2])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
q("DELETE FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s'",
|
q("DELETE FROM `photo` WHERE `uid` = %d AND `resource_id` = '%s'",
|
||||||
intval($page_owner_uid),
|
intval($page_owner_uid),
|
||||||
dbesc($r[0]['resource-id'])
|
dbesc($r[0]['resource_id'])
|
||||||
);
|
);
|
||||||
$i = q("SELECT * FROM `item` WHERE `resource-id` = '%s' AND `uid` = %d LIMIT 1",
|
$i = q("SELECT * FROM `item` WHERE `resource_id` = '%s' AND `uid` = %d LIMIT 1",
|
||||||
dbesc($r[0]['resource-id']),
|
dbesc($r[0]['resource_id']),
|
||||||
intval($page_owner_uid)
|
intval($page_owner_uid)
|
||||||
);
|
);
|
||||||
if(count($i)) {
|
if(count($i)) {
|
||||||
@ -324,7 +324,7 @@ function photos_post(&$a) {
|
|||||||
( (intval($_POST['rotate']) == 1) || (intval($_POST['rotate']) == 2) )) {
|
( (intval($_POST['rotate']) == 1) || (intval($_POST['rotate']) == 2) )) {
|
||||||
logger('rotate');
|
logger('rotate');
|
||||||
|
|
||||||
$r = q("select * from photo where `resource-id` = '%s' and uid = %d and scale = 0 limit 1",
|
$r = q("select * from photo where `resource_id` = '%s' and uid = %d and scale = 0 limit 1",
|
||||||
dbesc($resource_id),
|
dbesc($resource_id),
|
||||||
intval($page_owner_uid)
|
intval($page_owner_uid)
|
||||||
);
|
);
|
||||||
@ -337,7 +337,7 @@ function photos_post(&$a) {
|
|||||||
$width = $ph->getWidth();
|
$width = $ph->getWidth();
|
||||||
$height = $ph->getHeight();
|
$height = $ph->getHeight();
|
||||||
|
|
||||||
$x = q("update photo set data = '%s', height = %d, width = %d where `resource-id` = '%s' and uid = %d and scale = 0 limit 1",
|
$x = q("update photo set data = '%s', height = %d, width = %d where `resource_id` = '%s' and uid = %d and scale = 0 limit 1",
|
||||||
dbesc($ph->imageString()),
|
dbesc($ph->imageString()),
|
||||||
intval($height),
|
intval($height),
|
||||||
intval($width),
|
intval($width),
|
||||||
@ -350,7 +350,7 @@ function photos_post(&$a) {
|
|||||||
$width = $ph->getWidth();
|
$width = $ph->getWidth();
|
||||||
$height = $ph->getHeight();
|
$height = $ph->getHeight();
|
||||||
|
|
||||||
$x = q("update photo set data = '%s', height = %d, width = %d where `resource-id` = '%s' and uid = %d and scale = 1 limit 1",
|
$x = q("update photo set data = '%s', height = %d, width = %d where `resource_id` = '%s' and uid = %d and scale = 1 limit 1",
|
||||||
dbesc($ph->imageString()),
|
dbesc($ph->imageString()),
|
||||||
intval($height),
|
intval($height),
|
||||||
intval($width),
|
intval($width),
|
||||||
@ -364,7 +364,7 @@ function photos_post(&$a) {
|
|||||||
$width = $ph->getWidth();
|
$width = $ph->getWidth();
|
||||||
$height = $ph->getHeight();
|
$height = $ph->getHeight();
|
||||||
|
|
||||||
$x = q("update photo set data = '%s', height = %d, width = %d where `resource-id` = '%s' and uid = %d and scale = 2 limit 1",
|
$x = q("update photo set data = '%s', height = %d, width = %d where `resource_id` = '%s' and uid = %d and scale = 2 limit 1",
|
||||||
dbesc($ph->imageString()),
|
dbesc($ph->imageString()),
|
||||||
intval($height),
|
intval($height),
|
||||||
intval($width),
|
intval($width),
|
||||||
@ -376,13 +376,13 @@ function photos_post(&$a) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$p = q("SELECT * FROM `photo` WHERE `resource-id` = '%s' AND `uid` = %d ORDER BY `scale` DESC",
|
$p = q("SELECT * FROM `photo` WHERE `resource_id` = '%s' AND `uid` = %d ORDER BY `scale` DESC",
|
||||||
dbesc($resource_id),
|
dbesc($resource_id),
|
||||||
intval($page_owner_uid)
|
intval($page_owner_uid)
|
||||||
);
|
);
|
||||||
if(count($p)) {
|
if(count($p)) {
|
||||||
$ext = $phototypes[$p[0]['type']];
|
$ext = $phototypes[$p[0]['type']];
|
||||||
$r = q("UPDATE `photo` SET `desc` = '%s', `album` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s' WHERE `resource-id` = '%s' AND `uid` = %d",
|
$r = q("UPDATE `photo` SET `desc` = '%s', `album` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s' WHERE `resource_id` = '%s' AND `uid` = %d",
|
||||||
dbesc($desc),
|
dbesc($desc),
|
||||||
dbesc($albname),
|
dbesc($albname),
|
||||||
dbesc($str_contact_allow),
|
dbesc($str_contact_allow),
|
||||||
@ -414,7 +414,7 @@ function photos_post(&$a) {
|
|||||||
$arr['parent_uri'] = $uri;
|
$arr['parent_uri'] = $uri;
|
||||||
$arr['type'] = 'photo';
|
$arr['type'] = 'photo';
|
||||||
$arr['wall'] = 1;
|
$arr['wall'] = 1;
|
||||||
$arr['resource-id'] = $p[0]['resource-id'];
|
$arr['resource_id'] = $p[0]['resource_id'];
|
||||||
$arr['contact-id'] = $owner_record['id'];
|
$arr['contact-id'] = $owner_record['id'];
|
||||||
$arr['owner-name'] = $owner_record['name'];
|
$arr['owner-name'] = $owner_record['name'];
|
||||||
$arr['owner-link'] = $owner_record['url'];
|
$arr['owner-link'] = $owner_record['url'];
|
||||||
@ -430,8 +430,8 @@ function photos_post(&$a) {
|
|||||||
$arr['visible'] = $visibility;
|
$arr['visible'] = $visibility;
|
||||||
$arr['origin'] = 1;
|
$arr['origin'] = 1;
|
||||||
|
|
||||||
$arr['body'] = '[url=' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $p[0]['resource-id'] . ']'
|
$arr['body'] = '[url=' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $p[0]['resource_id'] . ']'
|
||||||
. '[img]' . $a->get_baseurl() . '/photo/' . $p[0]['resource-id'] . '-' . $p[0]['scale'] . '.'. $ext . '[/img]'
|
. '[img]' . $a->get_baseurl() . '/photo/' . $p[0]['resource_id'] . '-' . $p[0]['scale'] . '.'. $ext . '[/img]'
|
||||||
. '[/url]';
|
. '[/url]';
|
||||||
|
|
||||||
$item_id = item_store($arr);
|
$item_id = item_store($arr);
|
||||||
@ -499,7 +499,25 @@ function photos_post(&$a) {
|
|||||||
intval($profile_uid)
|
intval($profile_uid)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
elseif(strstr($name,'_') || strstr($name,' ')) {
|
else {
|
||||||
|
$newname = str_replace('_',' ',$name);
|
||||||
|
|
||||||
|
//select someone from this user's contacts by name
|
||||||
|
$r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
|
||||||
|
dbesc($newname),
|
||||||
|
intval($page_owner_uid)
|
||||||
|
);
|
||||||
|
|
||||||
|
if(! $r) {
|
||||||
|
//select someone by attag or nick and the name passed in
|
||||||
|
$r = q("SELECT * FROM `contact` WHERE `attag` = '%s' OR `nick` = '%s' AND `uid` = %d ORDER BY `attag` DESC LIMIT 1",
|
||||||
|
dbesc($name),
|
||||||
|
dbesc($name),
|
||||||
|
intval($page_owner_uid)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* elseif(strstr($name,'_') || strstr($name,' ')) {
|
||||||
$newname = str_replace('_',' ',$name);
|
$newname = str_replace('_',' ',$name);
|
||||||
$r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
|
$r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
|
||||||
dbesc($newname),
|
dbesc($newname),
|
||||||
@ -512,7 +530,7 @@ function photos_post(&$a) {
|
|||||||
dbesc($name),
|
dbesc($name),
|
||||||
intval($page_owner_uid)
|
intval($page_owner_uid)
|
||||||
);
|
);
|
||||||
}
|
}*/
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
$newname = $r[0]['name'];
|
$newname = $r[0]['name'];
|
||||||
$profile = $r[0]['url'];
|
$profile = $r[0]['url'];
|
||||||
@ -598,8 +616,8 @@ function photos_post(&$a) {
|
|||||||
$arr['tag'] = $tagged[4];
|
$arr['tag'] = $tagged[4];
|
||||||
$arr['inform'] = $tagged[2];
|
$arr['inform'] = $tagged[2];
|
||||||
$arr['origin'] = 1;
|
$arr['origin'] = 1;
|
||||||
$arr['body'] = '[url=' . $tagged[1] . ']' . $tagged[0] . '[/url]' . ' ' . t('was tagged in a') . ' ' . '[url=' . $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ']' . t('photo') . '[/url]' . ' ' . t('by') . ' ' . '[url=' . $owner_record['url'] . ']' . $owner_record['name'] . '[/url]' ;
|
$arr['body'] = '[url=' . $tagged[1] . ']' . $tagged[0] . '[/url]' . ' ' . t('was tagged in a') . ' ' . '[url=' . $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource_id'] . ']' . t('photo') . '[/url]' . ' ' . t('by') . ' ' . '[url=' . $owner_record['url'] . ']' . $owner_record['name'] . '[/url]' ;
|
||||||
$arr['body'] .= "\n\n" . '[url=' . $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ']' . '[img]' . $a->get_baseurl() . "/photo/" . $p[0]['resource-id'] . '-' . $best . '.' . $ext . '[/img][/url]' . "\n" ;
|
$arr['body'] .= "\n\n" . '[url=' . $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource_id'] . ']' . '[img]' . $a->get_baseurl() . "/photo/" . $p[0]['resource_id'] . '-' . $best . '.' . $ext . '[/img][/url]' . "\n" ;
|
||||||
|
|
||||||
$arr['object'] = '<object><type>' . ACTIVITY_OBJ_PERSON . '</type><title>' . $tagged[0] . '</title><id>' . $tagged[1] . '/' . $tagged[0] . '</id>';
|
$arr['object'] = '<object><type>' . ACTIVITY_OBJ_PERSON . '</type><title>' . $tagged[0] . '</title><id>' . $tagged[1] . '/' . $tagged[0] . '</id>';
|
||||||
$arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $tagged[1] . '" />' . "\n");
|
$arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $tagged[1] . '" />' . "\n");
|
||||||
@ -608,8 +626,8 @@ function photos_post(&$a) {
|
|||||||
$arr['object'] .= '</link></object>' . "\n";
|
$arr['object'] .= '</link></object>' . "\n";
|
||||||
|
|
||||||
$arr['target'] = '<target><type>' . ACTIVITY_OBJ_PHOTO . '</type><title>' . $p[0]['desc'] . '</title><id>'
|
$arr['target'] = '<target><type>' . ACTIVITY_OBJ_PHOTO . '</type><title>' . $p[0]['desc'] . '</title><id>'
|
||||||
. $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . '</id>';
|
. $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource_id'] . '</id>';
|
||||||
$arr['target'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . '" />' . "\n" . '<link rel="preview" type="'.$p[0]['type'].'" href="' . $a->get_baseurl() . "/photo/" . $p[0]['resource-id'] . '-' . $best . '.' . $ext . '" />') . '</link></target>';
|
$arr['target'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource_id'] . '" />' . "\n" . '<link rel="preview" type="'.$p[0]['type'].'" href="' . $a->get_baseurl() . "/photo/" . $p[0]['resource_id'] . '-' . $best . '.' . $ext . '" />') . '</link></target>';
|
||||||
|
|
||||||
$item_id = item_store($arr);
|
$item_id = item_store($arr);
|
||||||
if($item_id) {
|
if($item_id) {
|
||||||
@ -798,7 +816,7 @@ function photos_post(&$a) {
|
|||||||
$arr['parent_uri'] = $uri;
|
$arr['parent_uri'] = $uri;
|
||||||
$arr['type'] = 'photo';
|
$arr['type'] = 'photo';
|
||||||
$arr['wall'] = 1;
|
$arr['wall'] = 1;
|
||||||
$arr['resource-id'] = $photo_hash;
|
$arr['resource_id'] = $photo_hash;
|
||||||
$arr['contact-id'] = $owner_record['id'];
|
$arr['contact-id'] = $owner_record['id'];
|
||||||
$arr['owner-name'] = $owner_record['name'];
|
$arr['owner-name'] = $owner_record['name'];
|
||||||
$arr['owner-link'] = $owner_record['url'];
|
$arr['owner-link'] = $owner_record['url'];
|
||||||
@ -1062,8 +1080,8 @@ function photos_content(&$a) {
|
|||||||
|
|
||||||
$album = hex2bin($datum);
|
$album = hex2bin($datum);
|
||||||
|
|
||||||
$r = q("SELECT `resource-id`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` = '%s'
|
$r = q("SELECT `resource_id`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` = '%s'
|
||||||
AND `scale` <= 4 $sql_extra GROUP BY `resource-id`",
|
AND `scale` <= 4 $sql_extra GROUP BY `resource_id`",
|
||||||
intval($owner_uid),
|
intval($owner_uid),
|
||||||
dbesc($album)
|
dbesc($album)
|
||||||
);
|
);
|
||||||
@ -1077,8 +1095,8 @@ function photos_content(&$a) {
|
|||||||
else
|
else
|
||||||
$order = 'DESC';
|
$order = 'DESC';
|
||||||
|
|
||||||
$r = q("SELECT `resource-id`, `id`, `filename`, type, max(`scale`) AS `scale`, `desc` FROM `photo` WHERE `uid` = %d AND `album` = '%s'
|
$r = q("SELECT `resource_id`, `id`, `filename`, type, max(`scale`) AS `scale`, `desc` FROM `photo` WHERE `uid` = %d AND `album` = '%s'
|
||||||
AND `scale` <= 4 $sql_extra GROUP BY `resource-id` ORDER BY `created` $order LIMIT %d , %d",
|
AND `scale` <= 4 $sql_extra GROUP BY `resource_id` ORDER BY `created` $order LIMIT %d , %d",
|
||||||
intval($owner_uid),
|
intval($owner_uid),
|
||||||
dbesc($album),
|
dbesc($album),
|
||||||
intval($a->pager['start']),
|
intval($a->pager['start']),
|
||||||
@ -1137,10 +1155,10 @@ function photos_content(&$a) {
|
|||||||
$o .= replace_macros($tpl,array(
|
$o .= replace_macros($tpl,array(
|
||||||
'$id' => $rr['id'],
|
'$id' => $rr['id'],
|
||||||
'$twist' => ' ' . $twist . rand(2,4),
|
'$twist' => ' ' . $twist . rand(2,4),
|
||||||
'$photolink' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource-id']
|
'$photolink' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource_id']
|
||||||
. (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''),
|
. (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''),
|
||||||
'$phototitle' => t('View Photo'),
|
'$phototitle' => t('View Photo'),
|
||||||
'$imgsrc' => $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['scale'] . '.' .$ext,
|
'$imgsrc' => $a->get_baseurl() . '/photo/' . $rr['resource_id'] . '-' . $rr['scale'] . '.' .$ext,
|
||||||
'$imgalt' => template_escape($rr['filename']),
|
'$imgalt' => template_escape($rr['filename']),
|
||||||
'$desc'=> template_escape($rr['desc'])
|
'$desc'=> template_escape($rr['desc'])
|
||||||
));
|
));
|
||||||
@ -1161,14 +1179,14 @@ function photos_content(&$a) {
|
|||||||
//$o = '';
|
//$o = '';
|
||||||
// fetch image, item containing image, then comments
|
// fetch image, item containing image, then comments
|
||||||
|
|
||||||
$ph = q("SELECT * FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s'
|
$ph = q("SELECT * FROM `photo` WHERE `uid` = %d AND `resource_id` = '%s'
|
||||||
$sql_extra ORDER BY `scale` ASC ",
|
$sql_extra ORDER BY `scale` ASC ",
|
||||||
intval($owner_uid),
|
intval($owner_uid),
|
||||||
dbesc($datum)
|
dbesc($datum)
|
||||||
);
|
);
|
||||||
|
|
||||||
if(! count($ph)) {
|
if(! count($ph)) {
|
||||||
$ph = q("SELECT `id` FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s'
|
$ph = q("SELECT `id` FROM `photo` WHERE `uid` = %d AND `resource_id` = '%s'
|
||||||
LIMIT 1",
|
LIMIT 1",
|
||||||
intval($owner_uid),
|
intval($owner_uid),
|
||||||
dbesc($datum)
|
dbesc($datum)
|
||||||
@ -1189,7 +1207,7 @@ function photos_content(&$a) {
|
|||||||
$order = 'DESC';
|
$order = 'DESC';
|
||||||
|
|
||||||
|
|
||||||
$prvnxt = q("SELECT `resource-id` FROM `photo` WHERE `album` = '%s' AND `uid` = %d AND `scale` = 0
|
$prvnxt = q("SELECT `resource_id` FROM `photo` WHERE `album` = '%s' AND `uid` = %d AND `scale` = 0
|
||||||
$sql_extra ORDER BY `created` $order ",
|
$sql_extra ORDER BY `created` $order ",
|
||||||
dbesc($ph[0]['album']),
|
dbesc($ph[0]['album']),
|
||||||
intval($owner_uid)
|
intval($owner_uid)
|
||||||
@ -1197,7 +1215,7 @@ function photos_content(&$a) {
|
|||||||
|
|
||||||
if(count($prvnxt)) {
|
if(count($prvnxt)) {
|
||||||
for($z = 0; $z < count($prvnxt); $z++) {
|
for($z = 0; $z < count($prvnxt); $z++) {
|
||||||
if($prvnxt[$z]['resource-id'] == $ph[0]['resource-id']) {
|
if($prvnxt[$z]['resource_id'] == $ph[0]['resource_id']) {
|
||||||
$prv = $z - 1;
|
$prv = $z - 1;
|
||||||
$nxt = $z + 1;
|
$nxt = $z + 1;
|
||||||
if($prv < 0)
|
if($prv < 0)
|
||||||
@ -1208,8 +1226,8 @@ function photos_content(&$a) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$edit_suffix = ((($cmd === 'edit') && ($can_post)) ? '/edit' : '');
|
$edit_suffix = ((($cmd === 'edit') && ($can_post)) ? '/edit' : '');
|
||||||
$prevlink = $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$prv]['resource-id'] . $edit_suffix . (($_GET['order'] === 'posted') ? '?f=&order=posted' : '');
|
$prevlink = $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$prv]['resource_id'] . $edit_suffix . (($_GET['order'] === 'posted') ? '?f=&order=posted' : '');
|
||||||
$nextlink = $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$nxt]['resource-id'] . $edit_suffix . (($_GET['order'] === 'posted') ? '?f=&order=posted' : '');
|
$nextlink = $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$nxt]['resource_id'] . $edit_suffix . (($_GET['order'] === 'posted') ? '?f=&order=posted' : '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1233,7 +1251,7 @@ function photos_content(&$a) {
|
|||||||
if($can_post && ($ph[0]['uid'] == $owner_uid)) {
|
if($can_post && ($ph[0]['uid'] == $owner_uid)) {
|
||||||
$tools = array(
|
$tools = array(
|
||||||
'edit' => array($a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $datum . (($cmd === 'edit') ? '' : '/edit'), (($cmd === 'edit') ? t('View photo') : t('Edit photo'))),
|
'edit' => array($a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $datum . (($cmd === 'edit') ? '' : '/edit'), (($cmd === 'edit') ? t('View photo') : t('Edit photo'))),
|
||||||
'profile'=>array($a->get_baseurl() . '/profile_photo/use/'.$ph[0]['resource-id'], t('Use as profile photo')),
|
'profile'=>array($a->get_baseurl() . '/profile_photo/use/'.$ph[0]['resource_id'], t('Use as profile photo')),
|
||||||
);
|
);
|
||||||
|
|
||||||
// lock
|
// lock
|
||||||
@ -1260,9 +1278,9 @@ function photos_content(&$a) {
|
|||||||
$prevlink = array($prevlink, '<div class="icon prev"></div>') ;
|
$prevlink = array($prevlink, '<div class="icon prev"></div>') ;
|
||||||
|
|
||||||
$photo = array(
|
$photo = array(
|
||||||
'href' => $a->get_baseurl() . '/photo/' . $hires['resource-id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']],
|
'href' => $a->get_baseurl() . '/photo/' . $hires['resource_id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']],
|
||||||
'title'=> t('View Full Size'),
|
'title'=> t('View Full Size'),
|
||||||
'src' => $a->get_baseurl() . '/photo/' . $lores['resource-id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . datetime_convert('','','','ymdhis')
|
'src' => $a->get_baseurl() . '/photo/' . $lores['resource_id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . datetime_convert('','','','ymdhis')
|
||||||
);
|
);
|
||||||
|
|
||||||
if($nextlink)
|
if($nextlink)
|
||||||
@ -1271,7 +1289,7 @@ function photos_content(&$a) {
|
|||||||
|
|
||||||
// Do we have an item for this photo?
|
// Do we have an item for this photo?
|
||||||
|
|
||||||
$linked_items = q("SELECT * FROM `item` WHERE `resource-id` = '%s' $sql_extra LIMIT 1",
|
$linked_items = q("SELECT * FROM `item` WHERE `resource_id` = '%s' $sql_extra LIMIT 1",
|
||||||
dbesc($datum)
|
dbesc($datum)
|
||||||
);
|
);
|
||||||
if(count($linked_items)) {
|
if(count($linked_items)) {
|
||||||
@ -1347,7 +1365,7 @@ function photos_content(&$a) {
|
|||||||
'$album' => template_escape($ph[0]['album']),
|
'$album' => template_escape($ph[0]['album']),
|
||||||
'$newalbum' => t('New album name'),
|
'$newalbum' => t('New album name'),
|
||||||
'$nickname' => $a->data['user']['nickname'],
|
'$nickname' => $a->data['user']['nickname'],
|
||||||
'$resource_id' => $ph[0]['resource-id'],
|
'$resource_id' => $ph[0]['resource_id'],
|
||||||
'$capt_label' => t('Caption'),
|
'$capt_label' => t('Caption'),
|
||||||
'$caption' => template_escape($ph[0]['desc']),
|
'$caption' => template_escape($ph[0]['desc']),
|
||||||
'$tag_label' => t('Add a Tag'),
|
'$tag_label' => t('Add a Tag'),
|
||||||
@ -1534,8 +1552,8 @@ function photos_content(&$a) {
|
|||||||
// Default - show recent photos with upload link (if applicable)
|
// Default - show recent photos with upload link (if applicable)
|
||||||
//$o = '';
|
//$o = '';
|
||||||
|
|
||||||
$r = q("SELECT `resource-id`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s'
|
$r = q("SELECT `resource_id`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s'
|
||||||
$sql_extra GROUP BY `resource-id`",
|
$sql_extra GROUP BY `resource_id`",
|
||||||
intval($a->data['user']['uid']),
|
intval($a->data['user']['uid']),
|
||||||
dbesc('Contact Photos'),
|
dbesc('Contact Photos'),
|
||||||
dbesc( t('Contact Photos'))
|
dbesc( t('Contact Photos'))
|
||||||
@ -1545,9 +1563,9 @@ function photos_content(&$a) {
|
|||||||
$a->set_pager_itemspage(20);
|
$a->set_pager_itemspage(20);
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = q("SELECT `resource-id`, `id`, `filename`, type, `album`, max(`scale`) AS `scale` FROM `photo`
|
$r = q("SELECT `resource_id`, `id`, `filename`, type, `album`, max(`scale`) AS `scale` FROM `photo`
|
||||||
WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s'
|
WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s'
|
||||||
$sql_extra GROUP BY `resource-id` ORDER BY `created` DESC LIMIT %d , %d",
|
$sql_extra GROUP BY `resource_id` ORDER BY `created` DESC LIMIT %d , %d",
|
||||||
intval($a->data['user']['uid']),
|
intval($a->data['user']['uid']),
|
||||||
dbesc('Contact Photos'),
|
dbesc('Contact Photos'),
|
||||||
dbesc( t('Contact Photos')),
|
dbesc( t('Contact Photos')),
|
||||||
@ -1570,9 +1588,9 @@ function photos_content(&$a) {
|
|||||||
$photos[] = array(
|
$photos[] = array(
|
||||||
'id' => $rr['id'],
|
'id' => $rr['id'],
|
||||||
'twist' => ' ' . $twist . rand(2,4),
|
'twist' => ' ' . $twist . rand(2,4),
|
||||||
'link' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource-id'],
|
'link' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource_id'],
|
||||||
'title' => t('View Photo'),
|
'title' => t('View Photo'),
|
||||||
'src' => $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . ((($rr['scale']) == 6) ? 4 : $rr['scale']) . '.' . $ext,
|
'src' => $a->get_baseurl() . '/photo/' . $rr['resource_id'] . '-' . ((($rr['scale']) == 6) ? 4 : $rr['scale']) . '.' . $ext,
|
||||||
'alt' => template_escape($rr['filename']),
|
'alt' => template_escape($rr['filename']),
|
||||||
'album' => array(
|
'album' => array(
|
||||||
'link' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']),
|
'link' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']),
|
||||||
|
@ -111,7 +111,8 @@ function ping_init(&$a) {
|
|||||||
|
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
|
|
||||||
call_hooks('network_ping', array('items' => $r));
|
$arr = array('items' => $r);
|
||||||
|
call_hooks('network_ping', $arr);
|
||||||
|
|
||||||
foreach ($r as $it) {
|
foreach ($r as $it) {
|
||||||
if($it['wall'])
|
if($it['wall'])
|
||||||
|
@ -59,7 +59,7 @@ function profile_photo_post(&$a) {
|
|||||||
$srcW = $_POST['xfinal'] - $srcX;
|
$srcW = $_POST['xfinal'] - $srcX;
|
||||||
$srcH = $_POST['yfinal'] - $srcY;
|
$srcH = $_POST['yfinal'] - $srcY;
|
||||||
|
|
||||||
$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(local_user()),
|
dbesc(local_user()),
|
||||||
intval($scale));
|
intval($scale));
|
||||||
@ -72,21 +72,21 @@ function profile_photo_post(&$a) {
|
|||||||
if($im->is_valid()) {
|
if($im->is_valid()) {
|
||||||
$im->cropImage(175,$srcX,$srcY,$srcW,$srcH);
|
$im->cropImage(175,$srcX,$srcY,$srcW,$srcH);
|
||||||
|
|
||||||
$r = $im->store(local_user(), 0, $base_image['resource-id'],$base_image['filename'], t('Profile Photos'), 4, $is_default_profile);
|
$r = $im->store(local_user(), 0, $base_image['resource_id'],$base_image['filename'], t('Profile Photos'), 4, $is_default_profile);
|
||||||
|
|
||||||
if($r === false)
|
if($r === false)
|
||||||
notice ( sprintf(t('Image size reduction [%s] failed.'),"175") . EOL );
|
notice ( sprintf(t('Image size reduction [%s] failed.'),"175") . EOL );
|
||||||
|
|
||||||
$im->scaleImage(80);
|
$im->scaleImage(80);
|
||||||
|
|
||||||
$r = $im->store(local_user(), 0, $base_image['resource-id'],$base_image['filename'], t('Profile Photos'), 5, $is_default_profile);
|
$r = $im->store(local_user(), 0, $base_image['resource_id'],$base_image['filename'], t('Profile Photos'), 5, $is_default_profile);
|
||||||
|
|
||||||
if($r === false)
|
if($r === false)
|
||||||
notice( sprintf(t('Image size reduction [%s] failed.'),"80") . EOL );
|
notice( sprintf(t('Image size reduction [%s] failed.'),"80") . EOL );
|
||||||
|
|
||||||
$im->scaleImage(48);
|
$im->scaleImage(48);
|
||||||
|
|
||||||
$r = $im->store(local_user(), 0, $base_image['resource-id'],$base_image['filename'], t('Profile Photos'), 6, $is_default_profile);
|
$r = $im->store(local_user(), 0, $base_image['resource_id'],$base_image['filename'], t('Profile Photos'), 6, $is_default_profile);
|
||||||
|
|
||||||
if($r === false)
|
if($r === false)
|
||||||
notice( sprintf(t('Image size reduction [%s] failed.'),"48") . EOL );
|
notice( sprintf(t('Image size reduction [%s] failed.'),"48") . EOL );
|
||||||
@ -94,15 +94,15 @@ function profile_photo_post(&$a) {
|
|||||||
// If setting for the default profile, unset the profile photo flag from any other photos I own
|
// If setting for the default profile, unset the profile photo flag from any other photos I own
|
||||||
|
|
||||||
if($is_default_profile) {
|
if($is_default_profile) {
|
||||||
$r = q("UPDATE `photo` SET `profile` = 0 WHERE `profile` = 1 AND `resource-id` != '%s' AND `uid` = %d",
|
$r = q("UPDATE `photo` SET `profile` = 0 WHERE `profile` = 1 AND `resource_id` != '%s' AND `uid` = %d",
|
||||||
dbesc($base_image['resource-id']),
|
dbesc($base_image['resource_id']),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$r = q("update profile set photo = '%s', thumb = '%s' where id = %d and uid = %d limit 1",
|
$r = q("update profile set photo = '%s', thumb = '%s' where id = %d and uid = %d limit 1",
|
||||||
dbesc($a->get_baseurl() . '/photo/' . $base_image['resource-id'] . '-4'),
|
dbesc($a->get_baseurl() . '/photo/' . $base_image['resource_id'] . '-4'),
|
||||||
dbesc($a->get_baseurl() . '/photo/' . $base_image['resource-id'] . '-5'),
|
dbesc($a->get_baseurl() . '/photo/' . $base_image['resource_id'] . '-5'),
|
||||||
intval($_REQUEST['profile']),
|
intval($_REQUEST['profile']),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
@ -183,7 +183,7 @@ function profile_photo_content(&$a) {
|
|||||||
|
|
||||||
$resource_id = $a->argv[2];
|
$resource_id = $a->argv[2];
|
||||||
//die(":".local_user());
|
//die(":".local_user());
|
||||||
$r=q("SELECT * FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s' ORDER BY `scale` ASC",
|
$r=q("SELECT * FROM `photo` WHERE `uid` = %d AND `resource_id` = '%s' ORDER BY `scale` ASC",
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
dbesc($resource_id)
|
dbesc($resource_id)
|
||||||
);
|
);
|
||||||
@ -203,7 +203,7 @@ function profile_photo_content(&$a) {
|
|||||||
$r=q("UPDATE `photo` SET `profile`=0 WHERE `profile`=1 AND `uid`=%d",
|
$r=q("UPDATE `photo` SET `profile`=0 WHERE `profile`=1 AND `uid`=%d",
|
||||||
intval(local_user()));
|
intval(local_user()));
|
||||||
|
|
||||||
$r=q("UPDATE `photo` SET `profile`=1 WHERE `uid` = %d AND `resource-id` = '%s'",
|
$r=q("UPDATE `photo` SET `profile`=1 WHERE `uid` = %d AND `resource_id` = '%s'",
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
dbesc($resource_id)
|
dbesc($resource_id)
|
||||||
);
|
);
|
||||||
|
@ -96,7 +96,7 @@ function profiles_post(&$a) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$newname = $lookup;
|
$newname = $lookup;
|
||||||
if(strstr($lookup,' ')) {
|
/* if(strstr($lookup,' ')) {
|
||||||
$r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
|
$r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
|
||||||
dbesc($newname),
|
dbesc($newname),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
@ -107,6 +107,17 @@ function profiles_post(&$a) {
|
|||||||
dbesc($lookup),
|
dbesc($lookup),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
$r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
|
||||||
|
dbesc($newname),
|
||||||
|
intval(local_user())
|
||||||
|
);
|
||||||
|
if(! $r) {
|
||||||
|
$r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1",
|
||||||
|
dbesc($lookup),
|
||||||
|
intval(local_user())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
$prf = $r[0]['url'];
|
$prf = $r[0]['url'];
|
||||||
|
160
mod/subthread.php
Executable file
160
mod/subthread.php
Executable file
@ -0,0 +1,160 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require_once('include/security.php');
|
||||||
|
require_once('include/bbcode.php');
|
||||||
|
require_once('include/items.php');
|
||||||
|
|
||||||
|
|
||||||
|
function subthread_content(&$a) {
|
||||||
|
|
||||||
|
if(! local_user() && ! remote_user()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$activity = ACTIVITY_FOLLOW;
|
||||||
|
|
||||||
|
$item_id = (($a->argc > 1) ? notags(trim($a->argv[1])) : 0);
|
||||||
|
|
||||||
|
$r = q("SELECT * FROM `item` WHERE `parent` = '%s' OR `parent-uri` = '%s' and parent = id LIMIT 1",
|
||||||
|
dbesc($item_id),
|
||||||
|
dbesc($item_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
if(! $item_id || (! count($r))) {
|
||||||
|
logger('subthread: no item ' . $item_id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$item = $r[0];
|
||||||
|
|
||||||
|
$owner_uid = $item['uid'];
|
||||||
|
|
||||||
|
if(! can_write_wall($a,$owner_uid)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$remote_owner = null;
|
||||||
|
|
||||||
|
if(! $item['wall']) {
|
||||||
|
// The top level post may have been written by somebody on another system
|
||||||
|
$r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||||
|
intval($item['contact-id']),
|
||||||
|
intval($item['uid'])
|
||||||
|
);
|
||||||
|
if(! count($r))
|
||||||
|
return;
|
||||||
|
if(! $r[0]['self'])
|
||||||
|
$remote_owner = $r[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
// this represents the post owner on this system.
|
||||||
|
|
||||||
|
$r = q("SELECT `contact`.*, `user`.`nickname` FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
|
||||||
|
WHERE `contact`.`self` = 1 AND `contact`.`uid` = %d LIMIT 1",
|
||||||
|
intval($owner_uid)
|
||||||
|
);
|
||||||
|
if(count($r))
|
||||||
|
$owner = $r[0];
|
||||||
|
|
||||||
|
if(! $owner) {
|
||||||
|
logger('like: no owner');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(! $remote_owner)
|
||||||
|
$remote_owner = $owner;
|
||||||
|
|
||||||
|
|
||||||
|
// This represents the person posting
|
||||||
|
|
||||||
|
if((local_user()) && (local_user() == $owner_uid)) {
|
||||||
|
$contact = $owner;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||||
|
intval($_SESSION['visitor_id']),
|
||||||
|
intval($owner_uid)
|
||||||
|
);
|
||||||
|
if(count($r))
|
||||||
|
$contact = $r[0];
|
||||||
|
}
|
||||||
|
if(! $contact) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$uri = item_new_uri($a->get_hostname(),$owner_uid);
|
||||||
|
|
||||||
|
$post_type = (($item['resource_id']) ? t('photo') : t('status'));
|
||||||
|
$objtype = (($item['resource_id']) ? ACTIVITY_OBJ_PHOTO : ACTIVITY_OBJ_NOTE );
|
||||||
|
$link = xmlify('<link rel="alternate" type="text/html" href="' . $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ;
|
||||||
|
$body = $item['body'];
|
||||||
|
|
||||||
|
$obj = <<< EOT
|
||||||
|
|
||||||
|
<object>
|
||||||
|
<type>$objtype</type>
|
||||||
|
<local>1</local>
|
||||||
|
<id>{$item['uri']}</id>
|
||||||
|
<link>$link</link>
|
||||||
|
<title></title>
|
||||||
|
<content>$body</content>
|
||||||
|
</object>
|
||||||
|
EOT;
|
||||||
|
$bodyverb = t('%1$s is following %2$s\'s %3$s');
|
||||||
|
|
||||||
|
if(! isset($bodyverb))
|
||||||
|
return;
|
||||||
|
|
||||||
|
$arr = array();
|
||||||
|
|
||||||
|
$arr['uri'] = $uri;
|
||||||
|
$arr['uid'] = $owner_uid;
|
||||||
|
$arr['contact-id'] = $contact['id'];
|
||||||
|
$arr['type'] = 'activity';
|
||||||
|
$arr['wall'] = $item['wall'];
|
||||||
|
$arr['origin'] = 1;
|
||||||
|
$arr['gravity'] = GRAVITY_LIKE;
|
||||||
|
$arr['parent'] = $item['id'];
|
||||||
|
$arr['parent-uri'] = $item['uri'];
|
||||||
|
$arr['thr_parent'] = $item['uri'];
|
||||||
|
$arr['owner-name'] = $remote_owner['name'];
|
||||||
|
$arr['owner-link'] = $remote_owner['url'];
|
||||||
|
$arr['owner-avatar'] = $remote_owner['thumb'];
|
||||||
|
$arr['author-name'] = $contact['name'];
|
||||||
|
$arr['author-link'] = $contact['url'];
|
||||||
|
$arr['author-avatar'] = $contact['thumb'];
|
||||||
|
|
||||||
|
$ulink = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
|
||||||
|
$alink = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]';
|
||||||
|
$plink = '[url=' . $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . ']' . $post_type . '[/url]';
|
||||||
|
$arr['body'] = sprintf( $bodyverb, $ulink, $alink, $plink );
|
||||||
|
|
||||||
|
$arr['verb'] = $activity;
|
||||||
|
$arr['object-type'] = $objtype;
|
||||||
|
$arr['object'] = $obj;
|
||||||
|
$arr['allow_cid'] = $item['allow_cid'];
|
||||||
|
$arr['allow_gid'] = $item['allow_gid'];
|
||||||
|
$arr['deny_cid'] = $item['deny_cid'];
|
||||||
|
$arr['deny_gid'] = $item['deny_gid'];
|
||||||
|
$arr['visible'] = 1;
|
||||||
|
$arr['unseen'] = 1;
|
||||||
|
$arr['last-child'] = 0;
|
||||||
|
|
||||||
|
$post_id = item_store($arr);
|
||||||
|
|
||||||
|
if(! $item['visible']) {
|
||||||
|
$r = q("UPDATE `item` SET `visible` = 1 WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||||
|
intval($item['id']),
|
||||||
|
intval($owner_uid)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$arr['id'] = $post_id;
|
||||||
|
|
||||||
|
call_hooks('post_local_end', $arr);
|
||||||
|
|
||||||
|
killme();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -59,8 +59,8 @@ function tagger_content(&$a) {
|
|||||||
|
|
||||||
$uri = item_new_uri($a->get_hostname(),$owner_uid);
|
$uri = item_new_uri($a->get_hostname(),$owner_uid);
|
||||||
$xterm = xmlify($term);
|
$xterm = xmlify($term);
|
||||||
$post_type = (($item['resource-id']) ? t('photo') : t('status'));
|
$post_type = (($item['resource_id']) ? t('photo') : t('status'));
|
||||||
$targettype = (($item['resource-id']) ? ACTIVITY_OBJ_PHOTO : ACTIVITY_OBJ_NOTE );
|
$targettype = (($item['resource_id']) ? ACTIVITY_OBJ_PHOTO : ACTIVITY_OBJ_NOTE );
|
||||||
|
|
||||||
$link = xmlify('<link rel="alternate" type="text/html" href="'
|
$link = xmlify('<link rel="alternate" type="text/html" href="'
|
||||||
. $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ;
|
. $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ;
|
||||||
|
@ -63,7 +63,7 @@ class Item extends BaseObject {
|
|||||||
if($item['network'] === NETWORK_MAIL && local_user() != $item['uid']) {
|
if($item['network'] === NETWORK_MAIL && local_user() != $item['uid']) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if($item['verb'] === ACTIVITY_LIKE || $item['verb'] === ACTIVITY_DISLIKE) {
|
if(! visible_activity($item)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$child = new Item($item);
|
$child = new Item($item);
|
||||||
@ -304,11 +304,9 @@ class Item extends BaseObject {
|
|||||||
* Only add what will be displayed
|
* Only add what will be displayed
|
||||||
*/
|
*/
|
||||||
if($item->get_data_value('network') === NETWORK_MAIL && local_user() != $item->get_data_value('uid')) {
|
if($item->get_data_value('network') === NETWORK_MAIL && local_user() != $item->get_data_value('uid')) {
|
||||||
logger('[WARN] Item::add_child : Item is a mail ('. $item->get_id() .').', LOGGER_DEBUG);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if($item->get_data_value('verb') === ACTIVITY_LIKE || $item->get_data_value('verb') === ACTIVITY_DISLIKE) {
|
if(activity_match($item->get_data_value('verb'),ACTIVITY_LIKE) || activity_match($item->get_data_value('verb'),ACTIVITY_DISLIKE)) {
|
||||||
logger('[WARN] Item::add_child : Item is a (dis)like ('. $item->get_id() .').', LOGGER_DEBUG);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -634,5 +632,9 @@ class Item extends BaseObject {
|
|||||||
private function is_visiting() {
|
private function is_visiting() {
|
||||||
return $this->visiting;
|
return $this->visiting;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
14
update.php
14
update.php
@ -149,7 +149,7 @@ function update_1014() {
|
|||||||
$ph = new Photo($rr['data']);
|
$ph = new Photo($rr['data']);
|
||||||
if($ph->is_valid()) {
|
if($ph->is_valid()) {
|
||||||
$ph->scaleImage(48);
|
$ph->scaleImage(48);
|
||||||
$ph->store($rr['uid'],$rr['contact-id'],$rr['resource-id'],$rr['filename'],$rr['album'],6,(($rr['profile']) ? 1 : 0));
|
$ph->store($rr['uid'],$rr['contact-id'],$rr['resource_id'],$rr['filename'],$rr['album'],6,(($rr['profile']) ? 1 : 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -221,7 +221,7 @@ function update_1019() {
|
|||||||
|
|
||||||
function update_1020() {
|
function update_1020() {
|
||||||
q("ALTER TABLE `profile` DROP `showwith`");
|
q("ALTER TABLE `profile` DROP `showwith`");
|
||||||
q("ALTER TABLE `item` ADD `thr-parent` CHAR( 255 ) NOT NULL AFTER `parent_uri` ");
|
q("ALTER TABLE `item` ADD `thr_parent` CHAR( 255 ) NOT NULL AFTER `parent_uri` ");
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_1021() {
|
function update_1021() {
|
||||||
@ -499,7 +499,7 @@ function update_1057() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function update_1058() {
|
function update_1058() {
|
||||||
q("ALTER TABLE `item` ADD `event-id` INT NOT NULL AFTER `resource-id` ");
|
q("ALTER TABLE `item` ADD `event-id` INT NOT NULL AFTER `resource_id` ");
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_1059() {
|
function update_1059() {
|
||||||
@ -574,7 +574,7 @@ function update_1070() {
|
|||||||
|
|
||||||
function update_1071() {
|
function update_1071() {
|
||||||
q("ALTER TABLE `photo` ADD INDEX ( `uid` ) ");
|
q("ALTER TABLE `photo` ADD INDEX ( `uid` ) ");
|
||||||
q("ALTER TABLE `photo` ADD INDEX ( `resource-id` ) ");
|
q("ALTER TABLE `photo` ADD INDEX ( `resource_id` ) ");
|
||||||
q("ALTER TABLE `photo` ADD INDEX ( `album` ) ");
|
q("ALTER TABLE `photo` ADD INDEX ( `album` ) ");
|
||||||
q("ALTER TABLE `photo` ADD INDEX ( `scale` ) ");
|
q("ALTER TABLE `photo` ADD INDEX ( `scale` ) ");
|
||||||
q("ALTER TABLE `photo` ADD INDEX ( `profile` ) ");
|
q("ALTER TABLE `photo` ADD INDEX ( `profile` ) ");
|
||||||
@ -686,13 +686,13 @@ function update_1082() {
|
|||||||
$r = q("select `id` from `photo` where `guid` != '' limit 1");
|
$r = q("select `id` from `photo` where `guid` != '' limit 1");
|
||||||
if($r && count($r))
|
if($r && count($r))
|
||||||
return;
|
return;
|
||||||
$r = q("SELECT distinct(`resource-id`) FROM `photo` WHERE 1 group by `id`");
|
$r = q("SELECT distinct(`resource_id`) FROM `photo` WHERE 1 group by `id`");
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
foreach($r as $rr) {
|
foreach($r as $rr) {
|
||||||
$guid = get_guid();
|
$guid = get_guid();
|
||||||
q("update `photo` set `guid` = '%s' where `resource-id` = '%s'",
|
q("update `photo` set `guid` = '%s' where `resource_id` = '%s'",
|
||||||
dbesc($guid),
|
dbesc($guid),
|
||||||
dbesc($rr['resource-id'])
|
dbesc($rr['resource_id'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
2012-09-27.90
|
2012-10-01.94
|
||||||
|
@ -1128,7 +1128,7 @@ msgstr "Réglages avancés"
|
|||||||
|
|
||||||
#: ../../mod/search.php:13 ../../mod/network.php:75
|
#: ../../mod/search.php:13 ../../mod/network.php:75
|
||||||
msgid "Saved Searches"
|
msgid "Saved Searches"
|
||||||
msgstr "Recherches sauvées"
|
msgstr "Recherches"
|
||||||
|
|
||||||
#: ../../mod/search.php:16 ../../mod/network.php:81
|
#: ../../mod/search.php:16 ../../mod/network.php:81
|
||||||
msgid "Remove term"
|
msgid "Remove term"
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
|
|
||||||
Caro/a $myname,
|
Ciao $[myname],
|
||||||
|
|
||||||
Hai un nuovo seguace a $sitename - '$requestor'.
|
Un nuovo utente ha iniziato a seguirti su $[sitename] - '$[requestor]'.
|
||||||
|
|
||||||
Puoi visitare il suo profilo a $url.
|
Puoi vedere il suo profilo su $[url].
|
||||||
|
|
||||||
Accedi al tuo sito per approvare o ignorare/cancellare la richiesta.
|
Accedi sul tuo sito per approvare o ignorare la richiesta.
|
||||||
|
|
||||||
$siteurl
|
$[siteurl]
|
||||||
|
|
||||||
Saluti,
|
Saluti,
|
||||||
|
|
||||||
L'amministratore di $sitename
|
L'amministratore di $[sitename]
|
@ -1,23 +1,22 @@
|
|||||||
|
|
||||||
Caro/a $username,
|
Ciao $[username],
|
||||||
|
|
||||||
Grandi notizie... '$fn' a '$dfrn_url' ha accettato la tua richiesta di
|
Ottime notizie... '$[fn]' di '$[dfrn_url]' ha accettato
|
||||||
di connessione a '$sitename'.
|
la tua richiesta di connessione su '$[sitename]'.
|
||||||
|
|
||||||
Ora siete amici a vicenda e potete scambiarvi aggiornamenti di stato, foto e
|
Adesso siete amici reciproci e potete scambiarvi aggiornamenti di stato, foto ed email
|
||||||
email senza restrizioni.
|
senza restrizioni.
|
||||||
|
|
||||||
Visita la tua pagina 'Contatti' su $sitename se vuoi fare una qualsiasi modifica
|
Vai nella pagina 'Contatti' di $[sitename] se vuoi effettuare
|
||||||
a questa relazione.
|
qualche modifica riguardo questa relazione
|
||||||
|
|
||||||
$siteurl
|
$[siteurl]
|
||||||
|
|
||||||
[Per esempio, puoi voler creare un profilo separato con informazioni che non
|
[Ad esempio, potresti creare un profilo separato con le informazioni che non
|
||||||
sono disponibili al pubblico generico, e assegnarne i diritti di lettura a
|
sono disponibili pubblicamente - ed permettere di vederlo a '$[fn]'].
|
||||||
'$fn'].
|
|
||||||
|
|
||||||
Sinceramente tuo,
|
Saluti,
|
||||||
|
|
||||||
L'amministratore di $sitename
|
l'amministratore di $[sitename]
|
||||||
|
|
||||||
|
|
@ -1,22 +1,22 @@
|
|||||||
|
|
||||||
Caro/a $username,
|
Ciao $[username],
|
||||||
|
|
||||||
'$fn' a '$dfrn_url' ha accettato la tua richiesta di
|
'$[fn]' di '$[dfrn_url]' ha accettato
|
||||||
connessione a '$sitename'.
|
la tua richiesta di connessione a '$[sitename]'.
|
||||||
|
|
||||||
'$fn' ha scelto di accertarti come "fan", che limita alcune forme di
|
'$[fn]' ha deciso di accettarti come "fan", il che restringe
|
||||||
comunicazione, come i messaggi privati e alcune interazioni con il profilo.
|
alcune forme di comunicazione - come i messaggi privati e alcune
|
||||||
Se e' una celebrita' o una pagina di community, queste impostazioni
|
interazioni. Se è la pagina di una persona famosa o di una comunità, queste impostazioni saranno
|
||||||
sono applicate automaticamente.
|
applicate automaticamente.
|
||||||
|
|
||||||
'$fn' puo' decidere di estendere in una relazione piu' permissiva
|
'$[fn]' potrebbe decidere di estendere questa relazione in una comunicazione bidirezionale o ancora più permissiva
|
||||||
nel futuro.
|
.
|
||||||
|
|
||||||
Comincerai a rivecere gli aggiornamenti pubblici da '$fn',
|
Inizierai a ricevere gli aggiornamenti di stato pubblici da '$[fn]',
|
||||||
che apparira' sulla tua pagina 'Rete' su
|
che apparirà nella tua pagina 'Rete'
|
||||||
|
|
||||||
$siteurl
|
$[siteurl]
|
||||||
|
|
||||||
Saluti,
|
Saluti,
|
||||||
|
|
||||||
L'amministratore di $sitename
|
l'amministratore di $[sitename]
|
@ -1,34 +1,32 @@
|
|||||||
|
|
||||||
Caro/a $username,
|
Ciao $[username],
|
||||||
|
Su $[sitename] è stata ricevuta una richiesta di azzeramento di password per un account.
|
||||||
|
Per confermare la richiesta, clicca sul link di verifica
|
||||||
|
qui in fondo oppure copialo nella barra degli indirizzi del tuo browser.
|
||||||
|
|
||||||
E' arrivata recentemente una richiesta di resettare la password del tuo
|
Se NON hai richiesto l'azzeramento, NON seguire il link
|
||||||
account su $sitename. Per confermare questa richiesta, clicca sul link di
|
e ignora e/o cancella questa email.
|
||||||
verifica qui sotto o incollalo nella barra dell'indirizzo del tuo browser web.
|
|
||||||
|
|
||||||
Se NON hai richiesto questa modifica, NON seguire il link e ignora e cancella
|
La tua password non sarà modificata finché non avremo verificato che
|
||||||
questa mail.
|
hai fatto questa richiesta.
|
||||||
|
|
||||||
La tua password non verrà cambiata finchè non verifichiame che hai richiesto tu
|
Per verificare la tua identità clicca su:
|
||||||
la modifica.
|
|
||||||
|
|
||||||
Segui questo link per verificare la tua identità:
|
$[reset_link]
|
||||||
|
|
||||||
$reset_link
|
Dopo la verifica riceverai un messaggio di risposta con la nuova password.
|
||||||
|
|
||||||
Riceverai un messaggio contenente la nuova password.
|
Potrai cambiare la password dalla pagina delle impostazioni dopo aver effettuato l'accesso.
|
||||||
|
|
||||||
Potrai cambiare questa password dalla pagina delle impostazioni del tuo account
|
I dati di accesso sono i seguenti:
|
||||||
dopo aver effettuato l'accesso.
|
|
||||||
|
|
||||||
I dettagli d'accesso sono i seguenti:
|
Sito:»$[siteurl]
|
||||||
|
Nome utente:»$[email]
|
||||||
Sito: $siteurl
|
|
||||||
Nome: $email
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Saluti,
|
Saluti,
|
||||||
L'amministratore di $sitename
|
l'amministratore di $[sitename]
|
||||||
|
|
||||||
|
|
12471
view/it/messages.po
12471
view/it/messages.po
File diff suppressed because it is too large
Load Diff
@ -1,20 +1,20 @@
|
|||||||
|
|
||||||
Caro/a $username,
|
Ciao $[username],
|
||||||
La tua password è stata cambiata come richiesto. Segnati questa informazione
|
La tua password è cambiata come hai richiesto. Conserva queste
|
||||||
(o cambia immediatamente la password con qualcosa che ti ricorderai).
|
informazioni (oppure cambia immediatamente la password con
|
||||||
|
qualcosa che ti è più facile ricordare).
|
||||||
|
|
||||||
|
|
||||||
I tui dati di accesso sono i seguenti:
|
I tuoi dati di access sono i seguenti:
|
||||||
|
|
||||||
Sito: $siteurl
|
Sito:»$[siteurl]
|
||||||
Nome: $email
|
Nome utente:»$[email]
|
||||||
Password: $new_password
|
Password:»$[new_password]
|
||||||
|
|
||||||
Puoi cambiare la password dalla pagina delle impostazioni del tuo profilo dopo
|
Puoi cambiare la tua password dalla pagina delle impostazioni dopo aver effettuato l'accesso.
|
||||||
aver effetuato l'accesso.
|
|
||||||
|
|
||||||
|
|
||||||
Saluti,
|
Saluti,
|
||||||
L'amministratore di $sitename
|
l'amministratore di $[sitename]
|
||||||
|
|
||||||
|
|
@ -1,22 +1,34 @@
|
|||||||
|
|
||||||
Caro/a $username,
|
Ciao $[username],
|
||||||
Grazie per la tua registrazione a $sitename. Il tuo account è stato creato.
|
Grazie per aver effettuato la registrazione a $[sitename]. Il tuo account è stato creato.
|
||||||
I dati di accesso sono i seguenti:
|
I dettagli di accesso sono i seguenti
|
||||||
|
|
||||||
|
|
||||||
Sito: $siteurl
|
Sito:»$[siteurl]
|
||||||
Nome: $email
|
Nome utente:»$[email]
|
||||||
Password: $password
|
Password:»$[password]
|
||||||
|
|
||||||
Puoi cambiare la tua password dall pagina "Impostazioni" del tuo account dopo
|
Puoi cambiare la tua password dalla pagina "Impostazioni" del tuo profilo dopo aver effettuato l'accesso
|
||||||
aver effettuato l'accesso.
|
.
|
||||||
|
|
||||||
Prenditi un momento per rivedere le altre impostazioni dell'account su quella
|
Prenditi un momento per dare un'occhiata alle altre impostazioni del tuo profilo nella stessa pagina.
|
||||||
pagina.
|
|
||||||
|
|
||||||
Grazie e benventuo su $sitename.
|
Potrest voler aggiungere alcune informazioni di base a quelle predefinite del profilo
|
||||||
|
(nella pagina "Profilo") per rendere agli altri più facile trovarti.
|
||||||
|
|
||||||
Sinceramente,
|
Noi raccomandiamo di impostare il tuo nome completo, di aggiungere una foto,
|
||||||
L'amministratore di $sitename
|
di aggiungere alcune "parole chiavi" (molto utili per farsi nuovi amici) - e
|
||||||
|
magari il paese dove vivi; se non vuoi essere più dettagliato
|
||||||
|
di così.
|
||||||
|
|
||||||
|
Noi rispettiamo il tuo diritto alla privacy e nessuna di queste informazioni è indispensabile.
|
||||||
|
Se ancora non conosci nessuno qui, potrebbe esserti di aiuto
|
||||||
|
per farti nuovi e interessanti amici.
|
||||||
|
|
||||||
|
|
||||||
|
Grazie. Siamo contenti di darti il benvenuto su $[sitename]
|
||||||
|
|
||||||
|
Saluti,
|
||||||
|
l'amministratore di $[sitename]
|
||||||
|
|
||||||
|
|
@ -1,23 +1,25 @@
|
|||||||
|
|
||||||
E' stata ricevuta la richiesta di registrazione di un nuovo utente su
|
Su $[sitename] è stata ricevuta una nuova richiesta di registrazione da parte di un utente che richiede
|
||||||
$sitename che richiede la tua approvazione.
|
la tua approvazione.
|
||||||
|
|
||||||
I dettagli di login sono i seguenti:
|
|
||||||
|
|
||||||
Nome Completo: $username
|
|
||||||
Sito: $siteurl
|
|
||||||
Nome: $email
|
|
||||||
|
|
||||||
|
|
||||||
Per approvare la richiesta, visita il link:
|
I tuoi dati di accesso sono i seguenti:
|
||||||
|
|
||||||
$siteurl/regmod/allow/$hash
|
Nome completo:»$[username]
|
||||||
|
Sito:»$[siteurl]
|
||||||
|
Nome utente:»$[email]
|
||||||
|
|
||||||
|
|
||||||
Per rifiutare la richiesta e rimuovere l'account, visita:
|
Per approvare questa richiesta clicca su:
|
||||||
|
|
||||||
$siteurl/regmod/deny/$hash
|
|
||||||
|
$[siteurl]/regmod/allow/$[hash]
|
||||||
|
|
||||||
|
|
||||||
|
Per negare la richiesta e rimuove il profilo, clicca su:
|
||||||
|
|
||||||
|
|
||||||
|
$[siteurl]/regmod/deny/$[hash]
|
||||||
|
|
||||||
|
|
||||||
Grazie.
|
Grazie.
|
||||||
|
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
|
|
||||||
Caro/a $myname,
|
Ciao $[myname],
|
||||||
|
|
||||||
Hai appena ricevuto una richiesta di connessione su $sitename
|
Hai appena ricevuto una richiesta di connessione da $[sitename]
|
||||||
da '$requestor'.
|
|
||||||
|
|
||||||
Puoi visitare il suo profilo a $url.
|
da '$[requestor]'.
|
||||||
|
|
||||||
Accedi al tuo sito per vedere la completa presentazione e approvare o
|
Puoi visitare il suo profilo su $[url].
|
||||||
ignorare/cancellare la richiesta.
|
|
||||||
|
|
||||||
$siteurl
|
Accedi al tuo sito per vedere la richiesta completa
|
||||||
|
e approva o ignora/annulla la richiesta.
|
||||||
|
|
||||||
|
$[siteurl]
|
||||||
|
|
||||||
Saluti,
|
Saluti,
|
||||||
|
|
||||||
L'amministratore di $sitename
|
l'amministratore di $[sitename]
|
2511
view/it/strings.php
2511
view/it/strings.php
File diff suppressed because it is too large
Load Diff
8863
view/ru/messages.po
8863
view/ru/messages.po
File diff suppressed because it is too large
Load Diff
1930
view/ru/strings.php
1930
view/ru/strings.php
File diff suppressed because it is too large
Load Diff
@ -566,7 +566,7 @@ if ($color=="dark") $color_path = "/diabook-dark/";
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if ($rr['resource-id']){
|
if ($rr['resource_id']){
|
||||||
$post_type = t('photo');
|
$post_type = t('photo');
|
||||||
$m=array(); preg_match("/\[url=([^]]*)\]/", $rr['body'], $m);
|
$m=array(); preg_match("/\[url=([^]]*)\]/", $rr['body'], $m);
|
||||||
$rr['plink'] = $m[1];
|
$rr['plink'] = $m[1];
|
||||||
@ -584,11 +584,11 @@ if ($color=="dark") $color_path = "/diabook-dark/";
|
|||||||
if($close_lastphotos != "1") {
|
if($close_lastphotos != "1") {
|
||||||
$aside['$photos_title'] = t('Last photos');
|
$aside['$photos_title'] = t('Last photos');
|
||||||
$aside['$photos_items'] = array();
|
$aside['$photos_items'] = array();
|
||||||
$r = q("SELECT `photo`.`id`, `photo`.`resource-id`, `photo`.`scale`, `photo`.`desc`, `user`.`nickname`, `user`.`username` FROM
|
$r = q("SELECT `photo`.`id`, `photo`.`resource_id`, `photo`.`scale`, `photo`.`desc`, `user`.`nickname`, `user`.`username` FROM
|
||||||
(SELECT `resource-id`, MAX(`scale`) as maxscale FROM `photo`
|
(SELECT `resource_id`, MAX(`scale`) as maxscale FROM `photo`
|
||||||
WHERE `profile`=0 AND `contact-id`=0 AND `album` NOT IN ('Contact Photos', '%s', 'Profile Photos', '%s')
|
WHERE `profile`=0 AND `contact-id`=0 AND `album` NOT IN ('Contact Photos', '%s', 'Profile Photos', '%s')
|
||||||
AND `allow_cid`='' AND `allow_gid`='' AND `deny_cid`='' AND `deny_gid`='' GROUP BY `resource-id`) AS `t1`
|
AND `allow_cid`='' AND `allow_gid`='' AND `deny_cid`='' AND `deny_gid`='' GROUP BY `resource_id`) AS `t1`
|
||||||
INNER JOIN `photo` ON `photo`.`resource-id`=`t1`.`resource-id` AND `photo`.`scale` = `t1`.`maxscale`,
|
INNER JOIN `photo` ON `photo`.`resource_id`=`t1`.`resource_id` AND `photo`.`scale` = `t1`.`maxscale`,
|
||||||
`user`
|
`user`
|
||||||
WHERE `user`.`uid` = `photo`.`uid`
|
WHERE `user`.`uid` = `photo`.`uid`
|
||||||
AND `user`.`blockwall`=0
|
AND `user`.`blockwall`=0
|
||||||
@ -601,8 +601,8 @@ if ($color=="dark") $color_path = "/diabook-dark/";
|
|||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
$tpl = file_get_contents( dirname(__file__).'/ch_directory_item.tpl');
|
$tpl = file_get_contents( dirname(__file__).'/ch_directory_item.tpl');
|
||||||
foreach($r as $rr) {
|
foreach($r as $rr) {
|
||||||
$photo_page = $a->get_baseurl() . '/photos/' . $rr['nickname'] . '/image/' . $rr['resource-id'];
|
$photo_page = $a->get_baseurl() . '/photos/' . $rr['nickname'] . '/image/' . $rr['resource_id'];
|
||||||
$photo_url = $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['scale'] .'.jpg';
|
$photo_url = $a->get_baseurl() . '/photo/' . $rr['resource_id'] . '-' . $rr['scale'] .'.jpg';
|
||||||
|
|
||||||
$entry = replace_macros($tpl,array(
|
$entry = replace_macros($tpl,array(
|
||||||
'$id' => $rr['id'],
|
'$id' => $rr['id'],
|
||||||
|
@ -518,7 +518,7 @@ div[id$="wrapper"]{height:100%;}div[id$="wrapper"] br{clear:left;}
|
|||||||
.type-text{background-position:-60px 0px;}
|
.type-text{background-position:-60px 0px;}
|
||||||
.type-unkn{background-position:-80px 0;}
|
.type-unkn{background-position:-80px 0;}
|
||||||
.cc-license{margin-top:100px;font-size:0.7em;}
|
.cc-license{margin-top:100px;font-size:0.7em;}
|
||||||
footer{display:block;clear:both;}
|
footer{display:block;clear:both;text-align:center;}
|
||||||
#sectionfooter{margin:1em 0 1em 0;}
|
#sectionfooter{margin:1em 0 1em 0;}
|
||||||
#profile-jot-text{height:20px;color:#eeeecc;background:#2e2f2e;border:1px solid #eeeecc;-o-border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;border-radius:5px;width:99.5%;}
|
#profile-jot-text{height:20px;color:#eeeecc;background:#2e2f2e;border:1px solid #eeeecc;-o-border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;border-radius:5px;width:99.5%;}
|
||||||
#photo-edit-perms-select,#photos-upload-permissions-wrapper,#profile-jot-acl-wrapper{display:block !important;background:#2e2f2e;color:#eeeecc;}
|
#photo-edit-perms-select,#photos-upload-permissions-wrapper,#profile-jot-acl-wrapper{display:block !important;background:#2e2f2e;color:#eeeecc;}
|
||||||
|
@ -518,7 +518,7 @@ div[id$="wrapper"]{height:100%;}div[id$="wrapper"] br{clear:left;}
|
|||||||
.type-text{background-position:-60px 0px;}
|
.type-text{background-position:-60px 0px;}
|
||||||
.type-unkn{background-position:-80px 0;}
|
.type-unkn{background-position:-80px 0;}
|
||||||
.cc-license{margin-top:100px;font-size:0.7em;}
|
.cc-license{margin-top:100px;font-size:0.7em;}
|
||||||
footer{display:block;clear:both;}
|
footer{display:block;clear:both;text-align:center;}
|
||||||
#sectionfooter{margin:1em 0 1em 0;}
|
#sectionfooter{margin:1em 0 1em 0;}
|
||||||
#profile-jot-text{height:20px;color:#666666;background:#cccccc;border:1px solid #111111;-o-border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;border-radius:5px;width:99.5%;}
|
#profile-jot-text{height:20px;color:#666666;background:#cccccc;border:1px solid #111111;-o-border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;border-radius:5px;width:99.5%;}
|
||||||
#photo-edit-perms-select,#photos-upload-permissions-wrapper,#profile-jot-acl-wrapper{display:block !important;background:#eeeeec;color:#111111;}
|
#photo-edit-perms-select,#photos-upload-permissions-wrapper,#profile-jot-acl-wrapper{display:block !important;background:#eeeeec;color:#111111;}
|
||||||
|
@ -241,8 +241,9 @@ nav #nav-link-wrapper .nav-link {
|
|||||||
|
|
||||||
/* footer */
|
/* footer */
|
||||||
footer {
|
footer {
|
||||||
display: none;
|
text-align: right;
|
||||||
|
padding-bottom: 1em;
|
||||||
|
padding-right: 3em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.birthday-today, .event-today {
|
.birthday-today, .event-today {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<div id="nets-sidebar" class="widget">
|
<div id="nets-sidebar" class="widget">
|
||||||
<h3>$title</h3>
|
<h3>$title</h3>
|
||||||
<div id="nets-desc">$desc</div>
|
<div id="nets-desc">$desc</div>
|
||||||
<a href="$base" class="nets-link{{ if $sel_all }} nets-selected{{ endif }} nets-all">$all</a>
|
<a href="$base?nets=all" class="nets-link{{ if $sel_all }} nets-selected{{ endif }} nets-all">$all</a>
|
||||||
<ul class="nets-ul">
|
<ul class="nets-ul">
|
||||||
{{ for $nets as $net }}
|
{{ for $nets as $net }}
|
||||||
<li><a href="$base?nets=$net.ref" class="nets-link{{ if $net.selected }} nets-selected{{ endif }}">$net.name</a></li>
|
<li><a href="$base?nets=$net.ref" class="nets-link{{ if $net.selected }} nets-selected{{ endif }}">$net.name</a></li>
|
||||||
|
Reference in New Issue
Block a user