Jul
10
2009
0

Secure image capcha revisited

I found a nice script http://www.phpcaptcha.org/ for made form capcha named secureimage and add some code for have random background and font for the capcha image

Here are the class modification that I made on the class:

- Porting the class for use in php5
- Remove the define for images: SI_IMAGE_JPEG, SI_IMAGE_PNG, SI_IMAGE_GIF
- Add define for ttf font path SI_PATH_TTF_FONTS
- Add define for gd font path SI_PATH_GD_FONTS
- Add define for random background imagess path SI_PATH_BACKGROUND
- Add define for audio path SI_PATH_AUDIO
- Add define for wordlist path SI_PATH_WORDS
- Set static var for $charset
- Add var $automatic_random for enable / disable random font and background image
- Add var $lang_wordlist for have wordlist for any language
- Delete var $wordlist_file: the file now is on SI_PATH_WORDS.’wordlist-’.$lang_wordlist.’.txt’
- Add var $use_random_bg_image for set random extraction for the background image
- Modify var $gd_font_file: now can set only filename
- Modify var $gd_font_file: now can set only filename
- Modify var $audio_path: now can set only filename
- Add options array to the constructor function: $img = new Securimage(array(‘automatic_random’=>false,’lang_wordlist’=>’it’));
- Add generic function for set var in the class: (void)setOption($name, $value);
- Add generic function for set var in the class: (void)setBgImage(‘/path-to-my-bg-image/image-name.jpg’);
- Modify function show() and added the code for have random background and font in the class
- Added function getRandom() for charge random files

download
Size: 846.85 KB
Hits : 30

Share and Enjoy:
  • Facebook
  • del.icio.us
  • Twitter
  • Google Bookmarks
  • Digg
  • Technorati
  • MySpace
  • Live
  • BlinkList
  • Add to favorites
  • email
  • RSS
  • Mixx
  • Bitacoras.com
  • blogmarks
  • Blogosphere News
  • Blogplay
  • connotea
  • Current
  • Diggita
  • Diigo
  • DZone
  • eKudos
  • Internetmedia
  • LinkedIn
  • MSN Reporter
  • Reddit
  • Scoopeo
  • Segnalo
  • Slashdot
  • Socialogs
  • Sphinn
Written by Davide in: Library, php, scripts | Tags: , , ,
Jun
30
2009
0

PHP pdf invoice

I need for my cms a class that can print invoice payment in pdf format.

Wel I find a nice script for oscommerce ( http://www.oscommerce.com/community/contributions,5321/category,12/search,pdf_customer_invoice ) that have a nice view of  the pdf invoice; Than I port this script and make a class for use in all indipendent cms …

Here can download the example output of the invoice class:

Ininvoice pdf

download
Size: 81.96 KB
Hits : 70

(more…)

Share and Enjoy:
  • Facebook
  • del.icio.us
  • Twitter
  • Google Bookmarks
  • Digg
  • Technorati
  • MySpace
  • Live
  • BlinkList
  • Add to favorites
  • email
  • RSS
  • Mixx
  • Bitacoras.com
  • blogmarks
  • Blogosphere News
  • Blogplay
  • connotea
  • Current
  • Diggita
  • Diigo
  • DZone
  • eKudos
  • Internetmedia
  • LinkedIn
  • MSN Reporter
  • Reddit
  • Scoopeo
  • Segnalo
  • Slashdot
  • Socialogs
  • Sphinn
Written by Davide in: Library, php | Tags: , , , ,
Jun
19
2009
0

Mootools fValidator with Asset

I made some modifications on the great scrip fValidator (http://pilon.nl) for charge with Assets only used languages files.

Add too a compressed version of the class.

download
Size: 8.48 KB
Hits : 62

Share and Enjoy:
  • Facebook
  • del.icio.us
  • Twitter
  • Google Bookmarks
  • Digg
  • Technorati
  • MySpace
  • Live
  • BlinkList
  • Add to favorites
  • email
  • RSS
  • Mixx
  • Bitacoras.com
  • blogmarks
  • Blogosphere News
  • Blogplay
  • connotea
  • Current
  • Diggita
  • Diigo
  • DZone
  • eKudos
  • Internetmedia
  • LinkedIn
  • MSN Reporter
  • Reddit
  • Scoopeo
  • Segnalo
  • Slashdot
  • Socialogs
  • Sphinn
Written by Davide in: Library, javascript, mootools | Tags: , , , ,
Jun
13
2009
0

MooSkype

This is my new little class fot print Skype button status with mootools library.

It have a nice effect for the button taken from http://davidwalsh.name/skype-mootools.

Thanks David Your site is a good reference for me ;)

VIEW THE EXAMPLE FILE

download
Size: 68.42 KB
Hits : 17

(more…)

Share and Enjoy:
  • Facebook
  • del.icio.us
  • Twitter
  • Google Bookmarks
  • Digg
  • Technorati
  • MySpace
  • Live
  • BlinkList
  • Add to favorites
  • email
  • RSS
  • Mixx
  • Bitacoras.com
  • blogmarks
  • Blogosphere News
  • Blogplay
  • connotea
  • Current
  • Diggita
  • Diigo
  • DZone
  • eKudos
  • Internetmedia
  • LinkedIn
  • MSN Reporter
  • Reddit
  • Scoopeo
  • Segnalo
  • Slashdot
  • Socialogs
  • Sphinn
Written by Davide in: Library, javascript, mootools | Tags: , , , , ,
May
09
2009
4

Mootools swap image

Here is my Mootools class that I use for swap the source of an image with the

same filename + ‘_over’ before the extension (‘img.jpg’ will be
‘img_over.jpg’) work fine in firefox3, safari for windows, internet explorer 7.
Use this class is very simple:

First need to have mootools 1.2 javascript library
Second download MooSwap class

download
Size: 98.12 KB
Hits : 325

The class:

var MooSwap = new Class({

//implements
Implements: [Options],

options: {
imgHoverPrefix: '_hover'
},

initialize: function(elements, options) {
//set options
this.setOptions(options);
// Set elements
this.setSwap(elements);
},

setSwap: function(elements) {

var prefix = this.options.imgHoverPrefix;

// preload images array
imgTemp = [];
i = 0;

$$(elements).each(function(el) {
var mouseFx = new Fx.Tween(el, {duration: 240, wait: false});

var holdSrc = el.getProperty('src');
var extension = holdSrc.substring(holdSrc.lastIndexOf('.'),holdSrc.length);
var newSrc = holdSrc.replace(extension, prefix + '' + extension);

// set new image for preloading
imgTemp[i] = new Asset.image(newSrc, {'alt':el.getProperty('alt'),'id':el.getProperty('id')});
//imgTemp[i] = new Element('img', {'alt': el.getProperty('alt')}).set('src', newSrc);

// default link on current img element
var link = el;

// check if there is a link a href parent
var test = el.getParent('a');
if (test) {
var link = test.setProperty('id', '__link_' + i);
}

link.addEvents({
mouseover: function() {
el.setProperty('src', newSrc);
},
mouseout: function() {
el.setProperty('src', holdSrc);
}
});

i++;
});
}
});

The javascript in the page:

<script src="mootools-1.2.2-core.js" type="text/javascript"  charset="utf-8"></script>
<script type="text/javascript"  charset="utf-8">
//<![CDATA[
window.addEvent('domready', function() {
var swap = new MooSwap('.fade img', { imgHoverPrefix:'_hover' });
});
//]]>
</script>

The html

<ul class="fade">
<li><img src="my-image.jpg" alt="my title" /></li>
<li><a href="http://mylink/"><img src="my-image-1.jpg" alt="my title 1" /></a></li>
</ul>

Need to have valid
my-image_hover.jpg and my-image-1_hover.jpg

That’s all :)

Share and Enjoy:
  • Facebook
  • del.icio.us
  • Twitter
  • Google Bookmarks
  • Digg
  • Technorati
  • MySpace
  • Live
  • BlinkList
  • Add to favorites
  • email
  • RSS
  • Mixx
  • Bitacoras.com
  • blogmarks
  • Blogosphere News
  • Blogplay
  • connotea
  • Current
  • Diggita
  • Diigo
  • DZone
  • eKudos
  • Internetmedia
  • LinkedIn
  • MSN Reporter
  • Reddit
  • Scoopeo
  • Segnalo
  • Slashdot
  • Socialogs
  • Sphinn
Written by Davide in: javascript, mootools | Tags: , , , ,
Apr
15
2009
0

Open inviter front and translation revision 1

I make some modification in the class and add one forgot translation and correct the dobble error message bug in the class; I’ve change the css for better present the email  subject.

Here is the file that You can download the OpenInviter front class with this features in:

download
Size: 46.36 KB
Hits : 182

Share and Enjoy:
  • Facebook
  • del.icio.us
  • Twitter
  • Google Bookmarks
  • Digg
  • Technorati
  • MySpace
  • Live
  • BlinkList
  • Add to favorites
  • email
  • RSS
  • Mixx
  • Bitacoras.com
  • blogmarks
  • Blogosphere News
  • Blogplay
  • connotea
  • Current
  • Diggita
  • Diigo
  • DZone
  • eKudos
  • Internetmedia
  • LinkedIn
  • MSN Reporter
  • Reddit
  • Scoopeo
  • Segnalo
  • Slashdot
  • Socialogs
  • Sphinn
Written by Davide in: Library, php | Tags: , , ,
Apr
01
2009
0

Open inviter front and translation

I make a modification to openinviter class ( http://openinviter.com ) for my use because the class don’t have a public class defined and forget the translation … So I made it :)

The actual languages disponibles are:

  • Italian
  • English
  • Spanish
  • French
Share and Enjoy:
  • Facebook
  • del.icio.us
  • Twitter
  • Google Bookmarks
  • Digg
  • Technorati
  • MySpace
  • Live
  • BlinkList
  • Add to favorites
  • email
  • RSS
  • Mixx
  • Bitacoras.com
  • blogmarks
  • Blogosphere News
  • Blogplay
  • connotea
  • Current
  • Diggita
  • Diigo
  • DZone
  • eKudos
  • Internetmedia
  • LinkedIn
  • MSN Reporter
  • Reddit
  • Scoopeo
  • Segnalo
  • Slashdot
  • Socialogs
  • Sphinn
Written by Davide in: Library, php | Tags: , , ,
Feb
16
2009
0

Cat_Cache

Cat Cache

My class for caching datas.

Click HERE for see the code of this class

This is a simple cache system written for php5 used for caching any type of data in files. It use all static method for render quickly the cache.

This class is able to manage data to be stored in cache files in a way that it may be safely stored and retrieved even when there may be many concurrent processes attempting to access the same data.

This is an example of the class uses:

< ?php
// Include the cache library
include('cat-cache.inc.php');

// Take te cache if exist
$options = array(
'cache_path' =>'/my-cache-path/',
'cache_lifetime' =>7200,
'cache_group' =>'news',
'cache_prefix' =>'_my_prefix'
);
if (!$content = Cat_Cache_Datas::get('unique id', $options)) {

$content = 'Bla bla bla';

Cat_Cache_Datas::save('unique id', $content, $options);
}
echo $content;

// Delete all group cache if is expired or not
$options = array(
'cache_path' =>'/my-cache-path/'
);
Cat_Cache_Datas::clean('my_group', false, $options);

// Delete all expired cache
$options = array(
'cache_path' =>'/my-cache-path/'
);
Cat_Cache_Datas::clean(false, false, $options);

// Delete all cache if is expired or not
$options = array(
'cache_path' =>'/my-cache-path/'
);
Cat_Cache_Datas::clean(false, true, $options);

// Delete ID cache if is expired or not
$options = array(
'cache_path' =>'/my-cache-path/'
);
Cat_Cache_Datas::del('my-cache-unique-id', $options);

// Take name of the ID cache
$options = array(
'cache_path' =>'/my-cache-path/'
);
Cat_Cache_Datas::get_name('my-cache-unique-id');
?>
download
Size: 4.9 KB
Hits : 17

Share and Enjoy:
  • Facebook
  • del.icio.us
  • Twitter
  • Google Bookmarks
  • Digg
  • Technorati
  • MySpace
  • Live
  • BlinkList
  • Add to favorites
  • email
  • RSS
  • Mixx
  • Bitacoras.com
  • blogmarks
  • Blogosphere News
  • Blogplay
  • connotea
  • Current
  • Diggita
  • Diigo
  • DZone
  • eKudos
  • Internetmedia
  • LinkedIn
  • MSN Reporter
  • Reddit
  • Scoopeo
  • Segnalo
  • Slashdot
  • Socialogs
  • Sphinn
Written by Davide in: Library, php | Tags: , ,
Oct
18
2008
0

Cat Sitemap

Cat Sitemap

My class for make sitemap.

Work fine on my sites and have option for use crontab for create the sitemap.

Click HERE for see the code of this class

This is an example of the class uses:

 < ?php
// Set the path to webserver root
$path = $_SERVER['DOCUMENT_ROOT'].'/';
// Set url to webserver root
$url = 'http://'.$_SERVER['HTTP_HOST'].'/';

// include library
require(cat-sitemap.inc.php');

// inizialize the sitemap class
$map = new Cat_Sitemap($url.'/', $path, array('debug'=>true,'log_path'=>$path.'write/'));

// Make query
$sql = " SELECT page_name, url, lastmodify FROM my_database_table".
" WHERE 1 ORDER BY lastmodify DESC";
if (!$results = mysql_query($sql)) {
// No results ...
exit;
}
while($val = mysql_fetch_assoc($results)) {
// Here you need to set frequency and all datas for the url
$map->add_item($val->url, 'daily', 1, $val->lastmodify);
//$map->add_item($val->url, 'weekly', 0.6, $val->lastmodify);
//$map->add_item($val->url, 'monthly', 0.8, $val->lastmodify);
}
// Create sitemap
if (!$map->create()) {
trigger_error('Can create the sitemap !!', E_USER_WARNING);
}
// Print the log for this sitemap
echo $map->get_logDatas();
// Destroy the class
$map->__destruct();
?>
download
Size: 8.78 KB
Hits : 10

Share and Enjoy:
  • Facebook
  • del.icio.us
  • Twitter
  • Google Bookmarks
  • Digg
  • Technorati
  • MySpace
  • Live
  • BlinkList
  • Add to favorites
  • email
  • RSS
  • Mixx
  • Bitacoras.com
  • blogmarks
  • Blogosphere News
  • Blogplay
  • connotea
  • Current
  • Diggita
  • Diigo
  • DZone
  • eKudos
  • Internetmedia
  • LinkedIn
  • MSN Reporter
  • Reddit
  • Scoopeo
  • Segnalo
  • Slashdot
  • Socialogs
  • Sphinn
Written by Davide in: Library, php | Tags: , ,
Oct
13
2008
0

Cat Rss

Class Cat Rss

Simple class for print rss file.

Click HERE for see the code of this class

< ?php
// Include the library
include('cat-rss.inc.php');

// Inizialize the class
$rss = new Cat_Rss('Feed Title', 'feedPath' , 'feed desc, array('language'=>'en_EN'));

// Check if there is a logo feed
if (file_exists('rss-logo.jpg')) {
// Add feed image
$rss->add_image('feed title', 'rss-logo.jpg', 'http://url-file-feed');
}

$rss->add_article('title news', 'http://link-to-the-news', 'text of the news ...', 'lastmodify-date', array('guid'=>'http://link-to-permanent-link'));
$rss->add_article('title news', 'http://link-to-the-news', 'text of the news ...', 'lastmodify-date', array('guid'=>'http://link-to-permanent-link'));
$rss->add_article('title news', 'http://link-to-the-news', 'text of the news ...', 'lastmodify-date', array('guid'=>'http://link-to-permanent-link'));

// Take the xml file
$fileXml = $rss->get_rss();

// set header
header("Content-type: application/xml");

// Print rss
echo $fileXml;

$rss->__destruct();
?>
download
Size: 2.37 KB
Hits : 7

Share and Enjoy:
  • Facebook
  • del.icio.us
  • Twitter
  • Google Bookmarks
  • Digg
  • Technorati
  • MySpace
  • Live
  • BlinkList
  • Add to favorites
  • email
  • RSS
  • Mixx
  • Bitacoras.com
  • blogmarks
  • Blogosphere News
  • Blogplay
  • connotea
  • Current
  • Diggita
  • Diigo
  • DZone
  • eKudos
  • Internetmedia
  • LinkedIn
  • MSN Reporter
  • Reddit
  • Scoopeo
  • Segnalo
  • Slashdot
  • Socialogs
  • Sphinn
Written by Davide in: Library, php | Tags: , ,

Theme: TheBuckmaker.com Magazine Style Templates