aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-05-24 15:50:05 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-05-24 15:50:05 -0700
commit851f2f64df284d4ec410cdf7511b365db9fc5e9b (patch)
tree81484c475285226961b51240dd071197b7021791 /include
parent5795e2a58bb4a0702a3d318ec6ac05681d6e5864 (diff)
parent13546167877322afa274a2540656f525e55d3b48 (diff)
downloadvolse-hubzilla-851f2f64df284d4ec410cdf7511b365db9fc5e9b.tar.gz
volse-hubzilla-851f2f64df284d4ec410cdf7511b365db9fc5e9b.tar.bz2
volse-hubzilla-851f2f64df284d4ec410cdf7511b365db9fc5e9b.zip
Merge branch 'master' of https://github.com/redmatrix/redmatrix
Conflicts: index.php mod/setup.php
Diffstat (limited to 'include')
-rw-r--r--include/comanche.php26
-rw-r--r--include/dir_fns.php5
-rwxr-xr-xinclude/items.php6
-rw-r--r--include/oauth.php8
4 files changed, 27 insertions, 18 deletions
diff --git a/include/comanche.php b/include/comanche.php
index dfe907f4d..826948fa6 100644
--- a/include/comanche.php
+++ b/include/comanche.php
@@ -170,17 +170,12 @@ function comanche_block($s, $class = '') {
if($r) {
$o .= (($var['wrap'] == 'none') ? '' : '<div class="' . $class . '">');
- if($r[0]['title'] && trim($r[0]['title']) != '$content') {
+ if($r[0]['title'] && trim($r[0]['body']) != '$content') {
$o .= '<h3>' . $r[0]['title'] . '</h3>';
}
- if($r[0]['title'] && trim($r[0]['title']) === '$content' && get_app()->data['webpage'][0]['title']) {
- $o .= '<h3>' . get_app()->data['webpage'][0]['title'] . '</h3>';
- }
-
-
if(trim($r[0]['body']) === '$content') {
- $o .= prepare_text(get_app()->data['webpage'][0]['body'], get_app()->data['webpage'][0]['mimetype']);
+ $o .= get_app()->page['content'];
}
else {
$o .= prepare_text($r[0]['body'], $r[0]['mimetype']);
@@ -202,9 +197,17 @@ function comanche_js($s) {
case 'bootstrap':
$path = 'library/bootstrap/js/bootstrap.min.js';
break;
+ case 'foundation':
+ $path = 'library/foundation/js/foundation.min.js';
+ $init = "\r\n" . '<script>$(document).ready(function() { $(document).foundation(); });</script>';
+ break;
}
- return '<script src="' . z_root() . '/' . $path . '" ></script>';
+ $ret = '<script src="' . z_root() . '/' . $path . '" ></script>';
+ if($init)
+ $ret .= $init;
+
+ return $ret;
}
@@ -214,9 +217,14 @@ function comanche_css($s) {
case 'bootstrap':
$path = 'library/bootstrap/css/bootstrap.min.css';
break;
+ case 'foundation':
+ $path = 'library/foundation/css/foundation.min.css';
+ break;
}
- return '<link rel="stylesheet" href="' . z_root() . '/' . $path . '" type="text/css" media="screen">';
+ $ret = '<link rel="stylesheet" href="' . z_root() . '/' . $path . '" type="text/css" media="screen">';
+
+ return $ret;
}
diff --git a/include/dir_fns.php b/include/dir_fns.php
index eaa2db84b..902a0c1a3 100644
--- a/include/dir_fns.php
+++ b/include/dir_fns.php
@@ -425,10 +425,13 @@ function local_dir_update($uid, $force) {
);
}
+ $arr = array('channel_id' => $uid, 'hash' => $hash, 'profile' => $profile);
+ call_hooks('local_dir_update', $arr);
+
$address = $p[0]['channel_address'] . '@' . get_app()->get_hostname();
if (perm_is_allowed($uid, '', 'view_profile')) {
- import_directory_profile($hash, $profile, $address, 0);
+ import_directory_profile($hash, $arr['profile'], $address, 0);
} else {
// they may have made it private
$r = q("delete from xprof where xprof_hash = '%s'",
diff --git a/include/items.php b/include/items.php
index 828f43621..cc777788c 100755
--- a/include/items.php
+++ b/include/items.php
@@ -954,7 +954,7 @@ function import_author_diaspora($x) {
);
if($r) {
logger('in_cache: ' . $x['address'], LOGGER_DATA);
- return $r[0]['chan_hash'];
+ return $r[0]['xchan_hash'];
}
if(discover_by_webbie($x['address'])) {
@@ -4349,8 +4349,6 @@ function zot_feed($uid,$observer_hash,$arr) {
$mindate = null;
$message_id = null;
- require_once('include/security.php');
-
if(array_key_exists('mindate',$arr)) {
$mindate = datetime_convert('UTC','UTC',$arr['mindate']);
}
@@ -4364,7 +4362,7 @@ function zot_feed($uid,$observer_hash,$arr) {
$mindate = dbesc($mindate);
- logger('zot_feed: requested for uid ' . $uid . ' from observer ' . $observer_xchan, LOGGER_DEBUG);
+ logger('zot_feed: requested for uid ' . $uid . ' from observer ' . $observer_hash, LOGGER_DEBUG);
if($message_id)
logger('message_id: ' . $message_id,LOGGER_DEBUG);
diff --git a/include/oauth.php b/include/oauth.php
index ec754db95..a9509c68e 100644
--- a/include/oauth.php
+++ b/include/oauth.php
@@ -75,12 +75,12 @@ class FKOAuthDataStore extends OAuthDataStore {
$k = $consumer;
}
- $r = q("INSERT INTO tokens (id, secret, client_id, scope, expires) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP()+%d)",
+ $r = q("INSERT INTO tokens (id, secret, client_id, scope, expires) VALUES ('%s','%s','%s','%s', %d)",
dbesc($key),
dbesc($sec),
dbesc($k),
'request',
- intval(REQUEST_TOKEN_DURATION));
+ time()+intval(REQUEST_TOKEN_DURATION));
if (!$r) return null;
return new OAuthToken($key,$sec);
@@ -104,12 +104,12 @@ class FKOAuthDataStore extends OAuthDataStore {
$key = $this->gen_token();
$sec = $this->gen_token();
- $r = q("INSERT INTO tokens (id, secret, client_id, scope, expires, uid) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP()+%d, %d)",
+ $r = q("INSERT INTO tokens (id, secret, client_id, scope, expires, uid) VALUES ('%s','%s','%s','%s', %d, %d)",
dbesc($key),
dbesc($sec),
dbesc($consumer->key),
'access',
- intval(ACCESS_TOKEN_DURATION),
+ time()+intval(ACCESS_TOKEN_DURATION),
intval($uverifier));
if ($r)