<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TheHacked.com</title>
	<atom:link href="http://thehacked.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://thehacked.com</link>
	<description>Just another WordPress blog</description>
	<lastBuildDate>Wed, 09 May 2012 06:50:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>The biggest, most fattest list of free icons!</title>
		<link>http://thehacked.com/the-biggest-most-fattest-list-of-free-icons/</link>
		<comments>http://thehacked.com/the-biggest-most-fattest-list-of-free-icons/#comments</comments>
		<pubDate>Wed, 09 May 2012 06:15:14 +0000</pubDate>
		<dc:creator>DavidM</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[commercial]]></category>
		<category><![CDATA[favicons]]></category>
		<category><![CDATA[free graphics]]></category>
		<category><![CDATA[icons]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[website icons]]></category>

		<guid isPermaLink="false">http://thehacked.com/?p=305</guid>
		<description><![CDATA[<p>Need icons of practically all shapes and sizes?  For free? For personal or commercial use? No strings attached? Webtreats has you covered with a massive plethora, the most biggest plethora, of free icons you&#8217;ve ever seen! Check &#8216;em out at http://icons.mysitemyway.com/. The Dilemma Why spend money on icons when there&#8217;s such an abundance of free ones...</p>
 ]]></description>
			<content:encoded><![CDATA[<p>Need icons of practically all shapes and sizes?  For free? For personal or commercial use? No strings attached? Webtreats has you covered with a massive plethora, the most biggest plethora, of free icons you&#8217;ve ever seen!</p>
<p>Check &#8216;em out at <a title="Icons from mysitemyway.com!" href="http://icons.mysitemyway.com/" target="_blank">http://icons.mysitemyway.com/</a>.</p>
<p><span id="more-305"></span></p>
<h3>The Dilemma</h3>
<p>Why spend money on icons when there&#8217;s such an abundance of free ones out there on the market? Why? Because it often takes an incredible amount of time scouring the net finding ones you can actually use. To complicate things, many are released under various licenses that require you to spend as incredible an amount of time reading up on.</p>
<h3>Enter Webtreats</h3>
<p>Webtreats is an unbelievably gracious group of web developers who have kindly provided a huge arsenal of graphic and other web design elements for free to the masses. 100% free, for commercial, personal use or otherwise! Read it for yourself in their <a title="Terms of Use" href="http://icons.mysitemyway.com/terms-of-use/" target="_blank">Terms of Use</a>.</p>
<p>Their icons span the gamut of utility, covering categories such as alphanumeric, arrows, tools, and even social networks! And did we mention they&#8217;ve got one fat list of icons? Yep, it&#8217;s the biggest, most fattest list of free icons we&#8217;ve yet seen.</p>
<h3>So they&#8217;re free, are they any good?</h3>
<p>As great as &#8220;free&#8221; sounds, free graphics are only as valuable as they are useful, right? Fortunately,  Webtreats&#8217; icons, are designed by professionals and have all the sheen of commercial icon sets. Plus, they cover such a wide array of categories, they&#8217;re simply invaluable.</p>
<p><img class="aligncenter size-full wp-image-312" title="Icons from mysitemyway" src="http://thehacked.com/files/2012/05/icons-mysitemyway.png" alt="Icons from mysitemyway" width="617" height="142" /></p>
<p style="text-align: center;">
<p>Using Webtreats graphics, you&#8217;ll have a consistent, coherent and beautiful graphic experience at your disposal. They&#8217;re so utterly cool, we use them here throughout the site.</p>
<h3>More awesomeness from Webtreats!</h3>
<p>Being seasoned web development professionals, Webtreats does far more than provide super-cool, free resources. In fact, they&#8217;ve got a series of professional WordPress and general website themes up for sale on the Envato network, themeforest to be specific.</p>
<p>Need some awesome themes, check out <a title="Webtreats on ThemeForest.net" href="http://themeforest.net/user/Webtreats/portfolio" target="_blank">Webtreats on Envato</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://thehacked.com/the-biggest-most-fattest-list-of-free-icons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert your PNG graphics to ICO format with Converticon</title>
		<link>http://thehacked.com/convert-png-to-ico-with-convertico/</link>
		<comments>http://thehacked.com/convert-png-to-ico-with-convertico/#comments</comments>
		<pubDate>Tue, 01 May 2012 11:19:44 +0000</pubDate>
		<dc:creator>DavidM</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[convert to icon]]></category>
		<category><![CDATA[favicon]]></category>
		<category><![CDATA[png to ico converter]]></category>
		<category><![CDATA[transparent icons]]></category>

		<guid isPermaLink="false">http://thehacked.com/?p=296</guid>
		<description><![CDATA[<p>Need a favicon in the standard favicon .ico format and not sure how to make one? Perhaps you&#8217;re a developer who needs .ico files for your apps and you&#8217;re having a hard time converting PNG or JPG files to the esoteric .ico format? Not to worry at all, Converticon.com is here for to save you!...</p>
 ]]></description>
			<content:encoded><![CDATA[<p>Need a favicon in the standard favicon .ico format and not sure how to make one? Perhaps you&#8217;re a developer who needs .ico files for your apps and you&#8217;re having a hard time converting PNG or JPG files to the esoteric .ico format?</p>
<p>Not to worry at all, <a title="Converticon.com" href="http://converticon.com/" target="_blank">Converticon.com</a> is here for to save you!</p>
<p><span id="more-296"></span></p>
<p>The .ico file format hasn&#8217;t been the easiest format to find a converter for in the past. Most graphic editors, like Photoshop and Paintshop Pro, don&#8217;t seem to include native exporters for the format.</p>
<h3>What to do!</h3>
<p>Luckily, the good folks behind the incredible <a title="RocketDock" href="http://rocketdock.com/" target="_blank">RocketDock</a> software have created a quick and easy to use web app at Converticon.com that makes the conversion process a snap. Simply visit the website, select the file you want to convert, and convert it.</p>
<h3>Why would I need this?</h3>
<p>You likely don&#8217;t. But the .ico format is used for website favicons as well as software application icons. It includes the possibility of transparent pixels, so a proper converter will bear that in mind and fortunately, this is such a proper converter.</p>
<p>Have fun converting!</p>
]]></content:encoded>
			<wfw:commentRss>http://thehacked.com/convert-png-to-ico-with-convertico/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A WordPress plugin for Interactive Fiction via Inform 7</title>
		<link>http://thehacked.com/a-wordpress-plugin-for-interactive-fiction-via-inform-7/</link>
		<comments>http://thehacked.com/a-wordpress-plugin-for-interactive-fiction-via-inform-7/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 04:47:35 +0000</pubDate>
		<dc:creator>DavidM</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[file types in wp]]></category>
		<category><![CDATA[if]]></category>
		<category><![CDATA[infocom]]></category>
		<category><![CDATA[inform7]]></category>
		<category><![CDATA[interactive fiction]]></category>
		<category><![CDATA[mime type]]></category>
		<category><![CDATA[text adventure]]></category>
		<category><![CDATA[text game]]></category>
		<category><![CDATA[text-based games]]></category>
		<category><![CDATA[thatsif]]></category>
		<category><![CDATA[wordpress plugin]]></category>
		<category><![CDATA[z8]]></category>
		<category><![CDATA[zblorb]]></category>

		<guid isPermaLink="false">http://thehacked.com/?p=286</guid>
		<description><![CDATA[<p>Ever wanted to easily include an IF, or Interactive Fiction, game in your WordPress site? We&#8217;re here to help, with a WordPress plugin that lets you link to and include an Inform 7 game, either local or hosted elsewhere, using a simple shortcode. A bit of background Interactive fiction has captured the hearts and minds...</p>
 ]]></description>
			<content:encoded><![CDATA[<p>Ever wanted to easily include an IF, or Interactive Fiction, game in your WordPress site? We&#8217;re here to help, with a WordPress plugin that lets you link to and include an <a title="Inform 7" href="http://inform7.com/" target="_blank">Inform 7</a> game, either local or hosted elsewhere, using a simple shortcode.</p>
<p><span id="more-286"></span></p>
<h3>A bit of background</h3>
<p>Interactive fiction has captured the hearts and minds of many a geeky soul such as ourselves and while it&#8217;s been around in the computing realm for quite some time, it has a surprisingly exciting recent history. The development of <a title="Inform 7" href="http://inform7.com/" target="_blank">Inform 7</a> and its natural language system has brought the world of text-based game development into the hands of anyone with a grasp of the English language (well, sort of).</p>
<h3>What&#8217;s this Inform 7 thingy?</h3>
<p>Inform 7 lets you create text-based adventures, games of all textual sorts, using the English language as the programming method. Best of all, it&#8217;s totally free! More than that, it can even export a fully browser-playable game, via the amazing <a title="Parchment for Inform 7" href="http://code.google.com/p/parchment/" target="_blank">Parchment</a> JavaScript.</p>
<p>Awesome as that is, it still takes a bit of work to integrate those exported games in a WordPress site. But we&#8217;ve just gone through the trouble of doing that for you and hereby present a plugin that lets you easily achieve it. Check out the main plugin code!</p>
<p></p><pre class="crayon-plain-tag">&lt;?php

/*
Plugin Name: Inform 7 Plugin for WordPress
Plugin URI: http://thehacked.com/inform7
Description: Easily include Inform 7 games in your site. Available using the [inform7] shortcode.
Version: 1.0
Author: DavidM
Author URI: http://thehacked.com
License: GPL 2
*/

class Inform7_Shortcode {

	static $file_url;
 
	static function init() {
		add_shortcode( 'inform7', array( __CLASS__, 'handle_shortcode' ) );
 
		add_action( 'init', array( __CLASS__, 'register_scripts' ) );
		add_action( 'wp_footer', array( __CLASS__, 'print_scripts' ) );
	}
 
	static function handle_shortcode($args) {
		extract( shortcode_atts( array(
			'url' =&gt; '',
			'div' =&gt; 'inform7',
			'width' =&gt; '100%',
			'height' =&gt; '400px'
		), $args));
		// The crux of the output that will be echoed to the page
		$output = '&lt;div id=&quot;inform7-wrapper&quot; style=&quot;width:' . $width . ';height:' . $height . ';&quot;&gt;';
		$output .= '&lt;div id=&quot;gameport&quot;&gt;&lt;div id=&quot;parchment&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;';
		// Add user-specified div tag if specified
		if ( $div != '') {
			$output = '&lt;div id=&quot;' . $div . '&quot;&gt;' . $output;
			$output .= '&lt;/div&gt;';
		}

		self::$file_url = $url;
		return $output;
	}
 
	static function register_scripts() {

	// Register parchment options and special considerations
	wp_register_script( 'thehacked-inform7', plugins_url( 'thehacked_inform7.js', __FILE__ ) );
	
	// Register other scripts
	wp_register_script( 'jquery' );
	wp_register_script( 'inform7-parchment', plugins_url( 'parchment.min.js', __FILE__ ) );
	wp_register_script( 'inform7-gnusto', plugins_url( 'gnusto.min.js', __FILE__ ) );
	wp_register_script( 'inform7-zmachine', plugins_url( 'zmachine.min.js', __FILE__ ) );
	
	// Register styles
	wp_register_style( 'inform7-css', plugins_url('style.css', __FILE__ ) );

	}
 
	static function print_scripts() {
		if ( self::$file_url == '' )
			return;
		
		// Render options on page
		$data = array( 'url' =&gt; __( self::$file_url ), 'plugin_url' =&gt; plugins_url( '/', __FILE__ ) );
		wp_localize_script( 'thehacked-inform7', 'thehacked_inform7_data', $data );
		
		// Print scripts
		wp_print_scripts( 'thehacked-inform7' );
		wp_print_scripts( 'inform7-parchment-options' );
		wp_print_scripts( 'inform7-parchment' );
		wp_print_scripts( 'inform7-gnusto' );
		wp_print_scripts( 'inform7-zmachine' );
		
		// Print styles
		wp_print_styles( 'inform7-css' );
	}
}
 
Inform7_Shortcode::init();

?&gt;</pre><p></p>
<h3>Cool, what&#8217;s that do?</h3>
<p>That plugin code basically asks WordPress to include all the files and code necessary to make your Inform project work. It does so only when the [inform7] shortcode is detected too.</p>
<p>This is achieved using the awesome Jedi method described by the equally awesome Scribu in his post, <a href="http://scribu.net/wordpress/optimal-script-loading.html" alt="How to load JavaScript like a WordPress Master">How to load JavaScript like a WordPress Master</a>.</p>
<p>Of course, that&#8217;s just the main plugin code. You&#8217;ll need a bit more to complete the plugin, and here&#8217;s the JavaScript for the referenced thehacked-inform7.js file:</p>
<p></p><pre class="crayon-plain-tag">// Setup parchment options
parchment_options = {
default_story: [ thehacked_inform7_data.url],
lib_path: thehacked_inform7_data.plugin_url,
lock_story: 1,
page_title: 0
};

// Special hack to get #top-window into better position
jQuery(document).ready(function($) {
	setTimeout(function(){
		jQuery('div#top-window').appendTo('div#inform7-wrapper');
	}, 1000);
});</pre><p></p>
<h3>Hmm, and what&#8217;s this do?</h3>
<p>First off, this includes a few options that <a href="http://code.google.com/p/parchment/" alt="Parchment for Inform 7" target="_blank">Parchment</a> needs.</p>
<p>Second, it adds a bit of a JavaScript hack to get the top-window portion of the game into a better position. This is only required because of our &#8220;hacked&#8221; method of integration. <img src='http://thehacked.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Is that it?</h3>
<p>Oh, you&#8217;ll need a few more files to make this all happen. Included in the export folder of any Inform 7 web released project, you&#8217;ll find an /interpreter/ sub-folder. In that folder, you&#8217;ll see the following files:</p>
<ul>
<li>gnusto.min.js</li>
<li>parchment.min.js</li>
<li>zmachine.min.js</li>
</ul>
<p>There&#8217;s also the matter of css, which is available in both a style.css in the main export folder, and a parchment.css in the /interpreter/ sub-folder. These files will need a bit of adjustment to work properly in your site, thus we&#8217;ve hacked together our own adjusted style.css, as follows:</p>
<p></p><pre class="crayon-plain-tag">/*

Wrapper styles

*/

div#parchment div#content {
	width: 98% !important;
}

#inform7-wrapper
{
	top: 0px;
	bottom: 0px;
	left: 0px;
	right: 0px;
	margin: 0px;
	position: relative;
}

/*

Gameport styles

*/

#gameport
{
	background: white;
	top: 0px;
	bottom: 0px;
	right: 0px;
	left: 0px;
	line-height: 1.4;
	margin: 0px;
	position: absolute;
	overflow-y: auto;
	overflow-x: hidden;
}

/*
Styles for mobile browsers: change to a one-column layout.
*/

@media screen and (max-device-width: 480px)
{
	.coverimage, .introduction, .links, .about, .playinfo, .source, .sourceintroduction, .sourcecoverimage, .notes
	{
		float: none;
		margin-left: 1em;
		text-align: left;
	}

	.play .coverimage, .play .links, .play .interpretercredit
	{
		display: none;
	}
	
	#gameport
	{
		left: 0px;
		width: auto;
	}
}

/*

Main game styles. Foreground and background styles for each of the standard z-machine colors and styles.

*/


.fg-default {
    color: #000;
}

.fg-default-reversed {
    color: #fff;
}

.fg-black {
    color: #000;
}

.fg-red {
    color: #f00;
}

.fg-green {
    color: #0f0;
}

.fg-yellow {
    color: #ff0;
}

.fg-blue {
    color: #00f;
}

.fg-magenta {
    color: #f0f;
}

.fg-cyan {
    color: #0ff;
}

.fg-white {
    color: #fff;
}

.bg-default {
    background: #fff;
}

.bg-default-reversed {
    background: #000;
}

.bg-black {
    background: #000;
}

.bg-red {
    background: #f00;
}

.bg-green {
    background: #0f0;
}

.bg-yellow {
    background: #ff0;
}

.bg-blue {
    background: #00f;
}

.bg-magenta {
    background: #f0f;
}

.bg-cyan {
    background: #0ff;
}

.bg-white {
    background: #fff;
}

.z-roman {
}

.z-bold {
    font-variant: small-caps;
}

.z-italic {
    font-style: italic;
}

.z-fixed-pitch {
    font-family: monaco, andale mono, lucidatypewriter, courier, courier new, monospace;
    white-space: pre;
    font-size: 10pt;
}

.z-breaking-whitespace {
    white-space: normal;
}

.error {
    background: #f00;
    color: white;
    padding: 10px;
    margin: 10px;
}

/*
  Class for all Parchment output windows (usually just the status line and main window.).
*/

.buffered-window {
    text-align: center;
    margin: 0 auto;
    font-family: monaco, andale mono, lucidatypewriter, courier, courier new, monospace;
    font-size: 10pt;
    top: 0px;
    left: 0px;
    position: relative;
    z-index: 0;
}

/* The status bar */

#top-window {
	background-color: #000;
    z-index: 1;
	left: 0px !important;
	top: 0px;
	margin: 0px !important;
	line-height: 20px !important;
	position: absolute;
}

