]> git.mxchange.org Git - friendica.git/commitdiff
New option to enable and disable the "share" element
authorMichael Vogel <icarus@dabo.de>
Thu, 20 Dec 2012 23:08:58 +0000 (00:08 +0100)
committerMichael Vogel <icarus@dabo.de>
Thu, 20 Dec 2012 23:08:58 +0000 (00:08 +0100)
Changes to "vier" to use more "font awesome" icons

htconfig.php
include/bbcode.php
include/diaspora.php
include/items.php
mod/share.php
view/theme/vier/nav.tpl
view/theme/vier/style.css
view/theme/vier/theme.php
view/theme/vier/wall_thread.tpl

index bb0f47727ab289aab61e6ddaeda97eb8e20f0482..e8aec1090900d6a8baa0946013541e37a7ac212f 100644 (file)
@@ -92,5 +92,5 @@ $a->config['system']['lockpath'] = "";
 // If enabled, the MyBB fulltext engine is used
 // $a->config['system']['use_fulltext_engine'] = true;
 
-// Let reshared messages look like wall-to-wall posts
-// $a->config['system']['diaspora_newreshare'] = true;
+// Use the new "share" element
+// $a->config['system']['new_share'] = true;
index e09b1ed34259ffb02471dda4a9990899c46886ec..f3c4e360d5abc22a2a9c817c7e19c987b6444741 100644 (file)
@@ -3,6 +3,14 @@
 require_once("include/oembed.php");
 require_once('include/event.php');
 
+function bb_cleanstyle($st) {
+  return "<span style=\"".cleancss($st[1]).";\">".$st[2]."</span>";
+}
+
+function bb_cleanclass($st) {
+  return "<span class=\"".cleancss($st[1])."\">".$st[2]."</span>";
+}
+
 function cleancss($input) {
 
        $cleaned = "";
@@ -385,10 +393,10 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
        $Text = str_replace("[*]", "<li>", $Text);
 
        // Check for style sheet commands
-       $Text = preg_replace("(\[style=(.*?)\](.*?)\[\/style\])ism","<span style=\"$1;\">$2</span>",$Text);
+       $Text = preg_replace_callback("(\[style=(.*?)\](.*?)\[\/style\])ism","bb_cleanstyle",$Text);
 
        // Check for CSS classes
-       $Text = preg_replace("(\[class=(.*?)\](.*?)\[\/class\])ism","<span class=\"$1\">$2</span>",$Text);
+       $Text = preg_replace_callback("(\[class=(.*?)\](.*?)\[\/class\])ism","bb_cleanclass",$Text);
 
        // handle nested lists
        $endlessloop = 0;
index b14402b5a24cffade05e6fd14886ca1bdd88d053..5fd4a4d3fddc1dc5a20e711a4b00b45c02258aa4 100755 (executable)
@@ -960,12 +960,12 @@ function diaspora_reshare($importer,$xml,$msg) {
 
        $person = find_diaspora_person_by_handle($orig_author);
 
-       if(is_array($person) && x($person,'name') && x($person,'url'))
+       /*if(is_array($person) && x($person,'name') && x($person,'url'))
                $details = '[url=' . $person['url'] . ']' . $person['name'] . '[/url]';
        else
                $details = $orig_author;
 
-       $prefix = html_entity_decode("&#x2672; ", ENT_QUOTES, 'UTF-8') . $details . "\n";
+       $prefix = html_entity_decode("&#x2672; ", ENT_QUOTES, 'UTF-8') . $details . "\n";*/
 
 
        // allocate a guid on our system - we aren't fixing any collisions.
@@ -1012,7 +1012,7 @@ function diaspora_reshare($importer,$xml,$msg) {
                        }
                }
        }
-       
+
        $datarray['uid'] = $importer['uid'];
        $datarray['contact-id'] = $contact['id'];
        $datarray['wall'] = 0;
