January 2012
Monthly Archive
Using jQuery and tournament game data from JSON objects, I created and filled in basketball tournament brackets.
The JSON objects were created by looping through each tournament and organizing the data into JSON objects. A JavaScript file with a JSON object was created for each tournament and then ftp’d to the web server where it was used by a different JavaScript file to display a bracket.
The jQuery and JavaScript used to display the bracket parses through the JSON object which included tournament info and round by round game data. Then it built a bracket, positioned everything and appended the HTML to the bracket page to be displayed.
jQuery code snippet:

JSON object snippet:

Custom WordPress shortcode that allows the user to easily insert their Twitter URL as a link by typing [mh_twitter] into a WordPress post.
Using just [mh_twitter] will display the default username and message ‘Follow me on Twitter’ into the post.
By adding attributes to the shortcode the user can customize both the Twitter username/profile link and the link text.
[mh_twitter username="somename"] will overwrite the profile link but keep the default text. The HTML would look like this
<a href="http://twitter.com/somename">Follow me on Twitter</a>
[mh_twitter username="somename"]Please follow me on Twitter[/mh_twitter] will overwrite both the profile link and the link text. The HTML would look like this
<a href="http://twitter.com/somename">Please follow me on Twitter</a>
Coded example of a WordPress plugin I made. It displays related posts after the content of the post. The relation is based on the category of the current post the user is viewing but does not include the current post. The order is random and currently just hard coded to display 3 posts in list format.