I have made a plugin for wordpress to display up to 200 flash games within your wordpress blog.

It is a relatively simple plugin that pulls data from my arcade website Lingolux flash games.

At the backend Lingolux uses a simple wordpress WP_Query loop to pull data from the site as specified by the plugin.
This allows the user to select the number of games and whether to display new games, top games, or both.

Although most blogs will cache the page themselves i did not want my plugin to overwhelm my website so i implemented a simple caching system in php.
I found the information here


$cachefile = "cache/".$reqfilename.".html";
$cachetime = 5 * 60; // 5 minutes
// Serve from the cache if it is younger than $cachetime
if (file_exists($cachefile) && (time() - $cachetime
< filemtime($cachefile)))
{
include($cachefile);
echo "";
exit;
}
ob_start(); // start the output buffer
?>
I placed the wp query here
// open the cache file for writing
$fp = fopen($cachefile, 'w');
// save the contents of output buffer to the file
fwrite($fp, ob_get_contents());
// close the file
fclose($fp);
// Send the output to the browser
ob_end_flush();
?>

This provided some simple caching of the backend.

The plugin also uses a simple lightbox to display the flash.
You can see the plugin in operation here and you can download it from the wordpress site here
Flash Games Page

Tagged with:
 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Additional comments powered by BackType