aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-03-13 20:46:37 -0700
committerfriendica <info@friendica.com>2012-03-13 20:46:37 -0700
commit4972d7ef6ee740f6eb09d8c7efa9a76ee40973c1 (patch)
treee27d165beb084a7fea27e9cd5b2a8a9c6da4b1f8 /include
parentde017d1ed76500c01fd11c8e1d36cf4ebd70172d (diff)
downloadvolse-hubzilla-4972d7ef6ee740f6eb09d8c7efa9a76ee40973c1.tar.gz
volse-hubzilla-4972d7ef6ee740f6eb09d8c7efa9a76ee40973c1.tar.bz2
volse-hubzilla-4972d7ef6ee740f6eb09d8c7efa9a76ee40973c1.zip
more work on filer, comment level and file tag removal
Diffstat (limited to 'include')
-rwxr-xr-xinclude/conversation.php34
-rwxr-xr-xinclude/oembed.php5
-rw-r--r--include/text.php9
3 files changed, 28 insertions, 20 deletions
diff --git a/include/conversation.php b/include/conversation.php
index a420e9923..117127a28 100755
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -560,25 +560,28 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
);
$star = false;
+ $filer = false;
+
$isstarred = "unstarred";
- if ($profile_owner == local_user() && $toplevelpost) {
- $isstarred = (($item['starred']) ? "starred" : "unstarred");
-
- $star = array(
- 'do' => t("add star"),
- 'undo' => t("remove star"),
- 'toggle' => t("toggle star status"),
- 'classdo' => (($item['starred']) ? "hidden" : ""),
- 'classundo' => (($item['starred']) ? "" : "hidden"),
- 'starred' => t('starred'),
- 'tagger' => t("add tag"),
- 'filer' => t("file as"),
- 'classtagger' => "",
- );
+ if ($profile_owner == local_user()) {
+ if($toplevelpost) {
+ $isstarred = (($item['starred']) ? "starred" : "unstarred");
+
+ $star = array(
+ 'do' => t("add star"),
+ 'undo' => t("remove star"),
+ 'toggle' => t("toggle star status"),
+ 'classdo' => (($item['starred']) ? "hidden" : ""),
+ 'classundo' => (($item['starred']) ? "" : "hidden"),
+ 'starred' => t('starred'),
+ 'tagger' => t("add tag"),
+ 'classtagger' => "",
+ );
+ }
+ $filer = t("file as");
}
-
$photo = $item['photo'];
$thumb = $item['thumb'];
@@ -672,6 +675,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
'edpost' => $edpost,
'isstarred' => $isstarred,
'star' => $star,
+ 'filer' => $filer,
'drop' => $drop,
'vote' => $likebuttons,
'like' => $like,
diff --git a/include/oembed.php b/include/oembed.php
index 52068efc7..cc71f9757 100755
--- a/include/oembed.php
+++ b/include/oembed.php
@@ -1,6 +1,6 @@
<?php
function oembed_replacecb($matches){
- logger('oembedcb');
+// logger('oembedcb');
$embedurl=$matches[1];
$j = oembed_fetch_url($embedurl);
$s = oembed_format_object($j);
@@ -14,6 +14,9 @@ function oembed_fetch_url($embedurl){
$txt = Cache::get($embedurl);
+ // These media files should now be caught in bbcode.php
+ // left here as a fallback in case this is called from another source
+
$noexts = array("mp3","mp4","ogg","ogv","oga","ogm","webm");
$ext = pathinfo(strtolower($embedurl),PATHINFO_EXTENSION);
diff --git a/include/text.php b/include/text.php
index c44b4d178..199460d2c 100644
--- a/include/text.php
+++ b/include/text.php
@@ -874,6 +874,7 @@ function link_compare($a,$b) {
if(! function_exists('prepare_body')) {
function prepare_body($item,$attach = false) {
+ $a = get_app();
call_hooks('prepare_body_init', $item);
$s = prepare_text($item['body']);
@@ -916,7 +917,7 @@ function prepare_body($item,$attach = false) {
$matches = false;
$cnt = preg_match_all('/<(.*?)>/',$item['file'],$matches,PREG_SET_ORDER);
if($cnt) {
- logger('prepare_text: categories: ' . print_r($matches,true), LOGGER_DEBUG);
+// logger('prepare_text: categories: ' . print_r($matches,true), LOGGER_DEBUG);
foreach($matches as $mtch) {
if(strlen($x))
$x .= ',';
@@ -931,11 +932,11 @@ function prepare_body($item,$attach = false) {
$x = '';
$cnt = preg_match_all('/\[(.*?)\]/',$item['file'],$matches,PREG_SET_ORDER);
if($cnt) {
- logger('prepare_text: filed_under: ' . print_r($matches,true), LOGGER_DEBUG);
+// logger('prepare_text: filed_under: ' . print_r($matches,true), LOGGER_DEBUG);
foreach($matches as $mtch) {
if(strlen($x))
- $x .= ',';
- $x .= file_tag_decode($mtch[1]);
+ $x .= '&nbsp;&nbsp;&nbsp;';
+ $x .= file_tag_decode($mtch[1]). ' <a href="' . $a->get_baseurl() . '/filerm/' . $item['id'] . '?f=&term=' . file_tag_decode($mtch[1]) . '" title="' . t('remove') . '" >' . t('[remove]') . '</a>';
}
if(strlen($x) && (local_user() == $item['uid']))
$s .= '<div class="filesavetags"><span>' . t('Filed under:') . ' </span>' . $x . '</div>';