aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorHabeas Codice <habeascodice@federated.social>2014-11-19 21:11:11 -0800
committerHabeas Codice <habeascodice@federated.social>2014-11-19 21:11:11 -0800
commitc8af19c69c03b39d5eded833a2d9d8ed9ab5826c (patch)
tree16ded6330f1baa9d8e889978c9e093f1e90d7d85 /mod
parent92d0a9404ff92da23b558f9a73a3150f97b6a08e (diff)
parent18cae8a78cb3df8ffcd9e4787c3b572c799036da (diff)
downloadvolse-hubzilla-c8af19c69c03b39d5eded833a2d9d8ed9ab5826c.tar.gz
volse-hubzilla-c8af19c69c03b39d5eded833a2d9d8ed9ab5826c.tar.bz2
volse-hubzilla-c8af19c69c03b39d5eded833a2d9d8ed9ab5826c.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mod')
-rw-r--r--mod/dirsearch.php6
-rwxr-xr-xmod/like.php18
-rw-r--r--mod/mail.php8
-rw-r--r--mod/photos.php3
-rw-r--r--mod/wall_upload.php1
5 files changed, 20 insertions, 16 deletions
diff --git a/mod/dirsearch.php b/mod/dirsearch.php
index 52d953707..56e2378a8 100644
--- a/mod/dirsearch.php
+++ b/mod/dirsearch.php
@@ -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();
diff --git a/mod/like.php b/mod/like.php
index b56611197..04a2b43cd 100755
--- a/mod/like.php
+++ b/mod/like.php
@@ -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']);
+ if($r) {
+ // already liked it. Drop that item.
+ require_once('include/items.php');
+ drop_item($r[0]['id'],false,DROPITEM_PHASE1);
return;
}
diff --git a/mod/mail.php b/mod/mail.php
index dacb181c5..6c778b956 100644
--- a/mod/mail.php
+++ b/mod/mail.php
@@ -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:'),
diff --git a/mod/photos.php b/mod/photos.php
index ab848c709..7a9229cc4 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -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'),
diff --git a/mod/wall_upload.php b/mod/wall_upload.php
index 97840a180..7ed1859a8 100644
--- a/mod/wall_upload.php
+++ b/mod/wall_upload.php
@@ -8,6 +8,7 @@ require_once('include/photos.php');
function wall_upload_post(&$a) {
+
$using_api = ((x($_FILES,'media')) ? true : false);
if($using_api) {