aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/bbcode.php16
-rwxr-xr-xinclude/items.php43
-rw-r--r--include/menu.php24
3 files changed, 70 insertions, 13 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 1239e5497..0415d8a73 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -193,6 +193,9 @@ function translate_design_element($type) {
case 'block':
$ret = t('block');
break;
+ case 'menu':
+ $ret = t('menu');
+ break;
}
return $ret;
@@ -994,3 +997,16 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false)
return $Text;
}
+
+/**
+ * This function exists as a short-term solution to folks linking to private images from their /cloud in
+ * their profiles, which brings up a login dialogue in the directory when that entry is viewed.
+ * The long term solution is to separate the web file browser from DAV so that you'll never see a
+ * login prompt (though the resource may return a permission denied).
+ */
+
+
+
+function strip_bbimage($s) {
+ $Text = preg_replace("/\[[zi]mg(.*?)\](.*?)\[\/[zi]mg\]/ism", '', $Text);
+}
diff --git a/include/items.php b/include/items.php
index cc777788c..818e7f526 100755
--- a/include/items.php
+++ b/include/items.php
@@ -545,6 +545,7 @@ function get_feed_for($channel, $observer_hash, $params) {
'order' => 'post',
'top' => $params['top']
), $channel, $observer_hash, CLIENT_MODE_NORMAL, get_app()->module);
+
$feed_template = get_markup_template('atom_feed.tpl');
@@ -4349,6 +4350,8 @@ 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']);
}
@@ -4371,10 +4374,8 @@ function zot_feed($uid,$observer_hash,$arr) {
return $result;
}
- if(! is_sys_channel($uid)) {
- require_once('include/security.php');
+ if(! is_sys_channel($uid))
$sql_extra = item_permissions_sql($uid,$observer_hash);
- }
$limit = " LIMIT 100 ";
@@ -4839,3 +4840,39 @@ function comment_local_origin($item) {
return false;
}
+
+
+function i2asld($i) {
+
+ if(! $i)
+ return array();
+
+ $ret = array();
+
+ if($i['verb']) {
+ $ret['@context'] = dirname($i['verb']);
+ $ret['@type'] = ucfirst(basename($i['verb']));
+ }
+ $ret['@id'] = $i['plink'];
+ $ret['published'] = datetime_convert('UTC','UTC',$i['created'],ATOM_TIME);
+ if($i['title'])
+ $ret['title'] = $i['title'];
+ $ret['content'] = bbcode($i['body']);
+
+ $ret['actor'] = asencode_person($i['author']);
+ $ret['owner'] = asencode_person($i['owner']);
+
+
+ return $ret;
+
+}
+
+
+function asencode_person($p) {
+ $ret = array();
+ $ret['@type'] = 'Person';
+ $ret['@id'] = 'acct:' . $p['xchan_addr'];
+ $ret['displayName'] = $p['xchan_name'];
+
+ return $ret;
+}
diff --git a/include/menu.php b/include/menu.php
index 0e5fa3c99..d20df1d6e 100644
--- a/include/menu.php
+++ b/include/menu.php
@@ -28,10 +28,10 @@ function menu_element($menu) {
$arr = array();
$arr['type'] = 'menu';
- $arr['name'] = $menu['menu_name'];
- $arr['desc'] = $menu['menu_desc'];
- $arr['created'] = $menu['menu_created'];
- $arr['edited'] = $menu['menu_edited'];
+ $arr['pagetitle'] = $menu['menu']['menu_name'];
+ $arr['desc'] = $menu['menu']['menu_desc'];
+ $arr['created'] = $menu['menu']['menu_created'];
+ $arr['edited'] = $menu['menu']['menu_edited'];
$arr['baseurl'] = z_root();
if($menu['menu_flags']) {
@@ -66,13 +66,17 @@ function menu_element($menu) {
-function menu_render($menu, $class='', $edit = false, $var = '') {
+function menu_render($menu, $class='', $edit = false, $var = array()) {
if(! $menu)
return '';
$channel_id = ((is_array(get_app()->profile)) ? get_app()->profile['profile_uid'] : 0);
+ if ((! $channel_id) && (local_channel()))
+ $channel_id = local_channel();
+
$menu_list = menu_list($channel_id);
+ $menu_names = array();
foreach($menu_list as $menus) {
if($menus['menu_name'] != $menu['menu']['menu_name'])
@@ -82,7 +86,7 @@ function menu_render($menu, $class='', $edit = false, $var = '') {
for($x = 0; $x < count($menu['items']); $x ++) {
if(in_array($menu['items'][$x]['mitem_link'], $menu_names)) {
$m = menu_fetch($menu['items'][$x]['mitem_link'], $channel_id, get_observer_hash());
- $submenu = menu_render($m, 'dropdown-menu', $edit = false, $var = array('wrap' => 'none'));
+ $submenu = menu_render($m, 'dropdown-menu', $edit = false, array('wrap' => 'none'));
$menu['items'][$x]['submenu'] = $submenu;
}
@@ -124,7 +128,6 @@ function menu_fetch_id($menu_id,$channel_id) {
function menu_create($arr) {
-
$menu_name = trim(escape_tags($arr['menu_name']));
$menu_desc = trim(escape_tags($arr['menu_desc']));
$menu_flags = intval($arr['menu_flags']);
@@ -150,14 +153,16 @@ function menu_create($arr) {
if($r)
return false;
+ $t = datetime_convert();
+
$r = q("insert into menu ( menu_name, menu_desc, menu_flags, menu_channel_id, menu_created, menu_edited )
values( '%s', '%s', %d, %d, '%s', '%s' )",
dbesc($menu_name),
dbesc($menu_desc),
intval($menu_flags),
intval($menu_channel_id),
- dbesc(datetime_convert()),
- dbesc(datetime_convert())
+ dbesc(datetime_convert('UTC','UTC',(($arr['menu_created']) ? $arr['menu_created'] : $t))),
+ dbesc(datetime_convert('UTC','UTC',(($arr['menu_edited']) ? $arr['menu_edited'] : $t)))
);
if(! $r)
return false;
@@ -285,7 +290,6 @@ function menu_delete_id($menu_id, $uid) {
function menu_add_item($menu_id, $uid, $arr) {
-
$mitem_link = escape_tags($arr['mitem_link']);
$mitem_desc = escape_tags($arr['mitem_desc']);
$mitem_order = intval($arr['mitem_order']);