PHP

PHP, source code, scripts, developing, tips & hints

MySQL :: Setting Up the world Database

0

MySQL :: Setting Up the world Database – http://j.mp/hNqp1X

Haanga – über efficient template engine for PHP

0

Haanga – über efficient template engine for PHP – http://j.mp/e0Owc2

php-gettext Gettext emulation in P

0

php-gettext Gettext emulation in PHP http://j.mp/bx4YDJ

cool-php-captcha – Simple and cool CAPTCHA PHP implementation

1

cool-php-captcha – Simple and cool CAPTCHA PHP implementation – http://j.mp/g3bhqK

PHP wrapper class for cache engines

1

Make your life lot easier dealing with different cache engines by just using this PHP wrapper class. Perfect if you want to change the cache engine of your app almost without touching code ;)

Currently supports: fileCache, memcache, APC, Xcache and eaccelerator

Example:

//creating new instance singleton
$cache = wrapperCache::GetInstance('filecache',36,'cache/');//last 2 params are optional
//or set it in auto and the class will choose the cache engine for you ;)
$cache = wrapperCache::GetInstance('auto');
 
//caching values
$cache->thevar='I\'m the bar from wrapper cache using filecache ';//overload of set and get methods
//or:
$cache->cache('thevar','test values for the var!!!!');
 
//retrieving value for a key
echo $cache->thevar;//get
//or:
echo $cache->cache('thevar');//get
 
//isset and unset are overloaded
var_dump(isset($cache->thevar));
unset($cache->thevar);
 
//displays availables cache engines in your system:
echo $cache->getAvailableCache();
 
//flush all cache
$cache->clearCache();

(more…)

fileCache – Updated to v1.0

0

fileCache it’s been improved ;)

The latest version of the class chooses which is the best option of storage engine, based on the size of the variable. Then for example an entire page HTML will be in a single file, and a number or a person name would be in the APP cache.

Usage:

$cache = fileCache::GetInstance(30,'cache/');//creating new instance singleton
 
$cache->setDebug(true);//this runs the debug and in destruct prints it
 
//normal usage
$cache->cache('test','test values for the var!!!!');
echo $cache->cache('test');//get
 
//overloads
$cache->anyvar='tes asd asd aasdasdasda sada ast';//overload of set and get methods
echo $cache->anyvar;//get overload
var_dump(isset($cache->anyvar));//isset and unset are overloaded
unset($cache->anyvar);
 
//clear
$cache->deleteCache();//deletes all the cache
$cache->deleteCache(60);//deletes any cache older than X seconds

Download

Updated phpSEO class v0.2

0

Please update to this new improved file ;)

http://neo22s.com/phpseo/

See you in the PHP Barcelona Conference 2010

0

logo See you in the PHP Barcelona Conference 2010

“So much to learn, so much to discover. 29th-30th October 2010″

In just few weeks (actually 3) I will be in the PHP Barcelona Conference 2010. This year not as an Speaker since I didn’t have the time to prepare something good enough for this occasion. 2009 was great :D

I will be attending and my current company (privalia.com) is one of the sponsors of the event,  so if you see a big bald guy around privalia’s corner just say hi! is always nice to chat with people ;)

The hashtag for twitter will be #pbc10 use it!!

More info: (more…)

OC Mod: Advanced Spam by Country

0

This is the solution I use in classifiedsbarcelona.com to prevent Spam from India.

Usage:

Edit your commmon.php find the function isInSpamList

And replace the whole function with this code (there’s more than 1 function be aware)
(more…)

OC Mod: Ads only in child categories

4

Just a simple mod to allow publishing advertisement in child categories.

Edit the files:

/content/item-new.php
/content/item-manage.php

Search for:

$query="SELECT idCategory,name,(select name from ".TABLE_PREFIX."categories where idCategory=C.idCategoryParent) FROM ".TABLE_PREFIX."categories C order by idCategoryParent, `order`";

Replace in both files for:

$query="SELECT idCategory,name,(select name from ".TABLE_PREFIX."categories where idCategory=C.idCategoryParent) 
	FROM ".TABLE_PREFIX."categories C where C.idCategoryParent!=0 order by idCategoryParent, `order`";
Page 3 of 1012345...10...Last »
Go to Top