The page info function can now be called with a picture link, support for big and preview images for attachments in global.css

This commit is contained in:
Michael Vogel 2014-06-15 01:59:19 +02:00
parent 4c9a6ed2fb
commit 82c4e3fe50
3 changed files with 17 additions and 5 deletions

View file

@ -884,7 +884,7 @@ function get_atom_elements($feed, $item, $contact = array()) {
return $res; return $res;
} }
function add_page_info($url, $no_photos = false) { function add_page_info($url, $no_photos = false, $photo = "") {
require_once("mod/parse_url.php"); require_once("mod/parse_url.php");
$data = parseurl_getsiteinfo($url, true); $data = parseurl_getsiteinfo($url, true);
@ -905,7 +905,9 @@ function add_page_info($url, $no_photos = false) {
if (($data["type"] != "photo") AND is_string($data["title"])) if (($data["type"] != "photo") AND is_string($data["title"]))
$text .= "[bookmark=".$url."]".trim($data["title"])."[/bookmark]"; $text .= "[bookmark=".$url."]".trim($data["title"])."[/bookmark]";
if (($data["type"] != "video") AND (sizeof($data["images"]) > 0)) { if (($data["type"] != "video") AND ($photo != ""))
$text .= '[img]'.$photo.'[/img]';
elseif (($data["type"] != "video") AND (sizeof($data["images"]) > 0)) {
$imagedata = $data["images"][0]; $imagedata = $data["images"][0];
$text .= '[img]'.$imagedata["src"].'[/img]'; $text .= '[img]'.$imagedata["src"].'[/img]';
} }

View file

@ -122,7 +122,7 @@ function shortenmsg($msg, $limit, $twitter = false) {
return($msg); return($msg);
} }
function plaintext($a, $b, $limit = 0, $includedlinks = false) { function plaintext($a, $b, $limit = 0, $includedlinks = false, $htmlmode = 2) {
require_once("include/bbcode.php"); require_once("include/bbcode.php");
require_once("include/html2plain.php"); require_once("include/html2plain.php");
require_once("include/network.php"); require_once("include/network.php");
@ -136,7 +136,7 @@ function plaintext($a, $b, $limit = 0, $includedlinks = false) {
elseif ($b["title"] != "") elseif ($b["title"] != "")
$post["text"] = trim($b["title"]); $post["text"] = trim($b["title"]);
$html = bbcode($post["text"], false, false, 2); $html = bbcode($post["text"], false, false, $htmlmode);
$msg = html2plain($html, 0, true); $msg = html2plain($html, 0, true);
$msg = trim(html_entity_decode($msg,ENT_QUOTES,'UTF-8')); $msg = trim(html_entity_decode($msg,ENT_QUOTES,'UTF-8'));

View file

@ -33,13 +33,23 @@ span.connector {
clear: both; clear: both;
visibility: hidden; visibility: hidden;
} }
.wall-item-container .wall-item-content .type-link img, .wall-item-container .wall-item-content .type-link img,
.type-link img, .type-video img { .type-link img, .type-video img, img.attachment-preview {
max-width: 160px; max-width: 160px;
max-height: 160px; max-height: 160px;
float: left; float: left;
margin-right: 10px; margin-right: 10px;
} }
.wall-item-container .wall-item-content .type-link img.attachment-image,
.type-link img.attachment-image, .type-video img.attachment-image {
max-width: 640px;
max-height: initial;
float: initial;
margin-right: 0px;
}
.type-link blockquote, .type-video blockquote { .type-link blockquote, .type-video blockquote {
margin-left: 0px; margin-left: 0px;
max-height: 160px; max-height: 160px;