Re: Dependent in Associations is not working.

2009-04-17 Thread kaushik
It is my code for deleting user : if ($this-User-del($id,true)) { $this-flash('The User with id: '.$id.' has been deleted.', '../ users'); } I think that it is enough for deleting cascade entries. But it is not working. What is the problem? On Apr 14, 3:35 pm, Braindead

Paginator sort() links not switching between asc and desc?

2009-04-17 Thread George H
Hi guys, I have a list of users displayed in my view in a table, and the resultset is parsed by Paginator. I am also echoing $paginator-sort () in my view. When I view the page the links work and they sort by the columns that I have specified in my code. But I thought that if I was to click on

Re: find('list'): Filtering by a related table's field

2009-04-17 Thread John Andersen
How is your PropertyImage model defined? Does it have a hasMany to the Property model? I am asking, because your fields definition does not contain the model name, and the conditions definition contains Property model name, not PropertyImage model name. John On Apr 17, 6:29 am, mattalexx

Re: Dependent in Associations is not working.

2009-04-17 Thread John Andersen
Your user model should define the hasMany relationship to Blog as: 'foreignKey' = 'userId', See definition of foreignKey at http://book.cakephp.org/view/78/Associations-Linking-Models-Together#hasMany-82 Enjoy, John On Apr 17, 9:35 am, kaushik kaushikwo...@gmail.com wrote:

CakePHP hacked many times

2009-04-17 Thread Kal
Hi CakePHP gurus, My name is Kal and our website developed over CakePHP is crashing partially every month. We are getting 404 errors on some of the pages and all thumbnails disapper too. The only way to fix it is to restore the backup. Any suggestions why this is happening? Regards Kal

Re: Access to sql queries?

2009-04-17 Thread Clemens
okay. i found out: i have three models (user, project and picture). the user_id is in the project model and the project_id is in the picture model with this relation: var $hasMany = array( 'Picture' = array( 'className' = 'Picture',

Overriding, extending and modifying FormHelper

2009-04-17 Thread Ernesto
Hello. $form-month() $form-day() both return a selectbox, populated with english names. Is there a way to override the functions, making them return ita names? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

find('list') mit COUNT kombinieren

2009-04-17 Thread Günther Theilen
Moin, ist es möglich find('list') mit COUNT zu kombinieren? Ich möchte eine Liste erhalten mit dem Wert eines Feldes als key und der Häufigkeit des Auftretens als value. Geht das mit cake-Bordmitteln? Oder muss ich das Ergebnis einer find('list')-Abfrage in php auswerten (zählen)? Danke und

Re: CakePHP hacked many times

2009-04-17 Thread dr. Hannibal Lecter
If we knew *anything* about your system, we might know what's wrong with it. Do you not have any log files? Do you sanitize your input (*everywhere*)? On Apr 17, 9:10 am, Kal kalpatt...@gmail.com wrote: Hi CakePHP gurus, My name is Kal and our website developed over CakePHP is crashing

Re: Paginator sort() links not switching between asc and desc?

2009-04-17 Thread dr. Hannibal Lecter
Yup... https://trac.cakephp.org/ticket/6218 On Apr 17, 8:38 am, George H acher...@gmail.com wrote: Hi guys, I have a list of users displayed in my view in a table, and the resultset is parsed by Paginator.  I am also echoing $paginator-sort () in my view. When I view the page the links

borrar lineas seleccionadas con checkbox marcado

2009-04-17 Thread kryska
Hola a todos! Tengo una vista index.ctp con el código: ?php foreach ($clientes as $cliente): echo $cliente['Cliente']['id']; echo $html-link('Editar',array('action'='editar','id'=$cliente ['Cliente']['id'])); echo

Re: Plugin architecture and plugin limitations

2009-04-17 Thread Grzegorz Pawlik
It's an idea that just came up. Probably You could set up some kind of PluginHandler, which will handle the plugins instalation process (which i describe below) and plugin interacting. Each plugin knows where it need to inject himself into (I'll just call it widgets for now). IE: - extend Dog

Re: Reserved words in CakePHP?

2009-04-17 Thread John Andersen
Class names could be defined not to conflict with possible object names, for example by always having class names prefixed with a T, TAppController, TController, TObject etc. Just a suggestion :) John On Apr 16, 4:52 pm, Grzegorz Pawlik grzegorzpaw...@gmail.com wrote: Additionally You rather

