diff --git a/mod/health.php b/mod/health.php index 87d3203f..6f285326 100644 --- a/mod/health.php +++ b/mod/health.php @@ -287,9 +287,19 @@ function health_details($a, $id) '; } + //Nice name for registration policy. + switch ($site['reg_policy']) { + case 'REGISTER_OPEN': $policy = "Open"; break; + case 'REGISTER_APPROVE': $policy = "Admin approved"; break; + case 'REGISTER_CLOSED': $policy = "Closed"; break; + default: $policy = $site['reg_policy']; break; + } + $tpl .= file_get_contents('view/health_details.tpl'); return replace_macros($tpl, array( '$name' => $site['name'], + '$policy' => $policy, + '$site_info' => $site['info'], '$base_url' => $site['base_url'], '$health_score' => $site['health_score'], '$health_name' => health_score_to_name($site['health_score']), diff --git a/mod/opensearch.php b/mod/opensearch.php index 83c19869..f657fde2 100755 --- a/mod/opensearch.php +++ b/mod/opensearch.php @@ -2,9 +2,11 @@ function opensearch_init(&$a) { - $r = file_get_contents('view/osearch.tpl'); + $tpl = file_get_contents('view/osearch.tpl'); header("Content-type: application/opensearchdescription+xml"); - - echo $r; + echo replace_macros($tpl, array( + '$base' => $a->get_baseurl() + )); killme(); + } \ No newline at end of file diff --git a/mod/profile_photo.php b/mod/profile_photo.php deleted file mode 100755 index 7ed1bfc6..00000000 --- a/mod/profile_photo.php +++ /dev/null @@ -1,169 +0,0 @@ -user['nickname']); - -} - - -function profile_photo_post(&$a) { - - if(! local_user()) { - notice ( t('Permission denied.') . EOL ); - return; - } - - if((x($_POST,'cropfinal')) && ($_POST['cropfinal'] == 1)) { - - // phase 2 - we have finished cropping - - if($a->argc != 2) { - notice( t('Image uploaded but image cropping failed.') . EOL ); - return; - } - - $image_id = $a->argv[1]; - - if(substr($image_id,-2,1) == '-') { - $scale = substr($image_id,-1,1); - $image_id = substr($image_id,0,-2); - } - - - $srcX = $_POST['xstart']; - $srcY = $_POST['ystart']; - $srcW = $_POST['xfinal'] - $srcX; - $srcH = $_POST['yfinal'] - $srcY; - - $r = q("SELECT * FROM `photo` WHERE `resource-id` = '%s' AND `scale` = %d LIMIT 1", - dbesc($image_id), - intval($scale)); - - if(count($r)) { - - $base_image = $r[0]; - - $im = new Photo($base_image['data']); - $im->cropImage(175,$srcX,$srcY,$srcW,$srcH); - - $r = $im->store(0, $base_image['resource-id'],$base_image['filename'], t('Profile Photos'), 4, 1); - - if($r === false) - notice ( t('Image size reduction (175) failed.') . EOL ); - - $im->scaleImage(80); - - $r = $im->store(0, $base_image['resource-id'],$base_image['filename'], t('Profile Photos'), 5, 1); - - if($r === false) - notice( t('Image size reduction (80) failed.') . EOL ); - - // Unset the profile photo flag from any other photos I own - - $r = q("UPDATE `photo` SET `profile` = 0 WHERE `profile` = 1 AND `resource-id` != '%s' ", - dbesc($base_image['resource-id']) - ); - - $r = q("UPDATE `contact` SET `avatar-date` = '%s' WHERE `self` = 1 LIMIT 1", - dbesc(datetime_convert()) - ); - - } - goaway($a->get_baseurl() . '/profiles'); - return; // NOTREACHED - } - - $src = $_FILES['userfile']['tmp_name']; - $filename = basename($_FILES['userfile']['name']); - $filesize = intval($_FILES['userfile']['size']); - - $imagedata = @file_get_contents($src); - $ph = new Photo($imagedata); - - if(! ($image = $ph->getImage())) { - notice( t('Unable to process image.') . EOL ); - @unlink($src); - return; - } - - @unlink($src); - - $width = $ph->getWidth(); - $height = $ph->getHeight(); - - if($width < 175 || $height < 175) { - $ph->scaleImageUp(200); - $width = $ph->getWidth(); - $height = $ph->getHeight(); - } - - $hash = hash('md5',uniqid(mt_rand(),true)); - - - $smallest = 0; - - $r = $ph->store(0 , $hash, $filename, t('Profile Photos'), 0 ); - - if($r) - notice( t('Image uploaded successfully.') . EOL ); - else - notice( t('Image upload failed.') . EOL ); - - if($width > 640 || $height > 640) { - $ph->scaleImage(640); - $r = $ph->store(0 , $hash, $filename, t('Profile Photos'), 1 ); - - if($r === false) - notice( t('Image size reduction (640) failed.') . EOL ); - else - $smallest = 1; - } - - $a->config['imagecrop'] = $hash; - $a->config['imagecrop_resolution'] = $smallest; - $a->page['htmlhead'] .= file_get_contents("view/crophead.tpl"); - return; -} - - -if(! function_exists('profile_photo_content')) { -function profile_photo_content(&$a) { - - if(! local_user()) { - notice( t('Permission denied.') . EOL ); - return; - } - - if(! x($a->config,'imagecrop')) { - - $tpl = file_get_contents('view/profile_photo.tpl'); - - $o .= replace_macros($tpl,array( - - )); - - return $o; - } - else { - $filename = $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'] . '.jpg'; - $resolution = $a->config['imagecrop_resolution']; - $tpl = file_get_contents("view/cropbody.tpl"); - $o .= replace_macros($tpl,array( - '$filename' => $filename, - '$resource' => $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'], - '$image_url' => $a->get_baseurl() . '/photo/' . $filename - )); - - return $o; - } - - return; // NOTREACHED -}} \ No newline at end of file diff --git a/view/health_details.tpl b/view/health_details.tpl index 034f00df..7d6f694e 100644 --- a/view/health_details.tpl +++ b/view/health_details.tpl @@ -8,9 +8,11 @@

General information

$users users
+
$policy registration policy
Friendica $version
First noticed: $dt_first_noticed
Last update: $dt_last_seen
+
$site_info
diff --git a/view/osearch.tpl b/view/osearch.tpl index 2f35f55d..a9ab2e93 100755 --- a/view/osearch.tpl +++ b/view/osearch.tpl @@ -4,11 +4,11 @@ Friendica Global Directory Search Friendica Global Directory UTF-8 - http://dir.friendica.com/images/friendica-16.ico - http://dir.friendica.com/images/friendica-64.png - + $base/images/friendica-16.ico + $base/images/friendica-64.png + - http://dir.friendica.com + $base