#top-window .z-bold {
    text-decoration: underline;
    font-variant: normal;
}

/* The main story window */

#content {
    text-align: left;
}

/* General dialogs */
.dialog
{
	background: #fff;
	border-radius: 10px;
	-webkit-box-shadow: 5px 5px 10px #777;
	box-shadow: 5px 5px 10px #777;
	padding: 5px;
    width:200px;
    height:100px;
    position:absolute;
    left:50%;
    top:50%;
    margin:-100px 0 0 -150px;

}

/* Load indicator */
.load
{
	text-align: left;
}

/* A generic line input editor */
.LineInput
{
	display: inline;
}

.LineInput input
{
	background: none;
	border: 0;
	font: inherit;
	outline: 0;
	padding: 0;
}

.finished-input {
    opacity: 0.5;
}

/* A generic character input */
.CharInput
{
	left: -99em;
	position: absolute;
}</pre><p></p>
<h3>That&#8217;s a lot of work!</h3>
<p>Perhaps. If it seems a bit much to get an Inform project working for you, no worries, we&#8217;ve got a bundled version right here for ya!</p>
<p>Plugin download: <a href='http://thehacked.com/files/2012/04/thehacked-inform7.zip'>thehacked-inform7.zip</a></p>
<h3>Outstanding, how can we ever thank you?</h3>
<p>You&#8217;re very welcomed! And your appreciation, manifested through your kindly support of us by signing up with our most belovedest affiliate, <a href="http://thehacked.com/wpmu-dev-wordpress-must-use/" alt="WPMU DEV - WordPress Must Use!" title="WPMU DEV - WordPress Must Use!">WPMU DEV</a>, is more than thanks enough! <img src='http://thehacked.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<h3>I are noob, how I are to use this?</h3>
<p>No worries, we&#8217;re all noobs at something. Use the following shortcode examples to help you get started with using the shortcode once the plugin&#8217;s installed.</p>
<p>Display absolutely nothing, zippo, nada!<br />
<span class="text-shadow">[inform7]</span></p>
<p>Display a basic IF tutorial from the good folks at the awesome <a href="http://playfic.com" alt="playfic.com" target="_blank">playfic.com</a>!<br />
<span class="text-shadow">[inform7 url="http://playfic.com/releases/7/713402b6-8685-47b6-b972-3838b2784b1d/713402b6-8685-47b6-b972-3838b2784b1d.z8"]</span></p>
<p>Display the above tutorial game only with an additional DIV id of #playfic-tutorial, which you can then use to style this particular instance.<br />
<span class="text-shadow">[inform7 url="http://playfic.com/releases/7/713402b6-8685-47b6-b972-3838b2784b1d/713402b6-8685-47b6-b972-3838b2784b1d.z8" div="playfic-tutorial"]</span></p>
<p>Display the same tutorial, only constrained to 200px height and a width of 50%, so that the game window resizes based on the page it&#8217;s on.<br />
<span class="text-shadow">[inform7 url="" div="my-game" height="400px" width="50%"]</span></p>
<p>Oh, you can of course, refer to your own locally hosted files as well, rather than linking to external urls. To do so, merely upload the Inform 7 exported .zblorb or .zx file (or other compatible files), to your site, get the link to that file, and include it in the url parameter!</p>
<h3>One thing to consider with locally hosted IF files!</h3>
<p>If (excuse the pun) you&#8217;ll be hosting your games from within your WordPress site, you&#8217;ll very likely need to add the .blorb and .zx mime types to your system, otherwise you&#8217;ll get an upload error.</p>
<p>We&#8217;ve found the excellent and free <a href="http://wordpress.org/extend/plugins/pjw-mime-config/" alt="PJW Mime Config plugin for WordPress" target="_blank">PJW Mime Config</a> plugin to work perfectly well for this.</p>
<h3>Examples! We need examples!</h3>
<p>Hmm, that&#8217;s certainly demanding! But hey, we&#8217;ve got at least one very tiny example up thus far at our very odd sister site, <a href="http://thatsif.com" alt="thatsif.com">ThatsIF.com</a>. Be warned though, she&#8217;s a very strange sister, quite confusing.</p>
<h3>More incredible awesomeness!</h3>
<p>As if Inform and a nifty WP plugin for use with it weren&#8217;t already super-cool enough, take a moment to check out the equally super-cool <a href="http://playfic.com" alt="playfic.com" title="playfic.com" target="_blank">playfic.com</a>.</p>
<p>You can play all sorts of free IF games that others post there. Plus, you can register on the site and create your own Inform games right from within your browser, no download needed!</p>
<p>We&#8217;re already signed up and frequenting there ourselves. Hopefully, we&#8217;ll see ya around there!</p>
]]></content:encoded>
			<wfw:commentRss>http://thehacked.com/a-wordpress-plugin-for-interactive-fiction-via-inform-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Construct 2 projects in your beloved WordPress</title>
		<link>http://thehacked.com/construct-2-projects-in-wordpress/</link>
		<comments>http://thehacked.com/construct-2-projects-in-wordpress/#comments</comments>
		<pubDate>Thu, 29 Mar 2012 23:11:44 +0000</pubDate>
		<dc:creator>DavidM</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[2d games in wordpress]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[construct 2]]></category>
		<category><![CDATA[scirra construct]]></category>
		<category><![CDATA[videogames]]></category>

		<guid isPermaLink="false">http://thehacked.com/?p=280</guid>
		<description><![CDATA[<p>As if WordPress weren&#8217;t already almighty, we ever endeavor to make it almightier! This time, we&#8217;ve created a tool to adapt Scirra Construct 2 projects to work in WordPress via a shortcode. What&#8217;s this Construct 2 thing? For those seriously uninformed and less fortunate souls who don&#8217;t keep a keen eye on this here blog,...</p>
 ]]></description>
			<content:encoded><![CDATA[<p>As if WordPress weren&#8217;t already almighty, we ever endeavor to make it almightier! This time, we&#8217;ve created a tool to adapt Scirra Construct 2 projects to work in WordPress via a shortcode.</p>
<p><span id="more-280"></span></p>
<h3>What&#8217;s this Construct 2 thing?</h3>
<p>For those seriously uninformed and less fortunate souls who don&#8217;t keep a keen eye on this here blog, you can find out more about Construct 2 from our previous article, available <a title="Have fun with the HTML 5 Canvas in Scirra Construct 2" href="http://thehacked.com/have-fun-with-the-html-5-canvas-in-scirra-construct/">here</a>.</p>
<p>Basically though, it&#8217;s a drag-and-drop development platform for Windows that allows creation of games using the HTML 5 canvas.  This means the games are essentially cross-platform, able to be played on any HTML 5 enabled system/browser. Yay!</p>
<h3>Exquisite! Now how do we get a Construct 2 project into our blog?</h3>
<p>Easy! First off, you simply need to export your Construct 2 project to the necessary HTML format. You then follow the instructions on our lovely plugin maker page, made specifically for Construct 2.</p>
<p>Check it out here: <a href="http://thehacked.com/wordpress-plugin-maker-for-construct-2/">http://thehacked.com/wordpress-plugin-maker-for-construct-2/</a></p>
<h3>Give us examples! We demand!</h3>
<p>So you want examples of projects using this tool eh? It so happens we&#8217;ve got quite a few, but we&#8217;ll just list a few of them here so as not to litter the place with back-links to all our stuff. That way, it&#8217;ll give the illusion that this blog isn&#8217;t all about monetization via marketing.</p>
<p>First off, you can check out the Ugotsta Arcade, where we&#8217;ll be using this tool on a constant basis to post new games: <a href="http://www.ugotsta.com/arcade/">http://www.ugotsta.com/arcade/</a></p>
<p>You could also take a look at the beat box we&#8217;ve created and posted to the super-secret labs site: <a href="http://www.ugotsta.com/labs/ugotsta-beat-box/">http://www.ugotsta.com/labs/ugotsta-beat-box/</a></p>
<p>Last but certainly not least, feel free to check out the downloadable WordPress version of the Nibble game we&#8217;ve created for the <a title="HBGames Build and Win Construct 2 Contest" href="http://www.hbgames.org/forums/viewtopic.php?f=293&amp;t=76238" target="_blank">HBGames.org Build and Win Contest</a>. More on that as follows:<br />
<a href="http://www.ugotsta.com/labs/nibbles-like-clone-for-the-hbgames-build-and-win-contest/">http://www.ugotsta.com/labs/nibbles-like-clone-for-the-hbgames-build-and-win-contest/</a></p>
<p>And perhaps others might be interested in posting links to their ported projects below! <img src='http://thehacked.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Just a quick note!</h3>
<p>As with all of the tools available here, this one&#8217;s always a work in progress. Currently, it&#8217;s lacking an option to specify the canvas height and width. This is because there are a number of ways to handle height and width, making them fluid or static, or somehow integrating full-screen capabilities, which is a bit of an undertaking within WordPress, as it&#8217;d likely require the creation of a relatively blank page template.</p>
<p>We&#8217;ll post any updates and open discussion here in this post to keep the tool&#8217;s page less crowded. Meanwhile, enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://thehacked.com/construct-2-projects-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Timed CSS</title>
		<link>http://thehacked.com/timed-css/</link>
		<comments>http://thehacked.com/timed-css/#comments</comments>
		<pubDate>Thu, 29 Mar 2012 04:52:56 +0000</pubDate>
		<dc:creator>DavidM</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[change css after time period]]></category>
		<category><![CDATA[css after timeout]]></category>
		<category><![CDATA[delayed css]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://thehacked.com/?p=271</guid>
		<description><![CDATA[<p>Let&#8217;s say you have one of those million occasions where you need to have a web page element turned upside after a certain time limit is reached (yeah, we get that request from clients all the time, too). How would you do it? Well, we&#8217;re here to tell you how we&#8217;d do it. So how do...</p>
 ]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say you have one of those million occasions where you need to have a web page element turned upside after a certain time limit is reached (yeah, we get that request from clients all the time, too). How would you do it? Well, we&#8217;re here to tell you how we&#8217;d do it.<br />
<span id="more-271"></span></p>
<h3>So how do we do it?</h3>
<p>On a regular HTML page, this type of thing is done very easily using the almighty jQuery with something like the following:</p><pre class="crayon-plain-tag">jQuery(document).ready(function() {
setTimeout(function(){
jQuery( 'head' ).append( 'div#upside-down&nbsp;{-webkit-transform: rotate(180deg);-moz-transform: rotate(180deg);-ms-transform: rotate(180deg);-o-transform: rotate(180deg);transform: rotate(180deg);}' );
}, 10000);
});</pre><p></p>
<p>What that does is triggers the jQuery append function call after the timeout value of 10000 ms (10,000 ms which equates to 10 seconds) has elapsed. It will append, or add, that bit of css code to the web page&#8217;s head section, effectively turning upside down, any div tags with the id of &#8216;upside-down&#8217;.</p>
<h3>So how do we do it in our mighty WordPress site?</h3>
<p>Achieving that same effect in WordPress takes a bit more work. The route we&#8217;ve taken here in this article is to create a plugin that adds a piece of javascript to our pages, similar to above, and have the javascript include some variables posted to the page from the main plugin code.</p>
<p>The javascript is as follows:</p>
<p></p><pre class="crayon-plain-tag">jQuery(document).ready(function() {
setTimeout(function(){
jQuery( 'head' ).append( thehacked_timed_css_data.css_to_add );
}, thehacked_timed_css_data.delay_time);
});</pre><p></p>
<p>And of course, the PHP code for the plugin is as follows:</p>
<p></p><pre class="crayon-plain-tag">&lt;?php

/*
Plugin Name: Timed CSS Plugin
Plugin URI: http://thehacked.com/timed-css
Description: A simple plugin that adds css to a page after a certain time period.
Version: 1.0
Author: DavidM
Author URI: http://thehacked.com
License: GPL 2
*/

// Initialization function
function timed_css_init() {
	
	// Enqueue jQuery and necessary javascript
	wp_enqueue_script( 'jquery' );
	$plugin_url = plugins_url() . &quot;/&quot; . basename(dirname(__FILE__));
	wp_register_script( 'thehacked-timed-css', $plugin_url . '/thehacked-timed-css.js' );
	wp_enqueue_script( 'thehacked-timed-css' );

	// Add options to database if they don't already exist
	add_option( 'delay_time', '1000' );
	add_option( 'css_to_add', '.thehacked-timed-css {display:none;}' );

	// Get options
	$delay_time = get_option( 'delay_time' );
	$css_to_add = &quot;&lt;style&gt;&quot; . get_option( 'css_to_add' ) . &quot;&lt;/style&gt;&quot;;
	
	// Display options on page for javascript to access
	$data = array( 'delay_time' =&gt; __( $delay_time ), 'css_to_add' =&gt; __( $css_to_add ) );
	wp_localize_script( 'thehacked-timed-css', 'thehacked_timed_css_data', $data );
}

// Call initialization function
timed_css_init();

// Create settings submenu
function timed_css_settings_page_init() {
	add_submenu_page( 'options-general.php', 'Timed CSS Settings', 'Timed CSS', 'manage_options', 'timed_css_submenu', 'timed_css_submenu_callback');
}

add_action('admin_menu', 'timed_css_settings_page_init');

// Create settings section and fields
function timed_css_settings_section_init() {
 	
	// Add a settings section
	add_settings_section( 'timed_css_settings_section', 'Settings', 'timed_css_settings_section_callback', 'timed_css_submenu' );
	
	// Add the fields to the section
	add_settings_field( 'delay_time', 'Delay time', 'delay_time_callback', 'timed_css_submenu', 'timed_css_settings_section' );
	add_settings_field( 'css_to_add', 'CSS to add', 'css_to_add_callback', 'timed_css_submenu', 'timed_css_settings_section' );

	// Register options
	register_setting('timed_css_option_group','delay_time');
	register_setting('timed_css_option_group','css_to_add');
}

add_action('admin_init', 'timed_css_settings_section_init');

// Callback for submenu page
function timed_css_submenu_callback() {
	echo '&lt;h3&gt;TheHacked.com Timed CSS&lt;/h3&gt;';
	echo '&lt;p&gt;This plugin will append the specified CSS to your page(s) after the specified delay time has passed.&lt;/p&gt;';
	echo '&lt;div class=&quot;thehacked-timed-css-settings&quot;&gt;';
	echo '&lt;form method=&quot;post&quot; action=&quot;options.php&quot;&gt;';
	settings_fields( 'timed_css_option_group' );
	do_settings_sections( 'timed_css_submenu' );
	echo '&lt;br /&gt;';
	echo '&lt;input type=&quot;submit&quot; value=&quot;Save&quot; /&gt;';
	echo '&lt;/form&gt;';
	echo '&lt;/div&gt;';
}

// Callback for timed_css_settings section
 function timed_css_settings_section_callback() {
	echo '&lt;p&gt;Delay time is in miliseconds (1000 = 1 second).&lt;/p&gt;';
 }
 
// Callback functions for delay_time
function delay_time_callback() {
	echo '&lt;input name=&quot;delay_time&quot; id=&quot;delay_time&quot; class=&quot;code&quot; type=&quot;text&quot; value=&quot;' . get_option('delay_time') . '&quot; /&gt;';
}

// Callback functions for css_to_add
function css_to_add_callback() {
	echo '&lt;textarea name=&quot;css_to_add&quot; id=&quot;css_to_add&quot; class=&quot;code&quot;&gt;' . get_option('css_to_add') . '&lt;/textarea&gt;';
}
		
?&gt;</pre><p></p>
<p>It should be said, the only reason the code is so lengthy is because we&#8217;re including a settings page in the admin area. Without that, we could just use some globally defined variables, but then to make changes, you&#8217;d have to add some define statements to your wp-config.php file.</p>
<h3>So how do we install this thing?</h3>
<p>To install the plugin, simply create a couple empty files and name them thehacked-timed-css.js and thehacked-timed-css.php. Copy the above Javascript and paste it into the .js file, then do likewise with the above PHP code, pasting it into the .php file.</p>
<p>Alternatively, you could buy yourself a copy of the plugin file from the online store here. To be sure, it&#8217;s technically free, you just need virtual cash, or <a href="http://www.ugotsta.com/about/ugotscash/">$UgotsCash</a>.</p>
<h3>And how do we use it?</h3>
<p>Easy. Just go to <strong>Settings > Timed CSS</strong> in your admin area, enter in a timeout delay amount, then enter the CSS code you&#8217;d like to add to your page after that delay, and that&#8217;s it!</p>
<h3>Give me example, I are demanding!</h3>
<p>Okay, okay. So you wanna check out an example of the code/plugin in action? First you&#8217;ll need to ensure your browser is Javascript enabled.</p>
<p>With that, you can check out the uber-cool, while very strange <a href="http://terminaldot.com/" alt="TerminalDot.com">TerminalDot.com</a>.</p>
<p>Wait just about 1 minute and you&#8217;ll see some things turn upside-down. Pretty, eh? Or something like that.</p>
]]></content:encoded>
			<wfw:commentRss>http://thehacked.com/timed-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Have fun with the HTML 5 canvas in Scirra Construct</title>
		<link>http://thehacked.com/have-fun-with-the-html-5-canvas-in-scirra-construct/</link>
		<comments>http://thehacked.com/have-fun-with-the-html-5-canvas-in-scirra-construct/#comments</comments>
		<pubDate>Fri, 09 Mar 2012 16:17:01 +0000</pubDate>
		<dc:creator>DavidM</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[construct]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[game maker]]></category>
		<category><![CDATA[gamemaker]]></category>
		<category><![CDATA[html5 ide]]></category>
		<category><![CDATA[make games]]></category>
		<category><![CDATA[scirra]]></category>

		<guid isPermaLink="false">http://thehacked.com/?p=255</guid>
		<description><![CDATA[<p>There&#8217;s a whole lot going on with HTML these days, especially with the advent of HTML 5 and its canvas element. Powerful tools are surfacing to cover all sorts of possibilities and one such tool that really stands out is Scirra&#8217;s Construct 2, a game development platform with a heavy focus on HTML 5&#8242;s canvas....</p>
 ]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a whole lot going on with HTML these days, especially with the advent of HTML 5 and its canvas element. Powerful tools are surfacing to cover all sorts of possibilities and one such tool that really stands out is <a title="Scirra Construct" href="http://www.ugotsta.com/go/construct" target="_blank">Scirra&#8217;s Construct 2</a>, a game development platform with a heavy focus on HTML 5&#8242;s canvas.</p>
<p><span id="more-255"></span></p>
<p>Construct 2 uses a sort of modular, drag and drop canvas interface for building games, where you create objects and events with mouse clicks and drag things around as you like them. All of the coding is basically done within drag and drop event sheets which read rather like human language, making it quite easy for newcomers to programming or game development.</p>
<h3>Check it out in action!</h3>
<p><iframe width="500" height="281" src="http://www.youtube.com/embed/5RlSmkSbleI?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<h3>Coolness incarnate, eh?</h3>
<p>Interestingly, it&#8217;s actually possible to build a simple game without even touching the event sheet, as shown in the intro video. The built-in objects come with a number of properties and actions of their own and other built-in behaviors can be added easily within the visual interface, providing unlimited possibilities. This not only makes it much easier for novice game makers to create simple games, but it also can result in rather simple event sheets that are easy to read.</p>
<p>While the previous version, now <a title="Construct Classic" href="http://www.scirra.com/forum/default.asp?C=11&amp;title=construct-classic" target="_blank">Construct Classic</a>, was free software, Construct 2 costs just a bit of money, depending on the license needed. The licenses are incredibly affordable and well worth the price, especially considering the potential of the platform, as well as the noteworthy support and rapid development. The developers not only hear user requests, they do them, quickly too!</p>
<p>Fortunately for beginners, Scirra also provides a free version that can actually be used to develop some very complex games itself. Strangely, Construct 2 actually provides a great way to learn basic programming concepts, so it somewhat doubles as a learning platform. If you&#8217;re looking to get into game development, try out the free version. After all, it is free.</p>
<h3>So why mention this here on a WordPress blog?</h3>
<p>First off, we don&#8217;t really want to limit this blog to strictly WordPress related topics. However, given our love for WordPress, that will generally be the case.</p>
<p>More to the point though, we believe Construct&#8217;s utility extends beyond games and we&#8217;ve got some pretty cool projects we&#8217;re working on that will help integrate Construct 2 projects with our beloved WP. Look for a few posts to that effect shortly!</p>
<h3>Go git it!</h3>
<p>That said, check out Construct&#8217;s awesomeness for yourself, and also feel free to say hi to ourselves and everyone else in that <a title="Scirra Construct forums" href="http://www.scirra.com/forum/" target="_blank">friendly community</a> over there!</p>
]]></content:encoded>
			<wfw:commentRss>http://thehacked.com/have-fun-with-the-html-5-canvas-in-scirra-construct/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make Facebook Comments responsive</title>
		<link>http://thehacked.com/make-facebook-comments-responsive/</link>
		<comments>http://thehacked.com/make-facebook-comments-responsive/#comments</comments>
		<pubDate>Thu, 08 Mar 2012 09:09:24 +0000</pubDate>
		<dc:creator>DavidM</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[facebook comments]]></category>
		<category><![CDATA[fluid width]]></category>
		<category><![CDATA[responsive]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://thehacked.com/?p=243</guid>
		<description><![CDATA[<p>Currently, Facebook doesn&#8217;t provide a built-in way within its API to display Facebook comments on your site using a fluid width, you can only specify a static width. Fortunately, StackOverflow&#8216;s astounding community is here to save the day for those of us who would like a fully responsive experience on our sites, so that users...</p>
 ]]></description>
			<content:encoded><![CDATA[<p>Currently, Facebook doesn&#8217;t provide a built-in way within its API to display Facebook comments on your site using a fluid width, you can only specify a static width.</p>
<p>Fortunately, <a title="StackOverflow" href="http://stackoverflow.com/" target="_blank">StackOverflow</a>&#8216;s astounding community is here to save the day for those of us who would like a fully responsive experience on our sites, so that users on any browser, mobile or old 640 x 480 resolution PCs, can view the site aright.</p>
<p><span id="more-243"></span></p>
<p>If you&#8217;d like some responsive Facebook comments on your site, including when accessed via a plugin, such as the indispensable <a title="Ultimate Facebook from WPMU DEV" href="http://www.ugotsta.com/go/ultimate-facebook" target="_blank">Ultimate Facebook</a> plugin from WPMU DEV, check out the following Q&amp;A:</p>
<p><a href="http://stackoverflow.com/questions/6500424/is-it-possible-to-set-a-fluid-width-for-facebooks-social-plugins/">http://stackoverflow.com/questions/6500424/is-it-possible-to-set-a-fluid-width-for-facebooks-social-plugins/</a></p>
<p>And to repeat the final, and most complete answer, the following code, provide by user <a href="http://stackoverflow.com/users/1092504/arnonate">arnonate</a> (please feel free to send this user and the other helpful users some chocoloate) in that thread, is the key:</p>
<p></p><pre class="crayon-plain-tag">#fbcomments, .fb_iframe_widget, .fb_iframe_widget[style], .fb_iframe_widget iframe[style], #fbcomments iframe[style] {
width: 100% !important;
}</pre><p></p>
<p>Simply add that bit of code to your site&#8217;s css stylesheet (possibly via Appearance &gt; Editor for you WordPress fanatics) and you&#8217;ll have yourself some fluid width Facebook comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://thehacked.com/make-facebook-comments-responsive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WPMU DEV &#8211; WordPress Must Use!</title>
		<link>http://thehacked.com/wpmu-dev-wordpress-must-use/</link>
		<comments>http://thehacked.com/wpmu-dev-wordpress-must-use/#comments</comments>
		<pubDate>Sat, 04 Feb 2012 04:52:00 +0000</pubDate>
		<dc:creator>DavidM</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[forums]]></category>
		<category><![CDATA[Incsub]]></category>
		<category><![CDATA[Multisite]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[support]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[WPMU DEV]]></category>
		<category><![CDATA[WPMUDEV]]></category>

		<guid isPermaLink="false">http://thehacked.com/?p=132</guid>
		<description><![CDATA[<p>Around here, you&#8217;ll hear constant mention of our beloved affiliate, WPMU DEV, and we&#8217;d like to take a moment to explain what exactly is WPMU DEV, for those completely lost and living under a rock (it happens)! To begin with, did you even know that your existing, self-hosted WordPress site can be turned into a...</p>
 ]]></description>
			<content:encoded><![CDATA[<p>Around here, you&#8217;ll hear constant mention of our beloved affiliate, <a title="WPMU DEV" href="http://www.ugotsta.com/go/wpmudev" target="_blank">WPMU DEV</a>, and we&#8217;d like to take a moment to explain what exactly is WPMU DEV, for those completely lost and living under a rock (it happens)!</p>
<p>To begin with, did you even know that your existing, self-hosted WordPress site can be turned into a full-blown multi-site network? That&#8217;s right, you simply need to enable the network feature of WordPress and you&#8217;ll then be able to create other sites, just like your main WordPress site.</p>
<p>And of course, you&#8217;ll find out all about that special feature right at the <a title="WordPress Multisite" href="http://premium.wpmudev.org/wpmu-manual/wordpress-wordpress-mu-and-wordpress-multisite/" target="_blank">online manual</a> over at WPMU DEV.</p>
<p>Moreover, WPMU DEV has been specializing in Multisite development since its infancy and not only provides an abundance of resources and a massive forum full of insightful Multisite tidbits, but they&#8217;ve got plugins and themes  that are Multisite compatible and provide a bewildering array of awesome features specifically for use in Multisite scenarios.</p>
<p>Take for example the illustrious <a title="MarketPress - WordPress e-Commerce" href="http://www.ugotsta.com/go/marketpress" target="_blank">MarketPress</a>, the fully featured e-Commerce plugin that stands perfectly well on its own on a regular, single WordPress site. But in a Multisite setup, it gives you the ability to provide a full-blown e-Commerce network, sort of like <a title="Etsy" href="http://www.etsy.com/" target="_blank">Etsy</a>. You can let users create their very own shops on your network!</p>
<p>Now, MarketPress allows you to take a percentage of network sales automatically, using the integrated PayPal Chained Payments gateway. But what if you wanted to charge users for having a site, or shop, on your network, first off?</p>
<p>Enter <a title="Pro-Sites" href="http://premium.wpmudev.org/project/pro-sites" target="_blank">Pro Sites</a>, the Multisite plugin that lets you charge users for premium features. With all of its included modules, you can charge users for access to premium plugins or themes, limit the number of posts or post types (such as MarketPress products) a site can create, or even charge for having a site in the first place.</p>
<p>There&#8217;s also other massive plugins, like <a title="WordPress Membership plugin" href="http://www.ugotsta.com/go/membership" target="_blank">Membership Premium</a>, which lets you build a fully-functional membership site. While it can easily be used for a very simple, free membership site, its incredibly sophisticated design even lets you create elaborate membership systems, fully integrated with PayPal and other payment providers.</p>
<p>Then there&#8217;s <a title="Ultimate Facebook plugin for WordPress" href="http://www.ugotsta.com/go/ultimate-facebook" target="_blank">Ultimate Facebook</a>, which provides the most complete Facebook integration you&#8217;ll find, from Like/Send button functionality to full integration with Facebook registration and login, commenting system and all the Facebook widgets you&#8217;ll ever need.</p>
<p>Much more can be said about all the outstanding wares at WPMU DEV, but one of the things that truly sets them apart from similar development companies is their unbelievable service model, wherein you buy a Full subscription (for example, a single month subscription), and you get ALL their plugins and themes!</p>
<p>Better yet, you not only get all their wares, you get to use them in as many projects as you like, for as long as you like after you download them! That&#8217;s right, they stick with the WordPress GPL 2.0 open source license requirements, allowing you to use their plugins and themes the same way you use WordPress, even letting you mod them to suit your needs!</p>
<p>Plus, you get full support for the duration of the subscription you purchase (longer duration subscriptions provide dramatic discounts). That gets you access to the most awesomest <a title="WPMU DEV Forums" href="http://premium.wpmudev.org/forums/" target="_blank">forums</a> on the planet, where you can get pointers on how to modify these plugins and themes, glean insight on WordPress development from professionals in the field, or just get basic WordPress assistance if you&#8217;re still learning about WordPress.</p>
<p>It&#8217;s very difficult to explain all the benefits of membership at WPMU DEV here in a single article, as they&#8217;ve got an incredible history of WordPress development, and thus have an equally incredible arsenal of plugins, themes and resources.</p>
<p>It would be best to check it out for yourself, which you can do right from <a title="WPMU DEV - WordPress Plugins, themes, and awesomeness!" href="http://www.ugotsta.com/go/wpmudev" target="_blank">here</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://thehacked.com/wpmu-dev-wordpress-must-use/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Show your users their ugly mug with a shortcode!</title>
		<link>http://thehacked.com/show-your-users-their-ugly-mug-with-a-shortcode/</link>
		<comments>http://thehacked.com/show-your-users-their-ugly-mug-with-a-shortcode/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 07:16:36 +0000</pubDate>
		<dc:creator>DavidM</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[avatar shortcode]]></category>
		<category><![CDATA[display user avatar]]></category>
		<category><![CDATA[user avatars]]></category>
		<category><![CDATA[WordPress user image]]></category>

		<guid isPermaLink="false">http://thehacked.com/?p=179</guid>
		<description><![CDATA[<p>Let&#8217;s say you wanna provide your users a way to see how their mug looks to the public at large, sort of like a mirror check when they log into your site, so they know they look presentable on your pretty site. Easy, we&#8217;ve got a neat little shortcode for you here, to display the...</p>
 ]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say you wanna provide your users a way to see how their <a title="Mug Shot" href="http://en.wikipedia.org/wiki/Mug_shot" target="_blank">mug</a> looks to the public at large, sort of like a mirror check when they log into your site, so they know they look presentable on your pretty site.</p>
<p>Easy, we&#8217;ve got a neat little shortcode for you here, to display the logged in user&#8217;s avatar wherever you want it on your site, even in your <a href="http://premium.wpmudev.org/project/in-post-ads">ads</a>!</p>
<p><span id="more-179"></span></p>
<h3>How cool is that!</h3>
<p>One of the coolest things about working with one of the coolest web development sites out there is that you come across a lot of cool ideas for code projects. Cool, eh?</p>
<p>So, this request came up on the WPMU DEV forums the other day,  in this thread where a member was asking for an <a title="avatar shortcode for WordPress" href="http://premium.wpmudev.org/forums/topic/avatar-short-code" target="_blank">avatar shortcode</a>. Lo and behold, in searching for something simple like that, one could not be found!</p>
<h3>Oh noes! What to do!</h3>
<p>Well, you can use the snippet provided in that thread!</p>
<p>But going further, we&#8217;ve taken the code provided there and altered it a bit to display the logged in user&#8217;s avatar anywhere on your site using the [avatar-shortcode]. And we&#8217;ve extended it to include additional parameters as detailed in the WordPress function reference for the <a title="WordPress get_avatar function" href="http://codex.wordpress.org/Function_Reference/get_avatar" target="_blank">get_avatar()</a> function.</p>
<p>But we didn&#8217;t just stop there, nope! Well, we did, at first. But now we&#8217;ve even included the option to provide a user id or email as well, so you can display any user&#8217;s avatar based on their id!</p>
<p>And here&#8217;s that fancy snippet:</p><pre class="crayon-plain-tag">&lt;?php

function avatar_shortcode( $atts ) {
	extract( shortcode_atts( array(
	'userid' =&gt; 'logged-in-user',
	'size' =&gt; '96',
	'default' =&gt; '',
	'alt' =&gt; ''
	), $atts));
	return 'My name is' . $size;
	if ( $userid == 'logged-in-user' ) {
		if ( is_user_logged_in() ) {
			global $current_user;
			get_currentuserinfo();
			return get_avatar( $current_user-&gt;ID, $size, $default, $alt );
		}
	}
	else {
		return get_avatar( $userid, $size, $default, $alt );
	}
}
add_shortcode( 'avatar-shortcode', 'avatar_shortcode' );

?&gt;</pre><p></p>
<p>Pretty eh?</p>
<h3>What do I do with this?</h3>
<p>Besides the obvious, tatooing it on your back, you can include that somewhere in your WordPress theme&#8217;s functions.php file, or better yet, use our very own <a title="WordPress Plugin Maker" href="http://thehacked.com/wordpress-simple-plugin-maker/">WordPress Simple Plugin Maker</a> to bake up your own plugin with it!</p>
<h3>Help me! I are noob!</h3>
<p>No problem, we got ya covered! Here&#8217;s how you make use of the shortcode in your content, a bunch of examples to help you get started using them.</p>
<p>Display the logged in user&#8217;s avatar with the default height and width of 64px:<br />
<span class="text-shadow">[avatar-shortcode]</span></p>
<p>Display the logged in user&#8217;s avatar with a height and width of 512px:<br />
<span class="text-shadow">[avatar-shortcode size="512"]</span></p>
<p>Display the user steinjr&#8217;s avatar with the default height and width of 64px:<br />
<span class="text-shadow">[avatar-shortcode userid="steinjr"]</span></p>
<p>Display the avatar of the user with the email &#8216;me@youbigstupidhead.com&#8217; with an avatar size of 256px and the text &#8220;You big stupid head!&#8221;<br />
<span class="text-shadow">[avatar-shortcode userid="me@youbigstupidhead.com" size="256" alt="You big stupid head!"]</span></p>
<p>That&#8217;s it! Have fun with your new ugly mug rendering powers!</p>
]]></content:encoded>
			<wfw:commentRss>http://thehacked.com/show-your-users-their-ugly-mug-with-a-shortcode/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Look smart with the RegExp Search Tool!</title>
		<link>http://thehacked.com/look-smart-with-the-regexp-search-tool/</link>
		<comments>http://thehacked.com/look-smart-with-the-regexp-search-tool/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 10:35:10 +0000</pubDate>
		<dc:creator>DavidM</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[regular expression]]></category>
		<category><![CDATA[search and replace form]]></category>

		<guid isPermaLink="false">http://thehacked.com/?p=145</guid>
		<description><![CDATA[<p>Are you outcast from popular society because you&#8217;re just not geeky enough? Does your insatiable interest in superficial things conflict with your desire to appear super-intelligent? We got ya covered. Now, you can prove to all your friend that you have regular expression super powers, using this simple form that makes the otherwise very complex...</p>
 ]]></description>
			<content:encoded><![CDATA[<p>Are you outcast from popular society because you&#8217;re just not geeky enough? Does your insatiable interest in superficial things conflict with your desire to appear super-intelligent?</p>
<p>We got ya covered. Now, you can prove to all your friend that you have regular expression super powers, using this simple form that makes the otherwise very complex task of working with regular expressions 0.000001% easier!</p>
<p>Behold, the <a title="Regular expression search tool" href="http://thehacked.com/regexp-search/">RegExp search tool</a>!</p>
<p><span id="more-145"></span></p>
<p>It&#8217;s a javascript-based search tool that lets you search your pasted content using a regular expression that you provide. Just fill in the form and let it do its magick!</p>
]]></content:encoded>
			<wfw:commentRss>http://thehacked.com/look-smart-with-the-regexp-search-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

