Feed

Author Archive

FileDate Mover v1.0

admin on Apr 24th 2008

FileDate Mover is a program that moves files from one directory to directory tree based on file date.
If you have a file that have a date 2006.12.24 then it makes directory called 2006/12/filename.ext.
This program runs through a directory and moves all the files to date-based-directory-tree.
You can edit the i18n.ini file to change the settings.

rprog = datemove.exe -d

If you remove -d, then it moves the files from this month too. But if you use -d, it will ignore files that where made this month.

In the zip file you find these files:

  • i18n.ini settings file.
  • datemove.exe CMD based version of this program. Run datemove in cmd for usage options.
  • datemoveX.exe Gui-based version of this program.
  • src\ Directory containing the sourcefile in php.

Download: FileDate Mover v1.0 (812.01 KB)

Filed in Apps | No responses yet

Directory/File-chooser tool

admin on Apr 24th 2008


This is an open and free program.

Here is a small GUI for those old DOS command. With this program you can run programs with given file or directory input and output.

Here is how the ini file looks like:

 
[gui]
lprog=Title of the window goes here
lin= INPUT:
lout= OUTPUT:
lrun= RUN
lexit= CLOSE
lcof= Choose a output file / directory
lcif= Choose a input file / directory
lrunbox= "Done!"
lfot= Out File
lfit= Inn file
[run]
rprog = notepad.exe
rodir = 0
ridir = 0
 

rprog ::: you can choose the program to run.
rodir ::: 0=File 1=Directory
ridir ::: 0=File 1=Directory (If given file or directory dose not exist, it will be created.)

So now you can make your own windows based GUI from those good old DOS commands.

Download: Directory/File-chooser v1.0 (195.48 KB)

Filed in Apps | No responses yet

swapeCaster

admin on Apr 22nd 2008

swapeCaster is a free video/music podcasting script.
All you have to do is unzip the files in your web server, put your music/video files under the "files/" directory.
Point your podcast program (iTunes) to the place where you have the feed.php file and it will automatically generate podcast feed.

Configuration:
Just edit the lines in feed.php file to match your server address and other important stuff.

< ?php
//------ Config
$fileDirectory = "./files/"; // path to files
$webURL = "http://somewhere.com/feeds/files/"; // path to files from the web
$title = "Alireza Balouch private videoCasting"; // Title of the feed
$website = "http://www.swape.net";	// your homepage
$description = "My podcast";		// Description of the file
$authorEmail = "me@myplace.com";	// Your email adress
$copyright = "These works are licensed under a Creative Commons License (Some Rights Reserved)"; // Copyright stuff
$ttl = 1441;	// Time to live
//------
?>

Download: SwapeCaster v0.9 (4.03 KB)

Filed in Scripts | No responses yet

Checkbox value

admin on Apr 17th 2008

When you post a form with checkbox it dose not return any value when the checkbox is not ticked.
This is something that should have been fixed a long time ago.
But for now here is the solution:

 
<form action="?" method="post">
<input name="myCheckbox" type="hidden" value="0" />
<input name="myCheckbox" type="checkbox" />
</form>
 

You put an hidden input before checkbox input with the same name.
Since the last checkbox overwrite the value when it is checked, the hidden input do not return "0" but when the checkbox is not checked, the hidden input with the same name returns a "0".

So when the checkbox is checked it returns "on" and when it is not checked it returns "0"

And to make it easier to click on the ckeckbox use "label" tag around the name.

Before:

My Checkbox

After:

This way you can click on the checkbox label and make it checked.
The correct way to write an checkbox checked from the start is like this:

<label>
<input checked="checked" name="myCheckbox" type="checkbox" />
My Checkbox
</label>

Filed in Tips & Tricks | No responses yet

favicon2png

admin on Feb 19th 2008

Here is a script to download the favicon.ico files from a website and save it as a png file.

You must have imagemagick installed on your server to convert the ico file to png.

 
<!--- html code ---->
<form action="?" method="post">
<input id="site" name="site" type="text"
value="<?php echo $_POST['site']; ?/>" />
<input type="submit" />
</form>
 
< ?php
//--- favicon2png by Alireza Balouch @ swape.net 2008
 
if($_POST['site'] != ''){
 
//finding the hostname
$host = parse_url($_POST['site']);
$host = $host['host'];
$host = explode('.' , $host);
$host = $host[count($host) -2];
$filename = 'img/' . $host . '.png';
 
if (!is_file($filename)){
// getting the favicon
$handle = fopen( $_POST['site'] . '/favicon.ico', "rb");
$contents = stream_get_contents($handle);
fclose($handle);
 
file_put_contents('fav.ico' , $contents );
// converting to png
$StrExec = '/usr/local/bin/convert fav.ico -resize 24x24\> ' . $filename ;
$ret = exec($StrExec);
}
echo '<img src="' . $filename . '" />' . $_POST['site'];
}
?>

Filed in Scripts | No responses yet