provide some interesting new options to channel sources

This commit is contained in:
friendica 2014-01-31 20:02:59 -08:00
parent 902c9b1585
commit bd691300a7
4 changed files with 1012 additions and 956 deletions

View File

@ -2466,7 +2466,7 @@ function check_item_source($uid,$item) {
return false; return false;
$r = q("select * from source where src_channel_id = %d and src_xchan = '%s' limit 1", $r = q("select * from source where src_channel_id = %d and ( src_xchan = '%s' || src_xchan = '*' ) limit 1",
intval($uid), intval($uid),
dbesc(($item['source_xchan']) ? $item['source_xchan'] : $item['owner_xchan']) dbesc(($item['source_xchan']) ? $item['source_xchan'] : $item['owner_xchan'])
); );
@ -2502,7 +2502,7 @@ function check_item_source($uid,$item) {
foreach($words as $word) { foreach($words as $word) {
if(substr($word,0,1) === '#' && $tags) { if(substr($word,0,1) === '#' && $tags) {
foreach($tags as $t) foreach($tags as $t)
if($t['type'] == TERM_HASHTAG && substr($t,1) === $word) if(($t['type'] == TERM_HASHTAG) && ((substr($t,1) === substr($word,1)) || (substr($word,1) === '*')))
return true; return true;
} }
if(stristr($text,$word) !== false) if(stristr($text,$word) !== false)

View File

@ -12,9 +12,13 @@ function sources_post(&$a) {
$abook = intval($_REQUEST['abook']); $abook = intval($_REQUEST['abook']);
$words = $_REQUEST['words']; $words = $_REQUEST['words'];
$frequency = $_REQUEST['frequency']; $frequency = $_REQUEST['frequency'];
$name = $_REQUEST['name'];
$channel = $a->get_channel(); $channel = $a->get_channel();
if($name == '*')
$xchan = '*';
if($abook) { if($abook) {
$r = q("select abook_xchan from abook where abook_id = %d and abook_channel = %d limit 1", $r = q("select abook_xchan from abook where abook_id = %d and abook_channel = %d limit 1",
intval($abook), intval($abook),
@ -74,6 +78,9 @@ function sources_content(&$a) {
); );
if($r) { if($r) {
for($x = 0; $x < count($r); $x ++) { 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'); $r[$x]['src_patt'] = htmlspecialchars($r[$x]['src_patt'], ENT_COMPAT,'UTF-8');
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
2014-01-30.573 2014-01-31.574