Random


29
Apr 11

Win an iPad2

The iPad2 was officially released in South Africa today at some pretty good prices. However there are a lot of people that simply cannot afford these prices and are looking at winning an iPad2 in the hopes of getting their hands on this new toy. If you’re one of those people (like me), then you’ll be happy to know that you can win an iPad2 with UCit.co.za

 

Simply subscribe to UCit and stand in line to win an Apple ipad 2 and many more exciting prizes:

Double your chances of winning by subscribing to UCit social buying and following them onTwitter

Triple your chances of winning by following UCit Social in your beautiful city: Johannesburg,PretoriaCape TownDurban


30
Mar 11

Top Group Buying Websites in South Africa (Updated May 2011)

Group Buying websites have become very popular in the past few months, so much so that every Tom, Dick and Sipho have decided to create one of their own. With the help from a list compiled over at iGeek, I took the time to analyse which of these group buying websites are actually making an impression on the South Africa internet landscape.

*** 23 May 2011 (Latest)

Rank Website Alexa Rank (ZA) Unique Visitors (AdPlanner)
1 My City Deal 50 420k
2 Ubuntudeal 296 14k
3 WiCount 302 48k
4 CityMob 488 -
5 Zappon 524 12k
- Twangoo 896 11k
- VuvuPlaza 943 15k
- OneDayOnly 1258 5.3k
- Dealio 1701 -
- 24 Hours Only 1941 -
- Skoop 2293 -
- AllDeals 2599 -
- UCit 5073 -
- Collective Cow 8360 -
- SaleWine 9636 -
- Justhenga 12 228 -
- Bangoo 14 623 -
- GroupBuying 20 828 -
- DealsOn 21 057 -

The biggest climber for May was Zappon.

 

*** as at 30 Mar 2011

Rank Website Alexa Rank (ZA) Unique Visitors (AdPlanner)
1 My City Deal 39 350k
2 WiCount 248 44k
3 Twangoo 333 27k
4 Ubuntudeal 655 10k
5 OneDayOnly 868 7.9k
- Zappon 295 (* new)
- Dealio 1030 -
- Skoop 1826 -
- UCit 1913 -
- 24 Hours Only 1944 -
- VuvuPlaza 2559 -
- Collective Cow 3252 -
- Justhenga 7575 -
- Bangoo 7638 -
- AllDeals 8131 -
- SaleWine 11382 -
- DealsOn 13737 -
- GroupBuying 19339 -

 

Although Zappon was only recently created, Alexa.com believes its already the 295th ranked website in SA. Pretty impressive.

Which one is your favourite?


30
Mar 11

Protected: Articles for Alms test page

This post is password protected. To view it please enter your password below:



25
Mar 11

Cache certain areas of your page using PHP

Sometimes it’s necessary to cache only certain elements or areas of your dynamic page to speed up the load times. I recently needed to cache two DIV’s that were being dynamically generated on one of my websites. They were each taking about 10 seconds to load which as you know, can be detrimental to your SEO efforts. Here’s the steps I followed in order to reduce my page load times from 20 seconds to under 1.5 seconds.

Step 1: Separate the areas

First of all, you would need to make the areas you would want to cache separate from the page. You can do this by creating new files for these areas and using the “include (‘page_name.php’);” function. This allows us to better control that specific file for caching purposes.

Code:

<div id="pane_popular">
<? 
      // this is one of the divs we want to cache
      include('div_top_articles.php'); 
?>
</div>

Step 2: Create the cache directory
Create a directory called “cache” on your web server. We will reference this in step 3.

Step 3: Insert the PHP cache code

Insert the following script at the top of the included file (in this case it’s the ‘div_top_articles.php’ file).

Code:

<?
    $cachedir = 'cache/'; // Cache directory
    $cachetime = 600; // Seconds to cache files for
    $cacheext = 'cache'; // Extension to give cached files (usually cache, htm, txt)
 
    // Script
    $page = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    $cachefile = $cachedir.md5($page).'.'.$cacheext; // Cache file to either load or create
 
    $cachefile_created = ((@file_exists($cachefile))) ? @filemtime($cachefile) : 0;
    @clearstatcache();
 
    // Show file from cache if still valid
    if (time() - $cachetime < $cachefile_created) {
 
        //ob_start('ob_gzhandler');
        @readfile($cachefile);
        //ob_end_flush();
 
    }
    else {
    // If we're still here, we need to generate a cache file
 
        ob_start();
 
        // <CONTENT THAT YOU WANT CACHED-->
        // ----------------------------------------------------
        // ----------------------------------------------------
 
        show_latest_articles(10,"latest");
        echo "<small><small>Cached on: ".date("Y-m-d H:i:s")."</small></small>";
 
        // ----------------------------------------------------
        // ----------------------------------------------------
        // 
 
        // Now the script has run, generate a new cache file
        $fp = @fopen($cachefile, 'w'); 
 
        // save the contents of output buffer to the file
        @fwrite($fp, ob_get_contents());
        @fclose($fp); 
 
        ob_end_flush();
    }
 
?>

Code thanks to AddedBytes, modified slightly.

That’s all there is to it.


28
Feb 11

Redirect all pages of a domain except for one page with .htaccess

I had a really tough time this morning trying to figure out how to redirect all pages of one domain to another domain, but stop one (or two) of the pages on the old domain from redirecting.

The solution is as follows:

 
RewriteEngine on
#Note: do not include a "/" in the beginning of the path, this is automatic
RewriteCond $1 !^enquiry_control/enquiry4.php
RewriteCond $1 !^enquiry_control/capt.php
RewriteRule (.*) http://talooma.com/$1 [R=301,L]

Yup, its as easy as that – typical.