diff --git a/include/Photo.php b/include/Photo.php index 30424747da..5fdd682e74 100644 --- a/include/Photo.php +++ b/include/Photo.php @@ -792,15 +792,19 @@ function get_photo_info($url) { $filesize = strlen($img_str); - $tempfile = tempnam(get_temppath(), "cache"); + if (function_exists("getimagesizefromstring")) + $data = getimagesizefromstring($img_str); + else { + $tempfile = tempnam(get_temppath(), "cache"); - $a = get_app(); - $stamp1 = microtime(true); - file_put_contents($tempfile, $img_str); - $a->save_timestamp($stamp1, "file"); + $a = get_app(); + $stamp1 = microtime(true); + file_put_contents($tempfile, $img_str); + $a->save_timestamp($stamp1, "file"); - $data = getimagesize($tempfile); - unlink($tempfile); + $data = getimagesize($tempfile); + unlink($tempfile); + } if ($data) $data["size"] = $filesize; diff --git a/include/network.php b/include/network.php index ac5191b259..611f00632f 100644 --- a/include/network.php +++ b/include/network.php @@ -1246,6 +1246,9 @@ function original_url($url, $depth=1, $fetchbody = false) { $a->save_timestamp($stamp1, "network"); + if ($http_code == 0) + return($url); + if ((($curl_info['http_code'] == "301") OR ($curl_info['http_code'] == "302")) AND (($curl_info['redirect_url'] != "") OR ($curl_info['location'] != ""))) { if ($curl_info['redirect_url'] != "") diff --git a/mod/admin.php b/mod/admin.php index 95ab2b0c5a..70ef5f7511 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -160,7 +160,7 @@ function admin_content(&$a) { $aside_tools['plugins_admin']=array(); foreach ($r as $h){ $plugin =$h['name']; - $aside['plugins_admin'][] = array($a->get_baseurl(true)."/admin/plugins/".$plugin, $plugin, "plugin"); + $aside_tools['plugins_admin'][] = array($a->get_baseurl(true)."/admin/plugins/".$plugin, $plugin, "plugin"); // temp plugins with admin $a->plugins_admin[] = $plugin; } diff --git a/mod/parse_url.php b/mod/parse_url.php index 1ca5dc1dac..a1ca5a3db5 100644 --- a/mod/parse_url.php +++ b/mod/parse_url.php @@ -80,6 +80,7 @@ function parseurl_getsiteinfo_cached($url, $no_guessing = false, $do_oembed = tr function parseurl_getsiteinfo($url, $no_guessing = false, $do_oembed = true, $count = 1) { require_once("include/network.php"); + require_once("include/Photo.php"); $a = get_app(); @@ -330,7 +331,7 @@ function parseurl_getsiteinfo($url, $no_guessing = false, $do_oembed = true, $co $attr[$attribute->name] = $attribute->value; $src = completeurl($attr["src"], $url); - $photodata = @getimagesize($src); + $photodata = get_photo_info($src); if (($photodata) && ($photodata[0] > 150) and ($photodata[1] > 150)) { if ($photodata[0] > 300) { @@ -347,12 +348,12 @@ function parseurl_getsiteinfo($url, $no_guessing = false, $do_oembed = true, $co } } - } else { + } elseif ($siteinfo["image"] != "") { $src = completeurl($siteinfo["image"], $url); unset($siteinfo["image"]); - $photodata = @getimagesize($src); + $photodata = get_photo_info($src); if (($photodata) && ($photodata[0] > 10) and ($photodata[1] > 10)) $siteinfo["images"][] = array("src"=>$src, diff --git a/view/global.css b/view/global.css index ce69e2e27d..8646bf8e44 100644 --- a/view/global.css +++ b/view/global.css @@ -280,6 +280,18 @@ a { font-weight: bold; color: #00a700; } +.federation-graph { + width: 400px; + height: 400px; + float: right; + margin: 20px; +} +.federation-network-graph { + width: 240px; + height: 240px; + float: left; + margin: 20px; +} ul.federation-stats, ul.credits { list-style: none; @@ -289,6 +301,12 @@ ul.credits li { float: left; width: 240px; } +table#federation-stats { + width: 100%; +} +td.federation-data { + border-bottom: 1px solid #000; +} .contact-entry-photo img { max-width: 80px; diff --git a/view/templates/admin_federation.tpl b/view/templates/admin_federation.tpl index b1c56cd075..fb75157585 100644 --- a/view/templates/admin_federation.tpl +++ b/view/templates/admin_federation.tpl @@ -1,5 +1,5 @@ - +

{{$title}} - {{$page}}

{{$intro}}

@@ -30,7 +30,7 @@ var myDoughnutChart = new Chart(ctx).Doughnut(FedData, document.getElementById('FederationLegend').innerHTML = myDoughnutChart.generateLegend(); - +
{{foreach $counts as $c}} {{if $c[0]['total'] > 0}} @@ -39,9 +39,8 @@ document.getElementById('FederationLegend').innerHTML = myDoughnutChart.generate -
{{$c[0]['network']}}
- + +
    {{foreach $c[1] as $v}}