diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-06-28 22:33:13 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-06-28 22:33:13 -0700 |
commit | 63f2e9b41259975f1af6415cda01dc0f81b1af30 (patch) | |
tree | 01518a9183b0daf02350da8f8e7d853f1a039ffc | |
parent | 8d84472b4cb85b50c314491e0706d80eb5b7de6d (diff) | |
parent | 090dae46e500634cec8f3718fbb83d5dbb8f9690 (diff) | |
download | volse-hubzilla-63f2e9b41259975f1af6415cda01dc0f81b1af30.tar.gz volse-hubzilla-63f2e9b41259975f1af6415cda01dc0f81b1af30.tar.bz2 volse-hubzilla-63f2e9b41259975f1af6415cda01dc0f81b1af30.zip |
Merge branch 'master' of https://github.com/redmatrix/redmatrix
Conflicts:
include/zot.php
mod/connedit.php
util/messages.po
-rwxr-xr-x | boot.php | 2 | ||||
-rw-r--r-- | doc/roadmap.bb | 4 | ||||
-rw-r--r-- | doc/to_do_code.bb | 1 | ||||
-rwxr-xr-x | include/items.php | 65 | ||||
-rw-r--r-- | include/zot.php | 46 | ||||
-rw-r--r-- | install/schema_mysql.sql | 2 | ||||
-rw-r--r-- | install/schema_postgres.sql | 2 | ||||
-rw-r--r-- | install/update.php | 12 | ||||
-rw-r--r-- | mod/connedit.php | 13 | ||||
-rw-r--r-- | mod/tagger.php | 4 | ||||
-rw-r--r-- | version.inc | 2 | ||||
-rw-r--r-- | view/css/mod_directory.css | 2 | ||||
-rw-r--r-- | view/theme/redbasic/css/style.css | 7 | ||||
-rwxr-xr-x | view/tpl/abook_edit.tpl | 8 | ||||
-rwxr-xr-x | view/tpl/direntry.tpl | 2 |
15 files changed, 144 insertions, 28 deletions
@@ -49,7 +49,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' ); define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R'); define ( 'ZOT_REVISION', 1 ); -define ( 'DB_UPDATE_VERSION', 1143 ); +define ( 'DB_UPDATE_VERSION', 1144 ); /** * @brief Constant with a HTML line break. diff --git a/doc/roadmap.bb b/doc/roadmap.bb index 641fef4ca..4564f5fea 100644 --- a/doc/roadmap.bb +++ b/doc/roadmap.bb @@ -4,7 +4,9 @@ Roadmap for $Projectname V3 Crypto Convert E2EE to dynamic loading (on demand) using jQuery.getScript() [or other methods] to only load encryption libs when you require them. This should also support multiple encryption libraries (e.g. SJCL, others) triggered from the choice of algorithm and remain pluggable. - + +Diaspora + Convert core Diaspora federation code into a plugin. This presents a number of challenges since it touches and special cases a lot of core functionality. Subscriptions and business models Build enough into core(/addons) to generate income (or at least try and cover costs) out of the box diff --git a/doc/to_do_code.bb b/doc/to_do_code.bb index b3b75473f..bfa249dd5 100644 --- a/doc/to_do_code.bb +++ b/doc/to_do_code.bb @@ -4,6 +4,7 @@ We need much more than this, but here are areas where developers can help. Pleas [li]Documentation - see Red Documentation Project To-Do List[/li]
[li]Include TOS link in registration/verification email[/li]
+[li]forum widget with unread counts (requires the DB schema changes from v3/hubzilla to be viable)[/li]
[li]Create bug tracker module[/li]
[li]translation plugins - moses or apertium[/li]
[li]Infinite scroll improvements (i.e. embedded page links) see http://scrollsample.appspot.com/items
diff --git a/include/items.php b/include/items.php index cf7e28daa..5f479660e 100755 --- a/include/items.php +++ b/include/items.php @@ -3295,8 +3295,7 @@ function check_item_source($uid, $item) { $text = prepare_text($item['body'],$item['mimetype']); $text = html2plain($text); - /** @BUG $items is undefined, should this be $item? */ - $tags = ((count($items['term'])) ? $items['term'] : false); + $tags = ((count($item['term'])) ? $item['term'] : false); $words = explode("\n",$r[0]['src_patt']); if($words) { @@ -3306,11 +3305,71 @@ function check_item_source($uid, $item) { if(($t['type'] == TERM_HASHTAG) && ((substr($t,1) === substr($word,1)) || (substr($word,1) === '*'))) return true; } - if(stristr($text,$word) !== false) + elseif((strpos($word,'/') === 0) && preg_match($word,$body)) return true; + elseif(stristr($text,$word) !== false) + return true; + } + } + + return false; +} + +function post_is_importable($item,$abook) { + + if(! $abook) + return true; + if(! $item) + return false; + + if((! $abook['abook_incl']) && (! $abook['abook_excl'])) + return true; + + require_once('include/html2plain.php'); + $text = prepare_text($item['body'],$item['mimetype']); + $text = html2plain($text); + + $tags = ((count($item['term'])) ? $item['term'] : false); + + // exclude always has priority + + $exclude = (($abook['abook_excl']) ? explode("\n",$abook['abook_excl']) : null); + + if($exclude) { + foreach($exclude as $word) { + $word = trim($word); + if(substr($word,0,1) === '#' && $tags) { + foreach($tags as $t) + if(($t['type'] == TERM_HASHTAG) && ((substr($t,1) === substr($word,1)) || (substr($word,1) === '*'))) + return false; + } + elseif((strpos($word,'/') === 0) && preg_match($word,$body)) + return false; + elseif(stristr($text,$word) !== false) + return false; } } + $include = (($abook['abook_incl']) ? explode("\n",$abook['abook_incl']) : null); + + if($include) { + foreach($include as $word) { + $word = trim($word); + if(substr($word,0,1) === '#' && $tags) { + foreach($tags as $t) + if(($t['type'] == TERM_HASHTAG) && ((substr($t,1) === substr($word,1)) || (substr($word,1) === '*'))) + return true; + } + elseif((strpos($word,'/') === 0) && preg_match($word,$body)) + return true; + elseif(stristr($text,$word) !== false) + return true; + } + } + else { + return true; + } + return false; } diff --git a/include/zot.php b/include/zot.php index 568049237..dfaff268e 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1625,6 +1625,13 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $ } } + + $ab = q("select abook.* from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d + and abook_self = 0", + intval($channel['channel_id']) + ); + $abook = (($ab) ? $ab[0] : null); + if(intval($arr['item_deleted'])) { // remove_community_tag is a no-op if this isn't a community tag activity @@ -1665,10 +1672,15 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $ elseif($arr['edited'] > $r[0]['edited']) { $arr['id'] = $r[0]['id']; $arr['uid'] = $channel['channel_id']; - update_imported_item($sender,$arr,$channel['channel_id']); - $result[] = array($d['hash'],'updated',$channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>',$arr['mid']); - if(! $relay) - add_source_route($item_id,$sender['hash']); + if(($arr['mid'] == $arr['parent_mid']) && (! post_is_importable($arr,$abook))) { + $result[] = array($d['hash'],'update ignored',$channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>',$arr['mid']); + } + else { + update_imported_item($sender,$arr,$channel['channel_id']); + $result[] = array($d['hash'],'updated',$channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>',$arr['mid']); + if(! $relay) + add_source_route($item_id,$sender['hash']); + } } else { $result[] = array($d['hash'],'update ignored',$channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>',$arr['mid']); @@ -1688,18 +1700,24 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $ if(check_item_source($arr['uid'], $arr)) call_hooks('post_local', $arr); - - $item_result = item_store($arr); + $item_id = 0; - if($item_result['success']) { - $item_id = $item_result['item_id']; - $parr = array('item_id' => $item_id,'item' => $arr,'sender' => $sender,'channel' => $channel); - call_hooks('activity_received',$parr); - // don't add a source route if it's a relay or later recipients will get a route mismatch - if(! $relay) - add_source_route($item_id,$sender['hash']); + + if(($arr['mid'] == $arr['parent_mid']) && (! post_is_importable($arr,$abook))) { + $result[] = array($d['hash'],'post ignored',$channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>',$arr['mid']); + } + else { + $item_result = item_store($arr); + if($item_result['success']) { + $item_id = $item_result['item_id']; + $parr = array('item_id' => $item_id,'item' => $arr,'sender' => $sender,'channel' => $channel); + call_hooks('activity_received',$parr); + // don't add a source route if it's a relay or later recipients will get a route mismatch + if(! $relay) + add_source_route($item_id,$sender['hash']); + } + $result[] = array($d['hash'],(($item_id) ? 'posted' : 'storage failed:' . $item_result['message']),$channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>',$arr['mid']); } - $result[] = array($d['hash'],(($item_id) ? 'posted' : 'storage failed:' . $item_result['message']),$channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>',$arr['mid']); } if($relay && $item_id) { diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index c68261caf..e30eded29 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -21,6 +21,8 @@ CREATE TABLE IF NOT EXISTS `abook` ( `abook_self` tinyint(4) NOT NULL DEFAULT '0', `abook_feed` tinyint(4) NOT NULL DEFAULT '0', `abook_profile` char(64) NOT NULL DEFAULT '', + `abook_incl` TEXT NOT NULL DEFAULT '', + `abook_excl` TEXT NOT NULL DEFAULT '', PRIMARY KEY (`abook_id`), KEY `abook_account` (`abook_account`), KEY `abook_channel` (`abook_channel`), diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 7c8d74ae5..b7a699125 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -14,6 +14,8 @@ CREATE TABLE "abook" ( "abook_dob" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00', "abook_flags" bigint NOT NULL DEFAULT '0', "abook_profile" char(64) NOT NULL DEFAULT '', + "abook_incl" TEXT NOT NULL DEFAULT '', + "abook_excl" TEXT NOT NULL DEFAULT '', PRIMARY KEY ("abook_id") ); create index "abook_account" on abook ("abook_account"); diff --git a/install/update.php b/install/update.php index 62c976218..fb49e9a16 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ <?php -define( 'UPDATE_VERSION' , 1143 ); +define( 'UPDATE_VERSION' , 1144 ); /** * @@ -1656,4 +1656,14 @@ function update_r1142() { return UPDATE_FAILED; +} + +function update_r1143() { + + $r1 = q("ALTER TABLE abook ADD abook_incl TEXT NOT NULL DEFAULT ''"); + $r2 = q("ALTER TABLE abook ADD abook_excl TEXT NOT NULL DEFAULT '' "); + if($r1 && $r2) + return UPDATE_SUCCESS; + return UPDATE_FAILED; + }
\ No newline at end of file diff --git a/mod/connedit.php b/mod/connedit.php index 88304d2ed..dac393b5c 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -101,6 +101,9 @@ function connedit_post(&$a) { } } + $abook_incl = escape_tags($_POST['abook_incl']); + $abook_excl = escape_tags($_POST['abook_excl']); + $hidden = intval($_POST['hidden']); $priority = intval($_POST['poll']); @@ -189,12 +192,16 @@ function connedit_post(&$a) { } } - $r = q("UPDATE abook SET abook_profile = '%s', abook_my_perms = %d , abook_closeness = %d, abook_pending = %d + + $r = q("UPDATE abook SET abook_profile = '%s', abook_my_perms = %d , abook_closeness = %d, abook_pending = %d, + abook_incl = '%s', abook_excl = '%s' where abook_id = %d AND abook_channel = %d", dbesc($profile_id), intval($abook_my_perms), intval($closeness), intval(1 - intval($new_friend)), + dbesc($abook_incl), + dbesc($abook_excl), intval($contact_id), intval(local_channel()) ); @@ -661,7 +668,9 @@ function connedit_content(&$a) { '$lbl_slider' => t('Slide to adjust your degree of friendship'), '$lbl_rating' => t('Rating (this information is public)'), '$lbl_rating_txt' => t('Optionally explain your rating (this information is public)'), - '$rating_txt' => $rating_text, + '$incl' => array('abook_incl',t('Only import posts with this text'), $contact['abook_incl'],t('words one per line or #tags or /patterns/, leave blank to import all posts')), + '$excl' => array('abook_excl',t('Do not import posts with this text'), $contact['abook_excl'],t('words one per line or #tags or /patterns/, leave blank to import all posts')), + '$rating_text' => array('rating_text', t('Optionally explain your rating (this information is public)'),$rating_text,''), '$rating' => $rating, '$rating_val' => $rating_val, '$slide' => $slide, diff --git a/mod/tagger.php b/mod/tagger.php index c6365d707..9f9855ed8 100644 --- a/mod/tagger.php +++ b/mod/tagger.php @@ -48,7 +48,7 @@ function tagger_content(&$a) { break; default: $targettype = ACTIVITY_OBJ_NOTE; - $post_type = t('status'); + $post_type = t('post'); if($item['mid'] != $item['parent_mid']) $post_type = t('comment'); break; @@ -131,4 +131,4 @@ function tagger_content(&$a) { killme(); -}
\ No newline at end of file +} diff --git a/version.inc b/version.inc index df3ed0059..b06ac504d 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2015-06-23.1072 +2015-06-28.1077 diff --git a/view/css/mod_directory.css b/view/css/mod_directory.css index d3831e589..8e55ac3be 100644 --- a/view/css/mod_directory.css +++ b/view/css/mod_directory.css @@ -10,11 +10,13 @@ .contact-photo-wrapper { display: table-cell; + table-layout: fixed; vertical-align: top; } .contact-info { display: table-cell; + table-layout: fixed; vertical-align: top; padding-left: 10px; } diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index ad203867c..540f691c6 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1326,6 +1326,7 @@ header { .contactname { padding-top: 2px; font-weight: bold; + white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; @@ -1408,7 +1409,6 @@ header { .acl-list-item p { font-size: $font_size; margin: 0px; - overflow: ellipsis; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; @@ -1870,6 +1870,9 @@ nav .dropdown-menu { .section-subtitle-wrapper h3 { margin-top: 0px; margin-bottom: 0px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } .section-subtitle-wrapper { @@ -2000,6 +2003,7 @@ nav .badge.mail-update:hover { .dropdown-menu { font-size: $body_font_size; border-radius: $radiuspx; + max-width: 100%; } .dropdown-menu img { @@ -2277,3 +2281,4 @@ nav .badge.mail-update:hover { .channels_ckbx, .pending_ckbx, .users_ckbx { margin-top: -5px !important; } + diff --git a/view/tpl/abook_edit.tpl b/view/tpl/abook_edit.tpl index fb02ff8ed..10692856e 100755 --- a/view/tpl/abook_edit.tpl +++ b/view/tpl/abook_edit.tpl @@ -50,6 +50,9 @@ {{/if}} + {{include file="field_textarea.tpl" field=$incl}} + {{include file="field_textarea.tpl" field=$excl}} + {{if $rating}} <h3>{{$lbl_rating}}</h3> @@ -58,6 +61,8 @@ {{/if}} + + {{/if}} @@ -75,8 +80,7 @@ {{if $rating}} {{if $notself}} -<h3 class="abook-rating-text-desc">{{$lbl_rating_txt}}</h3> -<textarea name="rating_text" id="rating-text" >{{$rating_txt}}</textarea> + {{include file="field_textarea.tpl" field=$rating_text}} {{/if}} {{/if}} diff --git a/view/tpl/direntry.tpl b/view/tpl/direntry.tpl index 3450ad36d..98ec25e23 100755 --- a/view/tpl/direntry.tpl +++ b/view/tpl/direntry.tpl @@ -8,7 +8,9 @@ {{if $entry.ignlink}} <a class="directory-ignore btn btn-warning btn-xs" href="{{$entry.ignlink}}"> {{$entry.ignore_label}}</a> {{/if}} + {{if $entry.connect}} <a class="btn btn-success btn-xs" href="{{$entry.connect}}"><i class="icon-plus connect-icon"></i> {{$entry.conn_label}}</a> + {{/if}} </div> <h3>{{if $entry.public_forum}}<i class="icon-comments-alt" title="{{$entry.forum_label}} @{{$entry.nickname}}+"></i> {{/if}}<a href='{{$entry.profile_link}}' >{{$entry.name}}</a>{{if $entry.online}} <i class="icon-asterisk online-now" title="{{$entry.online}}"></i>{{/if}}</h3> </div> |