I found the solution to install Ioncube Loader on Dreamhost and it’s quick and simple. Just run the PHP file and it does the rest and your script will automatically work. It’s quite astonishing and brilliant!

You can find the original forum post here. The author is by sXI

But if somehow it’s not there, I kept a copy on my server as well here.

found this somewhere on the net

function strip_all_HTML($content) {
    $search = array(’/<\?((?!\?>).)*\?>/s’);
    $new = strip_tags(preg_replace($search, ”, $content));
    return $new;
}

this function strips out everything STARTING with <a

function strip_starting_LINK($content) {
    $search = array(’/\<a..*/s’);
    $new = preg_replace($search, ”, $content);
    return $new.’…’;
}

http://editplus.info/wiki/Search_and_Replace_Tricks

Sitepoint.com has a marketplace selling premium websites for $10K or above. I wonder how honest are these ads and sites. Has anyone experienced buying or selling a site there? Drop me a comment.

There’s a great article on error handling in PHP.

Lets say you want to copy php.ini to all the domain directors in hostgator (but NOT the subfolders). Here’s something that you can do. Just create a file called php_modifed.php and do your settings there. And copy that file and this file to the base directory and run the PHP script.

<?php
   
    function dirTree($dir) {

    $file = “php_modified.php”;

    $d = dir($dir);

    while (false !== ($entry = $d->read())) {
       if($entry != ‘.’ && $entry != ‘..’ && is_dir($dir.$entry))
       
        copy ($file, $entry . “/php.ini”);
    }
    $d->close();
    return $arDir;
}

function printTree($array, $level=0) {
   foreach($array as $key => $value) {
       echo “<div class=’dir’ style=’width: “.($level*20).”px;’> </div>”.$key.”<br/>\n”;
       if(is_array($value))
           printTree($value, $level+1);
   }
}

$dir = “./”;
dirTree($dir);

?>

This post tells how to create php.ini symbolic links in all your domain folders and subfolders. But what if you want to get rid of them? I edited the script to delete them in case you dont want it anymore.

<?php

// File and path names for your host and website.
$host_php_ini  = “/usr/local/lib/php.ini”;     // your host’s php.ini file (see phpinfo())
$local_php_ini = “/home/**your username**/local_php.ini”;  // your modified php.ini will go here
$website_root  = “/home/**your username**/public_html”;    // your website’s root

// Walk website directory tree, inserting symbolic links to modified php.ini file.
$nodes = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($website_root),
                                       RecursiveIteratorIterator::SELF_FIRST);
foreach ($nodes as $node) {
    if ($node->isDir()) {
        $linkpath = $node->getPathname() . “/php.ini”;
        if(is_link($linkpath)) {
        unlink($linkpath);
        },
    }
}

?>

PHP file_get_contents require allow_url_fopen to be ON in php.ini. Not a problem for hostgator since it is ON by default. But that might be dangerous (or not). Anyways, just to be safe, I turned it off in php.ini and
wrote a function to replace it using curl. I got the code from this page and added something of my own.

function file_get($site_url) {
    $ch = curl_init();
    $timeout = 0; // set to zero for no timeout
    curl_setopt ($ch, CURLOPT_URL, $site_url);
    curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
    ob_start();
    curl_exec($ch);
    curl_close($ch);
    $file_contents = ob_get_contents();
    ob_end_clean();
    return $file_contents;
}

I really like www.watchforeclosure.com site’s design’s integration with adsense ads. You could hardly tell the ads from the content itself. For someone trying to monetize their site, it works.

netnerds.net has a great post on how to convert an ATOM date to a normal PHP date. I found it very useful as I was trying to do this for my sites www.stormwarriorsmovie.com and www.roguebargains.com and it worked great!

Here’s the code from Chrissy of netnerds.net


$atomdate = ‘2006-04-22T10:00:00.000Z’;

$datetime = strtotime(substr($atomdate, 0, 10) . ‘ ‘ . substr($atomdate, 11, 8 ));

print date(’m.d.y’,$datetime);

?>

I was able to do a search the next day and the Digg entry came up on 2nd page of Google. So that’s not bad. I need to do that for all the sites now.

Here’s an idea for parsing out those <dc:creator> or <dc:date> using PHP and SimpleXMLElement.

Do a string replace.

Another idea is to go use the children() to get children of node.

Here’s an idea for parsing out those <dc:creator> or <dc:date> using PHP and SimpleXMLElement.

Do a string replace.

There’s a great interview with Donnie Yen on SCMP site about his new film IP Man.

I suggest using MYSQL Dump Importer. It works great! I have used it to move several hundred megs of mySQL databases on hostgator and it works great. The problem with hostgator is they do not allow mysql commands on Shell. So you can either ask their admins to do it or use the MYSQL Dump Importer to do it yourself.

Heelcandy  blogs about shoes and serves as affiliate for zappos. I really like the design and her reviews.

There’s some good XML and RSS parser scripts.

There’s some good XML and RSS parser scripts.

Instantmeat.com is an example of a Google Adsense for Domains site. It is similar to Godaddy’s Cashpark program I believe.

Changing Directory in PHP

<?php
$wd_was = getcwd();
chdir(”photos-event”);
$dirname = “photos-event/”;
include(”build.php”);
chdir($wd_was);
?>

Quick Minisite is a domain adsense page that you can use to make money off your domains. It is actually pretty neat php script.

Most Profitable Keywords

Xedant has an interesting comparison of most profitable keywords vs most expensive keywords.

Coderprofile has a great php cache script for use with php files. Written by Scott Thompson.

UnrealMedia has posted some really simple code to parse a RSS feed.

$file = file_get_contents("Feed URL");
$xml = new SimpleXMLElement($file);
foreach($xml->channel->item as $feed){
echo $feed->title.’<br>’;
}

It’s a tad bit more complicated than usual to do.

1. Add domain to Dreamhost hosting using Fully Managed
2. Delete the domain under Web Hosting column
3. Now click on DNS link under domain name and edit the settings

This automysqlbackup does a good job of backing up mysql database.

And you can use cron to backup hostgator file directories.

I hear celebrity wit makes a lot of money from ads. It’s kind of a simple site. But yeah, it’s addictive and funny too. I think humor sites are good bets.

This is kind of an interesting idea. Creating a single page for targetting with Google and adsense.

There’s a free plugin to allow you to build a BANS online ebay store for free.

Damn.. that really makes me angry. The American tax-payers are constantly helping these big corporations and finance all sorts of things that we dont like (like Iraq war) and always getting the short end of the stick. When is government ever going to work to help the average american to have a better life instead of making execs fly in their golden parachutes? I just dont think it’s fair.

I am still trying to figure out how people make money off adsense. Google must be making a lot of people money and I am constantly seeing tons of sites on how to make money off the adsense machine. But so far, I still have not seen it for myself. It would be nice to make a few dollars of adsense a day so I can pay for my web hosting. It’s a lot of effort and time to put into my sites.

This site has some great information on using YUI to find an element’s size and position.

This theme is touted as the ultimate money making theme.

Here’s an interview with Marhgil Macuha and how he makes money with macuha.com

You can request a SSH form through this SSH request form. I had to talk to a support rep in live chat.

Check Web Site Load Time

I was trying to determine which of my sites loads faster. The site at Dreamhost or the site at Host Gator. So I used a tool from iWebtool and discovered the Host Gator site loaded a bit faster. Although to me, both sites loaded the same. That could be due to the fact that Dreamhost server locations are in Sacramento and I live in the Bay Area.

Stargeek.com has some good PHP scripts for various things.

Dreamhost makes a lot more money off me from domains than hosting itself. I think it makes a whole lot of sense. For $9.99 they host my domain. It’s not cheap and fairly expensive compared to other places. I only do it because I have hosting there as well.

But I am thinking about switching to hostgator.com because Dreamhost downtime happens quite frequently and they do not compensate users for all that downtime.

I am really excited about orca 2. I think I’m going to implement it in one of my sites and see how it goes.

Really like FluxBB and PunBB for forum. It is powered by PHP and mySQL.

Orca 2 is an 100% AJAX forum script with many features. Seems interesting too.

Older Posts »