aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorroot <root@bawker.net>2014-05-10 10:55:50 -0700
committerroot <root@bawker.net>2014-05-10 10:55:50 -0700
commit80796c78f5326c670893476fe8e9024c30ebffcc (patch)
tree9be350288804ab8fa46e2ce10043c91e5c97672f /include
parent711719ce0ce340fbcda7559bf20582e85e4b1e3d (diff)
parent481b4c21c9ab6e7e6df8f65ef97135fb5807d7fd (diff)
downloadvolse-hubzilla-80796c78f5326c670893476fe8e9024c30ebffcc.tar.gz
volse-hubzilla-80796c78f5326c670893476fe8e9024c30ebffcc.tar.bz2
volse-hubzilla-80796c78f5326c670893476fe8e9024c30ebffcc.zip
Merge branch 'master' of https://github.com/chriswinstead/red
Diffstat (limited to 'include')
-rw-r--r--include/ItemObject.php15
-rw-r--r--include/bbcode.php24
-rwxr-xr-xinclude/text.php18
-rw-r--r--include/zot.php6
4 files changed, 57 insertions, 6 deletions
diff --git a/include/ItemObject.php b/include/ItemObject.php
index 2922ee473..36070335d 100644
--- a/include/ItemObject.php
+++ b/include/ItemObject.php
@@ -123,6 +123,14 @@ class Item extends BaseObject {
$location = format_location($item);
+ $like_count = ((x($alike,$item['mid'])) ? $alike[$item['mid']] : '');
+ $like_list = ((x($alike,$item['mid'])) ? $alike[$item['mid'] . '-l'] : '');
+ $like_button_label = ((x($alike,$item['mid'])) && ($alike[$item['mid']] < 2 ) ? t('like') : t('likes'));
+ if (feature_enabled($conv->get_profile_owner(),'dislike')) {
+ $dislike_count = ((x($dlike,$item['mid'])) ? $dlike[$item['mid']] : '');
+ $dislike_list = ((x($dlike,$item['mid'])) ? $dlike[$item['mid'] . '-l'] : '');
+ $dislike_button_label = ((x($dlike,$item['mid'])) && ($dlike[$item['mid']] < 2) ? t('dislike') : t('dislikes'));
+ }
$showlike = ((x($alike,$item['mid'])) ? format_like($alike[$item['mid']],$alike[$item['mid'] . '-l'],'like',$item['mid']) : '');
$showdislike = ((x($dlike,$item['mid']) && feature_enabled($conv->get_profile_owner(),'dislike'))
@@ -251,7 +259,12 @@ class Item extends BaseObject {
'drop' => $drop,
'multidrop' => ((feature_enabled($conv->get_profile_owner(),'multi_delete')) ? $multidrop : ''),
// end toolbar buttons
-
+ 'like_count' => $like_count,
+ 'like_list' => $like_list,
+ 'like_button_label' => $like_button_label,
+ 'dislike_count' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike_count : ''),
+ 'dislike_list' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike_list : ''),
+ 'dislike_button_label' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike_button_label : ''),
'showlike' => $showlike,
'showdislike' => $showdislike,
'comment' => $this->get_comment_box($indent),
diff --git a/include/bbcode.php b/include/bbcode.php
index 92d979638..d89ae8485 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -507,6 +507,30 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
$Text = preg_replace("(\[size=(\d*?)\](.*?)\[\/size\])ism","<span style=\"font-size: $1px;\">$2</span>",$Text);
$Text = preg_replace("(\[size=(.*?)\](.*?)\[\/size\])ism","<span style=\"font-size: $1;\">$2</span>",$Text);
}
+ // Check for h1
+ if (strpos($Text,'[h1]') !== false) {
+ $Text = preg_replace("(\[h1\](.*?)\[\/h1\])ism",'<h1>$1</h1>',$Text);
+ }
+ // Check for h2
+ if (strpos($Text,'[h2]') !== false) {
+ $Text = preg_replace("(\[h2\](.*?)\[\/h2\])ism",'<h2>$1</h2>',$Text);
+ }
+ // Check for h3
+ if (strpos($Text,'[h3]') !== false) {
+ $Text = preg_replace("(\[h3\](.*?)\[\/h3\])ism",'<h3>$1</h3>',$Text);
+ }
+ // Check for h4
+ if (strpos($Text,'[h4]') !== false) {
+ $Text = preg_replace("(\[h4\](.*?)\[\/h4\])ism",'<h4>$1</h4>',$Text);
+ }
+ // Check for h5
+ if (strpos($Text,'[h5]') !== false) {
+ $Text = preg_replace("(\[h5\](.*?)\[\/h5\])ism",'<h5>$1</h5>',$Text);
+ }
+ // Check for h6
+ if (strpos($Text,'[h6]') !== false) {
+ $Text = preg_replace("(\[h6\](.*?)\[\/h6\])ism",'<h6>$1</h6>',$Text);
+ }
// Check for centered text
if (strpos($Text,'[/center]') !== false) {
$Text = preg_replace("(\[center\](.*?)\[\/center\])ism","<div style=\"text-align:center;\">$1</div>",$Text);
diff --git a/include/text.php b/include/text.php
index b36e550f9..0e136fe8e 100755
--- a/include/text.php
+++ b/include/text.php
@@ -705,12 +705,22 @@ function contact_block() {
if($shown == 0)
return;
+
+ $is_owner = ((local_user() && local_user() == $a->profile['uid']) ? true : false);
+
+ $abook_flags = ABOOK_FLAG_PENDING|ABOOK_FLAG_SELF;
+ $xchan_flags = XCHAN_FLAGS_ORPHAN|XCHAN_FLAGS_DELETED;
+ if(! $is_owner) {
+ $abook_flags = $abook_flags | ABOOK_FLAGS_HIDDEN;
+ $xchan_flags = $xchan_flags | XCHAN_FLAGS_HIDDEN;
+ }
+
if((! is_array($a->profile)) || ($a->profile['hide_friends']))
return $o;
$r = q("SELECT COUNT(abook_id) AS total FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d and not ( abook_flags & %d ) and not (xchan_flags & %d)",
intval($a->profile['uid']),
- intval(ABOOK_FLAG_HIDDEN|ABOOK_FLAG_PENDING|ABOOK_FLAG_SELF),
- intval(XCHAN_FLAGS_HIDDEN|XCHAN_FLAGS_ORPHAN|XCHAN_FLAGS_DELETED)
+ intval($abook_flags),
+ intval($xchan_flags)
);
if(count($r)) {
$total = intval($r[0]['total']);
@@ -723,8 +733,8 @@ function contact_block() {
$r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash WHERE abook_channel = %d AND not ( abook_flags & %d) and not (xchan_flags & %d ) ORDER BY RAND() LIMIT %d",
intval($a->profile['uid']),
- intval(ABOOK_FLAG_HIDDEN|ABOOK_FLAG_PENDING|ABOOK_FLAG_SELF),
- intval(XCHAN_FLAGS_HIDDEN|XCHAN_FLAGS_ORPHAN|XCHAN_FLAGS_DELETED),
+ intval($abook_flags),
+ intval($xchan_flags),
intval($shown)
);
diff --git a/include/zot.php b/include/zot.php
index c919b0981..9e69aea96 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -171,6 +171,10 @@ function zot_finger($webbie,$channel,$autofallback = true) {
return array('success' => false);
}
+ // potential issue here; the xchan_addr points to the primary hub.
+ // The webbie we were called with may not, so it might not be found
+ // unless we query for hubloc_addr instead of xchan_addr
+
$r = q("select xchan.*, hubloc.* from xchan
left join hubloc on xchan_hash = hubloc_hash
where xchan_addr = '%s' and (hubloc_flags & %d) limit 1",
@@ -1453,7 +1457,7 @@ function process_delivery($sender,$arr,$deliveries,$relay,$public = false) {
if((x($arr,'obj_type')) && (activity_match($arr['obj_type'],ACTIVITY_OBJ_EVENT))) {
require_once('include/event.php');
$ev = bbtoevent($arr['body']);
- if(x($ev,'desc') && x($ev,'start')) {
+ if(x($ev,'description') && x($ev,'start')) {
$ev['event_xchan'] = $arr['author_xchan'];
$ev['uid'] = $channel['channel_id'];
$ev['account'] = $channel['channel_account_id'];