diff --git a/classes/UFCOE/Elgg/Url.php b/classes/UFCOE/Elgg/Url.php new file mode 100644 index 0000000..d71495e --- /dev/null +++ b/classes/UFCOE/Elgg/Url.php @@ -0,0 +1,86 @@ +scheme = $m[1]; + $this->host = $m[2]; + $this->path = $m[3]; + } + + /** + * @param string $url + * @return int 0 if no GUID found + */ + public function getGuid($url) { + $url = $this->analyze($url); + return ($url && $url['guid']) ? $url['guid'] : 0; + } + + /** + * @param string $url + * @return array|bool + */ + public function analyze($url) { + $url = trim($url); + if (!preg_match('~^(https?)\\://([^/]+)(/[^\\?]*)~', $url, $m)) { + return false; + } + list (, $scheme, $host, $path) = $m; + $ret = array( + 'scheme_matches' => ($scheme === $this->scheme), + 'host_matches' => ($host === $this->host), + 'guid' => null, + 'action' => null, + 'handler' => null, + 'handler_segments' => array(), + ); + $ret['in_site'] = ($ret['host_matches'] && (0 === strpos($path, $this->path))); + if ($ret['in_site']) { + $sitePath = substr($path, strlen($this->path)); + if (preg_match('~^action/(.*)~', $sitePath, $m)) { + if (preg_match('~^[^/]~', $m[1])) { + $ret['action'] = $m[1]; + } + } else { + $segments = explode('/', $sitePath); + if (!empty($segments[0])) { + $ret['handler'] = $segments[0]; + $ret['handler_segments'] = array_slice($segments, 1); + if ($segments[0] !== 'profile') { + if ((count($segments) >= 3) + && in_array($segments[1], array('view', 'read')) + && preg_match('~^[1-9]\\d*$~', $segments[2])) { + $ret['guid'] = (int) $segments[2]; + + // less-reliable guessing + } elseif (preg_match('~^(?:[^/]+/)+([1-9]\\d*)(?:$|/)~', $sitePath, $m)) { + $ret['guid'] = (int) $m[1]; + } + } + } + } + } + return $ret; + } +} diff --git a/graphics/email.png b/graphics/email.png new file mode 100644 index 0000000..91f3e62 Binary files /dev/null and b/graphics/email.png differ diff --git a/graphics/facebook.png b/graphics/facebook.png new file mode 100644 index 0000000..5d8918a Binary files /dev/null and b/graphics/facebook.png differ diff --git a/graphics/googleplus.png b/graphics/googleplus.png new file mode 100644 index 0000000..547a7df Binary files /dev/null and b/graphics/googleplus.png differ diff --git a/graphics/infiniteeureka.png b/graphics/infiniteeureka.png new file mode 100644 index 0000000..8e3e0d9 Binary files /dev/null and b/graphics/infiniteeureka.png differ diff --git a/graphics/linkedin.png b/graphics/linkedin.png new file mode 100644 index 0000000..f728959 Binary files /dev/null and b/graphics/linkedin.png differ diff --git a/graphics/pinterest.png b/graphics/pinterest.png new file mode 100644 index 0000000..abf35ad Binary files /dev/null and b/graphics/pinterest.png differ diff --git a/graphics/stumble.png b/graphics/stumble.png new file mode 100644 index 0000000..645c5e9 Binary files /dev/null and b/graphics/stumble.png differ diff --git a/graphics/twitter.png b/graphics/twitter.png new file mode 100644 index 0000000..cf722bd Binary files /dev/null and b/graphics/twitter.png differ diff --git a/graphics/youtube.png b/graphics/youtube.png new file mode 100644 index 0000000..71d0684 Binary files /dev/null and b/graphics/youtube.png differ diff --git a/languages/en.php b/languages/en.php new file mode 100644 index 0000000..0409ea0 --- /dev/null +++ b/languages/en.php @@ -0,0 +1,105 @@ +sitename; +$english = array( + 'interconnected:share' => 'Share this page using', + 'interconnected:profile:share' => "Share this profile using", + 'interconnected:no-share' => "This item cannot be shared yet", + 'interconnected:profile-on' => "%s's profile on %s", + 'interconnected:my-profiles' => "My profiles", + 'interconnected:access-denied' => "Only items with an access/privacy level of public and blogs that are published are accessible outside of the community.", + 'interconnected:twitter' => 'Twitter', + 'interconnected:facebook' => 'facebook', + 'interconnected:googleplus' => 'Google+', + 'interconnected:linkedin' => 'Linked in', + 'interconnected:linkedin-button' => 'Linked', + 'interconnected:pinterest' => 'Pinterest', + 'interconnected:stumbleupon' => 'StumbleUpon', + 'interconnected:youtube' => 'Youtube', + 'interconnected:email' => 'Email', + 'interconnected:source' => 'Source: ', + 'interconnected:hjcategory' => 'Category from ' . $sitename . ':', + 'interconnected:videolist_item' => 'A video shared by', + 'interconnected:file' => 'A file shared by', + 'interconnected:image' => 'An image shared by', + 'interconnected:album' => 'An image album shared by', + 'interconnected:blog' => 'A blog shared by', + 'interconnected:bookmarks' => 'A bookmark shared by', + 'interconnected:page_top' => 'A page shared by', + 'interconnected:page' => 'A page shared by', + 'interconnected:pinboards' => 'A pinboard shared by', + 'interconnected:market' => 'An item for sale, shared by', + 'interconnected:event' => 'An event shared by', + 'interconnected:thewire' => 'A status update from', + 'interconnected:title:profile' => "%s's profile at " . $sitename . ':', + 'interconnected:profile' => "Profile", + 'interconnected:friends' => "Friends", + 'interconnected:category' => 'Category', + 'interconnected:categories' => 'Categories', + 'interconnected:title:privacy' => 'Privacy policy', + 'interconnected:title:terms' => 'Terms of use', + 'interconnected:title:about' => 'About', + 'interconnected:groups' => 'Groups', + 'interconnected:members' => 'Members', + 'interconnected:rootpage:title:activity' => 'Activity at ' . $sitename, + 'interconnected:rootpage:title:members' => 'Members at ' . $sitename, + 'interconnected:rootpage:title:groups' => 'Groups at ' . $sitename, + 'interconnected:rootpage:title:file' => 'Files at ' . $sitename, + 'interconnected:rootpage:title:blog' => 'Blogs at ' . $sitename, + 'interconnected:rootpage:title:photos' => 'Images at ' . $sitename, + 'interconnected:rootpage:title:albums' => 'Image albums at ' . $sitename, + 'interconnected:rootpage:title:events' => 'Events listed at ' . $sitename, + 'interconnected:rootpage:title:videolist' => 'Videos at ' . $sitename, + 'interconnected:rootpage:title:bookmarks' => 'Bookmarks at ' . $sitename, + 'interconnected:rootpage:title:pages' => 'Pages at ' . $sitename, + 'interconnected:rootpage:title:thewire' => 'Status updates at ' . $sitename, + 'interconnected:rootpage:title:pinboards' => 'Pinboards at ' . $sitename, + 'interconnected:rootpage:title:market' => 'Items being traded at ' . $sitename, + 'interconnected:title:friends' => "%s's friends at " . $sitename, + 'interconnected:rootpage:title:categories' => 'Categorised items from ' . $sitename, + 'interconnected:rootpage:title:privacy' => 'The privacy policy at ' . $sitename, + 'interconnected:rootpage:title:terms' => 'The terms of use agreement at ' . $sitename, + 'interconnected:rootpage:title:search' => 'Search results information from ' . $sitename, + 'interconnected:rootpage:title:tags' => 'The top tags in the community at ' . $sitename, + 'interconnected:rootpage:title:donation' => 'Donations to support ' . $sitename, + 'interconnected:rootpage:description:donation' => 'Here you can use a variety of online methods to make donations to support the operations of the community at ' . $sitename, + 'interconnected:rootpage:title:liked_content' => 'The most liked items at ' . $sitename, + 'interconnected:rootpage:description:liked_content' => 'This list shows which items are the most popular with members of the community at ' . $sitename, + 'interconnected:rootpage:description:tags' => 'These are the most commonly used tags for items that have been added to the community at ' . $sitename, + 'interconnected:rootpage:description:activity' => 'The full list of the activity in the community at ' . $sitename, + 'interconnected:rootpage:description:members' => 'The full list of the members of the community at ' . $sitename, + 'interconnected:rootpage:description:groups' => 'The full list of groups that have been created by the members of the community at ' . $sitename, + 'interconnected:rootpage:description:file' => 'The full list of files that have been uploaded and shared by the members of the community at ' . $sitename, + 'interconnected:rootpage:description:blog' => 'The full list of blogs that have been created and shared by the members of the community at ' . $sitename, + 'interconnected:rootpage:description:photos' => 'The full list of images that have been created and shared by the members of the community at ' . $sitename, + 'interconnected:rootpage:description:albums' => 'The full list of Image albums that have been created and shared by the members of the community at ' . $sitename, + 'interconnected:rootpage:description:events' => 'The full list of events that have been listed by the members of the community at ' . $sitename, + 'interconnected:rootpage:description:videolist' => 'The full list of videos that have been found and shared by the members of the community at ' . $sitename, + 'interconnected:rootpage:description:bookmarks' => 'The full list of bookmarks that have been found and shared by the members of the community at ' . $sitename, + 'interconnected:rootpage:description:pages' => 'The full list of pages that have been created by the members of the community at ' . $sitename, + 'interconnected:rootpage:description:thewire' => 'The full list of publicly shared status updates from the members of the community at ' . $sitename, + 'interconnected:rootpage:description:pinboards' => 'The pinboards at ' . $sitename . ' allow you to build and share collections of images, videos and whatever else you wish to share.', + 'interconnected:rootpage:description:market' => 'The market pages at ' . $sitename . ' are full of features for buying and selling.', + 'interconnected:description:friends' => "The full list of %s's friends at " . $sitename, + 'interconnected:rootpage:description:privacy' => 'This privacy policy expresses the intentions of the site operators as they pertain to maintaining the privacy of the users of this website.', + 'interconnected:rootpage:description:terms' => 'This page contains the full terms of use agreement that all users of this website are required to read and agree to, prior to joining here and creating a user profile.', + 'interconnected:rootpage:description:categories' => 'The full list of categories available at ' . $sitename . '. Each category contains different types of item from the community.', + 'interconnected:rootpage:description:search' => 'Search for information from the community at ' . $sitename, + 'interconnected:emailbody' => "Greetings! I found this at " . $sitename . "... %s %s %s", + 'interconnected:title:file-type' => 'A selection of files from the community at ' . $sitename, + 'interconnected:description:file-type' => 'A selection from one category of files; from the community at ' . $sitename, + 'interconnected:widget:buttons' => 'Share this with', + 'interconnected:widget:buttons_descr' => 'Adds a collection of sharing buttons for popular social networks.', + 'interconnected:admin:title:social' => 'Social sharing options.', + 'interconnected:admin:title:seo' => 'Search engine optimisation options.', + 'interconnected:admin:site-logo' => 'a complete (absolute) url for your site logo (version: small image)', + 'interconnected:admin:full-site-logo' => 'a complete (absolute) url for your site logo (version: full size image - recommended 600px wide)', + 'interconnected:admin:twitter-handle' => '(optional) a twitter handle/id that you use for your site (when pages shared using twitter, the tweet will end with - via @your-twitter-handle)', + 'interconnected:admin:about-me' => "the name of the field the contains the user's about me profile information on your site (default is description)", + 'interconnected:admin:group-description' => "the name of the field the contains the description field for your site's groups (default is briefdescription)", + 'interconnected:admin:default-title' => "an opengraph (og:title) title to be used when sharing pages that do not have a specific title - generally this will only be for your homepage and does not effect the main html title for the page.", + 'interconnected:admin:default-meta-keywords' => "a comma seperated list of keywords to use as default in the metatag section of the page head when no better options are available. e.g. social network,community,sharing", + 'interconnected:admin:max-meta-keywords' => "the maximum amount of keywords to display on any page (enter an integer that is greater than or equal to 0)", + 'interconnected:admin:max-meta-description' => "the maximum amount of characters to be used in the metatag description for each page (enter an integer that is greater than or equal to 0 - 160 is recommended)", +); +add_translation("en", $english); +?> \ No newline at end of file diff --git a/lib/interconnected.php b/lib/interconnected.php new file mode 100644 index 0000000..6df2ff2 --- /dev/null +++ b/lib/interconnected.php @@ -0,0 +1,393 @@ +analyze($url); +} + + /*************** + * get_sharing_data_for_current_page() + * + * returns: array - $content - containing: + * author = name of page creator + * item_title = the most relevant title for the current page + * subtext = a formatted string that describes the sharing action + * description = a relevant description of the current page (commonly built from page content) + * icon_url = a smaller sized image url to represent the current page + * full_icon_url = a larger sized image url to represent the current page + * url = the url to be shared + * keywords = the current page's relevant tags + * + *************/ + + + function get_sharing_data_for_current_page() + { + static $content; // static variable is held in memory to be accessed again + if ($content === null) { // this allows multiple calls to the function to be made and the code to only be run once + global $CONFIG; + $site_url = elgg_get_site_url(); + $sitename = $CONFIG->sitename; + $siteinfo = $CONFIG->sitedescription; + + // these variables can be moved to an admin page + + $size = 'large'; + $full_size = 'master'; + + /*****************************/ + + $site_logo = elgg_get_plugin_setting('site_logo', 'interconnected'); + if ($site_logo == '') + $site_logo = $current_user->getIconURL($size); + + $full_site_logo = elgg_get_plugin_setting('full_site_logo', 'interconnected'); + if ($full_site_logo == '') + $full_site_logo = $current_user->getIconURL($full_size); + + $default_title = elgg_get_plugin_setting('default_title', 'interconnected'); + if ($default_title == '') + $default_title = $sitename; + + $twitter_handle = elgg_get_plugin_setting('twitter_handle', 'interconnected'); + + $aboutme = elgg_get_plugin_setting('about_me', 'interconnected'); + + $group_description = elgg_get_plugin_setting('group_description', 'interconnected'); + + $current_user = elgg_get_logged_in_user_entity(); + + $context = elgg_get_context(); + $url = current_page_url(); + $url_array = interconnected_analyze_url($url); + $handler = $url_array['handler']; + + $type = 'website'; + + if ($url_array['guid']) // if 3rd url path parameter is a numeric + { + $entity = get_entity(sanitise_int($url_array['guid'])); // check to see if an entity can be found + } + + + if ($entity instanceof ElggEntity) // if an entity is found get entity specific data + { + $container = $entity->getContainerEntity(); + $owner = $entity->getOwnerEntity(); + $author = $owner->name; + $subtype = $entity->getSubtype(); + $tags = $entity->tags; + + if (($url_array['handler_segments'][0] != 'view')&&($url_array['handler_segments'][0] != $url_array['guid'])) // check url structure to see if it is view mode or not + { + if ($url_array['handler_segments'][0] != 'album') //tidypics album paths are non-standard + $url = $site_url . $handler . '/view/' . $url_array['guid']; // set the shared url to be the view mode url and not edit or another mode which is unsuitable for sharing + } + + if (isset($tags)) //if the current item has tags + { + if (is_array($tags)) //if the current item has more than 1 tag + { + $tags = array_unique($tags); // create unique list + } + else + { + $tags = array($tags); + } + } + + if ($entity instanceof ElggGroup) + { + $item_title = elgg_echo('group') . ': ' . $entity->name; + + $description = $entity->$group_description; + + $icon_url = $entity->getIconURL($size); + $full_icon_url = $icon_url; + + } + else + { + $item_title = $entity->title; + $access_id = $entity->access_id; + $access_id_string = get_readable_access_level($access_id); + + if ($access_id_string != 'public') + { + $content['access_denied'] = TRUE; + return $content; + } + + switch ($subtype) + { + case 'blog': + { + if ((elgg_is_active_plugin('blog_tools'))&&($icontime = $entity->icontime)) + { + $icontime = "{$icontime}"; + $filehandler = new ElggFile(); + $filehandler->owner_guid = $entity->getOwnerGUID(); + $filehandler->setFilename("blogs/" . $entity->getGUID() . $size . ".jpg"); + + if ($filehandler->exists()) + { + $icon_url = $site_url . "blogicon/{$entity->getGUID()}/$size/$icontime.jpg"; + $full_icon_url = $site_url . "blogicon/{$entity->getGUID()}/$full_size/$icontime.jpg"; + } + } + $description = $entity->description; + $subtext = elgg_echo('interconnected:' . $subtype) .' ' . $author . '... '; + $type = 'blog'; + break; + } + case 'image': + case 'album': + { + if ($subtype=='album') + { + $cover_guid = $entity->getCoverImageGuid(); + $cover_entity = get_entity($cover_guid); + $icon_url = $cover_entity->getIconURL($size); + $full_icon_url = $cover_entity->getIconURL($full_size); + } + else + { + $icon_url = $entity->getIconURL($size); + $full_icon_url = $entity->getIconURL($full_size); + } + $description = $entity->description; + $subtext = elgg_echo('interconnected:' . $subtype) .' ' . $author . '... '; + $type = 'article'; + break; + } + case 'hjcategory': + { + $icon_url = $entity->getIconURL($size); + $full_icon_url = $entity->getIconURL($full_size); + $description = $entity->description; + $tags = array(elgg_echo('interconnected:category'), $item_title, $sitename); + $item_title = elgg_echo('interconnected:' . $subtype) . ' ' . $item_title; + break; + } + case 'videolist_item': + default: + { + $icon_url = $entity->getIconURL($size); + $full_icon_url = $entity->getIconURL($full_size); + $description = $entity->description; + $subtext = elgg_echo('interconnected:' . $subtype) .' ' . $author . '... '; + $type = 'article'; + break; + } + } + } + + } + else // there is no specific entity on the page, then look at contexts next + { + if (elgg_is_active_plugin('pagehandler_hijack')) + { + $hijack_handlers = pagehandler_hijack_get_replacements(); + $original_handler = array_search($handler, $hijack_handlers); + if ($original_handler) + $handler = $original_handler; + } + // elgg_dump ($handler); + switch($handler) + { + case 'blog': // pages that are not for specific entities - such as 'all', 'owner', 'friends' + case 'bookmarks': + case 'pages': + case 'videolist': + case 'market': + case 'events': + case 'thewire': + case 'pinboards': + case 'search': + case 'tags': + case 'donation': + case 'liked_content': + { + $item_title = elgg_echo('interconnected:rootpage:title:' . $handler); + $description = elgg_echo('interconnected:rootpage:description:' . $handler); + break; + } + case 'activity': + { + $item_title = elgg_echo('interconnected:rootpage:title:' . $handler); + $description = elgg_echo('interconnected:rootpage:description:' . $handler); + $type = 'activity'; + break; + } + case 'members': + case 'groups': + { + $item_title = elgg_echo('interconnected:rootpage:title:' . $handler); + $description = elgg_echo('interconnected:rootpage:description:' . $handler); + $tags = array(elgg_echo('interconnected:' . $handler),$sitename); + break; + } + case 'friends': + case 'profile': + { + $owner = get_user_by_username($url_array['handler_segments'][0]); + if ($owner) + { + $icon_url = $owner->getIconURL($size); + $full_icon_url = $owner->getIconURL($full_size); + $item_title = elgg_echo('interconnected:title:' . $handler, array($owner->name)); + if ($handler == 'profile') + $description = $owner->$aboutme; + else + $description = elgg_echo('interconnected:description:' . $handler, array($owner->name)); + $author = $owner->name; + $type='profile'; + $tags = array(elgg_echo('interconnected:' . $handler),$author,$sitename); + } + break; + } + case 'categories': + { + $item_title = elgg_echo('interconnected:rootpage:title:' . $handler); + $description = elgg_echo('interconnected:rootpage:description:'. $handler); + $tags = array(elgg_echo('interconnected:categories'), $sitename); + break; + } + case 'file': + { + switch($url_array['handler_segments'][0]) + { + case 'search': + { + $item_title = elgg_echo('interconnected:title:file-type'); + $description = elgg_echo('interconnected:description:file-type'); + $tags = array(elgg_echo('interconnected:file-type'), $item_title, $sitename); + break; + } + case 'all': + default: + { + $item_title = elgg_echo('interconnected:rootpage:title:' . $handler); + $description = elgg_echo('interconnected:rootpage:description:'. $handler); + $tags = array(elgg_echo('interconnected:' . $handler), $item_title, $sitename); + break; + } + } + break; + } + case 'photos': + { + if ($url_array['handler_segments'][0] = 'album') + { + $item_title = elgg_echo('interconnected:rootpage:title:albums'); + $description = elgg_echo('interconnected:rootpage:description:albums'); + $tags = array(elgg_echo('interconnected:albums'), $item_title, $sitename); + } + else + { + $item_title = elgg_echo('interconnected:rootpage:title:photos'); + $description = elgg_echo('interconnected:rootpage:description:photos'); + $tags = array(elgg_echo('interconnected:photos'), $item_title, $sitename); + } + break; + } + case 'about': + case 'privacy': + case 'terms': + { + $item_title = elgg_echo('interconnected:title:' . $handler); + $description = elgg_echo('interconnected:rootpage:description:'. $handler); + $tags = array(elgg_echo('interconnected:' . $handler), $item_title, $sitename); + break; + } + default: + { + $profile_user_entity = get_user_by_username($handler); + if ($profile_user_entity) // profile_url plugin is being used so page is a profile + { + $owner = $profile_user_entity; + $icon_url = $owner->getIconURL($size); + $full_icon_url = $owner->getIconURL($full_size); + $item_title = elgg_echo('interconnected:title:profile', array($owner->name)); + $description = $owner->$aboutme; + $author = $owner->name; + $tags = array(elgg_echo('interconnected:profile'),$author,$sitename); + } + + break; + } + } + } + + if (empty($icon_url)||(strpos($icon_url, '_graphics/icons/default/'))) // if there is no icon found or if the default icon is returned + { + if ($container) + { + $icon_url = $container->getIconURL($size); + if ($container instanceof ElggGroup) + $full_icon_url = $icon_url; + else + $full_icon_url = $container->getIconURL($full_size); + } + else + { + $icon_url = $site_logo; + $full_icon_url = $full_site_logo; + } + } + + if ($icon_url) + { + $content['icon_url'] = $icon_url; + $content['full_icon_url'] = $full_icon_url; + } + + if ($description) + $content['description'] = $description; + else + $content['description'] = $siteinfo; + + if ($item_title) + $content['item_title'] = $item_title; + else + $content['item_title'] = $default_title; + + if ($subtext) + { + $content['subtext'] = $subtext; + } + + if ($author) + $content['author'] = $author; + else + $content['author'] = $sitename; + + if ($type) + $content['type'] = $type; + else + $content['type'] = 'website'; + + $content['keywords'] = $tags; + $content['url'] = $url; + + + } + // elgg_dump($content); + // elgg_dump($url_array); + return $content; + } + + ?> \ No newline at end of file diff --git a/manifest.xml b/manifest.xml new file mode 100644 index 0000000..9b55ad4 --- /dev/null +++ b/manifest.xml @@ -0,0 +1,25 @@ + + + interconnected + ura soul + 0.1 + for social sharing without bloatage + https://www.infiniteeureka.com + GNU Public License version 2 + + + elgg_release + 1.8 + + + plugin + profile_manager + + + priority + after + profile_manager + + Communication + advanced + \ No newline at end of file diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..ec24b40 --- /dev/null +++ b/readme.txt @@ -0,0 +1,72 @@ + +/** + * interconnected - elgg plugin + * @license GNU Public License version 2 + * @author ura soul + * @website https://www.infiniteeureka.com - donations may increase capacity for creating freely shared code and are gladly received + * @functionality - connects elgg sites to other social sites and improves seo - includes simple sharing buttons for common social networks and opengraph metatags + */ + + +This plugin uses various methods to allow users to share elgg items/pages on various social networks. + +- no javascript from external sites is used and the button images are intentionally stored locally so that connections to external servers only occur when shares are intentionally made, rather than on every page load - this is to support privacy and limit the use of social network as spying devices. +- there is no javascript loaded at all by this plugin. + +features: + +* adds sharing buttons to appropriate locations in elgg - currently adds a sidebar module to appropriate elgg pages and buttons to the bottom of profile info boxes (you can edit start.php to change this). +* passes appropriate images/thumbnails and text to target sites for sharing. +* adds opengraph and standard metatags to each page header to ensure sites that use metatag fields (e.g. tag: xmlns:og="http://ogp.me/ns#" +so the full html tag will look like this: + +todo: + +* could add a settings page for each user to allow them to write their default greeting or signature for messages sent to external sharing services. +* setting option to choose whether to share internal urls for videos/bookmarks or to share source urls. e.g. share youtube videos directly or share elgg page. +* add more target sites +* integrate wire functionality to allow wire posts to be auto-shared to multiple target sites. +* integrate multi-access functionality to upgrade thewire to allow posts to be made to multiple subsets of users, rather than only to public. +* auto-share option for new items (requires extension/over-riding of 'add' forms - and/or a hook). +* fix: linked-in does not pick up images when pages are shared. +* better support for groups - (requires re-structuring of functions) + +notes: + +* og:author is not included because facebook uses that to point to a facebook profile and if we add data to that field that contains spaces, the facebook validator will error. +* og:image for groups - there are not master icons available for groups in elgg... which results in fb complaining that some group images are too small. +* facebook's sharer page and opengraph code is sometimes glitchy - even when image paths are passed directly to facebook they sometimes do not render - regardless of whether the facebook opengraph debugger throws an error or not. + diff --git a/screenshots/admin.png b/screenshots/admin.png new file mode 100644 index 0000000..daecaa9 Binary files /dev/null and b/screenshots/admin.png differ diff --git a/screenshots/buttons.png b/screenshots/buttons.png new file mode 100644 index 0000000..d42b268 Binary files /dev/null and b/screenshots/buttons.png differ diff --git a/screenshots/facebook.png b/screenshots/facebook.png new file mode 100644 index 0000000..27d2b7f Binary files /dev/null and b/screenshots/facebook.png differ diff --git a/screenshots/google.png b/screenshots/google.png new file mode 100644 index 0000000..94664b1 Binary files /dev/null and b/screenshots/google.png differ diff --git a/screenshots/pinboard.png b/screenshots/pinboard.png new file mode 100644 index 0000000..1f45a98 Binary files /dev/null and b/screenshots/pinboard.png differ diff --git a/screenshots/profile-edit.png b/screenshots/profile-edit.png new file mode 100644 index 0000000..5053578 Binary files /dev/null and b/screenshots/profile-edit.png differ diff --git a/screenshots/profile.png b/screenshots/profile.png new file mode 100644 index 0000000..422e19e Binary files /dev/null and b/screenshots/profile.png differ diff --git a/screenshots/twitter.png b/screenshots/twitter.png new file mode 100644 index 0000000..45318d4 Binary files /dev/null and b/screenshots/twitter.png differ diff --git a/start.php b/start.php new file mode 100644 index 0000000..e861078 --- /dev/null +++ b/start.php @@ -0,0 +1,40 @@ + \ No newline at end of file diff --git a/views/default/interconnected/admin.php b/views/default/interconnected/admin.php new file mode 100644 index 0000000..cbe7a08 --- /dev/null +++ b/views/default/interconnected/admin.php @@ -0,0 +1,6 @@ +.plugin-panel{ + padding:15px; +} +.plugin-panel > .elgg-input-text { + width:90%; +} \ No newline at end of file diff --git a/views/default/interconnected/css.php b/views/default/interconnected/css.php new file mode 100644 index 0000000..1453597 --- /dev/null +++ b/views/default/interconnected/css.php @@ -0,0 +1,115 @@ +.elgg-sharing-wrapper-simple +{ + margin-bottom:20px; + margin-left:20px; +} + +.elgg-sharing-wrapper-simple, .elgg-sharing-wrapper-simple > label +{ + padding-right:5px; +} + +.elgg-sharing-wrapper +{ + display:inline-block; + margin:0 !important; + list-style:none!important; +} +.elgg-sharing-wrapper li +{ + float:left; + margin-right: 8px; + margin-top: 11px; +} +.elgg-button-share{ + background-size: contain!important; + color: #000; + background-color: #eee; + font-size: 15px!important; + transition: 0.25s ease-in-out; +} + +.elgg-button-share:hover { + transition: 0s ease-in-out; +} + +.elgg-my-profiles{ + float: left; + width: 200px; + clear: left; + margin: 10px 0 20px 25px; +} + +.elgg-social-shortcut{ + margin:3px; + display: inline-block; +} + +.elgg-button-twitter{ + background: url('')no-repeat, linear-gradient(to bottom, rgb(255, 255, 255) 0%,rgb(231, 221, 221) 4%,rgb(150, 150, 150) 100%); + padding-left: 25px!important; + border: 1px solid rgb(123, 123, 123); +} +.elgg-button-twitter:hover{ + background: url('')no-repeat, linear-gradient(to bottom, rgb(255, 255, 255) 0%,rgb(248, 248, 248) 4%,rgb(192, 191, 191) 100%); + border: 1px solid rgb(201,201,201); +} +.elgg-button-facebook{ + color: rgb(238, 238, 238); + background: url('') no-repeat, linear-gradient(to bottom, rgb(47, 48, 65) 0%,rgb(42, 96, 198) 4%,rgb(48, 80, 141) 100%); + border: 1px solid rgb(61, 94, 158); + padding-left: 25px!important; +} +.elgg-button-facebook:hover{ + background: url('') no-repeat, linear-gradient(to bottom, rgb(151, 152, 165) 0%,rgb(65, 121, 225) 4%,rgb(54, 98, 181) 100%); + border: 1px solid rgb(78, 117, 192); +} +.elgg-button-googleplus{ + background: url('') no-repeat, linear-gradient(to bottom, rgb(101, 73, 73) 0%,rgb(193, 47, 47) 4%,rgb(137, 52, 52) 100%); + border: 1px solid rgb(131, 53, 53); + color: rgb(238, 238, 238); + padding-left: 25px!important; +} +.elgg-button-googleplus:hover{ + background: url('') no-repeat, linear-gradient(to bottom, rgb(135, 100, 100) 0%,rgb(225, 65, 65) 4%,rgb(204, 30, 30) 100%); + border: 1px solid rgb(194, 76, 76); +} +.elgg-button-linkedin{ + background: url('')no-repeat, linear-gradient(to bottom, rgb(255, 255, 255) 0%,rgb(231, 221, 221) 4%,rgb(150, 150, 150) 100%); + background-position: right top; + padding-right: 25px!important; + border: 1px solid rgb(123, 123, 123); +} +.elgg-button-linkedin:hover{ + background: url('')no-repeat, linear-gradient(to bottom, rgb(255, 255, 255) 0%,rgb(248, 248, 248) 4%,rgb(192, 191, 191) 100%); + background-position: right top; + border: 1px solid rgb(201,201,201); +} +.elgg-button-pinterest{ + background: url('')no-repeat, linear-gradient(to bottom, rgb(255, 255, 255) 0%,rgb(231, 221, 221) 4%,rgb(150, 150, 150) 100%); + color:rgb(187, 5, 5); + padding-left: 25px!important; + border: 1px solid rgb(123, 123, 123); +} +.elgg-button-pinterest:hover{ + background: url('')no-repeat, linear-gradient(to bottom, rgb(255, 255, 255) 0%,rgb(248, 248, 248) 4%,rgb(192, 191, 191) 100%); + border: 1px solid rgb(201,201,201); +} +.elgg-button-stumbleupon{ + background: url('')no-repeat, linear-gradient(to bottom, rgb(255, 255, 255) 0%,rgb(231, 221, 221) 4%,rgb(150, 150, 150) 100%); + padding-left: 25px!important; + border: 1px solid rgb(123, 123, 123); +} +.elgg-button-stumbleupon:hover{ + background: url('')no-repeat, linear-gradient(to bottom, rgb(255, 255, 255) 0%,rgb(248, 248, 248) 4%,rgb(192, 191, 191) 100%); + border: 1px solid rgb(201,201,201); +} +.elgg-button-email{ + background: url('')no-repeat, linear-gradient(to bottom, rgb(255, 255, 255) 0%,rgb(231, 221, 221) 4%,rgb(150, 150, 150) 100%); + padding-left: 25px!important; + border: 1px solid rgb(123, 123, 123); +} +.elgg-button-email:hover{ + background: url('')no-repeat, linear-gradient(to bottom, rgb(255, 255, 255) 0%,rgb(248, 248, 248) 4%,rgb(192, 191, 191) 100%); + border: 1px solid rgb(201,201,201); +} \ No newline at end of file diff --git a/views/default/interconnected/interconnected.php b/views/default/interconnected/interconnected.php new file mode 100644 index 0000000..b73fc6e --- /dev/null +++ b/views/default/interconnected/interconnected.php @@ -0,0 +1,86 @@ + $url, + 'twitter_handle' => $twitter_handle, + 'item_title' => $item_title, + 'subtext' => $subtext, + 'description' => $description); + + $body = ''; + + echo $body; + return TRUE; +?> \ No newline at end of file diff --git a/views/default/interconnected/metatags.php b/views/default/interconnected/metatags.php new file mode 100644 index 0000000..03b823b --- /dev/null +++ b/views/default/interconnected/metatags.php @@ -0,0 +1,109 @@ +sitename; + + $default_site_logo = elgg_get_plugin_setting('site_logo', 'interconnected'); + + $default_meta_keywords = elgg_get_plugin_setting('default_meta_keywords', 'interconnected'); + if ($default_meta_keywords) + $default_meta_keywords = explode(',',$default_meta_keywords); + + if (count($INTERCONNECTED_PAGE_DATA['keywords']) <= 0) + $INTERCONNECTED_PAGE_DATA['keywords'] = $default_meta_keywords; + + $max_meta_keywords = (elgg_get_plugin_setting('max_meta_keywords', 'interconnected')-1); + + $max_meta_description = elgg_get_plugin_setting('max_meta_description', 'interconnected'); + + $author = $INTERCONNECTED_PAGE_DATA['author']; + $item_title = $INTERCONNECTED_PAGE_DATA['item_title']; + $subtext = $INTERCONNECTED_PAGE_DATA['subtext']; + $description = $INTERCONNECTED_PAGE_DATA['description']; + $icon_url = $INTERCONNECTED_PAGE_DATA['icon_url']; + $full_icon_url = $INTERCONNECTED_PAGE_DATA['full_icon_url']; + $url = $INTERCONNECTED_PAGE_DATA['url']; + $keywords = $INTERCONNECTED_PAGE_DATA['keywords']; + $og_type = $INTERCONNECTED_PAGE_DATA['type']; + + if (!is_array($keywords)) + $keywords = $default_meta_keywords; + + // clean fields ready for html output + + if ($icon_url) + { + $icon_url = strip_tags(filter_tags($icon_url)); + $full_icon_url = strip_tags(filter_tags($full_icon_url)); + } + + if ($description) + { + $description = strip_tags (filter_tags($description)); + $description = str_replace(array("\r", "\n"), '', $description); + } + + if ($item_title) + { + $item_title = strip_tags(filter_tags($item_title)); + $item_title = str_replace(array("\r", "\n"), '', $item_title); + } + + if ($subtext) + { + $subtext = strip_tags(filter_tags($subtext)); + $subtext = str_replace(array("\r", "\n"), '', $subtext); + } + + if ($author) + { + $author = strip_tags(filter_tags($author)); + } + + $vars['url'] = $url; + + if (isset($keywords)) + { + foreach ($keywords as $index => $keyword) + { + $keywords[$index] = strip_tags(filter_tags($keyword)); + } + } + + // $size = getimagesize($icon_url); + + +if($description) { ?> + + + + + + + + + + + + + + + + + + + + + + + 0) +{ ?> + + \ No newline at end of file diff --git a/views/default/interconnected/profile.php b/views/default/interconnected/profile.php new file mode 100644 index 0000000..a4e7c51 --- /dev/null +++ b/views/default/interconnected/profile.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/views/default/interconnected/simple.php b/views/default/interconnected/simple.php new file mode 100644 index 0000000..24d2380 --- /dev/null +++ b/views/default/interconnected/simple.php @@ -0,0 +1,8 @@ +' . '

' . elgg_echo('interconnected:share') . ':

' . elgg_view('interconnected/interconnected') . ''; +?> \ No newline at end of file diff --git a/views/default/interconnected/social-shortcuts.php b/views/default/interconnected/social-shortcuts.php new file mode 100644 index 0000000..10750a5 --- /dev/null +++ b/views/default/interconnected/social-shortcuts.php @@ -0,0 +1,38 @@ +name; + $social_profiles = array('twitter'=>'twitter.com', + 'facebook'=>'www.facebook.com', + 'googleplus'=>'plus.google.com', + 'youtube'=>'www.youtube.com', + 'linkedin' => 'www.linkedin.com', + 'infiniteeureka' => 'www.infiniteeureka.com'); + + $i = 0; + $title = elgg_echo('interconnected:my-profiles'); + $body = '
'; + $body .= '

' . $title . '

'; + $body .= '
'; + if ($i > 0) + { + echo $body; + } +?> \ No newline at end of file diff --git a/views/default/output/social-shortcut.php b/views/default/output/social-shortcut.php new file mode 100644 index 0000000..4c5b2be --- /dev/null +++ b/views/default/output/social-shortcut.php @@ -0,0 +1,8 @@ + $vars['profile_url'], + 'text' => elgg_view('output/img', $vars), + 'title' => $vars['alt'])); +?> \ No newline at end of file diff --git a/views/default/plugins/interconnected/settings.php b/views/default/plugins/interconnected/settings.php new file mode 100644 index 0000000..063da28 --- /dev/null +++ b/views/default/plugins/interconnected/settings.php @@ -0,0 +1,102 @@ +
+sitename; + elgg_set_plugin_setting('default_title',$default_meta_keywords); + } + + $default_meta_keywords = elgg_get_plugin_setting('default_meta_keywords', 'interconnected'); + if (!$default_meta_keywords) { + $default_meta_keywords = ''; + elgg_set_plugin_setting('default_meta_keywords',$default_meta_keywords); + } + + $max_meta_keywords = elgg_get_plugin_setting('max_meta_keywords', 'interconnected'); + if (!$max_meta_keywords) { + $max_meta_keywords = 0; + elgg_set_plugin_setting('max_meta_keywords',$max_meta_keywords); + } + + $max_meta_description = elgg_get_plugin_setting('max_meta_description', 'interconnected'); + if (!$max_meta_description) { + $max_meta_description = 160; + elgg_set_plugin_setting('max_meta_description',$max_meta_description); + } + + echo "

"; + echo elgg_echo('interconnected:admin:title:social'); + echo "


"; + echo ''; + echo "
"; + echo elgg_view('input/text', array('name'=>'params[site_logo]', 'value'=>$site_logo)); + echo "

"; + echo ''; + echo "
"; + echo elgg_view('input/text', array('name'=>'params[full_site_logo]', 'value'=>$full_site_logo)); + echo "

"; + echo ''; + echo "
"; + echo elgg_view('input/text', array('name'=>'params[twitter_handle]', 'value'=>$twitter_handle)); + echo "

"; + echo ''; + echo "
"; + echo elgg_view('input/text', array('name'=>'params[about_me]', 'value'=>$about_me)); + echo "

"; + echo ''; + echo "
"; + echo elgg_view('input/text', array('name'=>'params[group_description]', 'value'=>$group_description)); + echo "

"; + + echo "

"; + echo elgg_echo('interconnected:admin:title:seo'); + echo "


"; + + echo ''; + echo "
"; + echo elgg_view('input/text', array('name'=>'params[default_title]', 'value'=>$default_title)); + echo "
"; + + echo ''; + echo "
"; + echo elgg_view('input/text', array('name'=>'params[default_meta_keywords]', 'value'=>$default_meta_keywords)); + echo "
"; + + echo ''; + echo "
"; + echo elgg_view('input/text', array('name'=>'params[max_meta_keywords]', 'value'=>$max_meta_keywords)); + echo "
"; + + echo ''; + echo "
"; + echo elgg_view('input/text', array('name'=>'params[max_meta_description]', 'value'=>$max_meta_description)); + echo "
"; + +?> +
\ No newline at end of file diff --git a/views/default/sidebar/interconnected.php b/views/default/sidebar/interconnected.php new file mode 100644 index 0000000..fffeebd --- /dev/null +++ b/views/default/sidebar/interconnected.php @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/views/default/social-sites/share-to/email.php b/views/default/social-sites/share-to/email.php new file mode 100644 index 0000000..68c27fc --- /dev/null +++ b/views/default/social-sites/share-to/email.php @@ -0,0 +1,17 @@ +
' . elgg_echo('interconnected:email') . '
'; + + echo $vars['button']; + return true; + +?> \ No newline at end of file diff --git a/views/default/social-sites/share-to/facebook.php b/views/default/social-sites/share-to/facebook.php new file mode 100644 index 0000000..cb93041 --- /dev/null +++ b/views/default/social-sites/share-to/facebook.php @@ -0,0 +1,5 @@ +
' . elgg_echo('interconnected:facebook') . '
'; + echo $vars['button']; + return true; +?> \ No newline at end of file diff --git a/views/default/social-sites/share-to/googleplus.php b/views/default/social-sites/share-to/googleplus.php new file mode 100644 index 0000000..410fc1d --- /dev/null +++ b/views/default/social-sites/share-to/googleplus.php @@ -0,0 +1,6 @@ +
' . elgg_echo('interconnected:googleplus') . '
'; + + echo $vars['button']; + return true; +?> \ No newline at end of file diff --git a/views/default/social-sites/share-to/linkedin.php b/views/default/social-sites/share-to/linkedin.php new file mode 100644 index 0000000..b3b3661 --- /dev/null +++ b/views/default/social-sites/share-to/linkedin.php @@ -0,0 +1,6 @@ +
' . elgg_echo('interconnected:linkedin-button') . '
'; + + echo $vars['button']; + return true; +?> \ No newline at end of file diff --git a/views/default/social-sites/share-to/pinterest.php b/views/default/social-sites/share-to/pinterest.php new file mode 100644 index 0000000..d3f2301 --- /dev/null +++ b/views/default/social-sites/share-to/pinterest.php @@ -0,0 +1,18 @@ +
' . elgg_echo('interconnected:pinterest') . '
'; + + echo $vars['button']; + return true; +?> \ No newline at end of file diff --git a/views/default/social-sites/share-to/stumbleupon.php b/views/default/social-sites/share-to/stumbleupon.php new file mode 100644 index 0000000..491e7d7 --- /dev/null +++ b/views/default/social-sites/share-to/stumbleupon.php @@ -0,0 +1,6 @@ +
' . elgg_echo('interconnected:stumbleupon') . '
'; + + echo $vars['button']; + return true; +?> \ No newline at end of file diff --git a/views/default/social-sites/share-to/twitter.php b/views/default/social-sites/share-to/twitter.php new file mode 100644 index 0000000..80493d7 --- /dev/null +++ b/views/default/social-sites/share-to/twitter.php @@ -0,0 +1,12 @@ +
' . elgg_echo('interconnected:twitter') . '
'; + + echo $vars['button']; + return true; +?> \ No newline at end of file diff --git a/views/default/widgets/interconnected/content.php b/views/default/widgets/interconnected/content.php new file mode 100644 index 0000000..3189041 --- /dev/null +++ b/views/default/widgets/interconnected/content.php @@ -0,0 +1,3 @@ +' . elgg_view('interconnected/interconnected',$vars) . ''; +?> \ No newline at end of file