notboring dev blog

flex, flash, javascript, videos, games, iphone

Clearing background color settings in a wordpress child theme

I wanted to clear the background color of the website header area so the background image could be viewed inside the header. To do so I created a child theme that looked like this:

Theme Name: FruitfulChild
Theme URI:
Description: Child Theme for Fruitful
Author: Malte Köhrer
Author URI:
Template: fruitful
Version: 0.1
@import url("../fruitful/style.css");
.head-container {
background-color:rgba(0,0,0,0) !important;

As you can see the file contains the required wordpress header as comment. After the comments the style sheets file includes the style sheets file from the original/unchanged fruitful theme/template. Finally I redefine the head-container that provides the website header with it’s color to be black with an alpha value of 0. Since the alpha value is set like that, the header color is being removed and the background can be seen. The !important property makes sure that the new definition is being used instead of the original one.

No Comments

Finding alternatives to Mochi that’s closing the gates

Mochi’s owners Shandra are closing down it’s services. They announced it 14 days before the service is unavailable so everybody is in a hurry to find alternatives.

I checked a few:

FGL Ads: Flash Games License Ads

They were easy to implement but don’t offer much choice. Their ad always display as a game blocking popup and the user will be annoyed for having to wait. An solution that I find acceptable once at the start of the game, but not after it.

They only seem to be interessting for the web area, not for mobiles.

Epic Game Ads (

Implementation was easy. If you register don’t wonder if you can’t login right after clicking the confirmation link your email. They will manually unblock you.

Skyrocket (

I had strong hopes for this provider. There was an open sourced ANE for Air, support for multiple ad works and lots of options. Looking for an implementation detail I found out soon that the company behind it got bought by Apple. Which means it very likely has no future in the multi platform market if you look at previous Apple aquisitions.

And it looks like Apple is already murdering the service:

CPM star

You need a sponsor and according to many postings I found on them they are not making much money. I’ll maybe check it when I find nothing else.


This seems to be a mobile only provider. There’s a working ANE for them. This ad provider was easy to implement, the documentation lacked in some areas but everything was solvable.

No Comments

Displaying line numbers as default setting in Jetbrains PHP Storm

To enable line numbers as default on every file you open, you use the settings dialogue:

File -> Settings -> (IDE Settings) Editor -> Appearance -> [x] Show line numbers

That’s it.

[Please ignore this:]

No Comments

Automated unit testing for code igniter 2.x/3.x

Here’s a quick way to setup unit testing for CI 2.x/3.x:

Step 1: Add a class for testing into your application/controllers folder:

< ?php
class Frontend_Tests_Controller extends Frontend_Controller{
    function __construct(){
    public function index(){
        $this->unit->run( $this->test_reflection(5), 5, "Testing testing" );
        echo $this->unit->report();
    protected function test_reflection($value){
        return $value;

In this file you can add all your tests and then call them from the index function.

Step 2: Add auto loading code for your new testing class to application/config/config.php:

function __autoload($class){
    if (file_exists(APPPATH."controllers/".strtolower($class).".php")){

Step 3: Add the route to application/config/routes.php

$route['tests'] = "Frontend_Tests_Controller/index";

Now you can call /tests to run the tests.

No Comments

xampp mailtodisk application problem: no emails are being saved, the tool seems broken.

To “fix” the issue, please check the content of your xampp/apache folder. mailtodisk ingores the path settings and write the logs in to a subfolder of the webserver. That means you gonna find your emails in xampp/apache/mailoutput.


Deleting all files from a folder that reached a certain age (x hours/days/weeks/months/years) using PHP

Here a quick example of how to delete all files of a folder that are olden the x days/minutes/hours/months. This method works under both windows and unix. The custom getCorrectMTime() function was posted on the PHP documentation and takes into account that time measurement under windows and unix is slightly different. Of course I also have a small ignore list where files (eg .htaccess, index.html etc) can be blocked from getting deleted.

     * @param $folder the folder in which the old files are supposed to get purged
     * @param $maximumAge maximum file age in seconds
     * @param $ignoreList array() of filenames that should get ignored
    public function deleteOldFiles($folder, $maximumAge,$ignoreList){
        foreach($dir as $file){
                    //echo "<br />deleting ".$folder.$file." because it has the age: ".$fileAge;
                    //echo "<br />keeping ".$folder.$file." because it has the age: ".$fileAge;
                //echo "<br />ignored ".$file;
public function getCorrectMTime($filePath){
        $time = filemtime($filePath);
        $isDST = (date('I', $time) == 1);
        $systemDST = (date('I') == 1);
        $adjustment = 0;
        if($isDST == false && $systemDST == true)
            $adjustment = 3600;
        else if($isDST == true && $systemDST == false)
            $adjustment = -3600;
            $adjustment = 0;
        return ($time + $adjustment);
1 Comment

Fixing the Mochi “Download the latest flash player” bug

I decided to update my Mochi titles to the latest version of the framework: 3.9.5. The compiled files looked nice and worked without flaws. But after uploading them to Mochi, enabling the live updater, things broke.

All I could see was a “Download the latest flash player” message right after the Ad. The game was not accessible anymore.

When checking the Flash export settings in noticed that Flash CS6 seem to have set the plugin version number for the project to the latest version istead of the previous version 9.

Badly enough switching back to version 9 didn’t help, but after a few tries I found out that version 10.3. works perfectly.

No Comments

Simple to use Windows SMTP test server

If you are developing on a windows server using xampp or a similar webserver package you might run into issues with testing functions that reply on emails. That’s because windows got no built in SMTP server.

But there are simple SMTP servers aiming at developers only. and one of them is the antix smtp server:

Since the official antix smtp server is offline and alternative downloads that I checked contained a trojan, here a list of alternatives:

No Comments

xampp: Making CURL available for direct (php.exe/php cli) execution

Open your xampp folder (eg. c:\xampp) and go into the php subfolder (eg. c:\xampp\php). Open the file “php.ini” in a text editor and enable CURL line by replacing the outcommented line




This enables the CURL extension for both HTTP and the php command line executable (php.exe/php).

No Comments

How to access wordpress functionality using the command line (CLI)

WordPress does not offer any type of command line (cli) support to autmate tasks without using the HTTP protocol. You can easily add it though.

Full fledged wordpress administration using the command line (cli)

wp-cli, a set of tools to manage wordpress from the CLI. It adds access to some of the word press functionality and can be easily extended to run your own code from the command line.

Find more informations about this usefull word press extension at:

Directly calling WordPress PHP functions from the command line (cli)

If you just need to run a php script to add own functionality, you can use the following template to initalize wordpress correctly:

ini_set( "memory_limit", "64M" );
// set this to the path of your file. In my example the php 
// file is in a subfolder, thus there's a ".." to tell PHP it 
// needs to access the parent directory
require_once(dirname(__FILE__) . '/../wp-load.php');

That’s it. Now you can use wordpres functionality like you would do it in plugins. Here a bigger example:

ini_set( "memory_limit", "64M" );
// set this to the path of your file. In my example the php 
// file is in a subfolder, thus there's a ".." to tell PHP it 
// needs to access the parent directory
require_once(dirname(__FILE__) . '/../wp-load.php');

// now let's access the wpdb database
global $wpdb;
$q = $wpdb->prepare ("SELECT * FROM nb_cntv_video_files WHERE filename_base=%s",$filenameBase);
$results = $wpdb->get_results ($q);
echo "found " . count ($results) . "\n";
No Comments
Rss Feeds