From ed00301bb641d716e43876572be640f8252b9b05 Mon Sep 17 00:00:00 2001 From: marijus Date: Sat, 25 Jan 2014 14:50:05 +0100 Subject: disable feature setting for collections and make feature settings for personal and new tab working. --- include/conversation.php | 14 ++++++++------ include/features.php | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index cec5993b6..b6ee08e1f 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1388,21 +1388,23 @@ function network_tabs() { 'sel'=>$postord_active, 'title' => t('Sort by Post Date'), ), + ); - array( + if(feature_enabled(local_user(),'personal_tab')) + $tabs[] = array( 'label' => t('Personal'), 'url' => $a->get_baseurl(true) . '/' . $cmd . '?f=' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . '&conv=1', 'sel' => $conv_active, 'title' => t('Posts that mention or involve you'), - ), - array( + ); + + if(feature_enabled(local_user(),'new_tab')) + $tabs[] = array( 'label' => t('New'), 'url' => $a->get_baseurl(true) . '/' . $cmd . '?f=' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . '&new=1' . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''), 'sel' => $new_active, 'title' => t('Activity Stream - by date'), - ), - - ); + ); if(feature_enabled(local_user(),'star_posts')) $tabs[] = array( diff --git a/include/features.php b/include/features.php index 1f83eb319..efdf6dc3a 100644 --- a/include/features.php +++ b/include/features.php @@ -46,7 +46,8 @@ function get_features() { 'net_module' => array( t('Network and Stream Filtering'), array('archives', t('Search by Date'), t('Ability to select posts by date ranges')), - array('groups', t('Collections Filter'), t('Enable widget to display Network posts only from selected collections')), + // Disabled until a solution for default feature settings is found. + // array('groups', t('Collections Filter'), t('Enable widget to display Network posts only from selected collections')), array('savedsearch', t('Saved Searches'), t('Save search terms for re-use')), array('personal_tab', t('Network Personal Tab'), t('Enable tab to display only Network posts that you\'ve interacted on')), array('new_tab', t('Network New Tab'), t('Enable tab to display all new Network activity')), -- cgit v1.2.3 From 4ce6335364a5c86cac97bcc43af0dc6bfa38d114 Mon Sep 17 00:00:00 2001 From: marijus Date: Sun, 26 Jan 2014 14:44:55 +0100 Subject: Revert "disable feature setting for collections and make feature settings for personal and new tab working." This reverts commit ed00301bb641d716e43876572be640f8252b9b05. --- include/conversation.php | 14 ++++++-------- include/features.php | 3 +-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index b6ee08e1f..cec5993b6 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1388,23 +1388,21 @@ function network_tabs() { 'sel'=>$postord_active, 'title' => t('Sort by Post Date'), ), - ); - if(feature_enabled(local_user(),'personal_tab')) - $tabs[] = array( + array( 'label' => t('Personal'), 'url' => $a->get_baseurl(true) . '/' . $cmd . '?f=' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . '&conv=1', 'sel' => $conv_active, 'title' => t('Posts that mention or involve you'), - ); - - if(feature_enabled(local_user(),'new_tab')) - $tabs[] = array( + ), + array( 'label' => t('New'), 'url' => $a->get_baseurl(true) . '/' . $cmd . '?f=' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . '&new=1' . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''), 'sel' => $new_active, 'title' => t('Activity Stream - by date'), - ); + ), + + ); if(feature_enabled(local_user(),'star_posts')) $tabs[] = array( diff --git a/include/features.php b/include/features.php index 973fe9fe7..cc8d457bc 100644 --- a/include/features.php +++ b/include/features.php @@ -48,8 +48,7 @@ function get_features() { 'net_module' => array( t('Network and Stream Filtering'), array('archives', t('Search by Date'), t('Ability to select posts by date ranges')), - // Disabled until a solution for default feature settings is found. - // array('groups', t('Collections Filter'), t('Enable widget to display Network posts only from selected collections')), + array('groups', t('Collections Filter'), t('Enable widget to display Network posts only from selected collections')), array('savedsearch', t('Saved Searches'), t('Save search terms for re-use')), array('personal_tab', t('Network Personal Tab'), t('Enable tab to display only Network posts that you\'ve interacted on')), array('new_tab', t('Network New Tab'), t('Enable tab to display all new Network activity')), -- cgit v1.2.3 From fe2b6f3dfb4a9473905dde49b7741a6c03699c23 Mon Sep 17 00:00:00 2001 From: marijus Date: Thu, 30 Jan 2014 00:01:19 +0100 Subject: add image floating to bbcode --- doc/bbcode.html | 6 +++++- include/bbcode.php | 50 ++++++++++++++++++++++++++++++++++++++---------- view/tpl/item_attach.tpl | 2 +- 3 files changed, 46 insertions(+), 12 deletions(-) diff --git a/doc/bbcode.html b/doc/bbcode.html index a24dd8b5d..d46f9d05a 100644 --- a/doc/bbcode.html +++ b/doc/bbcode.html @@ -1,5 +1,5 @@

BBcode reference

-
+


  • [b]bold[/b] - bold
    @@ -9,6 +9,10 @@
  • [color=red]red[/color] - red
  • [url=https://redmatrix.me]Red Matrix[/url] Red Matrix
  • [img]https://redmatrix.me/images/default_profile_photos/rainbow_man/48.jpg[/img] Image/photo
    +
  • [img float=left]https://redmatrix.me/images/default_profile_photos/rainbow_man/48.jpg[/img] Image/photo
    +
    +
  • [img float=right]https://redmatrix.me/images/default_profile_photos/rainbow_man/48.jpg[/img] Image/photo
    +
  • [code]code[/code] code
  • [quote]quote[/quote]
    quote

  • [quote=Author]Author? Me? No, no, no...[/quote]
    Author wrote:
    Author? Me? No, no, no...

    diff --git a/include/bbcode.php b/include/bbcode.php index fec8750e9..57494bd7a 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -439,6 +439,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { if (strpos($Text,'[/center]') !== false) { $Text = preg_replace("(\[center\](.*?)\[\/center\])ism","
    $1
    ",$Text); } + // Check for list text $Text = str_replace("[*]", "
  • ", $Text); @@ -531,23 +532,52 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { "
    " . $t_wrote . "
    $2
    ", $Text); - // [img=widthxheight]image source[/img] - //$Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '', $Text); - if (strpos($Text,'[/img]') !== false) { - $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '', $Text); - } - if (strpos($Text,'[/zmg]') !== false) { - $Text = preg_replace("/\[zmg\=([0-9]*)x([0-9]*)\](.*?)\[\/zmg\]/ism", '', $Text); - } // Images // [img]pathtoimage[/img] - if (strpos($Text,'[/img]') !== false) { + if (strpos($Text,'[/img]') !== false) { $Text = preg_replace("/\[img\](.*?)\[\/img\]/ism", '' . t('Image/photo') . '', $Text); } - if (strpos($Text,'[/zmg]') !== false) { + if (strpos($Text,'[/zmg]') !== false) { $Text = preg_replace("/\[zmg\](.*?)\[\/zmg\]/ism", '' . t('Image/photo') . '', $Text); } + // [img float={left, right}]pathtoimage[/img] + if (strpos($Text,'[/img]') !== false) { + $Text = preg_replace("/\[img float=left\](.*?)\[\/img\]/ism", '' . t('Image/photo') . '', $Text); + } + if (strpos($Text,'[/img]') !== false) { + $Text = preg_replace("/\[img float=right\](.*?)\[\/img\]/ism", '' . t('Image/photo') . '', $Text); + } + if (strpos($Text,'[/zmg]') !== false) { + $Text = preg_replace("/\[zmg float=left\](.*?)\[\/zmg\]/ism", '' . t('Image/photo') . '', $Text); + } + if (strpos($Text,'[/zmg]') !== false) { + $Text = preg_replace("/\[zmg float=right\](.*?)\[\/zmg\]/ism", '' . t('Image/photo') . '', $Text); + } + + // [img=widthxheight]pathtoimage[/img] + if (strpos($Text,'[/img]') !== false) { + $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '' . t('Image/photo') . '', $Text); + } + if (strpos($Text,'[/zmg]') !== false) { + $Text = preg_replace("/\[zmg\=([0-9]*)x([0-9]*)\](.*?)\[\/zmg\]/ism", '' . t('Image/photo') . '', $Text); + } + + // [img=widthxheight float={left, right}]pathtoimage[/img] + if (strpos($Text,'[/img]') !== false) { + $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*) float=left\](.*?)\[\/img\]/ism", '' . t('Image/photo') . '', $Text); + } + if (strpos($Text,'[/img]') !== false) { + $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*) float=right\](.*?)\[\/img\]/ism", '' . t('Image/photo') . '', $Text); + } + if (strpos($Text,'[/zmg]') !== false) { + $Text = preg_replace("/\[zmg\=([0-9]*)x([0-9]*) float=left\](.*?)\[\/zmg\]/ism", '' . t('Image/photo') . '', $Text); + } + if (strpos($Text,'[/zmg]') !== false) { + $Text = preg_replace("/\[zmg\=([0-9]*)x([0-9]*) float=right\](.*?)\[\/zmg\]/ism", '' . t('Image/photo') . '', $Text); + } + + // crypt if (strpos($Text,'[/crypt]') !== false) { $x = random_string(); $Text = preg_replace("/\[crypt\](.*?)\[\/crypt\]/ism",'
    ' . t('Encrypted content') . '
    ', $Text); diff --git a/view/tpl/item_attach.tpl b/view/tpl/item_attach.tpl index 25c127a15..7dc8dfd59 100644 --- a/view/tpl/item_attach.tpl +++ b/view/tpl/item_attach.tpl @@ -1,6 +1,6 @@ +
    {{foreach $attaches as $a}} {{/foreach}} -
    -- cgit v1.2.3 From 4d23902d48e468e91f23c0ce767427a078f40103 Mon Sep 17 00:00:00 2001 From: marijus Date: Thu, 30 Jan 2014 00:11:17 +0100 Subject: oups --- doc/bbcode.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/bbcode.html b/doc/bbcode.html index d46f9d05a..cb8286ad7 100644 --- a/doc/bbcode.html +++ b/doc/bbcode.html @@ -1,5 +1,5 @@

    BBcode reference

    -
    +


    • [b]bold[/b] - bold
      -- cgit v1.2.3 From 75022367e5c3ecec24ec66acff162d6dd534486c Mon Sep 17 00:00:00 2001 From: marijus Date: Thu, 30 Jan 2014 00:15:13 +0100 Subject: minor whitespace cleanup --- include/bbcode.php | 1 - 1 file changed, 1 deletion(-) diff --git a/include/bbcode.php b/include/bbcode.php index 57494bd7a..2e2faddd6 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -439,7 +439,6 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { if (strpos($Text,'[/center]') !== false) { $Text = preg_replace("(\[center\](.*?)\[\/center\])ism","
      $1
      ",$Text); } - // Check for list text $Text = str_replace("[*]", "
    • ", $Text); -- cgit v1.2.3