Merge remote-tracking branch 'upstream/develop' into develop

This commit is contained in:
Andy H 2017-12-07 14:35:19 +07:00
commit b21703f778
11 changed files with 12693 additions and 12753 deletions

View file

@ -1,25 +0,0 @@
<?php
/**
* General purpose landing page for plugins/addons
*/
use Friendica\App;
function cb_init(App $a) {
call_hooks('cb_init');
}
function cb_post(App $a) {
call_hooks('cb_post', $_POST);
}
function cb_afterpost(App $a) {
call_hooks('cb_afterpost');
}
function cb_content(App $a) {
$o = '';
call_hooks('cb_content', $o);
return $o;
}

View file

@ -1,147 +0,0 @@
<?php
use Friendica\App;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
require_once('include/security.php');
require_once('include/bbcode.php');
require_once('include/items.php');
function mood_init(App $a) {
if (! local_user()) {
return;
}
$uid = local_user();
$verb = notags(trim($_GET['verb']));
if(! $verb)
return;
$verbs = get_mood_verbs();
if(! in_array($verb,$verbs))
return;
$activity = ACTIVITY_MOOD . '#' . urlencode($verb);
$parent = ((x($_GET,'parent')) ? intval($_GET['parent']) : 0);
logger('mood: verb ' . $verb, LOGGER_DEBUG);
if($parent) {
$r = q("select uri, private, allow_cid, allow_gid, deny_cid, deny_gid
from item where id = %d and parent = %d and uid = %d limit 1",
intval($parent),
intval($parent),
intval($uid)
);
if (DBM::is_result($r)) {
$parent_uri = $r[0]['uri'];
$private = $r[0]['private'];
$allow_cid = $r[0]['allow_cid'];
$allow_gid = $r[0]['allow_gid'];
$deny_cid = $r[0]['deny_cid'];
$deny_gid = $r[0]['deny_gid'];
}
}
else {
$private = 0;
$allow_cid = $a->user['allow_cid'];
$allow_gid = $a->user['allow_gid'];
$deny_cid = $a->user['deny_cid'];
$deny_gid = $a->user['deny_gid'];
}
$poster = $a->contact;
$uri = item_new_uri($a->get_hostname(),$uid);
$action = sprintf( t('%1$s is currently %2$s'), '[url=' . $poster['url'] . ']' . $poster['name'] . '[/url]' , $verbs[$verb]);
$arr = array();
$arr['guid'] = get_guid(32);
$arr['uid'] = $uid;
$arr['uri'] = $uri;
$arr['parent-uri'] = (($parent_uri) ? $parent_uri : $uri);
$arr['type'] = 'activity';
$arr['wall'] = 1;
$arr['contact-id'] = $poster['id'];
$arr['owner-name'] = $poster['name'];
$arr['owner-link'] = $poster['url'];
$arr['owner-avatar'] = $poster['thumb'];
$arr['author-name'] = $poster['name'];
$arr['author-link'] = $poster['url'];
$arr['author-avatar'] = $poster['thumb'];
$arr['title'] = '';
$arr['allow_cid'] = $allow_cid;
$arr['allow_gid'] = $allow_gid;
$arr['deny_cid'] = $deny_cid;
$arr['deny_gid'] = $deny_gid;
$arr['last-child'] = 1;
$arr['visible'] = 1;
$arr['verb'] = $activity;
$arr['private'] = $private;
$arr['origin'] = 1;
$arr['body'] = $action;
$item_id = item_store($arr);
if($item_id) {
q("UPDATE `item` SET `plink` = '%s' WHERE `uid` = %d AND `id` = %d",
dbesc(System::baseUrl() . '/display/' . $poster['nickname'] . '/' . $item_id),
intval($uid),
intval($item_id)
);
Worker::add(PRIORITY_HIGH, "Notifier", "tag", $item_id);
}
call_hooks('post_local_end', $arr);
Worker::add(PRIORITY_HIGH, "Notifier", "like", $post_id);
return;
}
function mood_content(App $a) {
if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
$parent = ((x($_GET,'parent')) ? intval($_GET['parent']) : '0');
$verbs = get_mood_verbs();
$shortlist = array();
foreach($verbs as $k => $v)
if($v !== 'NOTRANSLATION')
$shortlist[] = array($k,$v);
$tpl = get_markup_template('mood_content.tpl');
$o = replace_macros($tpl,array(
'$title' => t('Mood'),
'$desc' => t('Set your current mood and tell your friends'),
'$verbs' => $shortlist,
'$parent' => $parent,
'$submit' => t('Submit'),
));
return $o;
}

