Monthly Archives: September 2006

The biggest error box ever!

Standard

If you think that you are an experienced web designer, if you think that you have seen all the ways that IE can crash, then you must see that 🙂

http://web2announcer.com/go/18439

Advertisements

Backup all your databases with one click

Standard

Bellow is a php script that I made for taking backups of my mySql databases. The script is designed to run under console(CLI) in root mode, so I don’t think that it will work for shared hosting accounts, but you can try it, or try to modify the exec commands with SUDO.

<?php
//================================================
//
// Auto backup your databases
// Author: Nick Papanotas
// Comments/feedback/troubleshooting:
// http://www.webdigity.com/
//
// This script propably wont run from web, except
// if you modify it to add SUDO.
//================================================

$backup_dir = dirname( __FILE__ ) . ‘/backups/’;

$u = ‘User’;
$p = ‘XXXX’;
$db = ‘Adatatbase’;//This is just the name of a database just to make the query work. The script will backup all the databases that your use has access to.

$db_link = mysql_connect($h,$u,$p);
$res = mysql_db_query($db, ‘SHOW DATABASES’, $db_link) or die(‘Could not connect: ‘ . mysql_error());
echo
‘Found ‘. mysql_num_rows($res) . ‘ databases’ . “\n”;

while ( $rec = mysql_fetch_array($res) )
{
//Parse time :
$time = microtime();
$time = explode(‘ ‘, $time);
$time = $time[1] + $time[0];
$start = $time;

echo $rec[0] . “\n”;
shell_exec( ‘mysqldump –result-file=’.$backup_dir.$rec[0].‘.’.date(‘Y-m-d’).‘.sql –password=’.$p.‘ ‘.$rec[0] );
//Parse time :
$time = microtime();
$time = explode(‘ ‘, $time);
$time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish $start), 6);
echo
‘Parsed in ‘ . $total_time . ‘ secs’ . “\nStarting with compression\n”;
}
//Let’s tar those backups :
shell_exec( ‘tar cvf ‘.$backup_dir.date(‘Y-m-d’).‘.tar ‘.$backup_dir.‘*.sql’ );
?>

This script has been originally posted to webdigity’s code library.

Promoting through press releases Part I

Standard

As every webmaster should know, press releases is a great tool to get some free publicity, and in many cases a press release can kick start a web site (traffic + seo)

Let me explain how this works. You prepare a nice text explain what you offer, and then you are using a service that manages to distribute it to several newspapers, magazines, tv stations and key blogs to your subject’s topic. The next thing is that those media are sending you traffic. And all that in the price of $0! Of course you can spend some bucks to have some better chances, but this is something that I will explain later.
Personally I haven’t ever send a press release, but I had many discussions with people who had done this and got good results. So I thought to make a try, but as you can understand my english are too poor to write one….

Anyway thanks to my very good friend and proffesional in this subject, Michelle I got a very good press release to publish. Her experience in addition to her very proffesional work, had made a difference, so my advice for the people who plan to publish a PR is to get some proffesional assistance to that.

The next step after creating your PR is to send it. There are many companies that can do that, but beware because only a small portion of them are serious. My research pointed to two companies : PRWeb and PRLeap. The best is propably PRWeb as they distribute to more than 100,000 media sources, but the charge of $119 – $350 may convince you to try PRLeap or any other free PR service 🙂

This is what I tried too, as it was my first PR and I didn’t want to pay much for this (after all it is just an experiment). PRLeap is a free service, but they have some upgrades that may cost you $10 – $200. While I was submitting my PR, I realized that the “totally free” plan is not so good, so I upgraded the PR distribution using a $50 plan. The $50 plan allows you to :

  1. Post links, which is something very usefull as many sites will publish you PR and those links will propably help with your SEO and google PR (pagerank).
  2. Review/Distribute very fast (next day)
  3. Get Newswire Distribution. That gives your PR a much better chance to get listed in the top sources (as google news) and it will also include your PR to the RSS feeds of PRLeap. In other words this plan is a must if you have something good to say 🙂

I had posted my PR before a few hours, and as I saw in my account @ prleap the PR has allready accepted, and it will be distributed tomorrow. So check back tomorrow for the update regarding this press release, and my final thoughts on this promotion technique.

Web services and contextual solutions from Commision Juction

Standard

It appears that God listens to my prayers some times 🙂

CJ today announced their new web services that integrate your aps with their affiliate programs.

