]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #850 from annando/master
authortobiasd <tobias.diekershoff@gmx.net>
Mon, 9 Dec 2013 07:15:07 +0000 (23:15 -0800)
committertobiasd <tobias.diekershoff@gmx.net>
Mon, 9 Dec 2013 07:15:07 +0000 (23:15 -0800)
New style for shared links. Preparation for changes in some addons

include/bbcode.php
include/text.php
index.php
mod/network.php
mod/parse_url.php
view/theme/vier/style.css

index 412010380dc45c4867564ee673c71e7b4c6bea49..ff0d32772b8f942b4d0b9e5aa6c17b4057483088 100644 (file)
@@ -23,7 +23,7 @@ function cleancss($input) {
                if (($char >= "a") and ($char <= "z"))
                        $cleaned .= $char;
 
-               if (!(strpos(" #;:0123456789", $char) === false))
+               if (!(strpos(" #;:0123456789-_", $char) === false))
                        $cleaned .= $char;
        }
 
index ea36a2a01699d6b9794a611a6a2743721ddc49de..d41e7689e287cb84522ea78df0f0ade46484df0e 100644 (file)
@@ -21,7 +21,7 @@ if(! function_exists('replace_macros')) {
  * @return string substituted string
  */
 function replace_macros($s,$r) {
-       
+
        $stamp1 = microtime(true);
 
        $a = get_app();
@@ -55,7 +55,7 @@ function random_string($size = 64,$type = RANDOM_STRING_HEX) {
 
 if(! function_exists('notags')) {
 /**
- * This is our primary input filter. 
+ * This is our primary input filter.
  *
  * The high bit hack only involved some old IE browser, forget which (IE5/Mac?)
  * that had an XSS attack vector due to stripping the high-bit on an 8-bit character
@@ -278,12 +278,18 @@ function paginate_data(&$a, $count=null) {
        $stripped = str_replace('q=','',$stripped);
        $stripped = trim($stripped,'/');
        $pagenum = $a->pager['page'];
+
+       if (!strstr($stripped, "?")) {
+               $pos = strpos($stripped, "&");
+               $stripped = substr($stripped, 0, $pos)."?".substr($stripped, $pos + 1);
+       }
+
        $url = $a->get_baseurl() . '/' . $stripped;
 
 
        $data = array();
-       function _l(&$d, $name, $url, $text, $class="") { 
-               
+       function _l(&$d, $name, $url, $text, $class="") {
+
                $d[$name] = array('url'=>$url, 'text'=>$text, 'class'=>$class); 
        }
 
@@ -359,7 +365,7 @@ if(! function_exists('paginate')) {
  * @return string html for pagination #FIXME remove html
  */
 function paginate(&$a) {
-       
+
        $data = paginate_data($a);
        $tpl = get_markup_template("paginate.tpl");
        return replace_macros($tpl, array("pager" => $data));
index 98c7bce1113fa295fddad63bb6e96810ff4ffc45..e751dcbaf9f0dc5bec666fd71f747b30cca136f8 100644 (file)
--- a/index.php
+++ b/index.php
@@ -471,7 +471,7 @@ if ($_GET["mode"] == "raw") {
 
        foreach ($_GET AS $param => $value)
                if (($param != "page") AND ($param != "q"))
-                       $reload_uri .= "&".$param."=".$value;
+                       $reload_uri .= "&".$param."=".urlencode($value);
 
 $a->page['htmlhead'] .= <<< EOT
 <script type="text/javascript">
index 4c24943b07a908dc4ddb1ec6b0e0158da31db33c..ae1097e58ea84d475529acd3404b027fd01ce5ea 100644 (file)
@@ -115,21 +115,21 @@ function network_init(&$a) {
                        '/network?f=&bmark=1',                  //bookmarked
                        '/network?f=&spam=1',                   //spam
                );
-               
+
                // redirect if current selected tab is 'no_active' and
-               // last selected tab is _not_ 'all_active'. 
+               // last selected tab is _not_ 'all_active'.
                // and this isn't a date query
 
                if ($sel_tabs[0] == 'active' && $last_sel_tabs[0]!='active' && (! $is_a_date_query)) {
                        $k = array_search('active', $last_sel_tabs);
-          
+
             // merge tab querystring with request querystring
             $dest_qa = array();
             list($dest_url,$dest_qs) = explode("?", $tab_urls[$k]);
             parse_str( $dest_qs, $dest_qa);
             $dest_qa = array_merge($query_array, $dest_qa);
             $dest_qs = build_querystring($dest_qa);
-            
+
             // groups filter is in form of "network/nnn". Add it to $dest_url, if it's possible
             if ($a->argc==2 && is_numeric($a->argv[1]) && strpos($dest_url, "/",1)===false){
                 $dest_url .= "/".$a->argv[1];
index 3e172862565237f5a9219551b3ec82d508fcb708..cb7268c1df83acd0e14bb9db4e0b1617346e2bc4 100644 (file)
@@ -75,6 +75,19 @@ function parseurl_getsiteinfo($url, $no_guessing = false) {
                return($siteinfo);
        }
 
+       require_once("include/oembed.php");
+
+       $oembed_data = oembed_fetch_url($url);
+
+       if ($oembed_data->type == "link") {
+               if (isset($oembed_data->title))
+                       $siteinfo["title"] = $oembed_data->title;
+               if (isset($oembed_data->description))
+                       $siteinfo["text"] = $oembed_data->description;
+               if (isset($oembed_data->thumbnail_url))
+                       $siteinfo["image"] = $oembed_data->thumbnail_url;
+       }
+
        // Fetch the first mentioned charset. Can be in body or header
        if (preg_match('/charset=(.*?)['."'".'"\s\n]/', $header, $matches))
                $charset = trim(array_pop($matches));
index d340f12d60f4ab6908cc40dae05e9af0a46388ef..e1f9b3def923ee7365fd9dce6addfa5a6adac5dc 100644 (file)
@@ -479,6 +479,11 @@ div.jGrowl div.info {
   color: #ffffff;
   padding-left: 58px;
 }
+
+div.jGrowl div.jGrowl-notification {
+  margin-top: 40px;
+}
+
 /* header */
 header {
   position: fixed;
@@ -1161,6 +1166,21 @@ border-bottom: 1px solid #D2D2D2;
   font-size: 12px;
 }
 
+.wall-item-container .wall-item-content .type-link img,
+.type-link img {
+  max-width: 160px;
+  max-height: 160px;
+  float: left;
+  margin-right: 10px;
+}
+.type-link blockquote {
+  margin-left: 160px;
+  max-height: 160px;
+  overflow: hidden;
+}
+.type-link .oembed {
+}
+
 .wall-item-container .wall-item-content {
   font-size: 14px;
   max-width: 660px;
@@ -1659,22 +1679,27 @@ border-bottom: 1px solid #D2D2D2;
 #profile-link-wrapper {
   float: left;
   margin-left: 15px;
+  cursor: pointer;
 }
 #profile-video-wrapper {
   float: left;
   margin-left: 15px;
+  cursor: pointer;
 }
 #profile-audio-wrapper {
   float: left;
   margin-left: 15px;
+  cursor: pointer;
 }
 #profile-location-wrapper {
   float: left;
   margin-left: 15px;
+  cursor: pointer;
 }
 #profile-nolocation-wrapper {
   float: left;
   margin-left: 15px;
+  cursor: pointer;
 }
 #jot-perms-icon {
   float: right;