├── .gitignore ├── follow.module ├── icons ├── large │ ├── icon-feed.png │ ├── icon-virb.png │ ├── icon-bliptv.png │ ├── icon-flickr.png │ ├── icon-lastfm.png │ ├── icon-myspace.png │ ├── icon-picasa.png │ ├── icon-tumblr.png │ ├── icon-twitter.png │ ├── icon-vimeo.png │ ├── icon-youtube.png │ ├── icon-delicious.png │ ├── icon-facebook.png │ ├── icon-linkedin.png │ └── icon-newsletter.png └── small │ ├── icon-feed.png │ ├── icon-virb.png │ ├── icon-bliptv.png │ ├── icon-flickr.png │ ├── icon-lastfm.png │ ├── icon-myspace.png │ ├── icon-picasa.png │ ├── icon-tumblr.png │ ├── icon-twitter.png │ ├── icon-vimeo.png │ ├── icon-youtube.png │ ├── icon-delicious.png │ ├── icon-facebook.png │ ├── icon-linkedin.png │ └── icon-newsletter.png ├── follow.info ├── follow.api.php ├── follow.css ├── README.txt └── follow.install /.gitignore: -------------------------------------------------------------------------------- 1 | .svn 2 | CVS 3 | .DS_Store 4 | -------------------------------------------------------------------------------- /follow.module: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/follow.module -------------------------------------------------------------------------------- /icons/large/icon-feed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/large/icon-feed.png -------------------------------------------------------------------------------- /icons/large/icon-virb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/large/icon-virb.png -------------------------------------------------------------------------------- /icons/small/icon-feed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/small/icon-feed.png -------------------------------------------------------------------------------- /icons/small/icon-virb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/small/icon-virb.png -------------------------------------------------------------------------------- /icons/large/icon-bliptv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/large/icon-bliptv.png -------------------------------------------------------------------------------- /icons/large/icon-flickr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/large/icon-flickr.png -------------------------------------------------------------------------------- /icons/large/icon-lastfm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/large/icon-lastfm.png -------------------------------------------------------------------------------- /icons/large/icon-myspace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/large/icon-myspace.png -------------------------------------------------------------------------------- /icons/large/icon-picasa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/large/icon-picasa.png -------------------------------------------------------------------------------- /icons/large/icon-tumblr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/large/icon-tumblr.png -------------------------------------------------------------------------------- /icons/large/icon-twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/large/icon-twitter.png -------------------------------------------------------------------------------- /icons/large/icon-vimeo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/large/icon-vimeo.png -------------------------------------------------------------------------------- /icons/large/icon-youtube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/large/icon-youtube.png -------------------------------------------------------------------------------- /icons/small/icon-bliptv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/small/icon-bliptv.png -------------------------------------------------------------------------------- /icons/small/icon-flickr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/small/icon-flickr.png -------------------------------------------------------------------------------- /icons/small/icon-lastfm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/small/icon-lastfm.png -------------------------------------------------------------------------------- /icons/small/icon-myspace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/small/icon-myspace.png -------------------------------------------------------------------------------- /icons/small/icon-picasa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/small/icon-picasa.png -------------------------------------------------------------------------------- /icons/small/icon-tumblr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/small/icon-tumblr.png -------------------------------------------------------------------------------- /icons/small/icon-twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/small/icon-twitter.png -------------------------------------------------------------------------------- /icons/small/icon-vimeo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/small/icon-vimeo.png -------------------------------------------------------------------------------- /icons/small/icon-youtube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/small/icon-youtube.png -------------------------------------------------------------------------------- /icons/large/icon-delicious.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/large/icon-delicious.png -------------------------------------------------------------------------------- /icons/large/icon-facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/large/icon-facebook.png -------------------------------------------------------------------------------- /icons/large/icon-linkedin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/large/icon-linkedin.png -------------------------------------------------------------------------------- /icons/small/icon-delicious.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/small/icon-delicious.png -------------------------------------------------------------------------------- /icons/small/icon-facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/small/icon-facebook.png -------------------------------------------------------------------------------- /icons/small/icon-linkedin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/small/icon-linkedin.png -------------------------------------------------------------------------------- /icons/large/icon-newsletter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/large/icon-newsletter.png -------------------------------------------------------------------------------- /icons/small/icon-newsletter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antillas21/drupal-follow/master/icons/small/icon-newsletter.png -------------------------------------------------------------------------------- /follow.info: -------------------------------------------------------------------------------- 1 | ; $Id: follow.info,v 1.1 2009/04/29 17:20:42 q0rban Exp $ 2 | name = Follow 3 | description = Add sitewide and per user links to social network profiles. 4 | core = 6.x -------------------------------------------------------------------------------- /follow.api.php: -------------------------------------------------------------------------------- 1 | t('Mailing List'), 17 | 'domain' => '', 18 | ); 19 | 20 | // Replace Twitter with Identi.ca 21 | unset($networks['twitter']); 22 | $networks['identica'] = array( 23 | 'title' => t('Identi.ca'), 24 | 'domain' => 'identi.ca', 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /follow.css: -------------------------------------------------------------------------------- 1 | /* $Id: follow.css,v 1.1.2.7 2010/05/14 15:05:07 q0rban Exp $ */ 2 | 3 | a.follow-link { 4 | height: 30px; 5 | display: block; 6 | line-height: 26px; 7 | padding-left: 28px; 8 | background-position: 0 0; 9 | background-repeat: no-repeat; 10 | } 11 | 12 | a.follow-link-facebook { 13 | background-image: url(icons/small/icon-facebook.png); 14 | } 15 | 16 | a.follow-link-myspace { 17 | background-image: url(icons/small/icon-myspace.png); 18 | } 19 | 20 | a.follow-link-virb { 21 | background-image: url(icons/small/icon-virb.png); 22 | } 23 | 24 | a.follow-link-bliptv { 25 | background-image: url(icons/small/icon-bliptv.png); 26 | } 27 | 28 | a.follow-link-lastfm { 29 | background-image: url(icons/small/icon-lastfm.png); 30 | } 31 | 32 | a.follow-link-youtube { 33 | background-image: url(icons/small/icon-youtube.png); 34 | } 35 | 36 | a.follow-link-twitter { 37 | background-image: url(icons/small/icon-twitter.png); 38 | } 39 | 40 | a.follow-link-picasa { 41 | background-image: url(icons/small/icon-picasa.png); 42 | } 43 | 44 | a.follow-link-flickr { 45 | background-image: url(icons/small/icon-flickr.png); 46 | } 47 | 48 | a.follow-link-vimeo { 49 | background-image: url(icons/small/icon-vimeo.png); 50 | } 51 | 52 | a.follow-link-linkedin { 53 | background-image: url(icons/small/icon-linkedin.png); 54 | } 55 | 56 | a.follow-link-delicious { 57 | background-image: url(icons/small/icon-delicious.png); 58 | } 59 | 60 | a.follow-link-tumblr { 61 | background-image: url(icons/small/icon-tumblr.png); 62 | } 63 | 64 | a.follow-link-this-site { 65 | background-image: url(icons/small/icon-feed.png); 66 | } 67 | 68 | a.follow-link-newsletter { 69 | background-image: url(icons/small/icon-newsletter.png); 70 | } 71 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | DESCRIPTION 2 | ******************************************************************************** 3 | Follow adds sitewide and per user links that link to various social networking 4 | sites. The links reside in two blocks. The Follow Site block lists all the 5 | links for the site itself, and by default is visible on all pages. The Follow 6 | User block lists all the follow links for the user and is visible only on user 7 | profile pages. There is a setting in the Follow Site block to have it not 8 | display on user profile pages. 9 | 10 | INSTALLATION 11 | ******************************************************************************** 12 | Enable the module at admin/build/modules, then go to user/admin/permissions to 13 | set which roles are allowed to edit the sitewide follow links, edit own follow 14 | links, edit all user follow links, or administer follow. Go to 15 | admin/build/blocks to enable the blocks. User follow links can be edited at 16 | user/%/follow, whereas sitewide follow links are at admin/build/follow 17 | 18 | RECOMMENDED ADD ON 19 | ******************************************************************************** 20 | It is recommended to enable a module such as external [1] that will pop open 21 | the follow links in a new tab or window; target="_blank" is not used since it 22 | does not validate. 23 | 24 | [1] http://drupal.org/project/external 25 | 26 | SOCIAL NETWORKS 27 | ******************************************************************************** 28 | Here's a list of the currently supported social networks: 29 | - Facebook 30 | - Virb 31 | - MySpace 32 | - Twitter 33 | - Picasa 34 | - Flickr 35 | - YouTube 36 | - Vimeo 37 | - blip.tv 38 | - last.fm 39 | - LinkedIn 40 | - Delicious 41 | - Tumblr 42 | 43 | ICONS 44 | ******************************************************************************** 45 | Although a few of the icons were hand made, most of them were created by either 46 | Eli Burford [1] or Yichi [2]. Thanks, you guys! 47 | 48 | [1] http://www.blogperfume.com/social-media-icons-pack-in-3-sizes-for-download/ 49 | [2] http://vikiworks.com/2007/06/15/social-bookmark-iconset/ 50 | 51 | -------------------------------------------------------------------------------- /follow.install: -------------------------------------------------------------------------------- 1 | 'Stores sitewide and user follow links.', 22 | 'fields' => array( 23 | 'lid' => array( 24 | 'type' => 'serial', 25 | 'unsigned' => TRUE, 26 | 'not null' => TRUE, 27 | 'description' => 'Unique identifier for the {follow_links}.', 28 | ), 29 | 'name' => array( 30 | 'type' => 'varchar', 31 | 'length' => 255, 32 | 'not null' => TRUE, 33 | 'default' => '', 34 | 'description' => "The machine name of the {follow_links}.", 35 | ), 36 | 'uid' => array( 37 | 'type' => 'int', 38 | 'not null' => TRUE, 39 | 'default' => 0, 40 | 'description' => "User's {users} uid. Sitewide {follow_links} use uid 0", 41 | ), 42 | 'path' => array( 43 | 'type' => 'varchar', 44 | 'length' => 255, 45 | 'not null' => TRUE, 46 | 'default' => '', 47 | 'description' => 'The Drupal path or extenal URL the {follow_links} should point to.', 48 | ), 49 | 'options' => array( 50 | 'description' => 'A serialized array of options to be passed to the url() or l() function, such as a query string or HTML attributes.', 51 | 'type' => 'text', 52 | 'translatable' => TRUE, 53 | 'serialize' => TRUE, 54 | ), 55 | 'title' => array( 56 | 'type' => 'varchar', 57 | 'length' => 255, 58 | 'not null' => TRUE, 59 | 'default' => '', 60 | 'description' => 'The human readable name for the link.', 61 | ), 62 | 'weight' => array( 63 | 'type' => 'int', 64 | 'not null' => TRUE, 65 | 'default' => 0, 66 | 'size' => 'tiny', 67 | 'description' => 'The weight of this {follow_links}.', 68 | ), 69 | ), 70 | 'primary key' => array('lid'), 71 | 'unique keys' => array( 72 | 'uid_name' => array('uid', 'name'), 73 | ), 74 | ); 75 | return $schema; 76 | } 77 | 78 | /** 79 | * Implementation of hook_uninstall(). 80 | */ 81 | function follow_uninstall() { 82 | drupal_uninstall_schema('follow'); 83 | variable_del('follow_user_block_title'); 84 | variable_del('follow_site_block_title'); 85 | variable_del('follow_site_block_user'); 86 | } 87 | 88 | /** 89 | * Update for caching and schema changes. 90 | */ 91 | function follow_update_6000() { 92 | $ret = array(); 93 | 94 | if (drupal_get_installed_schema_version('follow') == 5000) { 95 | drupal_set_installed_schema_version('follow', 6003); 96 | 97 | return $ret; 98 | } 99 | 100 | // We no longer cache the follow networks. 101 | cache_clear_all('follow:networks', 'cache'); 102 | 103 | $schema = follow_schema(); 104 | $path = $schema['follow_links']['fields']['path']; 105 | $options = $schema['follow_links']['fields']['options']; 106 | 107 | // Since we match against just uid in queries, this field must 108 | // come first for the index to be used. 109 | db_drop_unique_key($ret, 'follow_links', 'name_uid'); 110 | db_add_unique_key($ret, 'follow_links', 'uid_name', array('uid', 'name')); 111 | db_add_field($ret, 'follow_links', 'path', $path); 112 | db_add_field($ret, 'follow_links', 'options', $options); 113 | 114 | // We need to populate current rows' options col with an empty array. 115 | $ret[] = update_sql("UPDATE {follow_links} SET options = 'a:0:{}'"); 116 | 117 | return $ret; 118 | } 119 | 120 | /** 121 | * Update existing data to the new schema. 122 | */ 123 | function follow_update_6001(&$sandbox = NULL) { 124 | $ret = array(); 125 | 126 | // Check to make sure the url column exists before running this update. The only 127 | // instance I can think of where this might happen is a D5 to D6 upgrade. 128 | if (db_column_exists('follow_links', 'url')) { 129 | if (!isset($sandbox['max_lid'])) { 130 | $sandbox['current_lid'] = 0; 131 | $sandbox['max_lid'] = db_result(db_query('SELECT MAX(lid) FROM {follow_links}')); 132 | } 133 | $result = db_query("SELECT lid, url FROM {follow_links} WHERE lid > %d ORDER BY lid ASC LIMIT 100", $sandbox['current_lid']); 134 | 135 | while ($link = db_fetch_object($result)) { 136 | $parsed_url = follow_parse_url($link->url); 137 | $path = db_escape_string($parsed_url['path']); 138 | $options = serialize($parsed_url['options']); 139 | 140 | $ret[] = update_sql("UPDATE {follow_links} SET path = '$path', options = '$options' WHERE lid = {$link->lid}"); 141 | 142 | $sandbox['current_lid'] = $link->lid; 143 | } 144 | 145 | $ret['#finished'] = empty($sandbox['max_lid']) ? 1 : ($sandbox['current_lid'] / $sandbox['max_lid']); 146 | } 147 | 148 | return $ret; 149 | } 150 | 151 | 152 | /** 153 | * Drop old schema column. 154 | */ 155 | function follow_update_6002() { 156 | $ret = array(); 157 | 158 | db_drop_field($ret, 'follow_links', 'url'); 159 | 160 | return $ret; 161 | } 162 | 163 | /** 164 | * Add a title field. 165 | */ 166 | function follow_update_6003() { 167 | $ret = array(); 168 | 169 | // Check to make sure the title column doesn't exists before running this 170 | // update. The only instance I can think of where this might happen is a D5 to 171 | // D6 upgrade. 172 | if (!db_column_exists('follow_links', 'title')) { 173 | $schema = follow_schema(); 174 | $title = $schema['follow_links']['fields']['title']; 175 | 176 | db_add_field($ret, 'follow_links', 'title', $title); 177 | } 178 | 179 | return $ret; 180 | } 181 | --------------------------------------------------------------------------------