]> git.mxchange.org Git - friendica.git/commitdiff
New template for shared content instead of hardcoded stuff in source
authorMichael Vogel <icarus@dabo.de>
Tue, 7 Jun 2016 20:29:50 +0000 (22:29 +0200)
committerMichael Vogel <icarus@dabo.de>
Tue, 7 Jun 2016 20:29:50 +0000 (22:29 +0200)
include/bbcode.php
view/templates/shared-content.tpl [new file with mode: 0644]
view/theme/duepuntozero/style.css
view/theme/frio/css/style.css
view/theme/vier/style.css

index 6cce25bcf4ab1a92df350176a682d02b3cad0e1f..bb4f77ebf9344e30043c6b5955f39c7ff3fdce06 100644 (file)
@@ -396,18 +396,17 @@ function bb_ShareAttributes($share, $simplehtml) {
 
        $itemcache = get_itemcachepath();
 
-       // relative dates only make sense when they aren't cached
-       if ($itemcache == "") {
-               preg_match("/posted='(.*?)'/ism", $attributes, $matches);
-               if ($matches[1] != "")
-                       $posted = $matches[1];
+       preg_match("/posted='(.*?)'/ism", $attributes, $matches);
+       if ($matches[1] != "")
+               $posted = $matches[1];
 
-               preg_match('/posted="(.*?)"/ism', $attributes, $matches);
-               if ($matches[1] != "")
-                       $posted = $matches[1];
+       preg_match('/posted="(.*?)"/ism', $attributes, $matches);
+       if ($matches[1] != "")
+               $posted = $matches[1];
 
+       // relative dates only make sense when they aren't cached
+       if ($itemcache == "")
                $reldate = (($posted) ? " " . relative_date($posted) : '');
-       }
 
        $data = get_contact_details_by_url($profile);
 
@@ -489,16 +488,20 @@ function bb_ShareAttributes($share, $simplehtml) {
                                $text .= "<br /><br />".$link;
                        break;
                default:
-                       $headline = trim($share[1])."\n";
-                       $headline .= '<div class="shared-wrapper">'."\n";
-                       $headline .= '<div class="shared_header">'."\n";
-                       if ($avatar != "")
-                               $headline .= '<img src="'.proxy_url($avatar, false, PROXY_SIZE_MICRO).'" height="32" width="32" >';
-
-                       $headline .= sprintf(t('<span><a href="%s" target="_blank">%s</a> wrote the following <a href="%s" target="_blank">post</a>'.$reldate.':</span>'), $profile, $author, $link);
-                       $headline .= "</div>\n";
-                       $text = $headline.'<blockquote class="shared_content">'.trim($share[3])."</blockquote>\n";
-                       $text .= "<div>\n";
+                       $text = trim($share[1])."\n";
+
+                       $tpl = get_markup_template('shared-content.tpl');
+                       $text .= replace_macros($tpl,
+                                       array(
+                                               '$profile' => $profile,
+                                               '$avatar' => $avatar,
+                                               '$author' => $author,
+                                               '$link' => $link,
+                                               '$posted' => $posted,
+                                               '$reldate' => $reldate,
+                                               '$content' => trim($share[3])
+                                       )
+                               );
                        break;
        }
        return($text);
diff --git a/view/templates/shared-content.tpl b/view/templates/shared-content.tpl
new file mode 100644 (file)
index 0000000..74f6aed
--- /dev/null
@@ -0,0 +1,13 @@
+<div class="shared-wrapper">
+       <div class="shared_header">
+               {{if $avatar}}
+                       <a href="{{$profile}}" target="_blank" class="shared-userinfo">
+                       <img src="{{$avatar}}" height="32" width="32">
+                       </a>
+               {{/if}}
+               {{*<span><a href="{{$profile}}" target="_blank" class="shared-wall-item-name">{{$author}}</a> wrote the following <a href="{{$link}}" target="_blank">post</a>{{$reldate}}:</span>*}}
+               <div><a href="{{$profile}}" target="_blank" class="shared-wall-item-name"><span class="shared-author">{{$author}}</span></a></div>
+               <div class="shared-wall-item-ago"><small><a href="{{$link}}" target="_blank"><span class="shared-time">{{$posted}}</a></a></small></div>
+       </div>
+       <blockquote class="shared_content">{{$content}}</blockquote>
+<div>
index 49754c83892be137e81f7255df632d777a465938..9732edb150448429a45801905a9677177e86f062 100644 (file)
@@ -1112,7 +1112,8 @@ input#dfrn-url {
        left: 65px;
 }
 
-.wall-item-ago {
+.wall-item-ago,
+.shared-time {
        color: #888888;
        font-size: 0.8em;
 }
@@ -1201,7 +1202,8 @@ input#dfrn-url {
 .wall-item-wrapper-end {
        clear: both;
 }
-.wall-item-name-link {
+.wall-item-name-link,
+.shared-author {
        font-weight: bold;
        text-decoration: none;
        color: #3172BD;
index 00d49b8a61705b8557629b7055c59939b96f90b4..81c4e690a795e85d33f96fa81c1847b1e9ed00a3 100644 (file)
@@ -1242,7 +1242,8 @@ section #jotOpen {
 .media-heading {
     margin: 0 0 5px;
 }
-.wall-item-name {
+.wall-item-name,
+.shared-author {
     font-size: 15px;
     font-weight: bold;
 }
@@ -1572,6 +1573,7 @@ ul.dropdown-menu li:hover {
 
 /* Media Classes */
 .media .time,
+.media .shared-time,
 .media .location,
 .media .location a {
     font-size: 11px;
index ebe8a895b4998304418f068da00faa83c482441e..d53c2f393f09504116eb740c5b31c6173a965a15 100644 (file)
@@ -1426,6 +1426,15 @@ section.minimal {
   font-size: 12px;
 }
 
+.shared-time {
+  color: #999;
+  font-size: 12px;
+}
+
+.shared_header {
+  line-height: 14px;
+}
+
 .wall-item-network {
   color: #999;
   font-size: 12px;
@@ -1504,7 +1513,8 @@ section.minimal {
   color: #36c;
 }
 
-.wall-item-container .wall-item-name {
+.wall-item-container .wall-item-name,
+.wall-item-container .shared-author {
   color: black;
   font-weight: bold;
   -webkit-transition: all 0.2s ease-in-out;
@@ -1515,7 +1525,9 @@ section.minimal {
 }
 
 .toplevel_item:hover .wall-item-name,
-.wall-item-container:hover .wall-item-name {
+.wall-item-container:hover .wall-item-name,
+.toplevel_item:hover .shared-author,
+.wall-item-container:hover .shared-author {
   color: #36c;
   font-weight: bold;
   -webkit-transition: all 0.2s ease-in-out;