I took a look some of the code examples and there are some very interesting contextual ads and mini product search engine.
I think this new APIs from CJ can make a really difference, especcially for people that aren’t sattisfied with Adsense.

Bellow is the official announcment :

Commission Junction is pleased to announce the launch of its much-anticipated Web Services. Web Services allow you to extend the power of your affiliate program through enhanced Product Catalog functionality and link and advertiser searches. Use our Web Services to tap into Commission Junction’s technology and create custom applications to access the data that matters most for your affiliate program.

Right media ending business with proxies

Standard

Today I got an email from Right Media, as an announcment that they stop business with proxy sites. Anyway I have stoped delivering their ads to my proxy, as I found a better pop up network, but the way they did that shows to me that Right Media is a serious company.

Bellow is the original mail I got :

Hello Right Media publishers,

We have made a decision as a network to no longer serve ads to proxy-style or proxy-related sites.
We agree that web browsing privacy is an important issue and that proxy sites have legitimate uses on the internet.  Unfortunately, the fact that users can use these services to view restricted material makes it unknown as to where our ads might be appearing or next to what type of content.  For this reason we need to disable all sites in our system labeled as a proxy site.
This change will go into effect at 5PM Pacific time, on September 20th.  Please plan on finding new advertising solutions before this time. The tags you are using for those sites/sections will show blanks after this time.

If you have sites listed in your account that are not proxy sites, those will remain active.

Thank you for your understanding on this matter.  We’re sorry if it causes any inconvenience.  Payments will be made on their scheduled times for all revenue earned up to this point, including amounts below the minimum of $50 if you have no other active sites in your account.

A class that automatically generates a menu of links (sitemap)

Standard

Use this php class to create a sitemap for your site, or create a links menu.

The function is recursive, so it will read the content of the directories, and the subdirectories in them.

Here is the class file:

Code:

<?php
<?php
class file2menu {
////////////////////////////////////////////////////
// File to menu converter class
//
// Version 1.00
//
// This class is creating an HTML menu from the files that
// exist in a directory, and its subdirectories
//
// Author: Nick Papanotas
//
// License: GPL, see LICENSE
// Support: You can post your questions/bugs or anything else
// to http://www.webdigity.com/
//
////////////////////////////////////////////////////

/*
The directory that we want to create the listing for. Should be relative to the web site’s root path
@var string
*/
var $directory;
/*
The file types that will be displayed in the menu
@var string
*/
var $acceptedFileTypes = array (‘php’,‘html’,‘htm’);
/*
Should we display the file extension to the menu?
@var string
*/
var $displayExt = false;
/*
Created by the preparse() function
@var array
*/
var $listArray;

/*********************************************************
* PUBLIC FUNCTIONS *
*********************************************************/

/*
A constructor function
@access public
@return bool
*/
function file2menu($directory)
{
$this->directory = $directory;
if ( empty (
$this->directory ))
die ( ‘Directory not selected’ );
else
{
$this->directory = substr($this->directory,0,1) != ‘/’?‘/’.$this->directory:$this->directory;
$this->directory = substr($this->directory,-1) == ‘/’?substr($this->directory,0,-1):$this->directory;
$this->directory = $_SERVER[‘DOCUMENT_ROOT’]. $this->directory;
if ( !
is_dir($this->directory ))
die ( $this->directory . ‘ is not a directory’);
}
return
true;
}
/*
Creates the $this->listArray array. You don’t have to use this function
This function is a modified version of http://fundisom.com/phparadise/php/directories/recursive_directory_listing
@access private/puplic
@return array
*/
function preparse($dir = )
{
$dir = empty($dir)?$this->directory:$dir;
$dirlist = opendir($dir);
while (
$file = readdir ($dirlist))
{
if (
$file != ‘.’ && $file != ‘..’)
{
$newpath = $dir.‘/’.$file;
$level = explode(‘/’,$newpath);
if (
is_dir($newpath))
{
$mod_array[] = array(
‘level’=>count($level)-1,
‘path’=>$newpath,
‘relPath’ => substr($newpath,strlen($_SERVER[‘DOCUMENT_ROOT’])),
‘name’=>end($level),
‘type’=>‘dir’,
‘mod_time’=>filemtime($newpath),
‘content’=>$this->preparse($newpath));
}else{
$ext = array_pop(explode(‘.’,$file));
if ( in_array ($ext,$this->acceptedFileTypes))
{
$end = end($level);
$mod_array[] = array(
‘level’=>count($level)-1,
‘name’=>$this->displayExt?$end:substr($end,0,(strlen($end) – strlen($ext)-1)),
‘relPath’ => substr($newpath,strlen($_SERVER[‘DOCUMENT_ROOT’])),
‘type’=>‘file’,
‘mod_time’=>filemtime($newpath),
‘size’=>filesize($newpath));
}
}
}
}
closedir($dirlist);
$this->listArray = $mod_array;
return
$mod_array;
}

/*
A recursive function that displays a menu. If you want to modify the look of the autogenerated menu, this is the function you have to change
@access public
@return NULL
*/
function DisplayMenu($list=,$displayHeaderFooter = true)
{
if ( empty(
$this->listArray))
$this->preparse();
$list = empty($list)?$this->listArray:$list;
$levelsSub = count(explode(‘/’,$_SERVER[‘DOCUMENT_ROOT’]));
if (
$displayHeaderFooter )
echo ‘<pre>’;//You can put some html header here
foreach ( $list as $item )
{
for (
$i=$levelsSub; $i<$item[‘level’];$i++)
echo “\t”;
if ( $item[‘type’] == ‘file’ )
{
//Here we parse files :
echo ‘<a href=”‘.$item[‘relPath’].‘”>’.$item[‘name’].‘</a><br />’;
}else{
//Here we parse directories:
echo ‘<b>’.$item[‘name’].‘</b><br />’;
if ( !empty($item[‘content’]))
echo $this->DisplayMenu($item[‘content’],false);
}
}
if (
$displayHeaderFooter )
echo ‘</pre>’;//You can put some html footer here
}

/*
Saves the output of the DisplayMenu function to a file.
@access public
@return bool
*/
function SaveAs ( $fileName )
{
if (!
$fp = @fopen ($fileName, ‘w’))
die ( ‘Can\’t open file for writing.’);
ob_start();
$this->DisplayMenu();
$data = ob_get_clean();
if ( !@
fwrite($fp, $data))
die( ‘Can\’t write to file.’);
if ( !@
fclose($fp))
die ( ‘Cam\’t close file.’);
return
true;
}
}

