Browse files

Updated README, edited the list to add, and implemented the shortcode…

… functions for most
  • Loading branch information...
1 parent 174edd6 commit e3f662b447e0ec54934354e209620ea5352339d0 @tw2113 committed Nov 21, 2010
Showing with 98 additions and 37 deletions.
  1. +20 −0 README
  2. +0 −30 SM_sites_add.txt
  3. +2 −0 ideas.txt
  4. +76 −7 social_media_shortcode_plugin.php
View
20 README
@@ -1 +1,21 @@
A basic Wordpress Plugin that creates shortcodes for profile links to various social media websites. I'll work on my readme more later.
+
+Example 1:
+
+[twitter name="JoeSomeone" text="some text you want the link to appear as"]
+
+results in:
+
+<a href="http://www.twitter.com/JoeSomeone" title="JoeSomeone's Twitter profile\">some text you want the link to appear as</a>
+
+on your post/page
+
+Example 2:
+
+[twitter name="JoeSomeone"]
+
+results in:
+
+<a href="http://www.twitter.com/JoeSomeone" title="JoeSomeone's Twitter profile\">JoeSomeone (Twitter)</a>
+
+on your post/page.
View
30 SM_sites_add.txt
@@ -1,34 +1,4 @@
-/****Already Added****/
-twitter
-identica
-facebook
-reddit
-linkedin
-stumbleupon
-myspace
-
-/****Add Me****/
-digg digg.com/user
deviantart user.deviantart.com
-foursquare foursquare.com/user
-scvngr
-delicious delicious.com/user
-youtube youtube.com/user
tumblr user.tumblr.com
-gowalla gowalla.com/users/user
-stumbleupon stumbleupon.com/stumbler/user
newsvine user.newsvine.com
-flickr flickr.com/photos/user
-vimeo vimeo.com/user
-stickam stickam.com/user
-scribd scribd.com/user
-slideshare slideshare.net/user
posterous user.posterous.com/
-daily booth dailybooth.com/user
-codesnipp.it codesnipp.it/user
-forrst forrst.com/people/user
-dribbble dribbble.com/user
-last.fm last.fm/user/user
-favstar.fm favstar.fm/users/user
-okcupid okcupid.com/profile/user
-
View
2 ideas.txt
@@ -1 +1,3 @@
As the plugin grows and adds more social media sites for the shortcode, create an options page listing them all with toggle switches. Not everyone is going to need each one enabled by default.
+
+for those sites that have user.url.com, put in an array and check? right now, url.com/user is slightly hardcoded. Put the check in the social_link_sc() function
View
83 social_media_shortcode_plugin.php
@@ -21,25 +21,76 @@ function social_link_sc($service, $link, $atts){
}
//First is the service name, then the profile url sans user ID. Gets passed to social_link_sc and has the actual link returned.
function twitter_sc($atts){
- return social_link_sc('twitter', 'http://twitter.com', $atts);
+ return social_link_sc('Twitter', 'http://twitter.com', $atts);
}
function identica_sc($atts){
- return social_link_sc('identica', 'http://identi.ca', $atts);
+ return social_link_sc('Identica', 'http://identi.ca', $atts);
}
function facebook_sc($atts){
- return social_link_sc('facebook', 'http://www.facebook.com', $atts);
+ return social_link_sc('Facebook', 'http://www.facebook.com', $atts);
}
function reddit_sc($atts){
- return social_link_sc('reddit', 'http://www.reddit.com/user', $atts);
+ return social_link_sc('Reddit', 'http://www.reddit.com/user', $atts);
}
function linkedin_sc($atts){
- return social_link_sc('linkedin', 'http://www.linkedin.com/in', $atts);
+ return social_link_sc('Linkedin', 'http://www.linkedin.com/in', $atts);
}
function stumbleupon_sc($atts){
- return social_link_sc('stumbleupon', 'http://www.stumbleupon.com/stumbler', $atts);
+ return social_link_sc('StumbleUpon', 'http://www.stumbleupon.com/stumbler', $atts);
}
function myspace_sc($atts){
- return social_link_sc('myspace', 'http://www.myspace.com', $atts);
+ return social_link_sc('Myspace', 'http://www.myspace.com', $atts);
+}
+function digg_sc($atts){
+ return social_link_sc('Digg', 'http://www.digg.com', $atts);
+}
+function foursquare_sc($atts){
+ return social_link_sc('Foursquare', 'http://foursquare.com', $atts);
+}
+function delicious_sc($atts){
+ return social_link_sc('Delicious', 'http://www.delicious.com', $atts);
+}
+function youtube_sc($atts){
+ return social_link_sc('Youtube', 'http://www.youtube.com', $atts);
+}
+function gowalla_sc($atts){
+ return social_link_sc('Gowalla', 'http://www.gowalla.com/users', $atts);
+}
+function flickr_sc($atts){
+ return social_link_sc('Flickr', 'http://www.flickr.com/photos', $atts);
+}
+function vimeo_sc($atts){
+ return social_link_sc('Vimeo', 'http://www.vimeo.com', $atts);
+}
+function stickam_sc($atts){
+ return social_link_sc('Stickam', 'http://www.stickam.com', $atts);
+}
+function scribd_sc($atts){
+ return social_link_sc('Scribd', 'http://www.scribd.com', $atts);
+}
+function slideshare_sc($atts){
+ return social_link_sc('Slideshare', 'http://www.slideshare.net', $atts);
+}
+function dailybooth_sc($atts){
+ return social_link_sc('Daily Booth', 'http://www.dailybooth.com', $atts);
+}
+function codesnippit_sc($atts){
+ return social_link_sc('Codesnipp.it', 'http://www.codesnipp.it', $atts);
+}
+function forrst_sc($atts){
+ return social_link_sc('Forrst', 'http://www.forrst.com/people', $atts);
+}
+function dribbble_sc($atts){
+ return social_link_sc('Dribbble', 'http://www.dribbble.com', $atts);
+}
+function lastfm_sc($atts){
+ return social_link_sc('Last.fm', 'http://www.last.fm/user', $atts);
+}
+function favstarfm_sc($atts){
+ return social_link_sc('Favstar.fm', 'http://www.favstar.fm/users', $atts);
+}
+function okcupid_sc($atts){
+ return social_link_sc('Okcupid', 'http://www.okcupid.com/profile', $atts);
}
add_shortcode('twitter', 'twitter_sc');
@@ -49,4 +100,22 @@ function myspace_sc($atts){
add_shortcode('linkedin', 'linkedin_sc');
add_shortcode('stumbleupon', 'stumbleupon_sc');
add_shortcode('myspace', 'myspace_sc');
+add_shortcode('digg', 'digg_sc');
+add_shortcode('foursquare', 'foursquare_sc');
+add_shortcode('delicious', 'delicious_sc');
+add_shortcode('youtube', 'youtube_sc');
+add_shortcode('gowalla', 'gowalla_sc');
+add_shortcode('flickr', 'flickr_sc');
+add_shortcode('vimeo', 'vimeo_sc');
+add_shortcode('stickam', 'stickam_sc');
+add_shortcode('scribd', 'scribd_sc');
+add_shortcode('slideshare', 'slideshare_sc');
+add_shortcode('dailybooth', 'dailybooth_sc');
+add_shortcode('codesnippit', 'codesnippit_sc');
+add_shortcode('forrst', 'forrst_sc');
+add_shortcode('dribbble', 'dribbble_sc');
+add_shortcode('lastfm', 'lastfm_sc');
+add_shortcode('favstarfm', 'favstarfm_sc');
+add_shortcode('okcupid', 'okcupid_sc');
+
?>

0 comments on commit e3f662b

Please sign in to comment.