View file

@ -1,29 +0,0 @@
<?php
use Friendica\App;
use Friendica\Core\System;
require_once("include/nav.php");
function navigation_content(App $a) {
$nav_info = nav_info($a);
/**
* Build the page
*/
$tpl = get_markup_template('navigation.tpl');
return replace_macros($tpl, array(
'$baseurl' => System::baseUrl(),
'$sitelocation' => $nav_info['sitelocation'],
'$nav' => $nav_info['nav'],
'$banner' => $nav_info['banner'],
'$emptynotifications' => t('Nothing new here'),
'$userinfo' => $nav_info['userinfo'],
'$sel' => $a->nav_sel,
'$apps' => $a->apps,
'$clear_notifs' => t('Clear notifications')
));
}

View file

@ -1,54 +0,0 @@
<?php
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Database\DBM;
function qsearch_init(App $a) {
if (! local_user()) {
killme();
}
$limit = (Config::get('system','qsearch_limit') ? intval(Config::get('system','qsearch_limit')) : 100);
$search = ((x($_GET,'s')) ? notags(trim(urldecode($_GET['s']))) : '');
if(! strlen($search))
killme();
if($search)
$search = dbesc($search);
$results = array();
$r = q("SELECT * FROM `group` WHERE `name` REGEXP '$search' AND `deleted` = 0 AND `uid` = %d LIMIT 0, %d ",
intval(local_user()),
intval($limit)
);
if (DBM::is_result($r)) {
foreach($r as $rr)
$results[] = array( 0, (int) $rr['id'], $rr['name'], '', '');
}
$sql_extra = ((strlen($search)) ? " AND (`name` REGEXP '$search' OR `nick` REGEXP '$search') " : "");
$r = q("SELECT * FROM `contact` WHERE `uid` = %d $sql_extra ORDER BY `name` ASC LIMIT 0, %d ",
intval(local_user()),
intval($limit)
);
if (DBM::is_result($r)) {
foreach($r as $rr)
$results[] = array( (int) $rr['id'], 0, $rr['name'],$rr['url'],$rr['photo']);
}
echo json_encode((object) $results);
killme();
}

View file

