aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authormarijus <mario@localhost.localdomain>2014-02-05 14:48:42 +0100
committermarijus <mario@localhost.localdomain>2014-02-05 14:48:42 +0100
commit419e3b5024efec40c98e48c3bf213c4e60d39fae (patch)
treed3754aa1d251308eb6178fe4ab138463ceaaf135 /mod
parentd7d2fff24b05bcb3ff3acc215e99f8f7d33d058d (diff)
parent0844110f7b154a0fb5102362fe732c2b091222d7 (diff)
downloadvolse-hubzilla-419e3b5024efec40c98e48c3bf213c4e60d39fae.tar.gz
volse-hubzilla-419e3b5024efec40c98e48c3bf213c4e60d39fae.tar.bz2
volse-hubzilla-419e3b5024efec40c98e48c3bf213c4e60d39fae.zip
Merge branch 'master' of https://github.com/friendica/red into upstream
Diffstat (limited to 'mod')
-rw-r--r--mod/bookmarks.php81
-rw-r--r--mod/chat.php19
-rw-r--r--mod/chatsvc.php118
-rw-r--r--mod/connections.php2
-rw-r--r--mod/connedit.php13
-rw-r--r--mod/item.php25
-rw-r--r--mod/menu.php7
-rw-r--r--mod/page.php4
-rw-r--r--mod/parse_url.php2
-rw-r--r--mod/photos.php26
-rw-r--r--mod/settings.php22
-rwxr-xr-xmod/setup.php5
-rw-r--r--mod/siteinfo.php18
-rw-r--r--mod/sources.php7
14 files changed, 270 insertions, 79 deletions
diff --git a/mod/bookmarks.php b/mod/bookmarks.php
new file mode 100644
index 000000000..de30d9bb6
--- /dev/null
+++ b/mod/bookmarks.php
@@ -0,0 +1,81 @@
+<?php
+
+function bookmarks_init(&$a) {
+ if(! local_user())
+ return;
+ $item_id = intval($_REQUEST['item']);
+ if(! $item_id)
+ return;
+
+ $u = $a->get_channel();
+
+ $i = q("select * from item where id = %d and uid = %d limit 1",
+ intval($item_id),
+ intval(local_user())
+ );
+
+ if(! $i)
+ return;
+
+ $i = fetch_post_tags($i);
+
+ $item = $i[0];
+
+ $terms = get_terms_oftype($item['term'],TERM_BOOKMARK);
+
+ if($terms && (! $item['item_restrict'])) {
+ require_once('include/bookmarks.php');
+
+ $s = q("select * from xchan where xchan_hash = '%s' limit 1",
+ dbesc($item['author_xchan'])
+ );
+ if(! $s) {
+ logger('mod_bookmarks: author lookup failed.');
+ killme();
+ }
+ foreach($terms as $t) {
+ bookmark_add($u,$s[0],$t,$item['item_private']);
+ notice( t('Bookmark added') . EOL);
+ }
+ }
+ killme();
+}
+
+function bookmarks_content(&$a) {
+ if(! local_user()) {
+ notice( t('Permission denied.') . EOL);
+ return;
+ }
+
+
+ require_once('include/menu.php');
+
+ $o = '<h3>' . t('My Bookmarks') . '</h3>';
+
+ $x = menu_list(local_user(),'',MENU_BOOKMARK);
+
+ if($x) {
+ foreach($x as $xx) {
+ $y = menu_fetch($xx['menu_name'],local_user(),get_observer_hash());
+ $o .= menu_render($y);
+ }
+ }
+
+ $o .= '<h3>' . t('My Connections Bookmarks') . '</h3>';
+
+
+ $x = menu_list(local_user(),'',MENU_SYSTEM|MENU_BOOKMARK);
+
+ if($x) {
+ foreach($x as $xx) {
+ $y = menu_fetch($xx['menu_name'],local_user(),get_observer_hash());
+ $o .= menu_render($y);
+ }
+ }
+
+
+
+ return $o;
+
+}
+
diff --git a/mod/chat.php b/mod/chat.php
index 54fa58092..e79973aef 100644
--- a/mod/chat.php
+++ b/mod/chat.php
@@ -91,7 +91,7 @@ function chat_content(&$a) {
}
if((argc() > 3) && intval(argv(2)) && (argv(3) === 'leave')) {
- chatroom_leave($observer,$room_id,$_SERVER['REMOTE_ADDR']);
+ chatroom_leave($observer,argv(2),$_SERVER['REMOTE_ADDR']);
goaway(z_root() . '/channel/' . argv(1));
}
@@ -101,10 +101,23 @@ function chat_content(&$a) {
$x = chatroom_enter($observer,$room_id,'online',$_SERVER['REMOTE_ADDR']);
if(! $x)
return;
+ $x = q("select * from chatroom where cr_id = %d and cr_uid = %d $sql_extra limit 1",
+ intval($room_id),
+ intval($a->profile['profile_uid'])
+ );
+ if($x) {
+ $room_name = $x[0]['cr_name'];
+ }
$o = replace_macros(get_markup_template('chat.tpl'),array(
- '$room_name' => '', // should we get this from the API?
+ '$room_name' => $room_name,
'$room_id' => $room_id,
- '$submit' => t('Submit')
+ '$baseurl' => z_root(),
+ '$nickname' => argv(1),
+ '$submit' => t('Submit'),
+ '$leave' => t('Leave Room'),
+ '$away' => t('I am away right now'),
+ '$online' => t('I am online')
+
));
return $o;
}
diff --git a/mod/chatsvc.php b/mod/chatsvc.php
index f32ea56ce..e6590f57a 100644
--- a/mod/chatsvc.php
+++ b/mod/chatsvc.php
@@ -29,17 +29,6 @@ function chatsvc_post(&$a) {
$room_id = $a->data['chat']['room_id'];
$text = escape_tags($_REQUEST['chat_text']);
- $status = strip_tags($_REQUEST['status']);
-
- if($status && $room_id) {
- $r = q("update chatpresence set cp_status = '%s', cp_last = '%s' where cp_room = %d and cp_xchan = '%s' and cp_client = '%s' limit 1",
- dbesc($status),
- dbesc(datetime_convert()),
- intval($room_id),
- dbesc(get_observer_hash()),
- dbesc($_SERVER['REMOTE_ADDR'])
- );
- }
if(! $text)
return;
@@ -65,47 +54,81 @@ function chatsvc_post(&$a) {
function chatsvc_content(&$a) {
- $lastseen = intval($_REQUEST['last']);
+ $status = strip_tags($_REQUEST['status']);
+ $room_id = intval($a->data['chat']['room_id']);
+ $stopped = ((x($_REQUEST,'stopped') && intval($_REQUEST['stopped'])) ? true : false);
- $ret = array('success' => false);
+ if($status && $room_id) {
- $sql_extra = permissions_sql($a->data['chat']['uid']);
+ $x = q("select channel_address from channel where channel_id = %d limit 1",
+ intval($a->data['chat']['uid'])
+ );
- $r = q("select * from chatroom where cr_uid = %d and cr_id = %d $sql_extra",
- intval($a->data['chat']['uid']),
- intval($a->data['chat']['room_id'])
- );
- if(! $r)
- json_return_and_die($ret);
+ $r = q("update chatpresence set cp_status = '%s', cp_last = '%s' where cp_room = %d and cp_xchan = '%s' and cp_client = '%s' limit 1",
+ dbesc($status),
+ dbesc(datetime_convert()),
+ intval($room_id),
+ dbesc(get_observer_hash()),
+ dbesc($_SERVER['REMOTE_ADDR'])
+ );
- $inroom = array();
+ goaway(z_root() . '/chat/' . $x[0]['channel_address'] . '/' . $room_id);
+ }
- $r = q("select * from chatpresence left join xchan on xchan_hash = cp_xchan where cp_room = %d order by xchan_name",
- intval($a->data['chat']['room_id'])
- );
- if($r) {
- foreach($r as $rr) {
- $inroom[] = array('img' => zid($rr['xchan_photo_m']), 'img_type' => $rr['xchan_photo_mimetype'],'name' => $rr['xchan_name']);
+ if(! $stopped) {
+
+ $lastseen = intval($_REQUEST['last']);
+
+ $ret = array('success' => false);
+
+ $sql_extra = permissions_sql($a->data['chat']['uid']);
+
+ $r = q("select * from chatroom where cr_uid = %d and cr_id = %d $sql_extra",
+ intval($a->data['chat']['uid']),
+ intval($a->data['chat']['room_id'])
+ );
+ if(! $r)
+ json_return_and_die($ret);
+
+ $inroom = array();
+
+ $r = q("select * from chatpresence left join xchan on xchan_hash = cp_xchan where cp_room = %d order by xchan_name",
+ intval($a->data['chat']['room_id'])
+ );
+ if($r) {
+ foreach($r as $rr) {
+ switch($rr['cp_status']) {
+ case 'away':
+ $status = t('Away');
+ break;
+ case 'online':
+ default:
+ $status = t('Online');
+ break;
+ }
+
+ $inroom[] = array('img' => zid($rr['xchan_photo_m']), 'img_type' => $rr['xchan_photo_mimetype'],'name' => $rr['xchan_name'], status => $status);
+ }
}
- }
- $chats = array();
+ $chats = array();
- $r = q("select * from chat left join xchan on chat_xchan = xchan_hash where chat_room = %d and chat_id > %d",
- intval($a->data['chat']['room_id']),
- intval($lastseen)
- );
- if($r) {
- foreach($r as $rr) {
- $chats[] = array(
- 'id' => $rr['chat_id'],
- 'img' => zid($rr['xchan_photo_m']),
- 'img_type' => $rr['xchan_photo_mimetype'],
- 'name' => $rr['xchan_name'],
- 'isotime' => datetime_convert('UTC', date_default_timezone_get(), $rr['created'], 'c'),
- 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $rr['created'], 'r'),
- 'text' => smilies(bbcode($rr['chat_text']))
- );
+ $r = q("select * from chat left join xchan on chat_xchan = xchan_hash where chat_room = %d and chat_id > %d",
+ intval($a->data['chat']['room_id']),
+ intval($lastseen)
+ );
+ if($r) {
+ foreach($r as $rr) {
+ $chats[] = array(
+ 'id' => $rr['chat_id'],
+ 'img' => zid($rr['xchan_photo_m']),
+ 'img_type' => $rr['xchan_photo_mimetype'],
+ 'name' => $rr['xchan_name'],
+ 'isotime' => datetime_convert('UTC', date_default_timezone_get(), $rr['created'], 'c'),
+ 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $rr['created'], 'r'),
+ 'text' => smilies(bbcode($rr['chat_text']))
+ );
+ }
}
}
@@ -117,9 +140,10 @@ function chatsvc_content(&$a) {
);
$ret['success'] = true;
- $ret['inroom'] = $inroom;
- $ret['chats'] = $chats;
-
+ if(! $stopped) {
+ $ret['inroom'] = $inroom;
+ $ret['chats'] = $chats;
+ }
json_return_and_die($ret);
}
diff --git a/mod/connections.php b/mod/connections.php
index 2119c69c7..3da9cec74 100644
--- a/mod/connections.php
+++ b/mod/connections.php
@@ -74,6 +74,7 @@ function connections_post(&$a) {
$abook_flags = $orig_record[0]['abook_flags'];
$new_friend = false;
+
if(($_REQUEST['pending']) && ($abook_flags & ABOOK_FLAG_PENDING)) {
$abook_flags = ( $abook_flags ^ ABOOK_FLAG_PENDING );
$new_friend = true;
@@ -88,6 +89,7 @@ function connections_post(&$a) {
intval($contact_id),
intval(local_user())
);
+
if($r)
info( t('Connection updated.') . EOL);
else
diff --git a/mod/connedit.php b/mod/connedit.php
index e2d4b861c..3f507cc3b 100644
--- a/mod/connedit.php
+++ b/mod/connedit.php
@@ -32,7 +32,7 @@ function connedit_init(&$a) {
}
function connedit_post(&$a) {
-
+
if(! local_user())
return;
@@ -86,6 +86,8 @@ function connedit_post(&$a) {
$abook_flags = $orig_record[0]['abook_flags'];
$new_friend = false;
+
+
if(($_REQUEST['pending']) && ($abook_flags & ABOOK_FLAG_PENDING)) {
$abook_flags = ( $abook_flags ^ ABOOK_FLAG_PENDING );
$new_friend = true;
@@ -100,6 +102,7 @@ function connedit_post(&$a) {
intval($contact_id),
intval(local_user())
);
+
if($r)
info( t('Connection updated.') . EOL);
else
@@ -442,13 +445,13 @@ function connedit_content(&$a) {
'$perms' => $perms,
'$forum' => t('Forum Members'),
'$soapbox' => t('Soapbox'),
- '$full' => t('Full Sharing'),
- '$cautious' => t('Cautious Sharing'),
+ '$full' => t('Full Sharing (typical social network permissions)'),
+ '$cautious' => t('Cautious Sharing '),
'$follow' => t('Follow Only'),
'$permlbl' => t('Individual Permissions'),
- '$permnote' => t('Some permissions may be inherited from your channel <a href="settings">privacy settings</a>, which have higher priority. Changing those inherited settings on this page will have no effect.'),
+ '$permnote' => t('Some permissions may be inherited from your channel <a href="settings">privacy settings</a>, which have higher priority than individual settings. Changing those inherited settings on this page will have no effect.'),
'$advanced' => t('Advanced Permissions'),
- '$quick' => t('Quick Links'),
+ '$quick' => t('Simple Permissions (select one and submit)'),
'$common_link' => $a->get_baseurl(true) . '/common/loc/' . local_user() . '/' . $contact['id'],
'$all_friends' => $all_friends,
'$relation_text' => $relation_text,
diff --git a/mod/item.php b/mod/item.php
index 6d421009b..c8c0e3762 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -887,13 +887,24 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag) {
$replaced = false;
$r = null;
- $termtype = ((strpos($tag,'#') === 0) ? TERM_HASHTAG : TERM_UNKNOWN);
- $termtype = ((strpos($tag,'@') === 0) ? TERM_MENTION : $termtype);
+
+ $termtype = ((strpos($tag,'#') === 0) ? TERM_HASHTAG : TERM_UNKNOWN);
+ $termtype = ((strpos($tag,'@') === 0) ? TERM_MENTION : $termtype);
+ $termtype = ((strpos($tag,'#^[') === 0) ? TERM_BOOKMARK : $termtype);
+
//is it a hash tag?
if(strpos($tag,'#') === 0) {
- // if the tag is replaced...
- if(strpos($tag,'[zrl=')) {
+ if(strpos($tag,'#^[') === 0) {
+ if(preg_match('/#\^\[(url|zrl)(.*?)\](.*?)\[\/(url|zrl)\]/',$tag,$match)) {
+ $basetag = $match[3];
+ $url = ((substr($match[2],0,1) === '=') ? substr($match[2],1) : $match[3]);
+ $replaced = true;
+
+ }
+ }
+ // if the tag is already replaced...
+ elseif(strpos($tag,'[zrl=')) {
//...do nothing
return $replaced;
}
@@ -904,7 +915,7 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag) {
$body = str_replace($tag,$newtag,$body);
$replaced = true;
}
- else {
+ if(! $replaced) {
//base tag has the tags name only
$basetag = str_replace('_',' ',substr($tag,1));
//create text for link
@@ -961,7 +972,7 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag) {
$newname = str_replace('_',' ',$name);
//select someone from this user's contacts by name
- $r = q("SELECT * FROM abook left join xchan on abook_xchan - xchan_hash
+ $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash
WHERE xchan_name = '%s' AND abook_channel = %d LIMIT 1",
dbesc($newname),
intval($profile_uid)
@@ -969,7 +980,7 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag) {
if(! $r) {
//select someone by attag or nick and the name passed in
- $r = q("SELECT * FROM abook left join xchan on abook_xchan - xchan_hash
+ $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash
WHERE xchan_addr like ('%s') AND abook_channel = %d LIMIT 1",
dbesc($newname . '@%'),
intval($profile_uid)
diff --git a/mod/menu.php b/mod/menu.php
index 47eed6484..a2d0c2385 100644
--- a/mod/menu.php
+++ b/mod/menu.php
@@ -8,6 +8,10 @@ function menu_post(&$a) {
return;
$_REQUEST['menu_channel_id'] = local_user();
+ if($_REQUEST['menu_bookmark'])
+ $_REQUEST['menu_flags'] |= MENU_BOOKMARK;
+ if($_REQUEST['menu_system'])
+ $_REQUEST['menu_flags'] |= MENU_SYSTEM;
$menu_id = ((argc() > 1) ? intval(argv(1)) : 0);
if($menu_id) {
@@ -76,6 +80,7 @@ function menu_content(&$a) {
'$header' => t('New Menu'),
'$menu_name' => array('menu_name', t('Menu name'), '', t('Must be unique, only seen by you'), '*'),
'$menu_desc' => array('menu_desc', t('Menu title'), '', t('Menu title as seen by others'), ''),
+ '$menu_bookmark' => array('menu_bookmark', t('Allow bookmarks'), 0 , t('Menu may be used to store saved bookmarks'), ''),
'$submit' => t('Create')
));
return $o;
@@ -104,6 +109,8 @@ function menu_content(&$a) {
'$editcontents' => t('Edit menu contents'),
'$menu_name' => array('menu_name', t('Menu name'), $m['menu_name'], t('Must be unique, only seen by you'), '*'),
'$menu_desc' => array('menu_desc', t('Menu title'), $m['menu_desc'], t('Menu title as seen by others'), ''),
+ '$menu_bookmark' => array('menu_bookmark', t('Allow bookmarks'), (($m['menu_flags'] & MENU_BOOKMARK) ? 1 : 0), t('Menu may be used to store saved bookmarks'), ''),
+ '$menu_system' => (($m['menu_flags'] & MENU_SYSTEM) ? 1 : 0),
'$submit' => t('Modify')
));
return $o;
diff --git a/mod/page.php b/mod/page.php
index 56592116f..df17dbf52 100644
--- a/mod/page.php
+++ b/mod/page.php
@@ -38,7 +38,7 @@ function page_content(&$a) {
$channel_address = argv(1);
$page_id = argv(2);
-dbg(1);
+
$u = q("select channel_id from channel where channel_address = '%s' limit 1",
dbesc($channel_address)
);
@@ -63,7 +63,7 @@ dbg(1);
dbesc($page_id),
intval(ITEM_WEBPAGE)
);
-dbg(0);
+
if(! $r) {
// Check again with no permissions clause to see if it is a permissions issue
diff --git a/mod/parse_url.php b/mod/parse_url.php
index c206c24ec..340e1a67e 100644
--- a/mod/parse_url.php
+++ b/mod/parse_url.php
@@ -252,7 +252,7 @@ function parse_url_content(&$a) {
logger('parse_url: ' . $url);
- $template = $br . '[url=%s]%s[/url]%s' . $br;
+ $template = $br . '#^[url=%s]%s[/url]%s' . $br;
$arr = array('url' => $url, 'text' => '');
diff --git a/mod/photos.php b/mod/photos.php
index c299fe778..6798cb002 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -763,7 +763,7 @@ function photos_content(&$a) {
/* Check again - this time without specifying permissions */
- $ph = q("SELECT `id` FROM `photo` WHERE `uid` = %d AND `resource_id` = '%s'
+ $ph = q("SELECT id FROM photo WHERE uid = %d AND resource_id = '%s'
and ( photo_flags = %d or photo_flags = %d )
LIMIT 1",
intval($owner_uid),
@@ -875,6 +875,9 @@ function photos_content(&$a) {
if($linked_items) {
+ xchan_query($linked_items);
+ $linked_items = fetch_post_tags($linked_items,true);
+
$link_item = $linked_items[0];
$r = q("select * from item where parent_mid = '%s'
@@ -890,6 +893,21 @@ function photos_content(&$a) {
$r = conv_sort($r,'commented');
}
+
+
+ $tags = array();
+ if($link_item['term']) {
+ $cnt = 0;
+ foreach($link_item['term'] as $t)
+ $tags[$cnt] = array(0 => format_term_for_display($t));
+ if($can_post && ($ph[0]['uid'] == $owner_uid)) {
+ $tags[$cnt][1] = 'tagrm?f=&item=' . $link_item['id'];
+ $tags[$cnt][2] = t('Remove');
+ }
+ $cnt ++;
+ }
+
+
if((local_user()) && (local_user() == $link_item['uid'])) {
q("UPDATE `item` SET item_flags = (item_flags ^ %d) WHERE parent = %d and uid = %d and (item_flags & %d)",
intval(ITEM_UNSEEN),
@@ -925,7 +943,6 @@ function photos_content(&$a) {
'capt_label' => t('Caption'),
'caption' => $caption_e,
'tag_label' => t('Add a Tag'),
- 'tags' => $link_item['tag'],
'permissions' => t('Permissions'),
'aclselect' => $aclselect_e,
'help_tags' => t('Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping'),
@@ -1067,10 +1084,10 @@ function photos_content(&$a) {
}
$album_e = array($album_link,$ph[0]['album']);
- $tags_e = $tags;
$like_e = $like;
$dislike_e = $dislike;
+
$photo_tpl = get_markup_template('photo_view.tpl');
$o .= replace_macros($photo_tpl, array(
'$id' => $ph[0]['id'],
@@ -1081,7 +1098,8 @@ function photos_content(&$a) {
'$prevlink' => $prevlink,
'$nextlink' => $nextlink,
'$desc' => $ph[0]['description'],
- '$tags' => $tags_e,
+ '$tag_hdr' => t('In This Photo:'),
+ '$tags' => $tags,
'$edit' => $edit,
'$likebuttons' => $likebuttons,
'$like' => $like_e,
diff --git a/mod/settings.php b/mod/settings.php
index 7ff76cd3e..7889538f3 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -306,6 +306,7 @@ function settings_post(&$a) {
$arr['channel_r_pages'] = (($_POST['view_pages']) ? $_POST['view_pages'] : 0);
$arr['channel_w_pages'] = (($_POST['write_pages']) ? $_POST['write_pages'] : 0);
$arr['channel_a_republish'] = (($_POST['republish']) ? $_POST['republish'] : 0);
+ $arr['channel_a_bookmark'] = (($_POST['bookmark']) ? $_POST['bookmark'] : 0);
$defperms = 0;
if(x($_POST['def_view_stream']))
@@ -342,6 +343,8 @@ function settings_post(&$a) {
$defperms += $_POST['def_write_pages'];
if(x($_POST['def_republish']))
$defperms += $_POST['def_republish'];
+ if(x($_POST['def_bookmark']))
+ $defperms += $_POST['def_bookmark'];
$notify = 0;
@@ -399,7 +402,7 @@ function settings_post(&$a) {
set_pconfig(local_user(),'system','hide_online_status',$hide_presence);
- $r = q("update channel set channel_name = '%s', channel_pageflags = %d, channel_timezone = '%s', channel_location = '%s', channel_notifyflags = %d, channel_max_anon_mail = %d, channel_max_friend_req = %d, channel_expire_days = %d, channel_default_group = '%s', channel_r_stream = %d, channel_r_profile = %d, channel_r_photos = %d, channel_r_abook = %d, channel_w_stream = %d, channel_w_wall = %d, channel_w_tagwall = %d, channel_w_comment = %d, channel_w_mail = %d, channel_w_photos = %d, channel_w_chat = %d, channel_a_delegate = %d, channel_r_storage = %d, channel_w_storage = %d, channel_r_pages = %d, channel_w_pages = %d, channel_a_republish = %d, channel_allow_cid = '%s', channel_allow_gid = '%s', channel_deny_cid = '%s', channel_deny_gid = '%s' where channel_id = %d limit 1",
+ $r = q("update channel set channel_name = '%s', channel_pageflags = %d, channel_timezone = '%s', channel_location = '%s', channel_notifyflags = %d, channel_max_anon_mail = %d, channel_max_friend_req = %d, channel_expire_days = %d, channel_default_group = '%s', channel_r_stream = %d, channel_r_profile = %d, channel_r_photos = %d, channel_r_abook = %d, channel_w_stream = %d, channel_w_wall = %d, channel_w_tagwall = %d, channel_w_comment = %d, channel_w_mail = %d, channel_w_photos = %d, channel_w_chat = %d, channel_a_delegate = %d, channel_r_storage = %d, channel_w_storage = %d, channel_r_pages = %d, channel_w_pages = %d, channel_a_republish = %d, channel_a_bookmark = %d, channel_allow_cid = '%s', channel_allow_gid = '%s', channel_deny_cid = '%s', channel_deny_gid = '%s' where channel_id = %d limit 1",
dbesc($username),
intval($pageflags),
dbesc($timezone),
@@ -426,6 +429,7 @@ function settings_post(&$a) {
intval($arr['channel_r_pages']),
intval($arr['channel_w_pages']),
intval($arr['channel_a_republish']),
+ intval($arr['channel_a_bookmark']),
dbesc($str_contact_allow),
dbesc($str_group_allow),
dbesc($str_contact_deny),
@@ -919,19 +923,21 @@ function settings_content(&$a) {
'$defloc' => array('defloc', t('Default Post Location:'), $defloc, ''),
'$allowloc' => array('allow_location', t('Use Browser Location:'), ((get_pconfig(local_user(),'system','use_browser_location')) ? 1 : ''), ''),
- '$adult' => array('adult', t('Adult Content'), $adult_flag, t('This channel publishes adult content.')),
+ '$adult' => array('adult', t('Adult Content'), $adult_flag, t('This channel frequently or regularly publishes adult content. (Please tag any adult material and/or nudity with #NSFW)')),
'$h_prv' => t('Security and Privacy Settings'),
- '$hide_presence' => array('hide_presence', t('Hide my online presence'),$hide_presence, t('Prevents showing if you are available for chat')),
+ '$hide_presence' => array('hide_presence', t('Hide my online presence'),$hide_presence, t('Prevents displaying in your profile that you are online')),
- '$lbl_pmacro' => t('Quick Privacy Settings:'),
- '$pmacro3' => t('Very Public - extremely permissive'),
- '$pmacro2' => t('Typical - default public, privacy when desired'),
- '$pmacro1' => t('Private - default private, rarely open or public'),
- '$pmacro0' => t('Blocked - default blocked to/from everybody'),
+ '$lbl_pmacro' => t('Simple Privacy Settings:'),
+ '$pmacro3' => t('Very Public - <em>extremely permissive (should be used with caution)</em>'),
+ '$pmacro2' => t('Typical - <em>default public, privacy when desired (similar to social network permissions but with improved privacy)</em>'),
+ '$pmacro1' => t('Private - <em>default private, never open or public</em>'),
+ '$pmacro0' => t('Blocked - <em>default blocked to/from everybody</em>'),
'$permiss_arr' => $permiss,
+ '$lbl_p2macro' => t('Advanced Privacy Settings'),
+
'$maxreq' => array('maxreq', t('Maximum Friend Requests/Day:'), intval($channel['channel_max_friend_req']) , t('May reduce spam activity')),
'$permissions' => t('Default Post Permissions'),
'$permdesc' => t("\x28click to open/close\x29"),
diff --git a/mod/setup.php b/mod/setup.php
index ca5566578..14572699e 100755
--- a/mod/setup.php
+++ b/mod/setup.php
@@ -373,7 +373,10 @@ function check_php(&$phpath, &$checks) {
if (strlen($phpath)){
$passed = file_exists($phpath);
} else {
- $phpath = trim(shell_exec('which php'));
+ if(is_windows())
+ $phpath = trim(shell_exec('where php'));
+ else
+ $phpath = trim(shell_exec('which php'));
$passed = strlen($phpath);
}
$help = "";
diff --git a/mod/siteinfo.php b/mod/siteinfo.php
index 37cba02ec..14ef17516 100644
--- a/mod/siteinfo.php
+++ b/mod/siteinfo.php
@@ -90,6 +90,21 @@ function siteinfo_content(&$a) {
$admininfo = bbcode(get_config('system','admininfo'));
+ $donate = <<< EOT
+<p>The Red Matrix is provided for you by volunteers working in their spare time. Your support will help us to build a better web. Select the following option for a one-time donation of your choosing</p>
+<form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" name="cmd" value="_donations" /><input type="hidden" name="business" value="mike@macgirvin.com" /><input type="hidden" name="lc" value="US" /><input type="hidden" name="item_name" value="Distributed Social Network Support Donation" /><input type="hidden" name="no_note" value="0" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="bn" value="PP-DonationsBF:btn_donate_LG.gif:NonHostedGuest" /><input style="border: none;" type="image" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" alt="Donations gladly accepted to support our work" /></form><br />
+<p>or</p>
+
+<form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" name="cmd" value="_s-xclick" /><input type="hidden" name="hosted_button_id" value="FHV36KE28CYM8" /><br />
+<table><tbody><tr><td><input type="hidden" name="on0" value="Recurring Donation Options" />Recurring Donation Options</td>
+</tr><tr><td>
+<select name="os0"><option value="Option 1">Option 1 : $3.00USD - monthly</option><option value="Option 2">Option 2 : $5.00USD - monthly</option><option value="Option 3">Option 3 : $10.00USD - monthly</option><option value="Option 4">Option 4 : $20.00USD - monthly</option></select></td>
+</tr></tbody></table><p><input type="hidden" name="currency_code" value="USD" /><input type="image" border="0" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribeCC_LG.gif" alt="PayPal - The safer, easier way to pay online!" /><img src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" alt="" width="1" height="1" border="0" /></p></form>
+<p></p>
+EOT;
+
+
+
$o = replace_macros(get_markup_template('siteinfo.tpl'), array(
'$title' => t('Red'),
'$description' => t('This is a hub of the Red Matrix - a global cooperative network of decentralised privacy enhanced websites.'),
@@ -100,7 +115,8 @@ function siteinfo_content(&$a) {
'$bug_text' => t('Bug reports and issues: please visit'),
'$bug_link_url' => 'https://github.com/friendica/red/issues',
'$bug_link_text' => 'redmatrix issues',
- '$contact' => t('Suggestions, praise, donations, etc. - please email "redmatrix" at librelist - dot com'),
+ '$contact' => t('Suggestions, praise, etc. - please email "redmatrix" at librelist - dot com'),
+ '$donate' => $donate,
'$adminlabel' => t('Site Administrators'),
'$admininfo' => $admininfo,
'$plugins_text' => $plugins_text,
diff --git a/mod/sources.php b/mod/sources.php
index 87bab60df..f4b36508f 100644
--- a/mod/sources.php
+++ b/mod/sources.php
@@ -12,9 +12,13 @@ function sources_post(&$a) {
$abook = intval($_REQUEST['abook']);
$words = $_REQUEST['words'];
$frequency = $_REQUEST['frequency'];
+ $name = $_REQUEST['name'];
$channel = $a->get_channel();
+ if($name == '*')
+ $xchan = '*';
+
if($abook) {
$r = q("select abook_xchan from abook where abook_id = %d and abook_channel = %d limit 1",
intval($abook),
@@ -74,6 +78,9 @@ function sources_content(&$a) {
);
if($r) {
for($x = 0; $x < count($r); $x ++) {
+ if($r[$x]['src_xchan'] == '*') {
+ $r[$x]['xchan_name'] = t('*');
+ }
$r[$x]['src_patt'] = htmlspecialchars($r[$x]['src_patt'], ENT_COMPAT,'UTF-8');
}
}