aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/ConversationObject.php30
-rw-r--r--include/ItemObject.php116
-rw-r--r--include/zot.php2
-rw-r--r--view/theme/redbasic/css/fancy.css12
-rw-r--r--view/theme/redbasic/css/style.css3
-rw-r--r--view/theme/redbasic/php/style.php4
6 files changed, 77 insertions, 90 deletions
diff --git a/include/ConversationObject.php b/include/ConversationObject.php
index 7cf39f757..e3b46ca3f 100644
--- a/include/ConversationObject.php
+++ b/include/ConversationObject.php
@@ -11,12 +11,14 @@ require_once('include/text.php');
/**
* A list of threads
*
- * We should think about making this a SPL Iterator
*/
+
class Conversation extends BaseObject {
private $threads = array();
private $mode = null;
+ private $observer = null;
private $writable = false;
+ private $commentable = false;
private $profile_owner = 0;
private $preview = false;
@@ -34,8 +36,8 @@ class Conversation extends BaseObject {
$a = $this->get_app();
- $observer = $a->get_observer();
- $ob_hash = (($observer) ? $observer['xchan_hash'] : '');
+ $this->observer = $a->get_observer();
+ $ob_hash = (($this->observer) ? $this->observer['xchan_hash'] : '');
switch($mode) {
case 'network':
@@ -63,7 +65,6 @@ class Conversation extends BaseObject {
break;
}
$this->mode = $mode;
-
}
/**
@@ -80,6 +81,10 @@ class Conversation extends BaseObject {
return $this->writable;
}
+ public function is_commentable() {
+ return $this->commentable;
+ }
+
/**
* Check if page is a preview
*/
@@ -101,6 +106,10 @@ class Conversation extends BaseObject {
$this->set_mode($mode);
}
+ public function get_observer() {
+ return $this->observer;
+ }
+
/**
* Add a thread to the conversation
@@ -121,12 +130,21 @@ class Conversation extends BaseObject {
}
/*
- * Only add will be displayed
+ * Only add things that will be displayed
*/
- if(activity_match($item->get_data_value('verb'),ACTIVITY_LIKE) || activity_match($item->get_data_value('verb'),ACTIVITY_DISLIKE)) {
+
+ if(($item->get_data_value('id') != $item->get_data_value('parent')) && (activity_match($item->get_data_value('verb'),ACTIVITY_LIKE) || activity_match($item->get_data_value('verb'),ACTIVITY_DISLIKE))) {
return false;
}
+
+ if(local_user() && $item->get_data_value('uid') == local_user())
+ $this->commentable = true;
+
+ if(($this->observer) && (! $this->writable)) {
+ $this->commentable = can_comment_on_post($this->observer['xchan_hash'],$item['data']);
+ }
+
$item->set_conversation($this);
$this->threads[] = $item;
return end($this->threads);
diff --git a/include/ItemObject.php b/include/ItemObject.php
index e057936ae..a56f66a01 100644
--- a/include/ItemObject.php
+++ b/include/ItemObject.php
@@ -11,12 +11,10 @@ require_once('boot.php');
* An item
*/
class Item extends BaseObject {
- private $data = array();
+ public $data = array();
private $template = 'conv_item.tpl';
private $comment_box_template = 'comment_item.tpl';
private $toplevel = false;
- private $writable = false;
- private $commentable = false;
private $children = array();
private $parent = null;
private $conversation = null;
@@ -34,19 +32,9 @@ class Item extends BaseObject {
$a = $this->get_app();
$this->data = $data;
- $this->channel = $a->get_channel();
- $this->observer = $a->get_observer();
-
$this->toplevel = ($this->get_id() == $this->get_data_value('parent'));
- $this->writable = (((local_user()) && ($this->channel['channel_hash'] === $this->data['owner_xchan'])) ? true : false);
- $this->commentable = $this->writable;
-
- if(($this->observer) && (! $this->writable)) {
- $this->commentable = can_comment_on_post($this->observer['xchan_hash'],$data);
- }
-
// Prepare the children
if(count($data['children'])) {
foreach($data['children'] as $item) {
@@ -106,10 +94,9 @@ class Item extends BaseObject {
else
$edpost = false;
-// FIXME - this is wrong.
-// if(($this->get_data_value('uid') == local_user()) || $this->is_visiting())
-
- if($this->get_data_value('uid') == local_user())
+ if($this->observer['xchan_hash'] == $this->get_data_value('author_xchan')
+ || $this->observer['xchan_hash'] == $this->get_data_value('owner_xchan')
+ || $this->get_data_value('uid') == local_user())
$dropping = true;
if($dropping) {
@@ -175,7 +162,7 @@ class Item extends BaseObject {
);
}
- if($this->is_commentable()) {
+ if($conv->is_commentable()) {
$like = array( t("I like this \x28toggle\x29"), t("like"));
$dislike = array( t("I don't like this \x28toggle\x29"), t("dislike"));
if ($shareable)
@@ -456,28 +443,6 @@ class Item extends BaseObject {
}
/**
- * Check if this is writable
- */
- private function is_writable() {
-
- return $this->writable;
-
-// $conv = $this->get_conversation();
-
-// return true;
-
-// if($conv) {
- // This will allow us to comment on wall-to-wall items owned by our friends
- // and community forums even if somebody else wrote the post.
-// return ($this->writable || ($this->is_visiting() && $conv->get_mode() == 'channel'));
-// }
- }
-
- private function is_commentable() {
- return $this->commentable;
- }
-
- /**
* Count the total of our descendants
*/
private function count_descendants() {
@@ -514,44 +479,43 @@ class Item extends BaseObject {
$comment_box = '';
$conv = $this->get_conversation();
- if(! $this->is_commentable())
+ if(! $conv->is_commentable())
return;
- if($conv->is_writable() || $this->is_writable()) {
- $template = get_markup_template($this->get_comment_box_template());
-
- $a = $this->get_app();
-
- $qc = ((local_user()) ? get_pconfig(local_user(),'system','qcomment') : null);
- $qcomment = (($qc) ? explode("\n",$qc) : null);
-
- $comment_box = replace_macros($template,array(
- '$return_path' => '',
- '$threaded' => $this->is_threaded(),
- '$jsreload' => (($conv->get_mode() === 'display') ? $_SESSION['return_url'] : ''),
- '$type' => (($conv->get_mode() === 'channel') ? 'wall-comment' : 'net-comment'),
- '$id' => $this->get_id(),
- '$parent' => $this->get_id(),
- '$qcomment' => $qcomment,
- '$profile_uid' => $conv->get_profile_owner(),
- '$mylink' => $this->observer['xchan_url'],
- '$mytitle' => t('This is you'),
- '$myphoto' => $this->observer['xchan_photo_s'],
- '$comment' => t('Comment'),
- '$submit' => t('Submit'),
- '$edbold' => t('Bold'),
- '$editalic' => t('Italic'),
- '$eduline' => t('Underline'),
- '$edquote' => t('Quote'),
- '$edcode' => t('Code'),
- '$edimg' => t('Image'),
- '$edurl' => t('Link'),
- '$edvideo' => t('Video'),
- '$preview' => ((feature_enabled($conv->get_profile_owner(),'preview')) ? t('Preview') : ''),
- '$indent' => $indent,
- '$sourceapp' => get_app()->sourcename
- ));
- }
+ $template = get_markup_template($this->get_comment_box_template());
+
+ $a = $this->get_app();
+ $observer = $conv->get_observer();
+
+ $qc = ((local_user()) ? get_pconfig(local_user(),'system','qcomment') : null);
+ $qcomment = (($qc) ? explode("\n",$qc) : null);
+
+ $comment_box = replace_macros($template,array(
+ '$return_path' => '',
+ '$threaded' => $this->is_threaded(),
+ '$jsreload' => (($conv->get_mode() === 'display') ? $_SESSION['return_url'] : ''),
+ '$type' => (($conv->get_mode() === 'channel') ? 'wall-comment' : 'net-comment'),
+ '$id' => $this->get_id(),
+ '$parent' => $this->get_id(),
+ '$qcomment' => $qcomment,
+ '$profile_uid' => $conv->get_profile_owner(),
+ '$mylink' => $observer['xchan_url'],
+ '$mytitle' => t('This is you'),
+ '$myphoto' => $observer['xchan_photo_s'],
+ '$comment' => t('Comment'),
+ '$submit' => t('Submit'),
+ '$edbold' => t('Bold'),
+ '$editalic' => t('Italic'),
+ '$eduline' => t('Underline'),
+ '$edquote' => t('Quote'),
+ '$edcode' => t('Code'),
+ '$edimg' => t('Image'),
+ '$edurl' => t('Link'),
+ '$edvideo' => t('Video'),
+ '$preview' => ((feature_enabled($conv->get_profile_owner(),'preview')) ? t('Preview') : ''),
+ '$indent' => $indent,
+ '$sourceapp' => get_app()->sourcename
+ ));
return $comment_box;
}
diff --git a/include/zot.php b/include/zot.php
index f9b40c06f..6c8a21d1a 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -1354,7 +1354,7 @@ function import_directory_profile($hash,$profile) {
}
else {
$update = true;
- $x = q("insert into xprof (xprof_hash, xprof_desc, xprof_dob, xprof_age, xprof_gender, xprof_marital, xprof_sexual, xprof_locale, xprof_region, xprof_postcode, xprof_country, xprof_keywords) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s') ",
+ $x = q("insert into xprof (xprof_hash, xprof_desc, xprof_dob, xprof_age, xprof_gender, xprof_marital, xprof_sexual, xprof_locale, xprof_region, xprof_postcode, xprof_country, xprof_keywords) values ('%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s') ",
dbesc($arr['xprof_hash']),
dbesc($arr['xprof_desc']),
dbesc($arr['xprof_dob']),
diff --git a/view/theme/redbasic/css/fancy.css b/view/theme/redbasic/css/fancy.css
index eeb822f72..277ea5596 100644
--- a/view/theme/redbasic/css/fancy.css
+++ b/view/theme/redbasic/css/fancy.css
@@ -1,7 +1,7 @@
/* There's probably some stuff in here we don't need, and maybe some missing stuff we do need. We can clean it up incrementaly, just get the heavy lifting done for now */
aside {
-border-radius: 0px 0px 20px 0px;}
+border-radius: $radiuspx;}
.tab {
@@ -9,9 +9,9 @@ border-radius: 0px 0px 20px 0px;}
background-color: #f00;
color: #fff !important;
font-weight: bold;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- border-radius: 20px;
+ -webkit-border-radius: $radiuspx;
+ -moz-border-radius: $radiuspx;
+ border-radius: $radiuspx;
margin: 0;
width: auto;
margin-left: 8px;
@@ -38,7 +38,7 @@ border-radius: 0px 0px 20px 0px;}
.wall-item-content-wrapper {
position: relative;
- border-radius: 10px;
+ border-radius: $radiuspx;
box-shadow: 8px 8px 8px #000;
border: 1px solid #eec;
}
@@ -68,7 +68,7 @@ opacity: 1;
ul.menu-popup {
background: #dd0000;
color: #eec;
- border-radius: 0px 0px 20px 20px;
+ border-radius: $radiuspx;
z-index: 100000;
-webkit-box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7);
-moz-box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7);
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index c2de29548..f9423ac62 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -926,6 +926,9 @@ footer {
.wall-item-content-wrapper {
margin-top: 10px;
position: relative;
+ border-radius: $radiuspx;
+ border: 1px solid #eec;
+
/* background: #fff; */
/* border-radius: 5px; */
/* box-shadow: 12px 12px 12px #111; */
diff --git a/view/theme/redbasic/php/style.php b/view/theme/redbasic/php/style.php
index ec551923a..b90bfe169 100644
--- a/view/theme/redbasic/php/style.php
+++ b/view/theme/redbasic/php/style.php
@@ -54,6 +54,7 @@
// Dark themes are very different - we need to do some of these from scratch, so don't bother setting vars for anything else
if ($colour_scheme === 'dark') {$colour = 'dark'; $navcolour = 'black';}
if ($colour_scheme === 'redbasic'){$navcolour = 'red';}
+ $shadows = false;
}
// This is probably the easiest place to apply global settings. Don't bother with site line height and such. Instead, check pconfig for global user settings.
@@ -133,7 +134,8 @@
if ($displaystyle === "fancy")
{if (file_exists('view/theme/' . current_theme() . '/css/fancy.css')) {
$fancy = (file_get_contents('view/theme/' . current_theme() . '/css/fancy.css'));
- echo "$fancy";}
+ echo str_replace(array('$radius'),array($radius),$fancy);
+ }
}
// Put the # here to force hex colours - if we don't, somebody is going to do something odd, using RGB and we're all going to be confused on the support forums