?>

 

To use the function you just need something like this :

<?php
$dir
= new file2menu(‘/myDirectory’);
$dir->DisplayMenu();

You can also use the SaveAs method to save the menu in a file :

<?php
$dir
= new file2menu(‘/myDirectory’);
$dir->SaveAs(‘FileToSave.html’);

If you have any comments, questions regarding this class, please post a topic here.

This class originally posted to webdigity’s code library.

 

Web design gallery @ webdigity

Standard

Yesterday I finished with the development of webdigity’s web design gallery. Well as I was sick and coded this site too fast, I left some bugs, but thanks to my friends in the forum, they all have been solved(or I think so…). Anyway I am glad that is finished, as it was my first project that uses AJAX and I think this web 2.0 feel will be nice to the visitors too.

If you wonder what this site is about, think that it is like a directory that lists only well designed web sites, having a special note for the w3c standards that each site uses. A designer can use it to promote his/her work, or even find some “inspiration” when designing a new site.

Later this week we will also have a new contest about this site, so prepare yourself and submit your designs as soon as possible 🙂

My pop up network odyssey

Standard

Latelly I was trying to find ways to monetize my proxy web site. As google is not allowing proxy sites to display their ads in the proxied pages, I think a popup solution would be the best.

So first I signed up with YesAdvertising, which is a company of Clicksor (the worst comany I ever associated with…) The company seemed to pay well, about $2 CPM. But when I reached the ammount to get my first check, they banned me “because fraudelent activities”! Ok this is very funny, because it is simply impossible to cheat a CPM program, but anyway I moved on….

The next company was Right Media‘s Yield Manager. Right media in conjuction with Clicksor and their companies, is a serious company, but yet they pay too low (about $1 – $1,5 CPM) and they pay 60 days after the ending of the month that you have the minimum ammount ($100) by check(that means another month of delay for mailing). So I decided to check some other companies….

The last company in my pop up network odyssey was Adversal.  Adversal is a very good company for many reasons that I will try to write here :

  1. They pay on an average of $1-$6 CPM (depending on the unique pageviews)
  2. They pay you 10% of the earning of your affiliates (nice huh?), but the best of all…
  3. is that they pay you 15 days after the end of the month (for $50+) through paypal!

Yesterday I got my first check, so I thought to recommend this company to my fellas webmasters. By the way if you want to use pop up ads for the monetization of your web site, think that this can harm your visitors loyalty. You can check a related discussion here.