diff options
author | zotlabs <mike@macgirvin.com> | 2017-02-05 18:47:35 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-02-05 18:47:35 -0800 |
commit | eb3685f5377be06615de66aba104aad6f4927495 (patch) | |
tree | 674ce0820b33eebf2e504644dc2ab9a04116007e | |
parent | 201a6b8742313d2b58f9668922f18b9ef38cf424 (diff) | |
download | volse-hubzilla-eb3685f5377be06615de66aba104aad6f4927495.tar.gz volse-hubzilla-eb3685f5377be06615de66aba104aad6f4927495.tar.bz2 volse-hubzilla-eb3685f5377be06615de66aba104aad6f4927495.zip |
remove per-page login css (home, login); add support for alternative markdown mention format
-rw-r--r-- | include/markdown.php | 37 | ||||
-rw-r--r-- | view/css/mod_home.css | 5 | ||||
-rw-r--r-- | view/css/mod_login.css | 5 |
3 files changed, 36 insertions, 11 deletions
diff --git a/include/markdown.php b/include/markdown.php index b4656f769..7afdc6c54 100644 --- a/include/markdown.php +++ b/include/markdown.php @@ -110,6 +110,39 @@ function diaspora_mention_callback($matches) { } +function diaspora_mention_callback2($matches) { + + $webbie = $matches[1] . '@' . $matches[2]; + $link = ''; + if($webbie) { + $r = q("select * from hubloc left join xchan on hubloc_hash = xchan_hash where hubloc_addr = '%s' limit 1", + dbesc($webbie) + ); + if(! $r) { + $x = discover_by_webbie($webbie); + if($x) { + $r = q("select * from hubloc left join xchan on hubloc_hash = xchan_hash where hubloc_addr = '%s' limit 1", + dbesc($webbie) + ); + } + } + if($r) + $link = $r[0]['xchan_url']; + } + + $name = (($r) ? $r[0]['xchan_name'] : $matches[1]); + + if(! $link) + $link = 'https://' . $matches[2] . '/u/' . $matches[1]; + + if($r && $r[0]['hubloc_network'] === 'zot') + return '@[zrl=' . $link . ']' . trim($name) . ((substr($matches[0],-1,1) === '+') ? '+' : '') . '[/zrl]' ; + else + return '@[url=' . $link . ']' . trim($name) . ((substr($matches[0],-1,1) === '+') ? '+' : '') . '[/url]' ; + +} + + /** * @brief @@ -141,9 +174,11 @@ function markdown_to_bb($s, $use_zrl = false) { // first try plustags $s = preg_replace_callback('/\@\{(.+?)\; (.+?)\@(.+?)\}\+/','diaspora_mention_callback',$s); - $s = preg_replace_callback('/\@\{(.+?)\; (.+?)\@(.+?)\}/','diaspora_mention_callback',$s); + $s = preg_replace_callback('/\@\{(.+?)\@(.+?)\}\+/','diaspora_mention_callback2',$s); + $s = preg_replace_callback('/\@\{(.+?)\@(.+?)\}/','diaspora_mention_callback2',$s); + // Escaping the hash tags - doesn't always seem to work // $s = preg_replace('/\#([^\s\#])/','\\#$1',$s); // This seems to work diff --git a/view/css/mod_home.css b/view/css/mod_home.css index b6112eb38..fa2b2b28d 100644 --- a/view/css/mod_home.css +++ b/view/css/mod_home.css @@ -3,8 +3,3 @@ margin-bottom: 50px; } -#login-main { - max-width: 400px; - margin-left: auto; - margin-right: auto; -} diff --git a/view/css/mod_login.css b/view/css/mod_login.css deleted file mode 100644 index 53ba9cb1d..000000000 --- a/view/css/mod_login.css +++ /dev/null @@ -1,5 +0,0 @@ -#login-main { - max-width: 400px; - margin-left: auto; - margin-right: auto; -} |