diff --git a/app/Resources/public/css/base.css b/app/Resources/public/css/base.css index cbf429ae95..9369f4278b 100644 --- a/app/Resources/public/css/base.css +++ b/app/Resources/public/css/base.css @@ -772,6 +772,32 @@ a.personal_agenda:hover, a.personal_agenda:hover { .social-home-anonymous-online { width: 200px; } +.social-thumbnail { + padding: 0px; +} +.social-title { + font-size: 18px; + font-family: helvetica, arial, sans-serif; + color: #000; +} +.social-description { + padding: 8px; + color: #000; +} +.social-image { + max-height: 300px; +} +.social-post-answers { + padding-right: 0px; + padding-left: 0px; +} +.social-host p {; + padding: 10px; + margin-top: 5px; + margin-bottom: 5px; + line-height: 22px; + color: #999; +} .menulist { margin: 0px; list-style: none; @@ -3829,6 +3855,16 @@ i.size-32.icon-new-work{ max-width: 50px; max-height: 50px; } +.top-mediapost { + border-bottom: 1px solid #ECF0F1; +} +.popularity-mediapost { + margin-bottom: 30px; + font-size: 1.2em; +} +.popularity-vote-found { + color: #FFD700; +} .top-mediapost .user-image, .sub-mediapost .user-image { @@ -3856,13 +3892,13 @@ i.size-32.icon-new-work{ } .top-mediapost .msg-content p, .sub-mediapost .rep-post .msg-content p{ - border-top:1px solid #ECF0F1; - padding-top: 10px; - padding-bottom: 10px; + /* border-top:1px solid #ECF0F1; */ + /* padding-top: 10px; */ + /* padding-bottom: 20px; */ margin-top: 5px; - margin-bottom: 5px; + margin-bottom: 20px; line-height: 22px; - padding-left: 10px; + /* padding-left: 10px; */ padding-right: 10px; color: #666666; } @@ -5985,4 +6021,8 @@ footer{ border: 2px dashed #bbbbbb; font-size: 120%; margin-bottom: 0; -} \ No newline at end of file +} + +#upload_form .fa-plus-square-o, #upload_form .fa-minus-square-o { + cursor:pointer; +} diff --git a/main/inc/ajax/social.ajax.php b/main/inc/ajax/social.ajax.php index 2a44c40fa0..66a3ce22af 100755 --- a/main/inc/ajax/social.ajax.php +++ b/main/inc/ajax/social.ajax.php @@ -225,14 +225,17 @@ switch ($action) { // Read the Url using OpenGraph and returns the hyperlinks content case 'readUrlWithOpenGraph': $url = isset($_POST['social_wall_new_msg_main']) ? $_POST['social_wall_new_msg_main'] : ''; + $url = trim($url); $html = ''; - if (SocialManager::verifyUrl($url) == true){ + if (SocialManager::verifyUrl($url) == true) { $html = Security::remove_XSS( SocialManager::readContentWithOpenGraph($url) ); } - echo utf8_decode($html); + echo $html; break; + case 'voteMsg': + default: echo ''; } diff --git a/main/inc/lib/social.lib.php b/main/inc/lib/social.lib.php index bc20e13b38..364ee4b0f0 100755 --- a/main/inc/lib/social.lib.php +++ b/main/inc/lib/social.lib.php @@ -1424,23 +1424,28 @@ class SocialManager extends UserManager $url = api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$userIdLoop; $media = ''; $media .= '
'; - if ($isOwnWall) { - $media .= '
'; - $media .= 'x'; - $media .= '
'; - } - $media .= '
'; + $media .= ''; + $media .= ''; $media .= '
'; - $media .= '
'; - $media .= '

'.Security::remove_XSS($message['content']).'

'; - $media .= '
'; + if ($isOwnWall) { + $media .= '
'; + $media .= '
'; + $media .= 'x'; + $media .= '
'; + $media .= '
'; + } $formattedList .= $media; } @@ -1573,6 +1578,9 @@ class SocialManager extends UserManager $html .= ''; $html .= ''; // end mediaPost + // Popularity post functionality + $html .= '
'; + return $html; } @@ -1583,28 +1591,26 @@ class SocialManager extends UserManager */ public static function readContentWithOpenGraph($link) { + if (strpos($link, "://") === false && substr($link, 0, 1) != "/") { + $link = "http://".$link; + } $graph = OpenGraph::fetch($link); + $link = parse_url($link); + $host = $link['host'] ? strtoupper($link['host']) : $link['path']; if (!$graph) { return false; } $url = $graph->url; $image = $graph->image; - $domain = empty($url) ? parse_url($link) : parse_url($url); - $domain = $domain['scheme'].'://'.$domain['host']; - // Trick to verify if the Image Url Exist because of some bad metatag dev - if (self::verifyUrl($image) == false){ - if (!($image[0] == '/')){ - $domain = $domain . '/'; - } - $image = $domain . $image; - } + $description = $graph->description; $title = $graph->title; - - $html = '
'; - $html .= '

'.$title.'

'; - $html .= empty($image) ? '' : '
'; - $html .= empty($graph->description) ? '' : '

'.$graph->description.'

'; - $html .= ''.$link.''; + $html = '
'; + $html .= empty($image) ? '' : ''; + $html .= ''; $html .= '
'; return $html; @@ -1927,7 +1933,7 @@ class SocialManager extends UserManager $post = $message['html']; $comment = SocialManager::getWallMessagesHTML($userId, $friendId, $message['id']); - $html .= $post.$comment; + $html .= Display::panel($post.$comment, ''); } return $html; diff --git a/main/social/profile.php b/main/social/profile.php index 0db6242417..dea99d7246 100755 --- a/main/social/profile.php +++ b/main/social/profile.php @@ -286,8 +286,7 @@ $social_wall_block = $wallSocialAddPost; // Social Post Wall $posts = SocialManager::getWallMessagesByUser($my_user_id, $friendId) ; -$posts = empty($posts) ? '

'.get_lang("NoPosts").'

' : $posts; -$social_post_wall_block = Display::panel($posts, get_lang('Posts')); +$social_post_wall_block = empty($posts) ? '

'.get_lang("NoPosts").'

' : $posts; $socialAutoExtendLink = Display::url( get_lang('SeeMore'), @@ -300,8 +299,11 @@ $socialAutoExtendLink = Display::url( // Added a Jquery Function to return the Preview of OpenGraph URL Content $htmlHeadXtra[] = '