From c7531eda8c4eb077f4ffd595a6447b3e8869258b Mon Sep 17 00:00:00 2001 From: YULIUS KURNIAWAN KRISTIANTO Date: Mon, 12 Mar 2018 23:20:42 +0100 Subject: [PATCH] add bio html to show social links author (#408) * add email and social links to author on content pages --- controller/action/ContentActions.class.php | 5 ++++- model/Post.class.php | 26 +++++++++++++++++++++- view/template/content/_postAuthor.php | 12 ++++++++-- web/scss/_blog.scss | 2 +- 4 files changed, 40 insertions(+), 5 deletions(-) diff --git a/controller/action/ContentActions.class.php b/controller/action/ContentActions.class.php index 4dd6463c..327fbc9c 100644 --- a/controller/action/ContentActions.class.php +++ b/controller/action/ContentActions.class.php @@ -353,7 +353,10 @@ class ContentActions extends Actions return [ 'authorName' => $post->getAuthorName(), 'photoImgSrc' => $post->getAuthorPhoto(), - 'authorBioHtml' => $post->getAuthorBioHtml() + 'authorBioHtml' => $post->getAuthorBioHtml(), + 'authorGithub' => $post->getAuthorGithubID(), + 'authorTwitter' => $post->getAuthorTwitterID(), + 'authorEmail' => $post->getAuthorPostEmail() ]; } diff --git a/model/Post.class.php b/model/Post.class.php index a090683f..f54a6a88 100644 --- a/model/Post.class.php +++ b/model/Post.class.php @@ -156,6 +156,30 @@ class Post return $this->author; } + public function getAuthorGithubID() + { + $post = ContentActions::prepareBioPartial(['person' =>$this->author]); + if(array_key_exists("github", $post)){ + return $post["github"]; + } + } + +public function getAuthorTwitterID() +{ + $post = ContentActions::prepareBioPartial(['person' =>$this->author]); + if(array_key_exists("twitter", $post)){ + return $post["twitter"]; + } +} + +public function getAuthorEmail() +{ + $post = ContentActions::prepareBioPartial(['person' =>$this->author]); + if(array_key_exists("email", $post)){ + return $post["email"]; + } +} + public function getDate() { return $this->date; @@ -232,7 +256,7 @@ class Post return $post["name"]; } - public function getAuthorEmail() + public function getAuthorPostEmail() { $post = ContentActions::prepareBioPartial(['person' =>$this->author]); diff --git a/view/template/content/_postAuthor.php b/view/template/content/_postAuthor.php index ea9ea4a7..bc742e71 100644 --- a/view/template/content/_postAuthor.php +++ b/view/template/content/_postAuthor.php @@ -6,9 +6,17 @@
{{news.author}}
-

+

+ + + + + + + + +

-
diff --git a/web/scss/_blog.scss b/web/scss/_blog.scss index 61813d86..ae3b0623 100644 --- a/web/scss/_blog.scss +++ b/web/scss/_blog.scss @@ -203,5 +203,5 @@ .post-author-spotlight { - h3 { text-transform: uppercase; margin-top: $spacing-vertical / 4 !important; } + h3 { text-transform: uppercase; margin-top: $spacing-vertical / 4 !important; margin-bottom: 0;} }