From bae844e36767836ebf9dbfed10759dfd1a2fbbd6 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 8 Dec 2013 16:49:07 +0100 Subject: [PATCH 1/2] New style for shared links. Preparation for changes in some addons --- include/bbcode.php | 2 +- mod/parse_url.php | 13 +++++++++++++ view/theme/vier/style.css | 25 +++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/include/bbcode.php b/include/bbcode.php index 412010380d..ff0d32772b 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -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; } diff --git a/mod/parse_url.php b/mod/parse_url.php index 3e17286256..cb7268c1df 100644 --- a/mod/parse_url.php +++ b/mod/parse_url.php @@ -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)); diff --git a/view/theme/vier/style.css b/view/theme/vier/style.css index d340f12d60..e1f9b3def9 100644 --- a/view/theme/vier/style.css +++ b/view/theme/vier/style.css @@ -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; From d20d2f74ae7c50064af6c4b703e9990beccf1df9 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 8 Dec 2013 20:10:28 +0100 Subject: [PATCH 2/2] Bugfix: Page switching had a problem with the search. And automatic reloading hadn't worked with some search terms --- include/text.php | 16 +++++++++++----- index.php | 2 +- mod/network.php | 8 ++++---- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/include/text.php b/include/text.php index ea36a2a016..d41e7689e2 100644 --- a/include/text.php +++ b/include/text.php @@ -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)); diff --git a/index.php b/index.php index 98c7bce111..e751dcbaf9 100644 --- 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