From 16803b2070200d7bdf1aaf4307ee2e5eadbf48f2 Mon Sep 17 00:00:00 2001 From: Timothy Gibbons Date: Sat, 25 Jun 2016 19:33:56 -0500 Subject: [PATCH] Add sharing options Added a sharing option where the user can share their post on to Facebook or Twitter. --- pages/forum/view_topic.php | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/pages/forum/view_topic.php b/pages/forum/view_topic.php index 29af8ca..69ab984 100644 --- a/pages/forum/view_topic.php +++ b/pages/forum/view_topic.php @@ -84,6 +84,19 @@ // Can the user post a reply in this topic? $can_reply = $forum->canPostReply($topic->forum_id, $user->data()->group_id); +//Get Self Url() +function getSelfUrl(){ + if($_SERVER['SERVER_ADDR'] !== "127.0.0.1"){ + if($_SERVER['SERVER_PORT'] == 80){ + return $_SERVER['REQUEST_SCHEME']."://".$_SERVER['SERVER_NAME']; + }else{ + return $_SERVER['REQUEST_SCHEME']."://".$_SERVER['SERVER_NAME'].":".$_SERVER['SERVER_PORT']; + } + }else{ + return false; + } +} + // Quick reply if(Input::exists()) { if(!$user->isLoggedIn() && !$can_reply){ @@ -228,11 +241,12 @@ + + isLoggedIn() && ($user->data()->group_id == 2 || $user->data()->group_id == 3)){ ?> -
-
+ +
+ + +
+


- \ No newline at end of file +