From ff9eab39a7c25dc419e62fcd48c6338bc117fb44 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 16 Nov 2018 00:00:03 -0500 Subject: [PATCH] Add translation string to templates - Lower popular widget lists to 10 elements - Add language to profile and server display --- src/classes/Views/Widget/PopularCountries.php | 3 +- src/classes/Views/Widget/PopularTags.php | 3 +- src/templates/directory.phtml | 4 +- src/templates/layout.phtml | 41 ++++++++++----- src/templates/search.phtml | 16 ++++-- src/templates/servers.phtml | 4 +- src/templates/sub/profile.phtml | 52 +++++++++++++------ src/templates/sub/profiles.phtml | 10 ++-- src/templates/sub/server.phtml | 36 ++++++++----- src/templates/widget/popularcountries.phtml | 2 +- src/templates/widget/populartags.phtml | 2 +- 11 files changed, 108 insertions(+), 65 deletions(-) diff --git a/src/classes/Views/Widget/PopularCountries.php b/src/classes/Views/Widget/PopularCountries.php index 197166e..5b045c6 100644 --- a/src/classes/Views/Widget/PopularCountries.php +++ b/src/classes/Views/Widget/PopularCountries.php @@ -31,11 +31,10 @@ WHERE `country` != "" AND `available` GROUP BY `country` ORDER BY COUNT(`country`) DESC -LIMIT 20'; +LIMIT 10'; $countries = $this->connection->fetchAll($stmt); $vars = [ - 'title' => 'Popular Countries', 'countries' => $countries ]; diff --git a/src/classes/Views/Widget/PopularTags.php b/src/classes/Views/Widget/PopularTags.php index 4dd2064..0fdf898 100644 --- a/src/classes/Views/Widget/PopularTags.php +++ b/src/classes/Views/Widget/PopularTags.php @@ -24,11 +24,10 @@ class PopularTags public function render(): string { - $stmt = 'SELECT `term`, COUNT(*) AS `total` FROM `tag` GROUP BY `term` ORDER BY COUNT(`term`) DESC LIMIT 20'; + $stmt = 'SELECT `term`, COUNT(*) AS `total` FROM `tag` GROUP BY `term` ORDER BY COUNT(`term`) DESC LIMIT 10'; $tags = $this->connection->fetchAll($stmt); $vars = [ - 'title' => 'Popular Tags', 'tags' => $tags ]; diff --git a/src/templates/directory.phtml b/src/templates/directory.phtml index 15a593e..15b74b4 100644 --- a/src/templates/directory.phtml +++ b/src/templates/directory.phtml @@ -1,6 +1,3 @@ -
fetch('sub/profiles.phtml', [ @@ -14,6 +11,7 @@
+
diff --git a/src/templates/layout.phtml b/src/templates/layout.phtml index fa71295..8b9108a 100644 --- a/src/templates/layout.phtml +++ b/src/templates/layout.phtml @@ -1,7 +1,7 @@ - + - Friendica Directory + <?php echo $this->__('Friendica Directory')?> @@ -15,22 +15,22 @@
- Friendica Directory + __('Friendica Directory')?>
- - + +
- +
@@ -40,11 +40,11 @@ + +
diff --git a/src/templates/search.phtml b/src/templates/search.phtml index a0a1e32..aa5bd00 100644 --- a/src/templates/search.phtml +++ b/src/templates/search.phtml @@ -1,16 +1,22 @@
- - + + + +
+ e($fieldName)?> +
+ +
- +
-

results for "e($query) ?>"

+

n__('%d result for "%s"', '%d results for "%s"', intval($count), $this->e($query))?>

fetch('sub/profiles.phtml', [ 'page' => 'search', 'profiles' => $profiles, diff --git a/src/templates/servers.phtml b/src/templates/servers.phtml index 5495300..eba98f3 100644 --- a/src/templates/servers.phtml +++ b/src/templates/servers.phtml @@ -1,5 +1,5 @@

e($title) ?>

-