]> git.mxchange.org Git - friendica.git/blobdiff - include/conversation.php
allow users to set categories on their posts
[friendica.git] / include / conversation.php
index 37856651e17f266012a3c473c22b34d1a4c925cb..df92a40ed000addbe70678ddae0200c1eff3932a 100755 (executable)
@@ -166,6 +166,13 @@ function localize_item(&$item){
                        }
                }
        }
+       $matches = null;
+       if(preg_match_all('/@\[url=(.*?)\]/is',$item['body'],$matches,PREG_SET_ORDER)) {
+               foreach($matches as $mtch) {
+                       if(! strpos($mtch[1],'zrl='))
+                               $item['body'] = str_replace($mtch[0],'@[url=' . zrl($mtch[1]). ']',$item['body']);
+               }
+       }
 
 }
 
@@ -243,7 +250,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
        $threads = array();
        $threadsid = -1;
        
-       if(count($items)) {
+       if($items && count($items)) {
 
                if($mode === 'network-new' || $mode === 'search' || $mode === 'community') {
 
@@ -525,9 +532,12 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
                                                if ($shareable) $likebuttons['share'] = array( t('Share this'), t('share'));
                                        }
 
+                                       $qc = $qcomment =  null;
 
-                                       $qc = ((local_user()) ? get_pconfig(local_user(),'qcomment','words') : null);
-                                       $qcomment = (($qc) ? explode("\n",$qc) : null);
+                                       if(in_array('qcomment',$a->plugins)) {
+                                               $qc = ((local_user()) ? get_pconfig(local_user(),'qcomment','words') : null);
+                                               $qcomment = (($qc) ? explode("\n",$qc) : null);
+                                       }
 
                                        if(($show_comment_box) || (($show_comment_box == false) && ($override_comment_box == false) && ($item['last-child']))) {
                                                $comment = replace_macros($cmnt_tpl,array(
@@ -585,7 +595,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
                                                        'classtagger' => "",
                                                );
                                        }
-                                       $filer = t("file as");
+                                       $filer = t("save to folder");
                                }
 
 
@@ -905,7 +915,7 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
                '$vidurl' => t("Please enter a video link/URL:"),
                '$audurl' => t("Please enter an audio link/URL:"),
                '$term' => t('Tag term:'),
-               '$fileas' => t('File as:'),
+               '$fileas' => t('Save to Folder:'),
                '$whereareu' => t('Where are you right now?')
        ));
 
@@ -964,6 +974,8 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
                '$shortnoloc' => t('clear location'),
                '$title' => "",
                '$placeholdertitle' => t('Set title'),
+               '$category' => "",
+               '$placeholdercategory' => t('Categories (comma-separated list)'),
                '$wait' => t('Please wait'),
                '$permset' => t('Permission settings'),
                '$shortpermset' => t('permissions'),