make the channel item query match recent changes to network item query (and some slightly older changes in display item query), and allow '@' in linkified urls.

This commit is contained in:
friendica 2015-03-18 19:06:05 -07:00
parent 5a7e35fbf8
commit 63683734a2
3 changed files with 7 additions and 5 deletions

View File

@ -469,7 +469,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
// Perform URL Search
$urlchars = '[a-zA-Z0-9\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\+\,]';
$urlchars = '[a-zA-Z0-9\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\+\,\@]';
if (strpos($Text,'http') !== false) {
$Text = preg_replace("/([^\]\='".'"'."\/]|^|\#\^)(https?\:\/\/$urlchars+)/ism", '$1<a href="$2" >$2</a>', $Text);

View File

@ -869,7 +869,7 @@ function valid_email($x){
function linkify($s,$me = false) {
$s = preg_replace("/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\@\~\#\'\%\$\!\+]*)/", (($me) ? ' <a href="$1" rel="me" >$1</a>' : ' <a href="$1" >$1</a>'), $s);
$s = preg_replace("/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\@\~\#\'\%\$\!\+\,\@]*)/", (($me) ? ' <a href="$1" rel="me" >$1</a>' : ' <a href="$1" >$1</a>'), $s);
$s = preg_replace("/\<(.*?)(src|href)=(.*?)\&amp\;(.*?)\>/ism",'<$1$2=$3&$4>',$s);
return($s);
}

View File

@ -149,17 +149,19 @@ function channel_content(&$a, $update = 0, $load = false) {
$page_mode = 'client';
$abook_uids = " and abook.abook_channel = " . intval($a->profile['profile_uid']) . " ";
if(($update) && (! $load)) {
if ($mid) {
$r = q("SELECT parent AS item_id from item where mid = '%s' and uid = %d AND item_restrict = 0
$r = q("SELECT parent AS item_id from item where mid like '%s' and uid = %d AND item_restrict = 0
AND (item_flags & %d) > 0 AND item_unseen = 1 $sql_extra limit 1",
dbesc($mid),
dbesc($mid . '%'),
intval($a->profile['profile_uid']),
intval(ITEM_WALL)
);
} else {
$r = q("SELECT distinct parent AS `item_id`, created from item
left join abook on item.author_xchan = abook.abook_xchan
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
WHERE uid = %d AND item_restrict = 0
AND (item_flags & %d) > 0 AND item_unseen = 1
AND ((abook.abook_flags & %d) = 0 or abook.abook_flags is null)