diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/bookmarks.php | 4 | ||||
-rw-r--r-- | mod/chatsvc.php | 4 | ||||
-rw-r--r-- | mod/connections.php | 3 | ||||
-rw-r--r-- | mod/dirsearch.php | 7 | ||||
-rw-r--r-- | mod/help.php | 6 | ||||
-rw-r--r-- | mod/layouts.php | 114 | ||||
-rw-r--r-- | mod/poco.php | 11 | ||||
-rw-r--r-- | mod/rbmark.php | 7 | ||||
-rw-r--r-- | mod/settings.php | 1 | ||||
-rw-r--r-- | mod/siteinfo.php | 18 | ||||
-rw-r--r-- | mod/zfinger.php | 16 |
11 files changed, 106 insertions, 85 deletions
diff --git a/mod/bookmarks.php b/mod/bookmarks.php index c5be68b8e..141ae2e0b 100644 --- a/mod/bookmarks.php +++ b/mod/bookmarks.php @@ -57,7 +57,7 @@ function bookmarks_content(&$a) { if($x) { foreach($x as $xx) { $y = menu_fetch($xx['menu_name'],local_user(),get_observer_hash()); - $o .= menu_render($y,true); + $o .= menu_render($y,'',true); } } @@ -69,7 +69,7 @@ function bookmarks_content(&$a) { if($x) { foreach($x as $xx) { $y = menu_fetch($xx['menu_name'],local_user(),get_observer_hash()); - $o .= menu_render($y,true); + $o .= menu_render($y,'',true); } } diff --git a/mod/chatsvc.php b/mod/chatsvc.php index e6590f57a..9cc8778f5 100644 --- a/mod/chatsvc.php +++ b/mod/chatsvc.php @@ -113,7 +113,7 @@ function chatsvc_content(&$a) { $chats = array(); - $r = q("select * from chat left join xchan on chat_xchan = xchan_hash where chat_room = %d and chat_id > %d", + $r = q("select * from chat left join xchan on chat_xchan = xchan_hash where chat_room = %d and chat_id > %d order by created", intval($a->data['chat']['room_id']), intval($lastseen) ); @@ -147,4 +147,4 @@ function chatsvc_content(&$a) { json_return_and_die($ret); } -
\ No newline at end of file + diff --git a/mod/connections.php b/mod/connections.php index e36cb5fc7..679b6d79d 100644 --- a/mod/connections.php +++ b/mod/connections.php @@ -223,7 +223,8 @@ function connections_content(&$a) { } $sql_extra = (($search_flags) ? " and ( abook_flags & " . $search_flags . " ) " : ""); - + if(argv(1) === 'pending') + $sql_extra .= " and not ( abook_flags & " . ABOOK_FLAG_IGNORED . " ) "; } else { diff --git a/mod/dirsearch.php b/mod/dirsearch.php index 59a1d448d..7b83b8a46 100644 --- a/mod/dirsearch.php +++ b/mod/dirsearch.php @@ -159,7 +159,12 @@ function dirsearch_content(&$a) { ); if($r) { foreach($r as $rr) { - $flags = (($rr['ud_flags'] & UPDATE_FLAGS_DELETED) ? array('deleted') : array()); + $flags = array(); + if($rr['ud_flags'] & UPDATE_FLAGS_DELETED) + $flags[] = 'deleted'; + if($rr['ud_flags'] & UPDATE_FLAGS_FORCED) + $flags[] = 'forced'; + $spkt['transactions'][] = array( 'hash' => $rr['ud_hash'], 'address' => $rr['ud_addr'], diff --git a/mod/help.php b/mod/help.php index bbfeb9a6c..aa0ee8ae6 100644 --- a/mod/help.php +++ b/mod/help.php @@ -40,19 +40,19 @@ function help_content(&$a) { if(argc() > 1) { $text = load_doc_file('doc/' . $a->argv[1] . '.md'); - $a->page['title'] = t('Help:') . ' ' . str_replace('-',' ',notags(argv(1))); + $a->page['title'] = t('Help:') . ' ' . ucwords(str_replace('-',' ',notags(argv(1)))); } if(! $text) { $text = load_doc_file('doc/' . $a->argv[1] . '.bb'); if($text) $doctype = 'bbcode'; - $a->page['title'] = t('Help:') . ' ' . str_replace('-',' ',notags(argv(1))); + $a->page['title'] = t('Help:') . ' ' . ucwords(str_replace('_',' ',notags(argv(1)))); } if(! $text) { $text = load_doc_file('doc/' . $a->argv[1] . '.html'); if($text) $doctype = 'html'; - $a->page['title'] = t('Help:') . ' ' . str_replace('-',' ',notags(argv(1))); + $a->page['title'] = t('Help:') . ' ' . ucwords(str_replace('-',' ',notags(argv(1)))); } if(! $text) { diff --git a/mod/layouts.php b/mod/layouts.php index 9ed349850..0dcaba361 100644 --- a/mod/layouts.php +++ b/mod/layouts.php @@ -28,84 +28,94 @@ function layouts_content(&$a) { return; } + // Get the observer, check their permissions + $observer = $a->get_observer(); + $ob_hash = (($observer) ? $observer['xchan_hash'] : ''); + $perms = get_all_perms($owner,$ob_hash); -// Get the observer, check their permissions + if(! $perms['write_pages']) { + notice( t('Permission denied.') . EOL); + return; + } - $observer = $a->get_observer(); - $ob_hash = (($observer) ? $observer['xchan_hash'] : ''); + if((argc() > 3) && (argv(2) === 'share') && (argv(3))) { + $r = q("select sid, service, mimetype, title, body from item_id left join item on item.id = item_id.iid where item_id.uid = %d and item.mid = '%s' and service = 'PDL' order by sid asc", + intval($owner), + dbesc(argv(3)) + ); + if($r) { + header('Content-type: application/x-redmatrix-layout'); + header('Content-disposition: attachment; filename="' . $r[0]['sid'] . '.pdl"'); + echo json_encode($r); + killme(); - $perms = get_all_perms($owner,$ob_hash); + } + } - if(! $perms['write_pages']) { - notice( t('Permission denied.') . EOL); - return; - } + $tabs = array( + array( + 'label' => t('Layout Help'), + 'url' => 'help/Comanche', + 'sel' => '', + 'title' => t('Help with this feature'), + 'id' => 'layout-help-tab', + )); -// if(local_user() && local_user() == $owner) { - // $a->set_widget('design',design_tools()); - // } - $tabs = array( - array( - 'label' => t('Layout Help'), - 'url' => 'help/Comanche', - 'sel' => '', - 'title' => t('Help with this feature'), - 'id' => 'layout-help-tab', - )); + $o .= replace_macros(get_markup_template('common_tabs.tpl'),array('$tabs' => $tabs)); - $o .= replace_macros(get_markup_template('common_tabs.tpl'),array('$tabs' => $tabs)); + // Create a status editor (for now - we'll need a WYSIWYG eventually) to create pages + // Nickname is set to the observers xchan, and profile_uid to the owners. This lets you post pages at other people's channels. + require_once ('include/conversation.php'); -// Create a status editor (for now - we'll need a WYSIWYG eventually) to create pages -// Nickname is set to the observers xchan, and profile_uid to the owners. This lets you post pages at other people's channels. -require_once ('include/conversation.php'); - $x = array( - 'webpage' => ITEM_PDL, - 'is_owner' => true, - 'nickname' => $a->profile['channel_address'], - 'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), - 'bang' => (($group || $cid) ? '!' : ''), - 'visitor' => 'none', - 'nopreview' => 1, - 'ptlabel' => t('Layout Name'), - 'profile_uid' => intval($owner), - ); + $x = array( + 'webpage' => ITEM_PDL, + 'is_owner' => true, + 'nickname' => $a->profile['channel_address'], + 'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), + 'bang' => (($group || $cid) ? '!' : ''), + 'visitor' => 'none', + 'nopreview' => 1, + 'ptlabel' => t('Layout Name'), + 'profile_uid' => intval($owner), + ); - $o .= status_editor($a,$x); + $o .= status_editor($a,$x); - //Get a list of blocks. We can't display all them because endless scroll makes that unusable, so just list titles and an edit link. -//TODO - this should be replaced with pagelist_widget + // Get a list of blocks. We can't display all them because endless scroll makes that unusable, so just list titles and an edit link. + // TODO - this should be replaced with pagelist_widget -$r = q("select * from item_id where uid = %d and service = 'PDL' order by sid asc", - intval($owner) -); + $r = q("select iid, sid, mid from item_id left join item on item.id = item_id.iid where item_id.uid = %d and service = 'PDL' order by sid asc", + intval($owner) + ); - $pages = null; + $pages = null; + + if($r) { + $pages = array(); + foreach($r as $rr) { + $pages[$rr['iid']][] = array('url' => $rr['iid'],'title' => $rr['sid'], 'mid' => $rr['mid']); + } + } - if($r) { - $pages = array(); - foreach($r as $rr) { - $pages[$rr['iid']][] = array('url' => $rr['iid'],'title' => $rr['sid']); - } - } + //Build the base URL for edit links + $url = z_root() . "/editlayout/" . $which; -//Build the base URL for edit links - $url = z_root() . "/editlayout/" . $which; -// This isn't pretty, but it works. Until I figure out what to do with the UI, it's Good Enough(TM). - return $o . replace_macros(get_markup_template("webpagelist.tpl"), array( + return $o . replace_macros(get_markup_template("layoutlist.tpl"), array( '$baseurl' => $url, '$edit' => t('Edit'), + '$share' => t('Share'), '$pages' => $pages, '$channel' => $which, '$view' => t('View'), '$preview' => '1', - )); + )); } diff --git a/mod/poco.php b/mod/poco.php index a5808b7db..9295f13de 100644 --- a/mod/poco.php +++ b/mod/poco.php @@ -76,6 +76,9 @@ function poco_init(&$a) { $sql_extra ", intval($channel_id) ); + $c = q("select * from menu_item where ( mitem_flags & " . intval(MENU_ITEM_CHATROOM) . " ) and allow_cid = '' and allow_gid = '' and deny_cid = '' and deny_gid = '' and mitem_channel_id = %d", + intval($channel_id) + ); } if($r) $totalResults = intval($r[0]['total']); @@ -115,6 +118,14 @@ function poco_init(&$a) { $ret['startIndex'] = (string) $startIndex; $ret['itemsPerPage'] = (string) $itemsPerPage; $ret['totalResults'] = (string) $totalResults; + + if($c) { + $ret['chatrooms'] = array(); + foreach($c as $d) { + $ret['chatrooms'][] = array('url' => $d['mitem_link'], 'desc' => $d['mitem_desc']); + } + } + $ret['entry'] = array(); diff --git a/mod/rbmark.php b/mod/rbmark.php index 1c962152c..e35c2494a 100644 --- a/mod/rbmark.php +++ b/mod/rbmark.php @@ -35,7 +35,8 @@ function rbmark_post(&$a) { $t = array('url' => escape_tags($_REQUEST['url']),'term' => escape_tags($_REQUEST['title'])); bookmark_add($channel,$channel,$t,((x($_REQUEST,'private')) ? intval($_REQUEST['private']) : 0), array('menu_id' => ((x($_REQUEST,'menu_id')) ? intval($_REQUEST['menu_id']) : 0), - 'menu_name' => ((x($_REQUEST,'menu_name')) ? escape_tags($_REQUEST['menu_name']) : '') + 'menu_name' => ((x($_REQUEST,'menu_name')) ? escape_tags($_REQUEST['menu_name']) : ''), + 'ischat' => ((x($_REQUEST['ischat'])) ? intval($_REQUEST['ischat']) : 0) )); goaway(z_root() . '/bookmarks'); @@ -92,8 +93,8 @@ function rbmark_content(&$a) { '$header' => t('Save Bookmark'), '$url' => array('url',t('URL of bookmark'),escape_tags($_REQUEST['url'])), '$title' => array('title',t('Description'),escape_tags($_REQUEST['title'])), - '$ischat' => (($ischat) ? 1 : 0), - '$private' => (($private) ? 1 : 0), + '$ischat' => ((x($_REQUEST,'ischat')) ? intval($_REQUEST['ischat']) : 0), + '$private' => ((x($_REQUEST,'private')) ? intval($_REQUEST['private']) : 0), '$submit' => t('Save'), '$menu_name' => array('menu_name',t('Or enter new bookmark folder name'),'',''), '$menus' => $menu_select diff --git a/mod/settings.php b/mod/settings.php index b88380ff0..13cb3cae9 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -439,7 +439,6 @@ function settings_post(&$a) { dbesc($str_group_deny), intval(local_user()) ); - if($r) info( t('Settings updated.') . EOL); diff --git a/mod/siteinfo.php b/mod/siteinfo.php index 7fdb892d2..bdf9b1af6 100644 --- a/mod/siteinfo.php +++ b/mod/siteinfo.php @@ -90,24 +90,6 @@ function siteinfo_content(&$a) { $admininfo = bbcode(get_config('system','admininfo')); - $project_donate = t('Project Donations'); - $donate_text = t('<p>The Red Matrix is provided for you by volunteers working in their spare time. Your support will help us to build a better, freer, and privacy respecting web. Select the following option for a one-time donation of your choosing</p>'); - $alternatively = t('<p>or</p>'); - $recurring = t('Recurring Donation Options'); - - $donate = <<< EOT -<h3>{$project_donate}</h3> -$donate_text -<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 /> -<strong>$alternatively</strong> -<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" />$recurring</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" style="border: none;" 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; - if(file_exists('doc/site_donate.html')) $donate .= file_get_contents('doc/site_donate.html'); diff --git a/mod/zfinger.php b/mod/zfinger.php index 94671271b..75abfefe4 100644 --- a/mod/zfinger.php +++ b/mod/zfinger.php @@ -176,10 +176,22 @@ function zfinger_init(&$a) { $ret['follow_url'] = z_root() . '/follow?f=&url=%s'; - $permissions = get_all_perms($e['channel_id'],(($ztarget && $zsig) + $ztarget_hash = (($ztarget && $zsig) ? base64url_encode(hash('whirlpool',$ztarget . $zsig,true)) - : '' ),false); + : '' ); + $permissions = get_all_perms($e['channel_id'],$ztarget_hash,false); + + $permissions['connected'] = false; + + if($ztarget_hash) { + $b = q("select * from abook where abook_xchan = '%s' and abook_channel = %d limit 1", + dbesc($ztarget_hash), + intval($e['channel_id']) + ); + if($b) + $permissions['connected'] = true; + } $ret['permissions'] = (($ztarget && $zkey) ? aes_encapsulate(json_encode($permissions),$zkey) : $permissions); |