Wwwebber's Blog

Php Script-Process, Display and Watermark all images in a Directory

Posted in free php scripts, image effects by wwwebber on December 13, 2009

I needed a bit of break from some large projects I’ve been working on so I made up a little script that will process, display and watermark all images in a directory. The script makes use of 2 classes. One class is a ImageViewer . This takes an image and watermerks it with whatever text you want.(font size and text is hard coded..so doesn’t work well for really small images…sorry just don’t have the time for that level of finesse at the moment)

The other class processes(DisplayImageDir) a directory by –it gets a list of all images in a given directory (anything with .jpg, .jpeg, .png, or .bmp)

The script will output a double columned display of all of the images in the directory with the watermark added!

You can download the scirpt

Here’s are some demo pages
Images of Linear Equations

This script could definitely be improved and generalized. I simply wanted to make it easier for search engines and users of my site to be able to find, and if possibly download the many, many images I have over at Math Warehouse. However, I did want to ensure that there was a copyright watermark on each file.

The script works right out of the box, is open source and hopefully will be useful for someone.

This script ran on a Godaddy shared hosting account–about as budget as it gets so if you’re host doesn’t support the features for the script…it might be time for you to upgrade your account!

Also, note that I named one of the files .php5 to ensure that it was processed by php 5–this was necessary on teh GoDaddy server…you might need to rename the file as well as teh associated variable which is located in DisplayImageDir.class.php


Comments Off on Php Script-Process, Display and Watermark all images in a Directory

Hashmap based on values of a key based array

Posted in free php scripts, hashmap, job search script, sorting arrays by wwwebber on May 26, 2009
I recently had to create a function that would take the values in a key based array and create a hashmap based off of the values. Basically, I had to switch the keys and values. (Remember there are no duplicate keys and I was going to need multiple objects associated with 1 key..this was all part of my free php job search script ) . Anyway, the goal was to take an array like this
$before = array(
“White Plains” => “NY”,
“New York City” => “NY”,
“Philadelphia”    =>”PA”,
“Tampa”            =>”FL”,
“Miami”            =>”FL”
and turn it into

$before = array(
‘NY’ => White Plains,New York City,
‘PA’ => Philadelphia,
‘FL’ => Tampa,Miami

function createHashMap(&$mc){
$hashMap = array();

while ($name = current($mc)) {
$key = key($mc);
//echo “key: $key , current:  “. $name . ‘ <br />’;
//            $newKey = substr($key,0,strlen($key)-1) //remove last
$hashMap[“‘”. $name .”‘”] .= $key .’,’ ;
$hashMap[“‘”. $name .”‘”] = “‘”. trim($key) .”‘”  ;

//print em out
foreach($hashMap as $key => $value)
echo $key . ‘ => ‘ . $value . ‘<br />’;


Comments Off on Hashmap based on values of a key based array

Php Job Script : Free Job Aggregator

Posted in free php scripts by wwwebber on May 24, 2009

One of my clients wanted to me to create a php job script–not a job portal but rather a script that would allow people to search for all of the jobs that you find on indeed.com

So I made up this script . It is largely open source (1 file is encrpyted…to make sure that the footer links remain intact:) )  Otherwise it is highly customizable and is SEO friendly as the entire script employs mod_rewrite.

How can I earn money with Script?
You can register for your own account at indeed.com and use your own ‘publisher id’ to get some cash for each click that a user makes. Also, from personal experience, I have noticed that cpc for Google Ad’s on my job search pages are decent–though would vary by industry.

Where Can I See a Demo? demo of the default install for the USA and for  India

    Some Sites Using the Script

What are the Server Requirements: Read them here.

Where can I download it ? Here

How can I remove the footer?

  • paypal $50  to  send it here  and I will send you an un-encrypted version. From there, you can do whatever you would like including removing the footer. However, you will need to find the relevant lines of code in the JobRoll.class file and remove them.

How can I get the entire script unecrypted?

  • paypal $50  to  send it here
      Note: there is only 1 file that is enctyped (jobroll.class.php). The script’s style is easily manipulated with cascading style sheets. If you want to do some deep customizations then, yes, it might be worth the the money  to get the unenctyped jobroll.class.php –however, please make sure you are very comfortable with PHP before trying trying this.

What Countries are Supported? USA  and India

Download the script at Hot Scripts: Job Search Script


Also, one of the benefits of the script is that it creates literally hundreds of SEO friendly web pages based off of every combination of city state and county. You can see an example of the site map (that can be customized by just changing a variable in the script here: