From 9176e739a405a35e7283d61ea51018e96a534099 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Sat, 17 Oct 2015 21:25:21 +0200 Subject: [PATCH] sugest.php: themeable as whole page --- mod/suggest.php | 37 ++++++++++--------- view/templates/suggest_friends.tpl | 36 ++++++++++-------- .../templates/suggest_friends.tpl | 36 ++++++++++-------- .../theme/frost/templates/suggest_friends.tpl | 36 ++++++++++-------- 4 files changed, 82 insertions(+), 63 deletions(-) diff --git a/mod/suggest.php b/mod/suggest.php index 8bf31ca8e5..760bbf06ae 100644 --- a/mod/suggest.php +++ b/mod/suggest.php @@ -65,11 +65,6 @@ function suggest_content(&$a) { $a->page['aside'] .= findpeople_widget(); - $o .= replace_macros(get_markup_template("section_title.tpl"),array( - '$title' => t('Friend Suggestions') - )); - - $r = suggestion_query(local_user()); if(! count($r)) { @@ -77,25 +72,31 @@ function suggest_content(&$a) { return $o; } - $tpl = get_markup_template('suggest_friends.tpl'); - foreach($r as $rr) { $connlnk = $a->get_baseurl() . '/follow/?url=' . (($rr['connect']) ? $rr['connect'] : $rr['url']); - $o .= replace_macros($tpl,array( - '$url' => zrl($rr['url']), - '$name' => $rr['name'], - '$photo' => proxy_url($rr['photo'], false, PROXY_SIZE_THUMB), - '$ignlnk' => $a->get_baseurl() . '/suggest?ignore=' . $rr['id'], - '$ignid' => $rr['id'], - '$conntxt' => t('Connect'), - '$connlnk' => $connlnk, - '$ignore' => t('Ignore/Hide') - )); + $entry = array( + 'url' => zrl($rr['url']), + 'url_clean' => $rr['url'], + 'name' => $rr['name'], + 'photo' => proxy_url($rr['photo'], false, PROXY_SIZE_THUMB), + 'ignlnk' => $a->get_baseurl() . '/suggest?ignore=' . $rr['id'], + 'ignid' => $rr['id'], + 'conntxt' => t('Connect'), + 'connlnk' => $connlnk, + 'ignore' => t('Ignore/Hide') + ); + $entries[] = $entry; } - $o .= cleardiv(); + $tpl = get_markup_template('suggest_friends.tpl'); + + $o .= replace_macros($tpl,array( + '$title' => t('Friend Suggestions'), + '$entries' => $entries, + )); + // $o .= paginate($a); return $o; } diff --git a/view/templates/suggest_friends.tpl b/view/templates/suggest_friends.tpl index a64c05dd83..e7c9c1ac00 100644 --- a/view/templates/suggest_friends.tpl +++ b/view/templates/suggest_friends.tpl @@ -1,17 +1,23 @@ -
- -
- - {{$name}} - +{{include file="section_title.tpl"}} + +{{foreach $entries as $entry}} +
+ +
+ + {{$entry.name}} + +
+
+ +
+ {{if $entry.connlnk}} + + {{/if}}
-
-
- {{$name}} -
-
- {{if $connlnk}} - - {{/if}} -
\ No newline at end of file +{{/foreach}} + +
diff --git a/view/theme/frost-mobile/templates/suggest_friends.tpl b/view/theme/frost-mobile/templates/suggest_friends.tpl index e39cca6e59..a386f30d00 100644 --- a/view/theme/frost-mobile/templates/suggest_friends.tpl +++ b/view/theme/frost-mobile/templates/suggest_friends.tpl @@ -1,17 +1,23 @@ -
-
- - {{$name}} - +{{include file="section_title.tpl"}} + +{{foreach $entries as $entry}} +
+
+ + {{$entry.name}} + +
+
+ +
+ {{if $entry.connlnk}} + + {{/if}} +
-
-
- {{$name}} -
-
- {{if $connlnk}} - - {{/if}} - -
+{{/foreach}} + +
diff --git a/view/theme/frost/templates/suggest_friends.tpl b/view/theme/frost/templates/suggest_friends.tpl index e39cca6e59..a386f30d00 100644 --- a/view/theme/frost/templates/suggest_friends.tpl +++ b/view/theme/frost/templates/suggest_friends.tpl @@ -1,17 +1,23 @@ -
-
- - {{$name}} - +{{include file="section_title.tpl"}} + +{{foreach $entries as $entry}} +
+
+ + {{$entry.name}} + +
+
+ +
+ {{if $entry.connlnk}} + + {{/if}} +
-
-
- {{$name}} -
-
- {{if $connlnk}} - - {{/if}} - -
+{{/foreach}} + +