return;
}
-
+
$ret = find_diaspora_person_by_handle($sender_handle);
$datarray['uid'] = $importer['uid'];
$datarray['contact-id'] = $contact['id'];
$datarray['wall'] = 0;
+ $datarray['network'] = NETWORK_DIASPORA;
$datarray['guid'] = $guid;
$datarray['uri'] = $datarray['parent-uri'] = $message_id;
$datarray['created'] = $datarray['edited'] = datetime_convert('UTC','UTC',$created);
$datarray['uid'] = $importer['uid'];
$datarray['contact-id'] = $contact['id'];
$datarray['wall'] = 0;
+ $datarray['network'] = NETWORK_DIASPORA;
$datarray['guid'] = $guid;
$datarray['uri'] = $datarray['parent-uri'] = $message_id;
$datarray['created'] = $datarray['edited'] = datetime_convert('UTC','UTC',$created);
$datarray = array();
-
+
$datarray['uid'] = $importer['uid'];
$datarray['contact-id'] = $contact['id'];
$datarray['wall'] = 0;
+ $datarray['network'] = NETWORK_DIASPORA;
$datarray['guid'] = $guid;
$datarray['uri'] = $datarray['parent-uri'] = $message_id;
$datarray['created'] = $datarray['edited'] = datetime_convert('UTC','UTC',$created);
$datarray['author-link'] = $contact['url'];
$datarray['author-avatar'] = $contact['thumb'];
$datarray['body'] = $body;
-
+
$datarray['app'] = 'Diaspora/Cubbi.es';
$message_id = item_store($datarray);
$datarray['contact-id'] = $contact['id'];
$datarray['type'] = 'remote-comment';
$datarray['wall'] = $parent_item['wall'];
+ $datarray['network'] = NETWORK_DIASPORA;
$datarray['gravity'] = GRAVITY_COMMENT;
$datarray['guid'] = $guid;
$datarray['uri'] = $message_id;
$datarray['tag'] = $str_tags;
// We can't be certain what the original app is if the message is relayed.
- if(($parent_item['origin']) && (! $parent_author_signature))
+ if(($parent_item['origin']) && (! $parent_author_signature))
$datarray['app'] = 'Diaspora';
$message_id = item_store($datarray);
$arr['uri'] = $uri;
$arr['uid'] = $importer['uid'];
$arr['guid'] = $guid;
+ $arr['network'] = NETWORK_DIASPORA;
$arr['contact-id'] = $contact['id'];
$arr['type'] = 'activity';
$arr['wall'] = $parent_item['wall'];
$arr['author-name'] = $person['name'];
$arr['author-link'] = $person['url'];
$arr['author-avatar'] = ((x($person,'thumb')) ? $person['thumb'] : $person['photo']);
-
+
$ulink = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
$alink = '[url=' . $parent_item['author-link'] . ']' . $parent_item['author-name'] . '[/url]';
$plink = '[url=' . $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $parent_item['id'] . ']' . $post_type . '[/url]';
}
$arr = array();
+ $arr["network"] = NETWORK_OSTATUS;
$arr["uri"] = $single_conv->id;
$arr["plink"] = $single_conv->id;
$arr["uid"] = $message["uid"];
$info[$k]=$v;
}
}
-
+
}
}
-
+
}
return $info;
}}
if (! function_exists('uninstall_theme')){
function uninstall_theme($theme){
logger("Addons: uninstalling theme " . $theme);
-
+
@include_once("view/theme/$theme/theme.php");
if(function_exists("{$theme}_uninstall")) {
$func = "{$theme}_uninstall";
return '';
}
- $r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
+ $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
`contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`,
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
if($r) {
$item_uri = $r[0]['uri'];
- $r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
+ $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
`contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`,
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
/**
*
* This is the POST destination for most all locally posted
- * text stuff. This function handles status, wall-to-wall status,
- * local comments, and remote coments that are posted on this site
+ * text stuff. This function handles status, wall-to-wall status,
+ * local comments, and remote coments that are posted on this site
* (as opposed to being delivered in a feed).
- * Also processed here are posts and comments coming through the
- * statusnet/twitter API.
- * All of these become an "item" which is our basic unit of
+ * Also processed here are posts and comments coming through the
+ * statusnet/twitter API.
+ * All of these become an "item" which is our basic unit of
* information.
- * Posts that originate externally or do not fall into the above
- * posting categories go through item_store() instead of this function.
+ * Posts that originate externally or do not fall into the above
+ * posting categories go through item_store() instead of this function.
*
- */
+ */
require_once('include/crypto.php');
require_once('include/enotify.php');
$body = escape_tags(trim($_REQUEST['body']));
$private = $orig_post['private'];
$pubmail_enable = $orig_post['pubmail'];
+ $network = $orig_post['network'];
}
else {
$verb = notags(trim($_REQUEST['verb']));
$emailcc = notags(trim($_REQUEST['emailcc']));
$body = escape_tags(trim($_REQUEST['body']));
+ $network = notags(trim($_REQUEST['network']));
$naked_body = preg_replace('/\[(.+?)\]/','',$body);
if($parent_item) {
$private = 0;
+ // for non native networks use the network of the original post as network of the item
+ if (($parent_item['network'] != NETWORK_DIASPORA)
+ AND ($parent_item['network'] != NETWORK_OSTATUS)
+ AND ($network == ""))
+ $network = $parent_item['network'];
+
if(($parent_item['private'])
|| strlen($parent_item['allow_cid'])
|| strlen($parent_item['allow_gid'])
$str_contact_deny = $parent_item['deny_cid'];
$str_group_deny = $parent_item['deny_gid'];
}
-
$pubmail_enable = ((x($_REQUEST,'pubmail_enable') && intval($_REQUEST['pubmail_enable']) && (! $private)) ? 1 : 0);
// if using the API, we won't see pubmail_enable - figure out if it should be set
&& ($parent_contact['nick']) && (! in_array('@' . $parent_contact['nick'],$tags))) {
$body = '@' . $parent_contact['nick'] . ' ' . $body;
$tags[] = '@' . $parent_contact['nick'];
- }
+ }
$tagged = array();
if(! strlen($verb))
$verb = ACTIVITY_POST ;
+ if ($network == "")
+ $network = NETWORK_DFRN;
+
$gravity = (($parent) ? 6 : 0 );
// even if the post arrived via API we are considering that it
// originated on this site by default for determining relayability.
$origin = ((x($_REQUEST,'origin')) ? intval($_REQUEST['origin']) : 1);
-
+
$notify_type = (($parent) ? 'comment-new' : 'wall-new' );
$uri = (($message_id) ? $message_id : item_new_uri($a->get_hostname(),$profile_uid));
$datarray['type'] = $post_type;
$datarray['wall'] = $wall;
$datarray['gravity'] = $gravity;
+ $datarray['network'] = $network;
$datarray['contact-id'] = $contact_id;
$datarray['owner-name'] = $contact_record['name'];
$datarray['owner-link'] = $contact_record['url'];
$post_id = 0;
- $r = q("INSERT INTO `item` (`guid`, `uid`,`type`,`wall`,`gravity`,`contact-id`,`owner-name`,`owner-link`,`owner-avatar`,
+ $r = q("INSERT INTO `item` (`guid`, `uid`,`type`,`wall`,`gravity`, `network`, `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`, `location`, `coord`,
`tag`, `inform`, `verb`, `postopts`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`, `private`, `pubmail`, `attach`, `bookmark`,`origin`, `moderated`, `file` )
- VALUES( '%s', %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, %d, '%s', %d, %d, %d, '%s' )",
+ VALUES( '%s', %d, '%s', %d, %d, '%s', %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, %d, '%s', %d, %d, %d, '%s' )",
dbesc($datarray['guid']),
intval($datarray['uid']),
dbesc($datarray['type']),
intval($datarray['wall']),
intval($datarray['gravity']),
+ dbesc($datarray['network']),
intval($datarray['contact-id']),
dbesc($datarray['owner-name']),
dbesc($datarray['owner-link']),
if(count($r)) {
$profile = $r[0]['url'];
//set newname to nick, find alias
- if($r[0]['network'] === 'stat') {
+ if(($r[0]['network'] === NETWORK_OSTATUS) OR ($r[0]['network'] === NETWORK_TWITTER)) {
$newname = $r[0]['nick'];
$stat = true;
if($r[0]['alias'])
if($nouveau) {
// "New Item View" - show all items unthreaded in reverse created date order
- $items = q("SELECT `item`.*, `item`.`id` AS `item_id`,
+ $items = q("SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`writable`,
`contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
// Fetch a page full of parent items for this page
if($update) {
- $r = q("SELECT `item`.`parent` AS `item_id`, `contact`.`uid` AS `contact_uid`
+ $r = q("SELECT `item`.`parent` AS `item_id`, `item`.`network` AS `item_network`, `contact`.`uid` AS `contact_uid`
FROM $sql_table LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND
(`item`.`deleted` = 0 OR item.verb = '" . ACTIVITY_LIKE ."' OR item.verb = '" . ACTIVITY_DISLIKE . "')
);
}
else {
- $r = q("SELECT `item`.`id` AS `item_id`, `contact`.`uid` AS `contact_uid`
+ $r = q("SELECT `item`.`id` AS `item_id`, `item`.`network` AS `item_network`, `contact`.`uid` AS `contact_uid`
FROM $sql_table LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
AND `item`.`moderated` = 0 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
foreach ($parents_arr AS $parents_str) {
- $thread_items = q("SELECT `item`.*, `item`.`id` AS `item_id`,
+ $thread_items = q("SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`rel`, `contact`.`writable`,
`contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
if($update) {
- $r = q("SELECT distinct(parent) AS `item_id`, `contact`.`uid` AS `contact-uid`
+ $r = q("SELECT distinct(parent) AS `item_id`, `item`.`network` AS `item_network`,
+ `contact`.`uid` AS `contact-uid`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND
(`item`.`deleted` = 0 OR item.verb = '" . ACTIVITY_LIKE ."' OR item.verb = '" . ACTIVITY_DISLIKE . "')
// FROM `item` FORCE INDEX (created, uid) LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
- $r = q("SELECT `item`.`id` AS `item_id`, `contact`.`uid` AS `contact-uid`
+ $r = q("SELECT `item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
+ `contact`.`uid` AS `contact-uid`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
and `item`.`moderated` = 0 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
$parents_arr[] = $rr['item_id'];
$parents_str = implode(', ', $parents_arr);
- $items = q("SELECT `item`.*, `item`.`id` AS `item_id`,
+ $items = q("SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`network`, `contact`.`rel`,
`contact`.`thumb`, `contact`.`self`, `contact`.`writable`,
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
'wait' => t('Please wait'),
'thread_level' => $thread_level,
'postopts' => $langstr,
- 'edited' => $edited
+ 'edited' => $edited,
+ 'network' => $item["item_network"],
+ 'network_name' => network_to_name($item['item_network']),
);
$arr = array('item' => $item, 'output' => $tmp_item);
padding-left: 58px;
}
-div.jGrowl div.jGrowl-notification {
- margin-top: 40px;
+div.jGrowl.top-right {
+ top: 40px;
+ z-index: 90;
}
/* header */
top: 0px;
padding: 0px;
padding-left: 0px;
- background: #2d2d2d;
+ /* background: #2d2d2d; */
+ background: rgb(36, 76, 94);
/*background: #364A84;
background: -moz-linear-gradient(top, #516499 0%, #364a84 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#516499), color-stop(100%,#364a84));
color: #999;
font-size: 12px;
}
+
+.wall-item-network {
+ color: #999;
+ font-size: 12px;
+ text-align: right;
+ float: right;
+}
+
.wall-item-location {
width: 350px;
float: left;
.shiny {
/* border-right: 10px solid #fce94f; */
- border-right: 1px solid #A7C7F7;
- padding-right: 12px;
+/* border-right: 1px solid #A7C7F7;
+ padding-right: 12px; */
}
#profile-jot-form #profile-jot-text {
{{if $item.plink}}<a title="{{$item.plink.title}}" href="{{$item.plink.href}}" style="color: #999">{{$item.ago}}</a>{{else}} {{$item.ago}} {{/if}}
{{if $item.lock}}<span class="fakelink" style="color: #999" onclick="lockview(event,{{$item.id}});">{{$item.lock}}</span> {{/if}}
</span>
+ <span class="wall-item-network">
+ {{$item.network_name}}
+ </span>
</div>
<div itemprop="description" class="wall-item-content">
function vier_init(&$a) {
set_template_engine($a, 'smarty3');
+$baseurl = $a->get_baseurl();
+
$a->theme_info = array();
$a->page['htmlhead'] .= <<< EOT
+<script type="text/javascript" src="$baseurl/view/theme/vier/js/jquery.divgrow-1.3.1.f1.min.js"></script>
<script>
+
+function collapseHeight(elems) {
+ var elemName = '.wall-item-body:not(.divmore)';
+ if(typeof elems != 'undefined') {
+ elemName = elems + ' ' + elemName;
+ }
+ $(elemName).each(function() {
+ if($(this).height() > 450) {
+ $('html').height($('html').height());
+ $(this).divgrow({ initialHeight: 400, showBrackets: false, speed: 0 });
+ $(this).addClass('divmore');
+ $('html').height('auto');
+ }
+ });
+}
+
function insertFormatting(comment,BBcode,id) {
var tmpStr = $("#comment-edit-text-" + id).val();
selected = document.selection.createRange();
if (BBcode == "url"){
selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
- } else
+ } else
selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
} else if (textarea.selectionStart || textarea.selectionStart == "0") {
var start = textarea.selectionStart;
function cmtBbClose(id) {
$("#comment-edit-bb-" + id).hide();
}
-
-/*
-$(document).ready(function() {
-
-$('html').click(function() { $("#nav-notifications-menu" ).hide(); });
-
-$('.group-edit-icon').hover(
- function() {
- $(this).addClass('icon'); $(this).removeClass('iconspacer');},
- function() {
- $(this).removeClass('icon'); $(this).addClass('iconspacer');}
- );
-
-$('.sidebar-group-element').hover(
- function() {
- id = $(this).attr('id');
- $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
-
- function() {
- id = $(this).attr('id');
- $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
- );
-
-
-$('.savedsearchdrop').hover(
- function() {
- $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
- function() {
- $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
- );
-
-$('.savedsearchterm').hover(
- function() {
- id = $(this).attr('id');
- $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
-
- function() {
- id = $(this).attr('id');
- $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
- );
-
-});
-
-*/
</script>
EOT;
}