Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Habeas Codice
2014-11-19 21:11:11 -08:00
17 changed files with 80 additions and 50 deletions

View File

@@ -305,6 +305,12 @@ function dir_parse_query($s) {
$curr['value'] = substr($curr['value'],1);
continue;
}
elseif($curr['value'][0] == '"' && $curr['value'][strlen($curr['value'])-1] == '"') {
$curr['value'] = substr($curr['value'],1,strlen($curr['value'])-2);
$ret[] = $curr;
$curr = array();
continue;
}
else {
$ret[] = $curr;
$curr = array();

View File

@@ -263,26 +263,18 @@ function like_content(&$a) {
else
killme();
$r = q("SELECT * FROM item WHERE verb = '%s' AND item_restrict = 0
$r = q("SELECT id FROM item WHERE verb = '%s' AND item_restrict = 0
AND author_xchan = '%s' AND ( parent = %d OR thr_parent = '%s') LIMIT 1",
dbesc($activity),
dbesc($observer['xchan_hash']),
intval($item_id),
dbesc($item['mid'])
);
if($r) {
$like_item = $r[0];
// Already liked/disliked it, delete it
$r = q("UPDATE item SET item_restrict = ( item_restrict & ~%d ), changed = '%s' WHERE id = %d",
intval(ITEM_DELETED),
dbesc(datetime_convert()),
intval($like_item['id'])
);
proc_run('php',"include/notifier.php","like",$like_item['id']);
// already liked it. Drop that item.
require_once('include/items.php');
drop_item($r[0]['id'],false,DROPITEM_PHASE1);
return;
}

View File

@@ -113,6 +113,7 @@ function mail_content(&$a) {
}
$channel = $a->get_channel();
head_set_icon($channel['xchan_photo_s']);
$cipher = get_pconfig(local_user(),'system','default_cipher');
@@ -163,13 +164,16 @@ function mail_content(&$a) {
$tpl = get_markup_template('msg-header.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array(
$header = replace_macros($tpl, array(
'$baseurl' => $a->get_baseurl(true),
'$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
'$nickname' => $channel['channel_address'],
'$linkurl' => t('Please enter a link URL:'),
'$expireswhen' => t('Expires YYYY-MM-DD HH:MM')
));
$a->page['htmlhead'] .= $header;
$preselect = (isset($a->argv[2])?array($a->argv[2]):false);
$prename = $preurl = $preid = '';
@@ -276,7 +280,7 @@ function mail_content(&$a) {
$tpl = get_markup_template('msg-header.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array(
'$nickname' => $channel['channel_addr'],
'$nickname' => $channel['channel_address'],
'$baseurl' => $a->get_baseurl(true),
'$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
'$linkurl' => t('Please enter a link URL:'),

View File

@@ -952,6 +952,7 @@ function photos_content(&$a) {
'lockstate' => $lockstate[0],
'help_tags' => t('Example: @bob, @Barbara_Jensen, @jim@example.com'),
'item_id' => ((count($linked_items)) ? $link_item['id'] : 0),
'adult_enabled' => feature_enabled($owner_uid,'adult_photo_flagging'),
'adult' => array('adult',t('Flag as adult in album view'), (($ph[0]['photo_flags'] & PHOTO_ADULT) ? 1 : 0),''),
'submit' => t('Submit'),
'delete' => t('Delete Photo')
@@ -1175,7 +1176,7 @@ function photos_content(&$a) {
$r = q("SELECT p.resource_id, p.id, p.filename, p.type, p.album, p.scale, p.created FROM photo p INNER JOIN
(SELECT resource_id, max(scale) scale FROM photo
WHERE uid=%d AND album != '%s' AND album != '%s'
AND (photo_flags = %d or photo_flags = %d ) $sql_extra group by resource_id) ph
AND (photo_flags = %d or ( photo_flags & %d ) > 0 ) $sql_extra group by resource_id) ph
ON (p.resource_id = ph.resource_id and p.scale = ph.scale) ORDER by p.created DESC LIMIT %d OFFSET %d",
intval($a->data['channel']['channel_id']),
dbesc('Contact Photos'),

View File

@@ -8,6 +8,7 @@ require_once('include/photos.php');
function wall_upload_post(&$a) {
$using_api = ((x($_FILES,'media')) ? true : false);
if($using_api) {