@@ -1024,15 +1024,7 @@ function diaspora_reshare($importer,$xml,$msg) {
        $datarray['owner-name'] = $contact['name'];
        $datarray['owner-link'] = $contact['url'];
        $datarray['owner-avatar'] = ((x($contact,'thumb')) ? $contact['thumb'] : $contact['photo']);
-       if (intval(get_config('system','diaspora_newreshare'))) {
-               // Let reshared messages look like wall-to-wall posts
-               // we have to set an additional value in the item in the future
-               // to distinct the wall-to-wall-posts from reshared/repeated messages
-               $datarray['author-name'] = $person['name'];
-               $datarray['author-link'] = $person['url'];
-               $datarray['author-avatar'] = ((x($person,'thumb')) ? $person['thumb'] : $person['photo']);
-               $datarray['body'] = $body;
-       } else {
+       if (intval(get_config('system','new_share'))) {
                $prefix = "[share author='".$person['name'].
                                "' profile='".$person['url'].
                                "' avatar='".((x($person,'thumb')) ? $person['thumb'] : $person['photo']).
@@ -1041,6 +1033,12 @@ function diaspora_reshare($importer,$xml,$msg) {
                $datarray['author-link'] = $contact['url'];
                $datarray['author-avatar'] = $contact['thumb'];
                $datarray['body'] = $prefix.$body."[/share]";
+       } else {
+               // Let reshared messages look like wall-to-wall posts
+               $datarray['author-name'] = $person['name'];
+               $datarray['author-link'] = $person['url'];
+               $datarray['author-avatar'] = ((x($person,'thumb')) ? $person['thumb'] : $person['photo']);
+               $datarray['body'] = $body;
        }
 
        $datarray['tag'] = $str_tags;
index b5e6062b23f7c55eebf6ffdc1aab09a84b348eff..65c04f0a2f3ee238e7554c7475174c37d3a71d2a 100755 (executable)
@@ -808,20 +808,22 @@ function get_atom_elements($feed,$item) {
                if (($name != "") and ($uri != "") and ($avatar != "") and ($message != "")) {
                        logger('get_atom_elements: fixing sender of repeated message.');
 
-                       /*$res["owner-name"] = $res["author-name"];
-                       $res["owner-link"] = $res["author-link"];
-                       $res["owner-avatar"] = $res["author-avatar"];
-
-                       $res["author-name"] = $name;
-                       $res["author-link"] = $uri;
-                       $res["author-avatar"] = $avatar;*/
-
-                       $prefix = "[share author='".$name.
-                                       "' profile='".$uri.
-                                       "' avatar='".$avatar.
-                                       "' link='".$orig_uri."']";
-
-                       $res["body"] = $prefix.html2bbcode($message)."[/share]";
+                       if (intval(get_config('system','new_share'))) {
+                               $prefix = "[share author='".$name.
+                                               "' profile='".$uri.
+                                               "' avatar='".$avatar.
+                                               "' link='".$orig_uri."']";
+
+                               $res["body"] = $prefix.html2bbcode($message)."[/share]";
+                       } else {
+                               $res["owner-name"] = $res["author-name"];
+                               $res["owner-link"] = $res["author-link"];
+                               $res["owner-avatar"] = $res["author-avatar"];
+
+                               $res["author-name"] = $name;
+                               $res["author-link"] = $uri;
+                               $res["author-avatar"] = $avatar;
+                       }
                }
        }
 
index 761220ad7fca94509f6a4d7cf3619d8eaacff821..e372031bbf6b55d90bc70949bfe8ffc69e7e1a57 100644 (file)
@@ -18,15 +18,30 @@ function share_init(&$a) {
        if(! count($r) || ($r[0]['private'] == 1))
                killme();
 
-       $o = '';
-
-       $o .= "\xE2\x99\xb2" . ' [url=' . $r[0]['author-link'] . ']' . $r[0]['author-name'] . '[/url]' . "\n";
-       if($r[0]['title'])
-               $o .= '[b]' . $r[0]['title'] . '[/b]' . "\n";
-       $o .= $r[0]['body'] . "\n" ;
-
-       $o .= (($r[0]['plink']) ? '[url=' . $r[0]['plink'] . ']' . t('link') . '[/url]' . "\n" : '');
-
+       if (intval(get_config('system','new_share'))) {
+               if (strpos($r[0]['body'], "[/share]") !== false) {
+                       $pos = strpos($r[0]['body'], "[share");
+                       $o = substr($r[0]['body'], $pos);
+               } else {
+                       $o = "[share author='".$r[0]['author-name'].
+                               "' profile='".$r[0]['author-link'].
+                               "' avatar='".$r[0]['author-avatar'].
+                               "' link='".$r[0]['plink']."']\n";
+                       if($r[0]['title'])
+                               $o .= '[b]'.$r[0]['title'].'[/b]'."\n";
+                       $o .= $r[0]['body'];
+                       $o.= "[/share]";
+               }
+       } else {
+               $o = '';
+
+               $o .= "\xE2\x99\xb2" . ' [url=' . $r[0]['author-link'] . ']' . $r[0]['author-name'] . '[/url]' . "\n";
+               if($r[0]['title'])
+                       $o .= '[b]' . $r[0]['title'] . '[/b]' . "\n";
+               $o .= $r[0]['body'] . "\n" ;
+
+               $o .= (($r[0]['plink']) ? '[url=' . $r[0]['plink'] . ']' . t('link') . '[/url]' . "\n" : '');
+       }
        echo $o;
-       killme();  
+       killme();
 }
index f615be85f0a34e3b7f474367ec50d539c63ed8cc..8a8b53dd8097dd49663b42c07e09a7a24d9fad50 100644 (file)
@@ -35,7 +35,7 @@
                         </li>           
                 {{ endif }}
 
-               <li id="nav-site-linkmenu" class="nav-menu-icon"><a href="#" rel="#nav-site-menu"><span class="icon s22 gear">Site</span></a>
+               <li id="nav-site-linkmenu" class="nav-menu-icon"><a href="#" rel="#nav-site-menu"><span class="icon s22 gear"></span></a>
                        <ul id="nav-site-menu" class="menu-popup">
                                {{ if $nav.manage }}<li><a class="$nav.manage.2" href="$nav.manage.0" title="$nav.manage.3">$nav.manage.1</a></li>{{ endif }}                           
                                {{ if $nav.help }} <li><a class="$nav.help.2" target="friendica-help" href="$nav.help.0" title="$nav.help.3" >$nav.help.1</a></li>{{ endif }}
@@ -50,7 +50,7 @@
                        </ul>           
                </li>
                {{ if $nav.notifications }}
-                       <li  id="nav-notifications-linkmenu" class="nav-menu-icon"><a href="$nav.notifications.0" rel="#nav-notifications-menu" title="$nav.notifications.1"><span class="icon s22 notify">$nav.notifications.1</span></a>
+                       <li  id="nav-notifications-linkmenu" class="nav-menu-icon"><a href="$nav.notifications.0" rel="#nav-notifications-menu" title="$nav.notifications.1"><span class="icon s22 notify"></span></a>
                                <span id="notify-update" class="nav-notify"></span>
                                <ul id="nav-notifications-menu" class="menu-popup">
                                        <li id="nav-notifications-mark-all"><a href="#" onclick="notifyMarkAll(); return false;">$nav.notifications.mark.1</a></li>
index e02a23dbe17c0016e993c74d803cd9f5c6ceb954..425beb2bfb636021d06d1e32cad5b0d1584ef6ef 100644 (file)
@@ -5,6 +5,7 @@
 
 /* @import "css/font-awesome.css"; */
 @import url("css/font-awesome.css") all;
+@import url("css/font2.css") all;
 
 /* ========= */
 /* = Admin = */
 #adminpage .selectall { text-align: right; }
 /* icons */
 
-.icon.bb-url{
-  background-image: url("../../../view/theme/diabook/icons/bb-url.png");
-  float: right;
-  margin-top: 2px;}
-.icon.quote{
-  background-image: url("../../../view/theme/diabook/icons/quote.png");
-  float: right;
-  margin-top: 2px;}
-.icon.bold{
-  background-image: url("../../../view/theme/diabook/icons/bold.png");
-  float: right;
-  margin-top: 2px;}
-.icon.underline{
-  background-image: url("../../../view/theme/diabook/icons/underline.png");
-  float: right;
-  margin-top: 2px;}
-.icon.italic{
-  background-image: url("../../../view/theme/diabook/icons/italic.png");
-  float: right;
-  margin-top: 2px;}
-.icon.bb-image{
-  background-image: url("../../../view/theme/diabook/icons/bb-image.png");
-  float: right;
-  margin-top: 2px;}
-.icon.bb-video{
-  background-image: url("../../../view/theme/diabook/icons/bb-video.png");
-  float: right;
-  margin-top: 2px;}
-
+/*
 .article       { background-position: -50px  0px;}
 .audio                 { background-position: -70px  0px;}
 .block                 { background-position: -90px  0px;}
 .prev           { background-position: -90px  -60px;}
 .next           { background-position: -110px -60px;}
 .tagged     { background-position: -130px -60px;}
+*/
 
+/*
 .attachtype {
         display: block; width: 20px; height: 23px;
         background-image: url('../../../images/content-types.png');
 .type-audio { background-position: -40px 0px; }
 .type-text  { background-position: -60px 0px; }
 .type-unkn  { background-position: -80px 0px; }
+*/
 
 .icon.drop, .icon.drophide {
  float: left;
 }
 
+
 .icon {
+  background-color: transparent ;
+  background-repeat: no-repeat;
+  width: 18px;
+  height: 18px;
+  display: block;
+  overflow: hidden;
+  padding: 1px;
+  color: #999;
+} 
+
+.icon:hover {
+  text-decoration: none;
+  color: #000;
+}
+
+.icon a:hover {
+}
+
+/*.icon {
   display: block;
   width: 18px;
   height: 18px;
 .icon {
   background-color: transparent ;
   background-repeat: no-repeat;
-  /* background-position: left center; */
   display: block;
   overflow: hidden;
   text-indent: -9999px;
   padding: 1px;
-}
+} */
 
 .icon.text {
   text-indent: 0px;
 .icon.s10.add {
   background-image: url("../../../images/icons/10/add.png");
 }
-.icon.s10.delete {
-  background-image: url("../../../images/icons/10/delete.png");
-}
-.icon.s10.edit {
-  background-image: url("../../../images/icons/10/edit.png");
-}
-.icon.s10.star {
-  background-image: url("../../../images/icons/10/star.png");
-}
 .icon.s10.menu {
   background-image: url("../../../images/icons/10/menu.png");
 }
-.icon.s10.link {
-  background-image: url("../../../images/icons/10/link.png");
-}
-.icon.s10.lock {
-  background-image: url("../../../images/icons/10/lock.png");
-}
-.icon.s10.unlock {
-  background-image: url("../../../images/icons/10/unlock.png");
-}
 .icon.s10.text {
   padding: 2px 0px 0px 15px;
   font-size: 10px;
 .icon.s16.add {
   background-image: url("../../../images/icons/16/add.png");
 }
-.icon.s16.delete {
-  background-image: url("../../../images/icons/16/delete.png");
-}
-/*.icon.s16.edit {
-  background-image: url("../../../images/icons/16/edit.png");
-}*/
-.icon.s16.star {
-  background-image: url("../../../images/icons/16/star.png");
-}
 .icon.s16.menu {
   background-image: url("../../../images/icons/16/menu.png");
 }
-/*.icon.s16.link {
-  background-image: url("../../../images/icons/16/link.png");
-}*/
-.icon.s16.lock {
-  background-image: url("../../../images/icons/16/lock.png");
-}
-.icon.s16.unlock {
-  background-image: url("../../../images/icons/16/unlock.png");
-}
 .icon.s16.text {
   padding: 4px 0px 0px 20px;
   font-size: 10px;
 .icon.s22.add {
   background-image: url("../../../images/icons/22/add.png");
 }
-.icon.s22.delete {
-  background-image: url("../../../images/icons/22/delete.png");
-}
-.icon.s22.edit {
-  background-image: url("../../../images/icons/22/edit.png");
-}
-.icon.s22.star {
-  background-image: url("../../../images/icons/22/star.png");
-}
 .icon.s22.menu {
   background-image: url("../../../images/icons/22/menu.png");
 }
-.icon.s22.link {
-  background-image: url("../../../images/icons/22/link.png");
-}
-.icon.s22.lock {
-  background-image: url("../../../images/icons/22/lock.png");
-}
-.icon.s22.unlock {
-  background-image: url("../../../images/icons/22/unlock.png");
-}
 .icon.s22.text {
   padding: 10px 0px 0px 25px;
-  width: 200px;
+  width: 230px;
+  font-size: 1em;
 }
 .icon.s48 {
   width: 48px;
 .icon.s48.add {
   background-image: url("../../../images/icons/48/add.png");
 }
-.icon.s48.delete {
-  background-image: url("../../../images/icons/48/delete.png");
-}
-.icon.s48.edit {
-  background-image: url("../../../images/icons/48/edit.png");
-}
-.icon.s48.star {
-  background-image: url("../../../images/icons/48/star.png");
-}
 .icon.s48.menu {
   background-image: url("../../../images/icons/48/menu.png");
 }
-.icon.s48.link {
-  background-image: url("../../../images/icons/48/link.png");
-}
-.icon.s48.lock {
-  background-image: url("../../../images/icons/48/lock.png");
-}
-.icon.s48.unlock {
-  background-image: url("../../../images/icons/48/unlock.png");
-}
 .sparkle {
        cursor: url('lock.cur'), pointer;
 }
@@ -355,10 +279,10 @@ div.pager, .birthday-notice {
   border-radius: 6px;
   background-color: #f2f2f2;
   clear: left;
-  margin-top: 15px;
+  margin-top: 5px;
   padding: 1%;
   height: 1em;
-  margin-bottom: 15px;
+  margin-bottom: 5px;
 }
 
 .birthday-notice {
@@ -587,6 +511,7 @@ header #banner #logo-text {
 }
 /* nav */
 nav {
+  min-width: 1000px;
   width: 100%;
   height: 32px;
   position: fixed;
@@ -633,7 +558,7 @@ nav ul li .menu-popup {
   right: auto;
 }
 nav #search-box #search-text {
-  background-image:  url('icons/lupe.png');
+  /* background-image:  url('icons/lupe.png'); */
   background-repeat:no-repeat;
   padding-left:0px;
   border-top-left-radius: 15px;
@@ -881,8 +806,8 @@ ul.menu-popup .empty {
 aside {
   display: table-cell;
   vertical-align: top;
-  width: 185px;
-  padding: 0px 10px 0px 20px;
+  width: 195px;
+  padding: 10px 10px 10px 10px;
   border-right: 1px solid #D2D2D2;
   background-color: #ECECF2;
   font-size: 14px;
@@ -1075,7 +1000,7 @@ section {
   display: table-cell;
   vertical-align: top;
   width: 760px;
-  padding: 0px 0px 0px 10px;
+  padding: 10px 0px 10px 10px;
 }
 /* wall item */
 .tread-wrapper {
@@ -1743,7 +1668,7 @@ ul.tabs a {
     float: left;
 }
 
-ul.tabs a, #jot-preview-link, .comment-edit-submit-wrapper .fakelink, .comment-edit-bb a{
+ul.tabs a, #jot-preview-link, .comment-edit-submit-wrapper .fakelink {
     /* padding: 0px 10px 1px 10px; */
     padding: 0px 5px 1px 5px;
     -webkit-border-radius: 4px;
@@ -1764,7 +1689,7 @@ ul.tabs a, #jot-preview-link, .comment-edit-submit-wrapper .fakelink, .comment-e
     background: linear-gradient(top, #ffffff 0%,#ececf2 100%);
 }
 
-ul.tabs li .active, ul.tabs a:hover, #jot-preview-link:hover, .comment-edit-submit-wrapper .fakelink:hover, .comment-edit-bb a:hover {
+ul.tabs li .active, ul.tabs a:hover, #jot-preview-link:hover, .comment-edit-submit-wrapper .fakelink:hover, {
 
     color: #fff;
     text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.5);
@@ -1783,6 +1708,15 @@ ul.tabs li .active, ul.tabs a:hover, #jot-preview-link:hover, .comment-edit-subm
 .comment-edit-bb {
   float:right;
 }
+.comment-edit-bb a {
+  color: #888;
+  padding: 0px 5px 1px 5px;
+}
+
+.comment-edit-bb a:hover {
+  color: #000;
+  text-decoration: none;
+}
 
 /**
  * Form fields
index db74385c8b23c42a58622634c17b32b06439d563..20da528147a8f6e7ccc29e2f361a99933986b496 100644 (file)
@@ -1,10 +1,11 @@
 <?php
 /**
  * Name: Vier
- * Version: 0.1
+ * Version: 0.9
  * Author: Fabio <http://kirgroup.com/profile/fabrixxm>
  * Author: Ike <http://pirati.ca/profile/heluecht>
  * Maintainer: Ike <http://pirati.ca/profile/heluecht>
+ * Description: "Vier" uses the font awesome font library: http://fortawesome.github.com/Font-Awesome/
  */
 
 $a->theme_info = array();
index db3e209b6e0e85f61b00ab595c16e03e2dec5db1..d535704605467e5e4af6be76d4301e1787642f84 100644 (file)
@@ -54,7 +54,7 @@
                        <a href="$item.profile_url" target="redir" title="$item.linktitle" class="wall-item-name-link"><span class="wall-item-name$item.sparkle">$item.name</span></a>
                         {{ if $item.owner_url }}$item.via <a href="$item.owner_url" target="redir" title="$item.olinktitle" class="wall-item-name-link"><span class="wall-item-name$item.osparkle" id="wall-item-ownername-$item.id">$item.owner_name</span></a> <!-- $item.vwall -->{{ endif }}
                        <span class="wall-item-ago">-
-                               {{ if $item.plink }}<a class="link" title="$item.plink.title" href="$item.plink.href" style="color: #999">$item.ago</a>{{ else }} $item.ago {{ endif }}
+                               {{ if $item.plink }}<a title="$item.plink.title" href="$item.plink.href" style="color: #999">$item.ago</a>{{ else }} $item.ago {{ endif }}
                                {{ if $item.lock }} - <span class="fakelink" style="color: #999" onclick="lockview(event,$item.id);">$item.lock</span> {{ endif }}
                        </span>
                </div>