Re: find('list') mit COUNT kombinieren

2009-04-17 Thread Richard
Sehr geehrter Herren - Ich glaube sie können dies mit GROUP BY. Zum Beispiel: array('fields'=array('Product.type','MIN(Product.price) as price'), 'group' = 'Product.type'); http://book.cakephp.org/view/74/Complex-Find-Conditions Mit freundlich Gruessen Richard Dear Günther, I think you

Re: borrar lineas seleccionadas con checkbox marcado

2009-04-17 Thread John Andersen
Corrected as I see it :) On Apr 17, 11:10 am, kryska kryskasan...@gmail.com wrote: Hola a todos! Tengo una vista index.ctp con el código: ?php echo $form-create( 'Cliente', array( 'action' = 'borrarseleccionados' ) );     foreach ($clientes as $cliente):                  echo

Re: Getting 5 Related Books via multiple Genres (HABTM ) from within Book view() and without requestAction

2009-04-17 Thread Mike Cook
Okay, so I just couldn't leave this alone :) I implemented the following, which works and even brings in the 'contain' info. However there is still a small problem... // books_controller.php view() $similar = $this-Book-similar_books($genre_id, $limit); // model book.php $similarBooks =

Re: Overriding, extending and modifying FormHelper

2009-04-17 Thread John Andersen
Use L10N and set the language to italian, then ensure that your locale .po file has the italian names for the months: msgid January msgstr italian january here etc. The month name generation code automatically calls the global function __('month name her', true), before giving back the select

Re: Plugin architecture and plugin limitations

2009-04-17 Thread Richard
Hi all, How this would apply with the CakePHP framework I'm unsure, but I use interfaces extensively in modular platforms when defining classes. I've used CakePHP mainly as a presentation control layer, with the external work occuring in libraries. My CakePHP plugins provide an integration layer

Re: find('list') mit COUNT kombinieren

2009-04-17 Thread Günther Theilen
Hi Richard, I solved it already with adding array_count_values after the find(). Works just fine. Thanks anyway! (And sorry for the first post in German. It was a bit early...) Regards Guenther Richard wrote: Sehr geehrter Herren - Ich glaube sie können dies mit GROUP BY. Zum Beispiel:

Re: Login attempts limitation

2009-04-17 Thread John Andersen
Auth does not provide that facility! You have to do the counting yourself! But it would be better to inform the user by email, that a login has failed X times, so in the case that the failed attempts was not performed by the owner, the owner can take action (whatever that may be!). Enjoy, John

Re: Login attempts limitation

2009-04-17 Thread schneimi
Hi, maybe you can use this component: http://bakery.cakephp.org/articles/view/brute-force-protection Greets, Michael On 16 Apr., 13:39, ShyamT ghanshyamt...@gmail.com wrote: I want to give limitation for login attempt user authentication. Suppose user fail to login in continuous 3 attempts,

Re: Contain and extra sql queries

2009-04-17 Thread gonzalobourdieu
Or do it the cakephp way... http://bakery.cakephp.org/articles/view/quick-tip-doing-ad-hoc-joins-in-model-find On 14 abr, 17:23, Miles J mileswjohn...@gmail.com wrote: I mean, you cant ALWAYS use joins to get all data with 1 query. CakePHP is limited in that use. Else do it yourself and

Reverse routing question

2009-04-17 Thread toby1kenobi
Hi there, Looking through various bits of information on reverse routing, particularly the manual and this great article: http://debuggable.com/posts/new-router-goodies:480f4dd6-4d40-4405-908d-4cd7cbdd56cb I think I'm more or less on top of things, but have one oddity. I have a route like

Doubt

2009-04-17 Thread Banu
I am having two models(Model,Vehicle) Each of the model having two table,(models,vehicles) Now my problem is that in my vehicles table I am having following field (model_id,Number,model_id) For inserting record to this i am using form with text box for number input and combo box for model which

doubt