@ -1,7 +0,0 @@
<?php
use Friendica\App;
function session_content(App $a) {
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,21 +0,0 @@
<h3>{{$title}}</h3>
<div id="mood-desc">{{$desc}}</div>
<form action="mood" method="get">
<br />
<br />
<input id="mood-parent" type="hidden" value="{{$parent}}" name="parent" />
<select name="verb" id="mood-verb-select" >
{{foreach $verbs as $v}}
<option value="{{$v.0}}">{{$v.1}}</option>
{{/foreach}}
</select>
<br />
<br />
<input type="submit" name="submit" value="{{$submit|escape:'html'}}" />
</form>

View file

@ -1,104 +0,0 @@
{{*
# LOGIN/REGISTER
*}}
<center>
{{* Use nested if's since the Friendica template engine doesn't support AND or OR in if statements *}}
{{if $nav.login}}
<div id="navigation-login-wrapper" >
{{else}}
{{if $nav.register}}
<div id="navigation-login-wrapper" >
{{/if}}
{{/if}}
{{if $nav.login}}<a id="navigation-login-link" class="navigation-link {{$nav.login.2}}" href="{{$nav.login.0}}" title="{{$nav.login.3}}" >{{$nav.login.1}}</a><br/> {{/if}}
{{if $nav.register}}<a id="navigation-register-link" class="navigation-link {{$nav.register.2}} {{$sel.register}}" href="{{$nav.register.0}}" title="{{$nav.register.3}}" >{{$nav.register.1}}</a><br/>{{/if}}
{{if $nav.login}}
</div>
{{else}}
{{if $nav.register}}
</div>
{{/if}}
{{/if}}
{{*
# NETWORK/HOME
*}}
{{if $nav.network}}
<div id="navigation-network-wrapper" >
{{else}}
{{if $nav.home}}
<div id="navigation-network-wrapper" >
{{else}}
{{if $nav.community}}
<div id="navigation-network-wrapper" >
{{/if}}
{{/if}}
{{/if}}
{{if $nav.network}}
<a id="navigation-network-link" class="navigation-link navigation-commlink {{$nav.network.2}} {{$sel.network}}" href="{{$nav.network.0}}" title="{{$nav.network.3}}" >{{$nav.network.1}}</a><br/>
<a class="navigation-link navigation-commlink" href="{{$nav.net_reset.0}}" title="{{$nav.net_reset.3}}">{{$nav.net_reset.1}}</a><br/>
{{/if}}
{{if $nav.home}}
<a id="navigation-home-link" class="navigation-link navigation-commlink {{$nav.home.2}} {{$sel.home}}" href="{{$nav.home.0}}" title="{{$nav.home.3}}" >{{$nav.home.1}}</a><br/>
{{/if}}
{{if $nav.community}}
<a id="navigation-community-link" class="navigation-link navigation-commlink {{$nav.community.2}} {{$sel.community}}" href="{{$nav.community.0}}" title="{{$nav.community.3}}" >{{$nav.community.1}}</a><br/>
{{/if}}
{{if $nav.network}}
</div>
{{else}}
{{if $nav.home}}
</div>
{{else}}
{{if $nav.community}}
</div>
{{/if}}
{{/if}}
{{/if}}
{{*
# PRIVATE MESSAGES
*}}
{{if $nav.messages}}
<div id="navigation-messages-wrapper">
<a id="navigation-messages-link" class="navigation-link navigation-commlink {{$nav.messages.2}} {{$sel.messages}}" href="{{$nav.messages.0}}" title="{{$nav.messages.3}}" >{{$nav.messages.1}}</a><br/>
</div>
{{/if}}
{{*
# CONTACTS
*}}
<div id="navigation-contacts-wrapper">
{{if $nav.contacts}}<a id="navigation-contacts-link" class="navigation-link {{$nav.contacts.2}}" href="{{$nav.contacts.0}}" title="{{$nav.contacts.3}}" >{{$nav.contacts.1}}</a><br/>{{/if}}
<a id="navigation-directory-link" class="navigation-link {{$nav.directory.2}}" href="{{$nav.directory.0}}" title="{{$nav.directory.3}}" >{{$nav.directory.1}}</a><br/>
{{if $nav.introductions}}
<a id="navigation-notify-link" class="navigation-link navigation-commlink {{$nav.introductions.2}} {{$sel.introductions}}" href="{{$nav.introductions.0}}" title="{{$nav.introductions.3}}" >{{$nav.introductions.1}}</a><br/>
{{/if}}
</div>
{{*
# NOTIFICATIONS
*}}
{{if $nav.notifications}}
<div id="navigation-notifications-wrapper">
<a id="navigation-notifications-link" class="navigation-link navigation-commlink" href="{{$nav.notifications.0}}" rel="#navigation-notifications-menu" title="{{$nav.notifications.1}}">{{$nav.notifications.1}}</a><br/>
</div>
{{/if}}
{{*
# MISCELLANEOUS
*}}
<div id="navigation-misc-wrapper">
{{if $nav.settings}}<a id="navigation-settings-link" class="navigation-link {{$nav.settings.2}}" href="{{$nav.settings.0}}" title="{{$nav.settings.3}}">{{$nav.settings.1}}</a><br/>{{/if}}
{{if $nav.manage}}<a id="navigation-manage-link" class="navigation-link navigation-commlink {{$nav.manage.2}} {{$sel.manage}}" href="{{$nav.manage.0}}" title="{{$nav.manage.3}}">{{$nav.manage.1}}</a><br/>{{/if}}
{{if $nav.profiles}}<a id="navigation-profiles-link" class="navigation-link {{$nav.profiles.2}}" href="{{$nav.profiles.0}}" title="{{$nav.profiles.3}}" >{{$nav.profiles.1}}</a><br/>{{/if}}
{{if $nav.admin}}<a id="navigation-admin-link" class="navigation-link {{$nav.admin.2}}" href="{{$nav.admin.0}}" title="{{$nav.admin.3}}" >{{$nav.admin.1}}</a><br/>{{/if}}
<a id="navigation-search-link" class="navigation-link {{$nav.search.2}}" href="{{$nav.search.0}}" title="{{$nav.search.3}}" >{{$nav.search.1}}</a><br/>
{{if $nav.apps}}<a id="navigation-apps-link" class="navigation-link {{$nav.apps.2}}" href="{{$nav.apps.0}}" title="{{$nav.apps.3}}" >{{$nav.apps.1}}</a><br/>{{/if}}
{{if $nav.help}} <a id="navigation-help-link" class="navigation-link {{$nav.help.2}}" target="friendica-help" href="{{$nav.help.0}}" title="{{$nav.help.3}}" >{{$nav.help.1}}</a><br/>{{/if}}
</div>
{{if $nav.logout}}<a id="navigation-logout-link" class="navigation-link {{$nav.logout.2}}" href="{{$nav.logout.0}}" title="{{$nav.logout.3}}" >{{$nav.logout.1}}</a><br/>{{/if}}
</center>