mirror of
https://github.com/friendica/friendica
synced 2025-03-15 19:48:26 +00:00
Merge develop into 1006-short-info
Conflicts: view/theme/frio/js/theme.js
This commit is contained in:
commit
d39f679230
9 changed files with 183 additions and 136 deletions
44
.gitignore
vendored
44
.gitignore
vendored
|
@ -1,44 +0,0 @@
|
||||||
favicon.*
|
|
||||||
.htconfig.php
|
|
||||||
.htpreconfig.php
|
|
||||||
\#*
|
|
||||||
include/jquery-1.4.2.min.js
|
|
||||||
*.log
|
|
||||||
*.out
|
|
||||||
*.version*
|
|
||||||
favicon.*
|
|
||||||
home.html
|
|
||||||
addon
|
|
||||||
*~
|
|
||||||
robots.txt
|
|
||||||
|
|
||||||
#ignore documentation, it should be newly built
|
|
||||||
doc/html
|
|
||||||
|
|
||||||
#ignore reports, should be generted with every build
|
|
||||||
report/
|
|
||||||
|
|
||||||
#ignore config files from eclipse, we don't want IDE files in our repository
|
|
||||||
.project
|
|
||||||
.buildpath
|
|
||||||
.externalToolBuilders
|
|
||||||
.settings
|
|
||||||
#ignore OSX .DS_Store files
|
|
||||||
.DS_Store
|
|
||||||
|
|
||||||
/nbproject/private/
|
|
||||||
|
|
||||||
#ignore smarty cache
|
|
||||||
/view/smarty3/compiled/
|
|
||||||
|
|
||||||
#ignore cache folders
|
|
||||||
/privacy_image_cache/
|
|
||||||
/photo/
|
|
||||||
/proxy/
|
|
||||||
nbproject
|
|
||||||
|
|
||||||
#ignore vagrant dir
|
|
||||||
.vagrant/
|
|
||||||
|
|
||||||
#ignore local folder
|
|
||||||
/local/
|
|
12
INSTALL.txt
12
INSTALL.txt
|
@ -154,18 +154,6 @@ Friendica also supports a number on non-standard headers in common use.
|
||||||
X-Forwarded-Ssl: on
|
X-Forwarded-Ssl: on
|
||||||
|
|
||||||
It is however preferable to use the standard approach if configuring a new server.
|
It is however preferable to use the standard approach if configuring a new server.
|
||||||
In Nginx, this can be done as follows (assuming Friendica runs on port 8080).
|
|
||||||
|
|
||||||
location / {
|
|
||||||
if ( $scheme != https ) { # Force Redirect to HTTPS
|
|
||||||
return 302 https://$host$uri;
|
|
||||||
}
|
|
||||||
proxy_pass http://localhost:8080;
|
|
||||||
proxy_redirect off;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header Forwarded "for=$proxy_add_x_forwarded_for; proto=$scheme";
|
|
||||||
}
|
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
|
|
133
mod/admin.php
133
mod/admin.php
|
@ -165,7 +165,7 @@ function admin_content(&$a) {
|
||||||
|
|
||||||
/* get plugins admin page */
|
/* get plugins admin page */
|
||||||
|
|
||||||
$r = q("SELECT `name` FROM `addon` WHERE `plugin_admin`=1 ORDER BY `name`");
|
$r = q("SELECT `name` FROM `addon` WHERE `plugin_admin` = 1 ORDER BY `name`");
|
||||||
$aside_tools['plugins_admin']=array();
|
$aside_tools['plugins_admin']=array();
|
||||||
foreach ($r as $h){
|
foreach ($r as $h){
|
||||||
$plugin =$h['name'];
|
$plugin =$h['name'];
|
||||||
|
@ -271,7 +271,7 @@ function admin_page_federation(&$a) {
|
||||||
// displayed on the stats page.
|
// displayed on the stats page.
|
||||||
$platforms = array('Friendica', 'Diaspora', '%%red%%', 'Hubzilla', 'GNU Social', 'StatusNet');
|
$platforms = array('Friendica', 'Diaspora', '%%red%%', 'Hubzilla', 'GNU Social', 'StatusNet');
|
||||||
$colors = array('Friendica' => '#ffc018', // orange from the logo
|
$colors = array('Friendica' => '#ffc018', // orange from the logo
|
||||||
'Diaspora' => '#a1a1a1', // logo is black and white, makes a gray
|
'Diaspora' => '#a1a1a1', // logo is black and white, makes a gray
|
||||||
'%%red%%' => '#c50001', // fire red from the logo
|
'%%red%%' => '#c50001', // fire red from the logo
|
||||||
'Hubzilla' => '#43488a', // blue from the logo
|
'Hubzilla' => '#43488a', // blue from the logo
|
||||||
'GNU Social'=> '#a22430', // dark red from the logo
|
'GNU Social'=> '#a22430', // dark red from the logo
|
||||||
|
@ -282,17 +282,17 @@ function admin_page_federation(&$a) {
|
||||||
foreach ($platforms as $p) {
|
foreach ($platforms as $p) {
|
||||||
// get a total count for the platform, the name and version of the
|
// get a total count for the platform, the name and version of the
|
||||||
// highest version and the protocol tpe
|
// highest version and the protocol tpe
|
||||||
$c = q('SELECT count(*) AS total, platform, network, version FROM gserver
|
$c = q('SELECT COUNT(*) AS `total`, `platform`, `network`, `version` FROM `gserver`
|
||||||
WHERE platform LIKE "%s" AND last_contact > last_failure AND `version` != ""
|
WHERE `platform` LIKE "%s" AND `last_contact` > `last_failure` AND `version` != ""
|
||||||
ORDER BY version ASC;', $p);
|
ORDER BY `version` ASC;', $p);
|
||||||
$total = $total + $c[0]['total'];
|
$total = $total + $c[0]['total'];
|
||||||
|
|
||||||
// what versions for that platform do we know at all?
|
// what versions for that platform do we know at all?
|
||||||
// again only the active nodes
|
// again only the active nodes
|
||||||
$v = q('SELECT count(*) AS total, version FROM gserver
|
$v = q('SELECT COUNT(*) AS `total, version` FROM `gserver`
|
||||||
WHERE last_contact > last_failure AND platform LIKE "%s" AND `version` != ""
|
WHERE `last_contact` > `last_failure` AND `platform` LIKE "%s" AND `version` != ""
|
||||||
GROUP BY version
|
GROUP BY `version`
|
||||||
ORDER BY version;', $p);
|
ORDER BY `version`;', $p);
|
||||||
|
|
||||||
//
|
//
|
||||||
// clean up version numbers
|
// clean up version numbers
|
||||||
|
@ -386,7 +386,10 @@ function admin_page_federation(&$a) {
|
||||||
*/
|
*/
|
||||||
function admin_page_queue(&$a) {
|
function admin_page_queue(&$a) {
|
||||||
// get content from the queue table
|
// get content from the queue table
|
||||||
$r = q("SELECT c.name,c.nurl,q.id,q.network,q.created,q.last from queue as q, contact as c where c.id=q.cid order by q.cid, q.created;");
|
$r = q("SELECT `c`.`name`, `c`.`nurl`, `q`.`id`, `q`.`network`, `q`.`created`, `q`.`last`
|
||||||
|
FROM `queue` AS `q`, `contact` AS `c`
|
||||||
|
WHERE `c`.`id` = `q`.`cid`
|
||||||
|
ORDER BY `q`.`cid`, `q`.`created`;");
|
||||||
|
|
||||||
$t = get_markup_template("admin_queue.tpl");
|
$t = get_markup_template("admin_queue.tpl");
|
||||||
return replace_macros($t, array(
|
return replace_macros($t, array(
|
||||||
|
@ -416,7 +419,7 @@ function admin_page_queue(&$a) {
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function admin_page_summary(&$a) {
|
function admin_page_summary(&$a) {
|
||||||
$r = q("SELECT `page-flags`, COUNT(uid) as `count` FROM `user` GROUP BY `page-flags`");
|
$r = q("SELECT `page-flags`, COUNT(`uid`) AS `count` FROM `user` GROUP BY `page-flags`");
|
||||||
$accounts = array(
|
$accounts = array(
|
||||||
array(t('Normal Account'), 0),
|
array(t('Normal Account'), 0),
|
||||||
array(t('Soapbox Account'), 0),
|
array(t('Soapbox Account'), 0),
|
||||||
|
@ -431,21 +434,21 @@ function admin_page_summary(&$a) {
|
||||||
|
|
||||||
logger('accounts: '.print_r($accounts,true),LOGGER_DATA);
|
logger('accounts: '.print_r($accounts,true),LOGGER_DATA);
|
||||||
|
|
||||||
$r = q("SELECT COUNT(id) as `count` FROM `register`");
|
$r = q("SELECT COUNT(`id`) AS `count` FROM `register`");
|
||||||
$pending = $r[0]['count'];
|
$pending = $r[0]['count'];
|
||||||
|
|
||||||
$r = q("select count(*) as total from deliverq where 1");
|
$r = q("SELECT COUNT(*) AS `total` FROM `deliverq` WHERE 1");
|
||||||
$deliverq = (($r) ? $r[0]['total'] : 0);
|
$deliverq = (($r) ? $r[0]['total'] : 0);
|
||||||
|
|
||||||
$r = q("select count(*) as total from queue where 1");
|
$r = q("SELECT COUNT(*) AS `total` FROM `queue` WHERE 1");
|
||||||
$queue = (($r) ? $r[0]['total'] : 0);
|
$queue = (($r) ? $r[0]['total'] : 0);
|
||||||
|
|
||||||
if (get_config('system','worker')) {
|
if (get_config('system','worker')) {
|
||||||
$r = q("select count(*) as total from workerqueue where 1");
|
$r = q("SELECT COUNT(*) AS `total` FROM `workerqueue` WHERE 1");
|
||||||
$workerqueue = (($r) ? $r[0]['total'] : 0);
|
$workerqueue = (($r) ? $r[0]['total'] : 0);
|
||||||
} else {
|
} else {
|
||||||
$workerqueue = 0;
|
$workerqueue = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We can do better, but this is a quick queue status
|
// We can do better, but this is a quick queue status
|
||||||
|
|
||||||
|
@ -543,7 +546,7 @@ function admin_page_site_post(&$a) {
|
||||||
set_config('system','url',$new_url);
|
set_config('system','url',$new_url);
|
||||||
|
|
||||||
// send relocate
|
// send relocate
|
||||||
$users = q("SELECT uid FROM user WHERE account_removed = 0 AND account_expired = 0");
|
$users = q("SELECT `uid` FROM `user` WHERE `account_removed` = 0 AND `account_expired` = 0");
|
||||||
|
|
||||||
foreach ($users as $user) {
|
foreach ($users as $user) {
|
||||||
proc_run('php', 'include/notifier.php', 'relocate', $user['uid']);
|
proc_run('php', 'include/notifier.php', 'relocate', $user['uid']);
|
||||||
|
@ -558,10 +561,10 @@ function admin_page_site_post(&$a) {
|
||||||
$sitename = ((x($_POST,'sitename')) ? notags(trim($_POST['sitename'])) : '');
|
$sitename = ((x($_POST,'sitename')) ? notags(trim($_POST['sitename'])) : '');
|
||||||
$hostname = ((x($_POST,'hostname')) ? notags(trim($_POST['hostname'])) : '');
|
$hostname = ((x($_POST,'hostname')) ? notags(trim($_POST['hostname'])) : '');
|
||||||
$sender_email = ((x($_POST,'sender_email')) ? notags(trim($_POST['sender_email'])) : '');
|
$sender_email = ((x($_POST,'sender_email')) ? notags(trim($_POST['sender_email'])) : '');
|
||||||
$banner = ((x($_POST,'banner')) ? trim($_POST['banner']) : false);
|
$banner = ((x($_POST,'banner')) ? trim($_POST['banner']) : false);
|
||||||
$shortcut_icon = ((x($_POST,'shortcut_icon')) ? notags(trim($_POST['shortcut_icon'])) : '');
|
$shortcut_icon = ((x($_POST,'shortcut_icon')) ? notags(trim($_POST['shortcut_icon'])) : '');
|
||||||
$touch_icon = ((x($_POST,'touch_icon')) ? notags(trim($_POST['touch_icon'])) : '');
|
$touch_icon = ((x($_POST,'touch_icon')) ? notags(trim($_POST['touch_icon'])) : '');
|
||||||
$info = ((x($_POST,'info')) ? trim($_POST['info']) : false);
|
$info = ((x($_POST,'info')) ? trim($_POST['info']) : false);
|
||||||
$language = ((x($_POST,'language')) ? notags(trim($_POST['language'])) : '');
|
$language = ((x($_POST,'language')) ? notags(trim($_POST['language'])) : '');
|
||||||
$theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : '');
|
$theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : '');
|
||||||
$theme_mobile = ((x($_POST,'theme_mobile')) ? notags(trim($_POST['theme_mobile'])) : '');
|
$theme_mobile = ((x($_POST,'theme_mobile')) ? notags(trim($_POST['theme_mobile'])) : '');
|
||||||
|
@ -647,41 +650,41 @@ function admin_page_site_post(&$a) {
|
||||||
|
|
||||||
if($ssl_policy != intval(get_config('system','ssl_policy'))) {
|
if($ssl_policy != intval(get_config('system','ssl_policy'))) {
|
||||||
if($ssl_policy == SSL_POLICY_FULL) {
|
if($ssl_policy == SSL_POLICY_FULL) {
|
||||||
q("update `contact` set
|
q("UPDATE `contact` SET
|
||||||
`url` = replace(`url` , 'http:' , 'https:'),
|
`url` = REPLACE(`url` , 'http:' , 'https:'),
|
||||||
`photo` = replace(`photo` , 'http:' , 'https:'),
|
`photo` = REPLACE(`photo` , 'http:' , 'https:'),
|
||||||
`thumb` = replace(`thumb` , 'http:' , 'https:'),
|
`thumb` = REPLACE(`thumb` , 'http:' , 'https:'),
|
||||||
`micro` = replace(`micro` , 'http:' , 'https:'),
|
`micro` = REPLACE(`micro` , 'http:' , 'https:'),
|
||||||
`request` = replace(`request`, 'http:' , 'https:'),
|
`request` = REPLACE(`request`, 'http:' , 'https:'),
|
||||||
`notify` = replace(`notify` , 'http:' , 'https:'),
|
`notify` = REPLACE(`notify` , 'http:' , 'https:'),
|
||||||
`poll` = replace(`poll` , 'http:' , 'https:'),
|
`poll` = REPLACE(`poll` , 'http:' , 'https:'),
|
||||||
`confirm` = replace(`confirm`, 'http:' , 'https:'),
|
`confirm` = REPLACE(`confirm`, 'http:' , 'https:'),
|
||||||
`poco` = replace(`poco` , 'http:' , 'https:')
|
`poco` = REPLACE(`poco` , 'http:' , 'https:')
|
||||||
where `self` = 1"
|
WHERE `self` = 1"
|
||||||
);
|
);
|
||||||
q("update `profile` set
|
q("UPDATE `profile` SET
|
||||||
`photo` = replace(`photo` , 'http:' , 'https:'),
|
`photo` = REPLACE(`photo` , 'http:' , 'https:'),
|
||||||
`thumb` = replace(`thumb` , 'http:' , 'https:')
|
`thumb` = REPLACE(`thumb` , 'http:' , 'https:')
|
||||||
where 1 "
|
WHERE 1 "
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
elseif($ssl_policy == SSL_POLICY_SELFSIGN) {
|
elseif($ssl_policy == SSL_POLICY_SELFSIGN) {
|
||||||
q("update `contact` set
|
q("UPDATE `contact` SET
|
||||||
`url` = replace(`url` , 'https:' , 'http:'),
|
`url` = REPLACE(`url` , 'https:' , 'http:'),
|
||||||
`photo` = replace(`photo` , 'https:' , 'http:'),
|
`photo` = REPLACE(`photo` , 'https:' , 'http:'),
|
||||||
`thumb` = replace(`thumb` , 'https:' , 'http:'),
|
`thumb` = REPLACE(`thumb` , 'https:' , 'http:'),
|
||||||
`micro` = replace(`micro` , 'https:' , 'http:'),
|
`micro` = REPLACE(`micro` , 'https:' , 'http:'),
|
||||||
`request` = replace(`request`, 'https:' , 'http:'),
|
`request` = REPLACE(`request`, 'https:' , 'http:'),
|
||||||
`notify` = replace(`notify` , 'https:' , 'http:'),
|
`notify` = REPLACE(`notify` , 'https:' , 'http:'),
|
||||||
`poll` = replace(`poll` , 'https:' , 'http:'),
|
`poll` = REPLACE(`poll` , 'https:' , 'http:'),
|
||||||
`confirm` = replace(`confirm`, 'https:' , 'http:'),
|
`confirm` = REPLACE(`confirm`, 'https:' , 'http:'),
|
||||||
`poco` = replace(`poco` , 'https:' , 'http:')
|
`poco` = REPLACE(`poco` , 'https:' , 'http:')
|
||||||
where `self` = 1"
|
WHERE `self` = 1"
|
||||||
);
|
);
|
||||||
q("update `profile` set
|
q("UPDATE `profile` SET
|
||||||
`photo` = replace(`photo` , 'https:' , 'http:'),
|
`photo` = REPLACE(`photo` , 'https:' , 'http:'),
|
||||||
`thumb` = replace(`thumb` , 'https:' , 'http:')
|
`thumb` = REPLACE(`thumb` , 'https:' , 'http:')
|
||||||
where 1 "
|
WHERE 1 "
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -876,7 +879,7 @@ function admin_page_site(&$a) {
|
||||||
/* get user names to make the install a personal install of X */
|
/* get user names to make the install a personal install of X */
|
||||||
$user_names = array();
|
$user_names = array();
|
||||||
$user_names['---'] = t('Multi user instance');
|
$user_names['---'] = t('Multi user instance');
|
||||||
$users = q("SELECT username, nickname FROM `user`");
|
$users = q("SELECT `username`, `nickname` FROM `user`");
|
||||||
foreach ($users as $user) {
|
foreach ($users as $user) {
|
||||||
$user_names[$user['nickname']] = $user['username'];
|
$user_names[$user['nickname']] = $user['username'];
|
||||||
}
|
}
|
||||||
|
@ -1084,7 +1087,7 @@ function admin_page_dbsync(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$failed = array();
|
$failed = array();
|
||||||
$r = q("select k, v from config where `cat` = 'database' ");
|
$r = q("SELECT `k`, `v` FROM `config` WHERE `cat` = 'database' ");
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
foreach($r as $rr) {
|
foreach($r as $rr) {
|
||||||
$upd = intval(substr($rr['k'],7));
|
$upd = intval(substr($rr['k'],7));
|
||||||
|
@ -1123,7 +1126,7 @@ function admin_page_users_post(&$a){
|
||||||
$pending = (x($_POST, 'pending') ? $_POST['pending'] : array());
|
$pending = (x($_POST, 'pending') ? $_POST['pending'] : array());
|
||||||
$users = (x($_POST, 'user') ? $_POST['user'] : array());
|
$users = (x($_POST, 'user') ? $_POST['user'] : array());
|
||||||
$nu_name = (x($_POST, 'new_user_name') ? $_POST['new_user_name'] : '');
|
$nu_name = (x($_POST, 'new_user_name') ? $_POST['new_user_name'] : '');
|
||||||
$nu_nickname = (x($_POST, 'new_user_nickname') ? $_POST['new_user_nickname'] : '');
|
$nu_nickname = (x($_POST, 'new_user_nickname') ? $_POST['new_user_nickname'] : '');
|
||||||
$nu_email = (x($_POST, 'new_user_email') ? $_POST['new_user_email'] : '');
|
$nu_email = (x($_POST, 'new_user_email') ? $_POST['new_user_email'] : '');
|
||||||
|
|
||||||
check_form_security_token_redirectOnErr('/admin/users', 'admin_users');
|
check_form_security_token_redirectOnErr('/admin/users', 'admin_users');
|
||||||
|
@ -1180,7 +1183,7 @@ function admin_page_users_post(&$a){
|
||||||
|
|
||||||
if(x($_POST,'page_users_block')) {
|
if(x($_POST,'page_users_block')) {
|
||||||
foreach($users as $uid){
|
foreach($users as $uid){
|
||||||
q("UPDATE `user` SET `blocked`=1-`blocked` WHERE `uid`=%s",
|
q("UPDATE `user` SET `blocked` = 1-`blocked` WHERE `uid` = %s",
|
||||||
intval($uid)
|
intval($uid)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1225,7 +1228,7 @@ function admin_page_users_post(&$a){
|
||||||
function admin_page_users(&$a){
|
function admin_page_users(&$a){
|
||||||
if($a->argc>2) {
|
if($a->argc>2) {
|
||||||
$uid = $a->argv[3];
|
$uid = $a->argv[3];
|
||||||
$user = q("SELECT username, blocked FROM `user` WHERE `uid`=%d", intval($uid));
|
$user = q("SELECT `username`, `blocked` FROM `user` WHERE `uid` = %d", intval($uid));
|
||||||
if(count($user)==0) {
|
if(count($user)==0) {
|
||||||
notice('User not found'.EOL);
|
notice('User not found'.EOL);
|
||||||
goaway('admin/users');
|
goaway('admin/users');
|
||||||
|
@ -1242,7 +1245,7 @@ function admin_page_users(&$a){
|
||||||
}; break;
|
}; break;
|
||||||
case "block":{
|
case "block":{
|
||||||
check_form_security_token_redirectOnErr('/admin/users', 'admin_users', 't');
|
check_form_security_token_redirectOnErr('/admin/users', 'admin_users', 't');
|
||||||
q("UPDATE `user` SET `blocked`=%d WHERE `uid`=%s",
|
q("UPDATE `user` SET `blocked` = %d WHERE `uid` = %s",
|
||||||
intval(1-$user[0]['blocked']),
|
intval(1-$user[0]['blocked']),
|
||||||
intval($uid)
|
intval($uid)
|
||||||
);
|
);
|
||||||
|
@ -1262,7 +1265,7 @@ function admin_page_users(&$a){
|
||||||
|
|
||||||
|
|
||||||
/* get users */
|
/* get users */
|
||||||
$total = q("SELECT count(*) as total FROM `user` where 1");
|
$total = q("SELECT COUNT(*) AS `total` FROM `user` WHERE 1");
|
||||||
if(count($total)) {
|
if(count($total)) {
|
||||||
$a->set_pager_total($total[0]['total']);
|
$a->set_pager_total($total[0]['total']);
|
||||||
$a->set_pager_itemspage(100);
|
$a->set_pager_itemspage(100);
|
||||||
|
@ -1855,11 +1858,11 @@ function admin_page_logs_post(&$a) {
|
||||||
function admin_page_logs(&$a){
|
function admin_page_logs(&$a){
|
||||||
|
|
||||||
$log_choices = array(
|
$log_choices = array(
|
||||||
LOGGER_NORMAL => 'Normal',
|
LOGGER_NORMAL => 'Normal',
|
||||||
LOGGER_TRACE => 'Trace',
|
LOGGER_TRACE => 'Trace',
|
||||||
LOGGER_DEBUG => 'Debug',
|
LOGGER_DEBUG => 'Debug',
|
||||||
LOGGER_DATA => 'Data',
|
LOGGER_DATA => 'Data',
|
||||||
LOGGER_ALL => 'All'
|
LOGGER_ALL => 'All'
|
||||||
);
|
);
|
||||||
|
|
||||||
$t = get_markup_template("admin_logs.tpl");
|
$t = get_markup_template("admin_logs.tpl");
|
||||||
|
|
|
@ -33,6 +33,7 @@ function dirfind_content(&$a, $prefix = "") {
|
||||||
|
|
||||||
if(strpos($search,'@') === 0) {
|
if(strpos($search,'@') === 0) {
|
||||||
$search = substr($search,1);
|
$search = substr($search,1);
|
||||||
|
$header = sprintf( t('People Search - %s'), $search);
|
||||||
if ((valid_email($search) AND validate_email($search)) OR
|
if ((valid_email($search) AND validate_email($search)) OR
|
||||||
(substr(normalise_link($search), 0, 7) == "http://")) {
|
(substr(normalise_link($search), 0, 7) == "http://")) {
|
||||||
$user_data = probe_url($search);
|
$user_data = probe_url($search);
|
||||||
|
@ -43,6 +44,7 @@ function dirfind_content(&$a, $prefix = "") {
|
||||||
if(strpos($search,'!') === 0) {
|
if(strpos($search,'!') === 0) {
|
||||||
$search = substr($search,1);
|
$search = substr($search,1);
|
||||||
$community = true;
|
$community = true;
|
||||||
|
$header = sprintf( t('Forum Search - %s'), $search);
|
||||||
}
|
}
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
@ -227,7 +229,7 @@ function dirfind_content(&$a, $prefix = "") {
|
||||||
$tpl = get_markup_template('viewcontact_template.tpl');
|
$tpl = get_markup_template('viewcontact_template.tpl');
|
||||||
|
|
||||||
$o .= replace_macros($tpl,array(
|
$o .= replace_macros($tpl,array(
|
||||||
'title' => sprintf( t('People Search - %s'), $search),
|
'title' => $header,
|
||||||
'$contacts' => $entries,
|
'$contacts' => $entries,
|
||||||
'$paginate' => paginate($a),
|
'$paginate' => paginate($a),
|
||||||
));
|
));
|
||||||
|
|
30
mods/sample-nginx-reverse-proxy.config
Normal file
30
mods/sample-nginx-reverse-proxy.config
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
#
|
||||||
|
# Example of NGINX as reverse-proxy terminating an HTTPS connection.
|
||||||
|
#
|
||||||
|
# This is not a complete NGINX config.
|
||||||
|
#
|
||||||
|
# Please refer to NGINX docs
|
||||||
|
#
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
server {
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
# assuming Friendica runs on port 8080
|
||||||
|
location / {
|
||||||
|
if ( $scheme != https ) {
|
||||||
|
# Force Redirect to HTTPS
|
||||||
|
return 302 https://$host$uri;
|
||||||
|
}
|
||||||
|
proxy_pass http://localhost:8080;
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header Forwarded "for=$proxy_add_x_forwarded_for; proto=$scheme";
|
||||||
|
}
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
}
|
|
@ -581,6 +581,9 @@ nav.navbar a {
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
padding: 10px 15px;
|
padding: 10px 15px;
|
||||||
}
|
}
|
||||||
|
#search-mobile .navbar-form {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
#topbar-first #search-box .form-search {
|
#topbar-first #search-box .form-search {
|
||||||
height: 25px;
|
height: 25px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
|
@ -1577,6 +1580,11 @@ img.acpopup-img {
|
||||||
/*margin-left: -15px;*/
|
/*margin-left: -15px;*/
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
#tabmenu .search-heading {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
ul.tabs {
|
ul.tabs {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
@ -1707,6 +1715,15 @@ ul.dropdown-menu li:hover {
|
||||||
color: $link_color;
|
color: $link_color;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
|
.search-content-wrapper > #search-header-wrapper {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.search-content-wrapper > .section-title-wrapper {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#navbar-button > #search-save-form > #search-save {
|
||||||
|
margin-top: 3px;
|
||||||
|
}
|
||||||
/* Section-Content-Wrapper */
|
/* Section-Content-Wrapper */
|
||||||
#search-header-wrapper {
|
#search-header-wrapper {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
|
|
|
@ -40,7 +40,7 @@ $(document).ready(function(){
|
||||||
$(".field.select > select, .field.custom > select").addClass("form-control");
|
$(".field.select > select, .field.custom > select").addClass("form-control");
|
||||||
|
|
||||||
// move the tabbar to the second nav bar
|
// move the tabbar to the second nav bar
|
||||||
if( $("ul.tabbar")) {
|
if( $("ul.tabbar").length ) {
|
||||||
$("ul.tabbar").appendTo("#topbar-second > .container > #tabmenu");
|
$("ul.tabbar").appendTo("#topbar-second > .container > #tabmenu");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ $(document).ready(function(){
|
||||||
// to the friendica logo (the mask is in nav.tpl at the botom). To make it work we need to apply the
|
// to the friendica logo (the mask is in nav.tpl at the botom). To make it work we need to apply the
|
||||||
// correct url. The only way which comes to my mind was to do this with js
|
// correct url. The only way which comes to my mind was to do this with js
|
||||||
// So we apply the correct url (with the link to the id of the mask) after the page is loaded.
|
// So we apply the correct url (with the link to the id of the mask) after the page is loaded.
|
||||||
if($("#logo-img")) {
|
if($("#logo-img").length ) {
|
||||||
var pageurl = "url('" + window.location.href + "#logo-mask')";
|
var pageurl = "url('" + window.location.href + "#logo-mask')";
|
||||||
$("#logo-img").css({"mask": pageurl});
|
$("#logo-img").css({"mask": pageurl});
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ $(document).ready(function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
// add Jot botton to the scecond navbar
|
// add Jot botton to the scecond navbar
|
||||||
if( $("section #jotOpen")) {
|
if( $("section #jotOpen").length ) {
|
||||||
$("section #jotOpen").appendTo("#topbar-second > .container > #navbar-button");
|
$("section #jotOpen").appendTo("#topbar-second > .container > #navbar-button");
|
||||||
if( $("#jot-popup").is(":hidden")) $("#topbar-second > .container > #navbar-button #jotOpen").hide();
|
if( $("#jot-popup").is(":hidden")) $("#topbar-second > .container > #navbar-button #jotOpen").hide();
|
||||||
}
|
}
|
||||||
|
@ -94,13 +94,6 @@ $(document).ready(function(){
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// add search-heading to the scecond navbar
|
|
||||||
if( $(".search-heading")) {
|
|
||||||
$(".search-heading").appendTo("#topbar-second > .container > #tabmenu");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//$('ul.flex-nav').flexMenu();
|
//$('ul.flex-nav').flexMenu();
|
||||||
|
|
||||||
|
@ -120,6 +113,47 @@ $(document).ready(function(){
|
||||||
// initialize the bootstrap-select
|
// initialize the bootstrap-select
|
||||||
$('.selectpicker').selectpicker();
|
$('.selectpicker').selectpicker();
|
||||||
|
|
||||||
|
// add search-heading to the seccond navbar
|
||||||
|
if( $(".search-heading").length) {
|
||||||
|
$(".search-heading").appendTo("#topbar-second > .container > #tabmenu");
|
||||||
|
}
|
||||||
|
|
||||||
|
// add search results heading to the second navbar
|
||||||
|
// and insert the search value to the top nav search input
|
||||||
|
if( $(".search-content-wrapper").length ) {
|
||||||
|
// get the text of the heading (we catch the plain text because we don't
|
||||||
|
// want to have a h4 heading in the navbar
|
||||||
|
var searchText = $(".section-title-wrapper > h2").text();
|
||||||
|
// insert the plain text in a <h4> heading and give it a class
|
||||||
|
var newText = '<h4 class="search-heading">'+searchText+'</h4>';
|
||||||
|
// append the new heading to the navbar
|
||||||
|
$("#topbar-second > .container > #tabmenu").append(newText);
|
||||||
|
|
||||||
|
// try to get the value of the original search input to insert it
|
||||||
|
// as value in the nav-search-input
|
||||||
|
var searchValue = $("#search-wrapper .form-group-search input").val();
|
||||||
|
|
||||||
|
// if the orignal search value isn't available use the location path as value
|
||||||
|
if( typeof searchValue === "undefined") {
|
||||||
|
// get the location path
|
||||||
|
var urlPath = window.location.search
|
||||||
|
// and split it up in its parts
|
||||||
|
var splitPath = urlPath.split(/(\?search?=)(.*$)/);
|
||||||
|
|
||||||
|
if(typeof splitPath[2] !== 'undefined') {
|
||||||
|
// decode the path (e.g to decode %40 to the character @)
|
||||||
|
var searchValue = decodeURIComponent(splitPath[2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( typeof searchValue !== "undefined") {
|
||||||
|
$("#nav-search-input-field").val(searchValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// move the "Save the search" button to the second navbar
|
||||||
|
$(".search-content-wrapper #search-save-form ").appendTo("#topbar-second > .container > #navbar-button");
|
||||||
|
|
||||||
// append the vcard-short-info to the second nav after passing the element
|
// append the vcard-short-info to the second nav after passing the element
|
||||||
// with .p-addr (vcard). Use scrollspy to get the scroll position.
|
// with .p-addr (vcard). Use scrollspy to get the scroll position.
|
||||||
if( $("aside .vcard .p-addr").length) {
|
if( $("aside .vcard .p-addr").length) {
|
||||||
|
@ -129,8 +163,6 @@ $(document).ready(function(){
|
||||||
$("#vcard-short-info").fadeOut(500, function () {
|
$("#vcard-short-info").fadeOut(500, function () {
|
||||||
$("#vcard-short-info").appendTo("#vcard-short-info-wrapper");
|
$("#vcard-short-info").appendTo("#vcard-short-info-wrapper");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
onEnter: function(element) {
|
onEnter: function(element) {
|
||||||
$("#vcard-short-info").appendTo("#nav-short-info");
|
$("#vcard-short-info").appendTo("#nav-short-info");
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
<span class="sr-only">Toggle navigation</span>
|
<span class="sr-only">Toggle navigation</span>
|
||||||
<i class="fa fa-ellipsis-v"></i>
|
<i class="fa fa-ellipsis-v"></i>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="navbar-toggle collapsed pull-right" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
|
<button type="button" class="navbar-toggle collapsed pull-right" data-toggle="collapse" data-target="#search-mobile" aria-expanded="false" aria-controls="navbar">
|
||||||
<span class="sr-only">Toggle Search</span>
|
<span class="sr-only">Toggle Search</span>
|
||||||
<i class="fa fa-search" style="color:#FFF;"></i>
|
<i class="fa fa-search" style="color:#FFF;"></i>
|
||||||
</button>
|
</button>
|
||||||
|
@ -247,6 +247,17 @@
|
||||||
</nav>
|
</nav>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
{{* provide a a search input for mobile view, which expands by pressing the search icon *}}
|
||||||
|
<div id="search-mobile" class="hidden-lg hidden-md collapse">
|
||||||
|
<form class="navbar-form" role="search" method="get" action="{{$nav.search.0}}">
|
||||||
|
<!-- <img class="hidden-xs" src="{{$nav.userinfo.icon}}" alt="{{$nav.userinfo.name}}" style="max-width:33px; max-height:33px; min-width:33px; min-height:33px; width:33px; height:33px;"> -->
|
||||||
|
<div class="form-group form-group-search">
|
||||||
|
<input id="nav-search-input-field-mobile" class="form-control form-search" type="text" name="search" data-toggle="tooltip" title="{{$search_hint}}" placeholder="{{$nav.search.1}}">
|
||||||
|
<button class="btn btn-default btn-sm form-button-search" type="submit">{{$nav.search.1}}</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
{{* The second navbar which contains nav points of the actual page - (nav points are actual handled by this theme throug js *}}
|
{{* The second navbar which contains nav points of the actual page - (nav points are actual handled by this theme throug js *}}
|
||||||
<div id="topbar-second" class="topbar">
|
<div id="topbar-second" class="topbar">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
|
|
||||||
|
{{* important notes: The frio theme hides under certain conditions some parts of the templates through css.
|
||||||
|
Some parts of this template will be moved by js to other places (see theme.js) - E.g. the save-search button}}
|
||||||
|
|
||||||
<div id="{{$id}}" {{* class="input-group" *}}>
|
<div id="{{$id}}" {{* class="input-group" *}}>
|
||||||
<div id="search-wrapper">
|
<div id="search-wrapper">
|
||||||
<form action="{{$action_url}}" method="get" >
|
<form action="{{$action_url}}" method="get" >
|
||||||
|
@ -15,7 +18,7 @@
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
{{* The button to save searches *}}
|
{{* The button to save searches *}}
|
||||||
{{if $savedsearch}}
|
{{if $savedsearch}}
|
||||||
<button class="btn btn-primary btn-small pull-right" type="submit" name="save" id="search-save" value="{{$save_label}}">{{$save_label}}</button>
|
<button class="btn btn-primary btn-small pull-right" type="submit" name="save" value="{{$save_label}}">{{$save_label}}</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{* The select popup menu to select what kind of results the user would like to search for *}}
|
{{* The select popup menu to select what kind of results the user would like to search for *}}
|
||||||
|
@ -43,4 +46,9 @@
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
{{* This form is inserted as experiment to move the search-save button to the second navbar with js *}}
|
||||||
|
<form id="search-save-form" action="{{$action_url}}" method="get" >
|
||||||
|
<input type="hidden" name="search" value="{{$s}}" />
|
||||||
|
<button class="btn btn-primary btn-sm btn-main pull-right" type="submit" name="save" id="search-save" value="{{$save_label}}"><i class="fa fa-floppy-o fa-2x" aria-hidden="true"></i></button>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue