39 Comments

simpletrading999
very good website: === http://www.simpletrading.org/ The website wholesale for many kinds of fashion shoes, like the nike, jordan, prada, also including the jeans, shirts, bags, hat and the decorations. All the products are free shipping, and the the price is competitive, and also can accept the paypal payment., After the payment, can ship within short time. We will give you a discount WE ACCEPT PYAPAL PAYMENT YOU MUST NOT MISS IT!!!
gaga66
Hello,everybody,the good shopping place,the new season approaching, click in. Let's facelift bar! ====== http://www.clothes6.org ======= Air jordan(1-24)shoes $33 UGG BOOT $50 Nike shox(R4,NZ,OZ,TL1,TL2,TL3) $33 Handbags(Coach lv fendi d&g) $33 Tshirts (Polo ,ed hardy,lacoste) $16 Jean(True Religion,ed hardy,coogi) $30 Sunglasses(Oakey,coach,gucci,Armaini) $12 New era cap $9 Bikini (Ed hardy,polo) $18 FREE SHIPPING ========= http://www.clothes6.org ==========
gaga66
Hello,everybody,the good shopping place,the new season approaching, click in. Let's facelift bar! ====== http://www.clothes6.org ======= Air jordan(1-24)shoes $33 UGG BOOT $50 Nike shox(R4,NZ,OZ,TL1,TL2,TL3) $33 Handbags(Coach lv fendi d&g) $33 Tshirts (Polo ,ed hardy,lacoste) $16 Jean(True Religion,ed hardy,coogi) $30 Sunglasses(Oakey,coach,gucci,Armaini) $12 New era cap $9 Bikini (Ed hardy,polo) $18 FREE SHIPPING ========= http://www.clothes6.org ==========
gaga66
Wonderful.website with you , http://www.clothes6.org Believe you will love it
hasnolm
Nice.But, why the images cannnot display using firefox? There is no problem in IE and chrome.
nepalipunk
To:-webdesignbarrie Mainly password is encrypted using MD5 which is widely used cryptographic hash function. If you are using MYSQL, Change the password and select MD5 in function. Then you will be able to login with your password. Hope this helps. -zing(nepalontheweb.com)
FirthyInc
Hey there, really great tutorial. I have a quick question though if you don't mind. I integrated this into an application that I am making to learn a bit more about CakePHP. Everything is working fine apart from one thing. When I try to upload a picture of my own, it comes up with this warning: Warning (2): shell_exec() has been disabled for security reasons [APP/vendors/phpThumb/phpthumb.functions.php, line 474] Do you have any idea why this might be? Have I forgotten to add something from your example in to my application?
SkysTheLimit81
very nice tutorial and it works great. but i have a little question. is it possible to create the galery_name as folder too. so when i upload an image and select the Galery “Example”, the folder “Example” doesn´t exists, the model creates the directory and upload the images to this ? nice grretings
lucianobargmann
Nice tut. Just what I was looking for - allow users to upload their profile pictures and crop/adjust the image to a square. On a side note, Meio is the portuguese word for "half" (site name can be translated to Half Code). You (should) pronounce Meio as "Mayo" :)
Dalia
Hi Jason thanx for the tutorial it is really good
hybmg57
This is great but how do you search and filter posts between two specified dates?
cpierce
$html-> should be changed to $this->Html-> per the 1.3 specifications.
waspinator
why does the sample app use public $actsAs = array( 'Search.Searchable'); instead of var $actsAs = array( 'Search.Searchable'); ? Also If I try to add Search.Searchable into my $actsAs I get an errorL The Behavior file c2a/models/behaviors/search.searchable.php can not be found or does not exist. I copied the 'search' plugin folder into my apps plugin directory. Is there something else that needs to be done?
aniljmk
what is default username and password to access admin ?
mag
how would I search if something is inside a certain radius? I mean location, I have stuffs with longitude and latitude, and I found this: SELECT ((ACOS(SIN($lat * PI() / 180) * SIN(lat * PI() / 180) + COS($lat * PI() / 180) * COS(lat * PI() / 180) * COS(($lon - lon) * PI() / 180)) * 180 / PI()) * 60 * 1.1515) AS distance FROM members HAVING distance<='10' ORDER BY distance ASC but how would I translate this sql to cakephp search dc plug in????
coventryLabs
As per usual I forgot to add the most important part:

This should be added in the model:

//enable date range searching.
public function makeRangeCondition($data, $field = null) {
if (is_array($data)) {
if (!empty($field['name'])) {
return array(date('Y-m-d H:i:s', strtotime($data[$field['name']].' 00:00:00')), date('Y-m-d H:i:s', strtotime($data[$field['name2']].' 23:59:59')));
} else {
$input = $data['range'];
}
}
}
coventryLabs
Update to my own post. I figured out how to use the search plugin search by a date range. I looked in the tests folder and found a pre-build makeRangeCondition method and modified it to my needs. Here is the example

Model:
public $filterArgs = array(
array('name' => 'first_name', 'type' => 'like', 'field' => 'Customer.first_name'),
array('name' => 'last_name', 'type' => 'like', 'field' => 'Customer.last_name'),
array('name' => 'application_num', 'type' => 'value', 'field' => 'Application.id'),
//enable date range searching.
array('name' => 'range_from', 'name2'=>'range_to', 'type' => 'expression', 'method' => 'makeRangeCondition', 'field' => 'Application.created BETWEEN ? AND ?'),
);

Controller:
public $presetVars = array( array('field' => 'first_name', 'type' => 'lookup', 'formField' => 'customer_input', 'modelField' => 'first_name', 'model' => 'Customer'),
array('field' => 'last_name', 'type' => 'lookup', 'formField' => 'customer_input', 'modelField' => 'last_name', 'model' => 'Customer'),
array('field' => 'id', 'type' => 'lookup', 'formField' => 'application_id', 'modelField' => 'id', 'model' => 'Application'),
array('field' => 'range_from', 'type' => 'lookup', 'formField' => 'range', 'modelField' => 'created', 'model' => 'Application'),
array('field' => 'range_to', 'type' => 'lookup', 'formField' => 'range', 'modelField' => 'created', 'model' => 'Application'),
);

View:
echo $this->Form->create('ApplicationsCustomer', array( 'url' => array_merge(array('action' => 'dealer_index'), $this->params['pass']) ));
echo $this->Form->input('first_name', array('div' => 'first_name'));
echo $this->Form->input('last_name', array('div' => 'first_name'));
echo $this->Form->input('application_num', array('div' => 'app_num', 'label'=>'ID'));
echo $datePicker->picker('range_from', array('div' => 'range_to', 'label'=>'To'));
echo $datePicker->picker('range_to', array('div' => 'range_to', 'label'=>'To'));
echo $this->Form->submit(__('Search', true), array('div' => 'search'));
echo $this->Form->end();

Feel free to contact us with questions.

CoventryLabs[dot]com
coventryLabs
Sorry the previous post was supposed to have a message and be spaced
I apologize to everyone who has to try to read that gibberish.
I am trying to use the Search plugin to query by a date range using the created field from my model. Wondering if you have been able to use the expression type to get something similar. Any help is appreciated

Model:
public $filterArgs = array(
array('name' => 'first_name', 'type' => 'like', 'field' => 'Customer.first_name'),
array('name' => 'last_name', 'type' => 'like', 'field' => 'Customer.last_name'),
array('name' => 'application_num', 'type' => 'value', 'field' => 'Application.id'),
array('name' => 'range', 'type' => 'expression', 'method' => 'makeRangeCondition', 'field' => 'Application.created BETWEEN ? AND ?'),
);
Controller:
public $presetVars = array(
array('field' => 'first_name', 'type' => 'lookup', 'formField' => 'customer_input', 'modelField' => 'first_name', 'model' => 'Customer'),
array('field' => 'last_name', 'type' => 'lookup', 'formField' => 'customer_input', 'modelField' => 'last_name', 'model' => 'Customer'),
array('field' => 'id', 'type' => 'lookup', 'formField' => 'application_id', 'modelField' => 'id', 'model' => 'Application'),
array('field' => 'range_from', 'type' => 'lookup', 'formField' => 'range_from', 'modelField' => 'created', 'model' => 'Application'),
array('field' => 'range_to', 'type' => 'lookup', 'formField' => 'range_to', 'modelField' => 'created', 'model' => 'Application'),
); View:
echo $this->Form->input('range_from', array('div' => 'range_from', 'label'=>'From'));
echo $this->Form->input('range_to', array('div' => 'range_to', 'label'=>'To'));
Any help would be greatly appreciated.

JM
coventryLabs
Model: public $filterArgs = array( array('name' => 'first_name', 'type' => 'like', 'field' => 'Customer.first_name'), array('name' => 'last_name', 'type' => 'like', 'field' => 'Customer.last_name'), array('name' => 'application_num', 'type' => 'value', 'field' => 'Application.id'), array('name' => 'range', 'type' => 'expression', 'method' => 'makeRangeCondition', 'field' => 'Application.created BETWEEN ? AND ?'), ); Controller: public $presetVars = array( array('field' => 'first_name', 'type' => 'lookup', 'formField' => 'customer_input', 'modelField' => 'first_name', 'model' => 'Customer'), array('field' => 'last_name', 'type' => 'lookup', 'formField' => 'customer_input', 'modelField' => 'last_name', 'model' => 'Customer'), array('field' => 'id', 'type' => 'lookup', 'formField' => 'application_id', 'modelField' => 'id', 'model' => 'Application'), array('field' => 'range_from', 'type' => 'lookup', 'formField' => 'range_from', 'modelField' => 'created', 'model' => 'Application'), array('field' => 'range_to', 'type' => 'lookup', 'formField' => 'range_to', 'modelField' => 'created', 'model' => 'Application'), ); View: echo $this->Form->input('range_from', array('div' => 'range_from', 'label'=>'From')); echo $this->Form->input('range_to', array('div' => 'range_to', 'label'=>'To')); Any help would be greatly appreciated. JM
damanlovett
Jason, love the tutorial, but I'm getting a Query: parseCriteria error
Most Recent 12 View All Comments