2009-04-17 Thread Banu
Hai I want to validate the user input from the text box from the form to be not empty before saving it. I used the following codebut it is not working. This one is in models_controller function add() { if(!empty($this-data)) {

Re: borrar lineas seleccionadas con checkbox marcado

2009-04-17 Thread banu sundar
Thanks for ur answer On Fri, Apr 17, 2009 at 3:26 PM, John Andersen j.andersen...@gmail.comwrote: Corrected as I see it :) On Apr 17, 11:10 am, kryska kryskasan...@gmail.com wrote: Hola a todos! Tengo una vista index.ctp con el código: ?php echo $form-create( 'Cliente', array(

Re: find('list') mit COUNT kombinieren

2009-04-17 Thread banu sundar
Thanks for ur Answer On Fri, Apr 17, 2009 at 3:04 PM, Richard rclay...@gmail.com wrote: Sehr geehrter Herren - Ich glaube sie können dies mit GROUP BY. Zum Beispiel: array('fields'=array('Product.type','MIN(Product.price) as price'), 'group' = 'Product.type');

Re: Helper not being found

2009-04-17 Thread Ernie
Miles, Here is my helper class: class StateListHelper extends FormHelper { var $helpers = array('Form'); function select($fieldname, $label, $default= , $attributes = null) { $list = 'div class=input'; $list .= $this-Form-label($label); $list

Re: Helper not being found

2009-04-17 Thread Ernie
Miles, Here is my helper class state_list.php: class StateListHelper extends FormHelper { var $helpers = array('Form'); function select($fieldname, $label, $default= , $attributes = null) { $list = 'div class=input'; $list .= $this-Form-label($label); $list .=

Error

2009-04-17 Thread Banu
$this-Vehicle-saveField(array(fields=array (Number,model_id)),array($number,$id)) With this code i am having error as Illegal offset type [CORE\cake \libs\model\model.php, line 1079] My database field are Number(varchar(50)), model_id(int)

Re: CakePHP hacked many times

2009-04-17 Thread brian
Define hacked. On Fri, Apr 17, 2009 at 3:10 AM, Kal kalpatt...@gmail.com wrote: Hi CakePHP gurus, My name is Kal and our website developed over CakePHP is crashing partially every month. We are getting 404 errors on some of the pages and all thumbnails disapper too. The only way to fix

Re: input name data[_method]

2009-04-17 Thread Telegu
Nobody have ideas??? On Apr 16, 1:57 pm, Telegu carandent...@gmail.com wrote: i have a problem, when i generate my form if input name has more level example (data[i][Model1][j][Model2][Model3]) it becames _method, data[i][Model1][j][Model2] work when i add [model3] it does not work. can you

Simple acl tutorial (Class DATABASE_CONFIG) not found

2009-04-17 Thread albe
Hi, I'm trying to follow the Simple ACL tutorial but I've got a problem just after the database configuration with cake bake. The steps I take are the following: - I copy cake code in my htdocs directory - I create a database with the 4 table just as wrote on the first page of the tutorial - I

Layout inheritance, setting a layout for a layout

2009-04-17 Thread maxmil
I would like to be able to define a kind of inheritance model for my layouts. Thats to say be able to define a layout for a layout. Probably not very well explained, heres a concrete example. I have a generic layout for my application but in a group of pages i need to add a panel to this

Rendering content from layered queries in a view

2009-04-17 Thread patdoops
Hi All: I'm fairly new to cakePHP. Have been intently reading the cookbook and tech blogs to try to glean as much info as I can on my own. I have hit a bit of a snag with a particular scenario I'm dealing with, though, and cannot quite wrap my head around the concept of how I might accomplish

.htaccess on IIS7???

2009-04-17 Thread Future22
Hello Cake Community, I uploaded the latest version of CakePHP to my share hosting server on GoDaddy. The CakePHP default page appears but with no CSS styles. The page appears with a white background and black text. I loaded the same version on my mac (with MAMP) and the page appears with the

data keys for multiple uploads

2009-04-17 Thread brian
I'm trying to put together a multi-file upload thing and I'm wondering how the element names should be set up and how I should expect the array keys to come in. I plan to use the jquery-multifile-plugin [1] and it appears that I'll need to adjust it slightly to deal with Cake's input naming

Using UUID's

2009-04-17 Thread Dave Maharaj :: WidePixels.com
I have been reading about Cakes' Using UUIDs as Primary Keys and in my case I think it would be a much to get info from queries. But 2 questions. Would the tables now look similar to this? User Table: id char(36) Accociated Tables: user_id char(36)... (I know I had to ask...im new at this and

How to paginate ordered by condition Id ?

2009-04-17 Thread yodi
Hello all, I have some ranking system and got some id by rank (not in field but processed by script in controller) like this : array('4','2','3'); So, i want paginate this. $result = array('4','2','3'); $this-paginate = $this-Photo-paginateSearch();

Re: How to paginate ordered by condition Id ? (solved)

2009-04-17 Thread yodi
Sorry, finally i can solved this. This is my solution : function paginateSearch($id = array()){ $list = implode(,,$id); $order = 'FIELD(PhotoAlbum.photo_album_id, '.$list.')'; . . 'order' = $order } hope this help someone. On Sat, 2009-04-18 at 00:33 +0700, yodi wrote:

Solutions for i18n like CookBook

2009-04-17 Thread kicaj
Hi, I looking-for solution for i18n like as is wrote in book.cakephp.org The default language is english, but when You switch to other language, articles which are translated will be displayed. But when there is no translated article, then we show message like cookbook: There is no translation

Re: Internationalization in find results

2009-04-17 Thread Stu
Thanks Marcelo, I wasn't using the correct approach for this. Cheers --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from

Search and Paginate hasMany relationship

2009-04-17 Thread Chez17
I am trying to create a search function and paginate the results. For all the standard fields, this is an easy task. I have one situation that is causing me a ton of headaches and any help you can give is most appreciated. Here is the setup: Registrations - hasMany RegistrationCodes

Re: input name data[_method]

2009-04-17 Thread Miles J
Still confused on what your asking. Can we see your form code, and the debugged $this-data. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to

Re: Helper not being found

2009-04-17 Thread Miles J
Do not extend the FormHelper, it should extend the AppHelper. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this

optgroups and belongsto relations

2009-04-17 Thread fain182
hello, If i have 3 model: A belongs to B B blongs to C C has many B B has many A i want the in the add of A a select that looks like: add a new C C1(optgroup) add a new B in C1 B1 that belongs to C1 B2 that belongs to C1 B3 that belongs to C1 C2(optgroup) add a new B in C2

Re: CakePHP hacked many times

2009-04-17 Thread mark_story
I think its the flux capacitor. But like others have said more detail is needed. But in the mean time check the mr. fusion, and the flux capacitors, they can be an ornery pair. -Mark On Apr 17, 3:10 am, Kal kalpatt...@gmail.com wrote: Hi CakePHP gurus, My name is Kal and our website

Re: XML parsing

2009-04-17 Thread smithtrev...@googlemail.com
I had it on debug level 2, so I changed it to level 3 to see if I could find anything out. It produces this, which looks like it should save properly to me. My table has 3 fields, id, name and specialid. [useDbConfig] = default [useTable] = teams

Re: XML parsing

2009-04-17 Thread smithtrev...@googlemail.com
I had it on debug level 2, so I changed it to level 3 to see if I could find anything out. It produces this, which looks like it should save properly to me. My table has 3 fields, id, name and specialid. [useDbConfig] = default [useTable] = teams

Model::find('value')

2009-04-17 Thread mattalexx
Is there any way to recreate something like this? ?php $result = mysql_query('SELECT single_field FROM table WHERE id = 1 LIMIT 1'); $single_field_value_of_record_1 = mysql_result($result, 0, 'single_field'); ? --~--~-~--~~~---~--~~ You received this message

Re: find('list'): Filtering by a related table's field

2009-04-17 Thread mattalexx
?php class PropertyImage extends AppModel { var $belongsTo = array( 'Property' = array() ); } ? On Apr 17, 12:43 am, John Andersen j.andersen...@gmail.com wrote: How is your PropertyImage model defined? Does it have a hasMany to the Property model? I

Re: Model::find('value')

2009-04-17 Thread fain182
?php $result = mysql_query('SELECT single_field FROM table WHERE id = 1 LIMIT 1'); $single_field_value_of_record_1 = mysql_result($result, 0, 'single_field'); ? $single_field_value_of_record_1 = $this-find('first', array( 'conditions'=array( 'table.single_field'= 1) )); the trick is the

Re: find('list'): Filtering by a related table's field

2009-04-17 Thread fain182
PropertyImage hasOne Property. Why can't I do this: ?php // APP/controllers/properties_controllers.php $check_property_images = $this-PropertyImage-find('list', array(        'fields' = array('id'),        'conditions' = array(                array('Property.mls' = '80578'),            

Re: doubt

2009-04-17 Thread fain182
I used the following codebut it is not working. what is not working? saving? validation? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to

Re: Model::find('value')

2009-04-17 Thread mattalexx
That returns a record, not one string, right? On Apr 17, 3:38 pm, fain182 fain...@gmail.com wrote: ?php $result = mysql_query('SELECT single_field FROM table WHERE id = 1 LIMIT 1'); $single_field_value_of_record_1 = mysql_result($result, 0, 'single_field'); ?

Re: find('list'): Filtering by a related table's field

2009-04-17 Thread mattalexx
'all joins the other table and doesn't give me an error. 'list' on the other hand, does not join the table and therefore 'array ('Property.mls' = '80578'),' is not available. On Apr 17, 3:41 pm, fain182 fain...@gmail.com wrote: PropertyImage hasOne Property. Why can't I do this: ?php

Re: find('list'): Filtering by a related table's field

2009-04-17 Thread AD7six
On Apr 17, 11:49 pm, mattalexx mattal...@gmail.com wrote: 'all joins the other table and doesn't give me an error. 'list' on the other hand, does not join the table and therefore 'array ('Property.mls' = '80578'),' is not available. find('list') has a default recrusive value of -1 Please

User Validation is acting weird

2009-04-17 Thread christianstrang
Hello :) my user validation during signup is not working right: ?php class User extends AppModel { var $name = 'User'; var $validate = array( 'username' = array( 'notEmpty' = array( 'rule' =

Re: Search and Paginate hasMany relationship

2009-04-17 Thread yodi
You want to make search, it result code contain with registration and paginate right ? seems you must learn about containable behavior. In CodesController $codeId = $this-Codes-find('list',array('conditions'= array(MATCH(Code.name) AGAINST('$input' IN BOOLEAN MODE)),'fields'='Code.id'));

Re: Search and Paginate hasMany relationship

2009-04-17 Thread yodi
Oopss, i'm forgot Registration, here : function paginateSearch($id = array()) { $this-recursive = '0'; $result = array('fields'='Code.id,Code.name', 'contain' =array('RegistrationCodes'=array( 'fields'=array('RegistrationCodes.id, RegistrationCodes.code_id,

HttpSocket keeps hitting my server

2009-04-17 Thread Andrew Koebbe
So I'm trying to use httpsocket to grab some data on an external server, but when I put the uri (let's say 'google.com/search'), I keep get a response from my own server saying that the page has permanently moved to mydomain.com/search. I'm assuming this is something in my apache config, but I'm

Re: optgroups and belongsto relations

2009-04-17 Thread yodi
Have trying use cake bake scaffolding before? my advice, just trying use cake bake but define models first. then just bake controller scaffold and view. It's help you to make it select *a little* maybe it helps. *scaffold not good when using for production, but it great for testing or

Routes

2009-04-17 Thread Dave Maharaj :: WidePixels.com
Thanks to everyone who helped me with my routing question. 1 last thing. I have Router::connect('/agents/:agent_slug',array('controller' = 'agents', 'action' = 'profile'),array('agent_slug' = '[-_A-Za-z]+','pass' = array('agent_slug'))); so that gives me http:site/agents/slug but i have

Re: Routes

2009-04-17 Thread Miles J
Put Router::connect('/agents/register', array('controller' = 'agents', 'action' = 'register')); infront of the other routes. If its put after it, it wouldnt get called because the first route takes precedence. --~--~-~--~~~---~--~~ You received this message

RE: Routes

2009-04-17 Thread Dave Maharaj :: WidePixels.com
Thanks again, Long night. I had it above the rest as you mentioned...i was trying to access register when logged in and wondering why cant I get to the register pagebecause already registered redirect... :) Thanks, Dave -Original Message- From: Miles J

Need help fix this script counterCache HABTM

2009-04-17 Thread yodi
Hello all, i have 3 models = Photos,Tags and PhotosTag with relation like this : 1. Photo HasAndBelongsToMany Tag 2. Tag HasAndBelongsToMany Photo 3. Tag HasMany PhotosTag 4. PhotosTag belongsTo Tag. I want count how many photos use this tag, so on Tag table, i'm create photos_tag_count. On