Struggling with creating a function and search an array then outputting data based upon results...

2007-07-07 Thread Jim Newfer
I have been trying to figure this out for the past 2 hours and to no avail. :/ So any advice is GREATLY appreciated. Ok, I have an array that returns data like this (see array below) The array[0] contains all the votes for one story as well as information that pertains to that vote, and the array

Re: Corrupted Image [file stored in filesystem, thumbnail ok!]

2007-07-07 Thread phpjoy
i figured out it's either apache or cakephp.. so wanted to make sure it's not cake. i'll setup a DB on a linux machine in the next few days to test it out.. thanks On Jul 7, 2:18 am, Grant Cox <[EMAIL PROTECTED]> wrote: > Felix had a similar issue last year > > http://www.thinkingphp.org/2006/11

Can cakePHP wrangle multiple controllers on one page?

2007-07-07 Thread MrKrinkle
I'm looking for a framework that allows more than one controller to handle a single request, and transparently manages the variable namespaces for each of them. Here is an example of what I mean: An "index" type of page, such as this forum's index, has pagination at the bottom. What if you wanted

Re: Loop through records in Model and update records

2007-07-07 Thread Dave M.
thanks grant. i guess the findby name function doesn't work how i thought it did. i used findAll instead and, along with your suggestion for $this->id= $row['Modelname']['id'] everything seems to work well. updateAll() seems like an even better solution, but i can't seem to get it to work. i get a

SWFUpload with CakePHP 1.1.x

2007-07-07 Thread NicoE
Hello everybody. I am using SWFUpload with CakePHP (based on the article written by James Revillini) and I have some problems regarding session issues. After uploading a file, the current session gets deleted. I have already read some articles about this problem and found that CakePHP handles sess

cake, Ajax, and jquery

2007-07-07 Thread [EMAIL PROTECTED]
Hi, I'm trying to use cake with jquery, and I am wondering how to automatically render certain controller actions as empty, or without any layout, just html snippets, automatically. since jquery doesn't add the same header to its ajax calls as does prototype, is this possible? Or, do I just crea

UserDir Installation

2007-07-07 Thread Scott Sharkey
Hi All, I'm trying a "top-level" installation into an apache UserDir. I've read the documentation, which says to put a RewriteBase directive in the /~user/public_html/.htaccess file. This does not seem to be working for me. Here's what I know: 1) Mod_Rewrite is loaded and working fine on t

Re: $html->link return me absolute path NOT relative path ??

2007-07-07 Thread Alberto Lopez Rubio
I had the same problem, and same solution worked. This is one of the problems I'm having after changing server. Tha most strange for me now is that the directory index doesn't load automatically, I have to click on index.php to load the web, the problem is not the webserver because I've tested w

Re: Cakephp generates Wrong query in PHP4?

2007-07-07 Thread Samuel DeVore
I am fairly sure that in php 4 you have to do FindByUser_Id I know this used to be the case due to limitations in php 4 see https://trac.cakephp.org/ticket/1567 for a ticket on the manual for this. I hope that one of the Cake Devs can confirm or deny this Sam D On 7/7/07, M <[EMAIL PROTECTED]> w

Re: $ajax->submit drops its eventHandler(ajax update) if it's loaded through AJAX

2007-07-07 Thread Mickster
Well, let me answer my own question: I had evalScript:false in the Ajax Updater(!) (Thanks to AD7Six for pointing it out!) Cost me one day of troubleshooting - guess that's what you get for being stupid ;) To see it on the bright side - I'll never do that mistake again =) --~--~-~--~---

Re: how to cache all the view in call ?

2007-07-07 Thread wluigi
My first message was for asking. My last for explaining because nobody answer me before I solve it, and because it wasn t that easy. On 6 juil, 21:58, "Pablo Viojo" <[EMAIL PROTECTED]> wrote: > I don't understand...you're asking or trying to explain it? > > Using that piece of code, you can set

Re: ACL

2007-07-07 Thread Chris Hartjes
On 7/7/07, citrus <[EMAIL PROTECTED]> wrote: > > I'm not sure, but in my opinion, ACL in Cake 1.2 doesn't work > properly. > > Correct me if I'm wrong. I guess it's a matter of what you mean by it "doesn't work properly". What parts of it are you having difficulty with? -- Chris Hartjes Senior

Challenge for CakePHP gurus

2007-07-07 Thread clarkvr
I'm trying to do an system that show an movie for left side while on the right side I've pictures changing from time to time. My friend do an javascript program to do this and is working., however we need to convert this program to php. When my user make his presentation, he start to see the movie

Quick admin routes question

2007-07-07 Thread [EMAIL PROTECTED]
Hi, I need to route '/admin' to '/admin/photos/index' in my routes table. Is this possible? I'm using CakePHP admin routes. Router::connect('/admin', array('controller' => 'photos', 'action' => 'admin_index')); For me, it generates the 'Trying to access private method in class' error.

$ajax->submit drops its eventHandler(ajax update) if it's loaded through AJAX

2007-07-07 Thread Mickster
Hi there, I followed this tutorial http://demo.grahambird.co.uk/tasks by Graham Bird to do a task list. It has a text box and a submit button that updates a div. This is how the form is rendered: input('Task/title', array('id' => 'add_input')); print $ajax->submit('Add task', ar

Cakephp generates Wrong query in PHP4?

2007-07-07 Thread M
CakePHP version: : 1.1.15.5144. Hello, the Bankaccount model belongs to User model. Now, in BankaccountsController::view method I have this statement: $data = $this->Bankaccount->findByUserId( $user_id ); In PHP 5 it works fine. In PHP 4.4.7 it gives this error: Query: SELECT `Bankaccount`

Re: Most wanted features in a CakePHP IDE Plugin ?

2007-07-07 Thread Joshua Benner
I would find an well-made integrated API reference with automatic syntax cues useful. You don't always remember the order of the arguments or the exact name of the obscure class variable you rarely use. The current API docs fill that need, but having them in the IDE could speed things up and a

Re: Binding my assocation on the fly to sort through a HABTM relationship...

2007-07-07 Thread inVINCable
Heh, yeah I fixed it, still no dice :( No Story.tag_id field On Jul 7, 11:12 am, Tim Koschuetzki <[EMAIL PROTECTED]> wrote: > Typo in the last line of the binding operation: > > 'cinditions' > > ; ] > > On 7 Jul., 19:58, inVINCable <[EMAIL PROTECTED]> wrote: > > > francky06I, > > > I think a pro

Re: Binding my assocation on the fly to sort through a HABTM relationship...

2007-07-07 Thread inVINCable
P.S. franckyl, You were right, it does not work because there is no tag_id field in my story table. On Jul 7, 10:58 am, inVINCable <[EMAIL PROTECTED]> wrote: > francky06I, > > I think a problem would occur because the variable depending on what > school_id is in their session, so if I put that i

Re: Binding my assocation on the fly to sort through a HABTM relationship...

2007-07-07 Thread Tim Koschuetzki
Typo in the last line of the binding operation: 'cinditions' ; ] On 7 Jul., 19:58, inVINCable <[EMAIL PROTECTED]> wrote: > francky06I, > > I think a problem would occur because the variable depending on what > school_id is in their session, so if I put that in the finderQuery, > would that work

Re: Binding my assocation on the fly to sort through a HABTM relationship...

2007-07-07 Thread inVINCable
francky06I, I think a problem would occur because the variable depending on what school_id is in their session, so if I put that in the finderQuery, would that work? It return results based upon their school only ? I was thinking about 'finderQuery' => 'where school_id = $session- >read(User.scho

Re: Binding my assocation on the fly to sort through a HABTM relationship...

2007-07-07 Thread francky06l
I guess the hasOne relation does not work because you do not have a tag_id in your story table. The "link" can't be done at this level. You could use the finderQuery parameter, maybe into the HABTM association. This thread is very helpfull for the syntax of the finderQuery : http://groups.google.

Binding my assocation on the fly to sort through a HABTM relationship...

2007-07-07 Thread inVINCable
Hi guys, Alright, this problem has troubled me for the past four hours so I have to resort to the group : \ Ok, I have a HABTM between stories, tags, and my join table is stories_tags. I have my search function set up very simply like this in my tag controller function search($tag) { $this->St

Most wanted features in a CakePHP IDE Plugin ?

2007-07-07 Thread Gustavo Carreno
I'm a long time user of PHPEdit, so this last week I was thinking about getting my hands dirty and cough up a CakePHP IDE plugin to ease up my Cake Baking. I had a chat with Sébastien, the CEO at Waterproof.fr and long friend since version 0.6/0.8 of PHPEdit and he made me realize one thing: - May

Re: Fatal error: Class 'Trace' not found

2007-07-07 Thread citrus
Use $this->Trace->save() instead. On Jul 7, 10:31 pm, M <[EMAIL PROTECTED]> wrote: > hello, > > I have this call in the model shop.php: > > var $uses = array ('User', 'Item', 'Trace' ); > ... > $trace = new Trace(); > $trace->save( $userdata['User']['id'], 'user bought a ' . > $i

Re: ACL

2007-07-07 Thread citrus
I'm not sure, but in my opinion, ACL in Cake 1.2 doesn't work properly. Correct me if I'm wrong. On Jul 7, 9:18 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On 7/7/07, sTb <[EMAIL PROTECTED]> wrote: > > > > > It seems that cake isnt inserting the stuff in the database. > > There are two grea

Re: Edit Functionality

2007-07-07 Thread Daniel Dias
Yeah yeah sure, to clarify what I'm doing is displaying only a summary > of the users > data to them for editing. So, why not do something like this? $this->data = $this->User->findByEmail('[EMAIL PROTECTED]', array('id', 'field1', 'field2')); //to get only the fields you want to display to use

Fatal error: Class 'Trace' not found

2007-07-07 Thread M
hello, I have this call in the model shop.php: var $uses = array ('User', 'Item', 'Trace' ); ... $trace = new Trace(); $trace->save( $userdata['User']['id'], 'user bought a ' . $itemdata['Item']['name'] . ' for ' . $price . ' credits from shop ' . $shopd

Re: ACL

2007-07-07 Thread Chris Hartjes
On 7/7/07, sTb <[EMAIL PROTECTED]> wrote: > > It seems that cake isnt inserting the stuff in the database. There are two great tutorials on using ACL http://bakery.cakephp.org/articles/view/real-world-access-control and one by AcidMax from the IRC channels that he sent to me but I can't find th

Re: Edit Functionality

2007-07-07 Thread francky06l
Ok, but why to create a new User if you want to update and existing one ? Maybe I do not catch really what you want to do, but if you edit only some fields of data and submit form for update, why the overhead of create new user etc Do not get me wrong, surely you have a good reason that I do

ACL

2007-07-07 Thread sTb
hi dudes, ive followed the ACL manuall 1 by 1, inserted db tables ect done $aro = new Aro(); $aro->create... like the manuall BUT its not creating users in the database! No error, no mysql db insert on mysql debug log... nothing... but if i do debug($aro)... it shows the hole class with vars

Re: Edit Functionality

2007-07-07 Thread Daniel Dias
You can try to refine your initial query by using the $fields argument of the find method. Then the database will return only the fields you really want to manipulate. Hope this helps. -- Daniel Dias --~--~-~--~~~---~--~~ You received this message because you are

Re: Edit Functionality

2007-07-07 Thread citrus
To save a single field, use $this->User->saveField($name, $value, $validate) To save more than one field but not all, specify them in your $fieldList array: $this->User->save($data, $validate, $fieldList) Cake API is your best friend ;) http://api.cakephp.org/1.2/class_model.html#ba917bb43f3eef

Re: using Scaffold

2007-07-07 Thread Daniel Dias
> > Is there anyway to preserver the form generated by scaffold and then > modify > only the 2-3 field that i need to customize ? Check the manual http://manual.cakephp.org/chapter/scaffolding -- Daniel Dias --~--~-~--~~~---~--~~ You received this message becaus

Re: using Scaffold

2007-07-07 Thread citrus
As far as I know, scaffold isn't for customization. If you want to format the form to meet your need, go ahead and create your own view. On Jul 7, 3:41 pm, salahuddin66 <[EMAIL PROTECTED]> wrote: > hello there, > > I am new to cakephp still learning. > > Scaffold create Form from my database, it

Re: Edit Functionality

2007-07-07 Thread [EMAIL PROTECTED]
Yeah yeah sure, to clarify what I'm doing is displaying only a summary of the users data to them for editing. I guess the flow of things is: Take the edited data out of this->data Stuff the data into a new User object (making sure I include the ID to perform an update rather than a insert Call s

Re: using Scaffold

2007-07-07 Thread Chris Hartjes
On 7/7/07, salahuddin66 <[EMAIL PROTECTED]> wrote: > > hello there, > > I am new to cakephp still learning. > > Scaffold create Form from my database, it was cool. > > But I need to change hardly 2-3 field out of 20+ form field . > > Is there anyway to preserver the form generated by scaffold and

Re: cake 1.2 problems

2007-07-07 Thread Chris Hartjes
On 7/7/07, Andras Kende <[EMAIL PROTECTED]> wrote: > Problems: > > - IE7 worked fine with 1.1 , but with cake 1.2 pages not loading fully > in 50% of page loads. Firefox works fine There is nothing in CakePHP that makes it not work with IE7. Blaming Cake for what is obviously a code issue is the

Re: Convert json notation to javascript notation

2007-07-07 Thread Chris Hartjes
On 7/7/07, clarkvr <[EMAIL PROTECTED]> wrote: > > Hello everyBody!! > I don't know how to convert an json notation like this: > > $javascript->object($jssignsfiles,false, '', '', array()); > > with this output: > ["img/files/Slide1.GIF","img/files/Slide2.GIF","img/files/Slide4.GIF"] > > to > ("img

Re: Edit Functionality

2007-07-07 Thread francky06l
Yes a 3rd method that I forgot. By the way, I do not understand the purpose of editing a field and not saving it. The form can "display" only certain fields, as long as they are not "editable" they will not be posted. On Jul 7, 2:36 pm, "Gonzalo Servat" <[EMAIL PROTECTED]> wrote: > On 7/7/07, fra

Re: Edit Functionality

2007-07-07 Thread Gonzalo Servat
On 7/7/07, francky06l <[EMAIL PROTECTED]> wrote: > > > Actually only the fields that are in this->data will be saved. To > limit the update you have 2 ways : > > 1) if you do not need to show/edit certains fields in the form, just > read what you need for the form using an array of field names. > 2

Re: Edit Functionality

2007-07-07 Thread francky06l
Actually only the fields that are in this->data will be saved. To limit the update you have 2 ways : 1) if you do not need to show/edit certains fields in the form, just read what you need for the form using an array of field names. 2) before saving the data, use unset($this->data['Model']['field

Re: mod_rewrite problem

2007-07-07 Thread Dia
ok, dun take care it's now ok dunno exactly why just downloaded cake again and it worked --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroup

mod_rewrite problem

2007-07-07 Thread Dia
hi I use Ubuntu 7.04 + Apache 2 when I install CakePHP, the CSS is not applied I installed mod_rewrite, it is now listed in the phpinfo page then I put AllowOverride to "all" for finally I restarted Apache but nothing to do... 1 hour I read tutorials on Internet and find nothing help please

Re: Deep associations (hasMany)

2007-07-07 Thread rikdc
Must have missed that one - cheers for the pointer! -R On Jul 7, 11:29 am, Felix Geisendörfer <[EMAIL PROTECTED]> wrote: > > I have this relationship: Project -> Customer -> Address. > > > When I do a read() on the project and it pulls out the customer > > details, I would like it to load the Add

Re: Deep associations (hasMany)

2007-07-07 Thread Felix Geisendörfer
> > I have this relationship: Project -> Customer -> Address. > > When I do a read() on the project and it pulls out the customer > details, I would like it to load the Address details as well. Is this > possible at all with the CakeAPI? This is a friendly RTFM reminder: http://manual.cakephp.org/

Re: Condition not applied to select drop down box in belongsTo association

2007-07-07 Thread michaelmcandrew
Answer: You can't change the drop down with scaffolding. "It uses generateList to get the listing - so there is no way with scaffoling - to tell it to exclude the current item." said ChrisPartridge on IRC. You can apply some extra validation to the model with function beforeValidate() { if($thi

customize scaffold

2007-07-07 Thread salahuddin pasha (salahuddin66)
hello there, I am new to cakephp still learning. Scaffold create Form from my database, it was cool. But I need to change hardly 2-3 field out of 20 form field . Is there anyway to preserver the form generated by scaffold and modify only the 2-3 field that i need to customize ? -- --salahud

cake 1.2 problems

2007-07-07 Thread Andras Kende
Hello, I started using experiencing with cake, so far I have a great using var $scaffold; Problems: - IE7 worked fine with 1.1 , but with cake 1.2 pages not loading fully in 50% of page loads. Firefox works fine - enum 'male','female' worked as a dropdown in 1.1 but in 1.2 creates a text

Deep associations (hasMany)

2007-07-07 Thread rikdc
Hello, I have this relationship: Project -> Customer -> Address. When I do a read() on the project and it pulls out the customer details, I would like it to load the Address details as well. Is this possible at all with the CakeAPI? Many thanks, Richard --~--~-~--~~~--

Edit Functionality

2007-07-07 Thread Jonathan Holloway
Hi all, This is probably a very basic question but I'm retrieving a user from a database using the following: $user = $this->User->findByEmail($email); Then setting a subset of the users details in the update my details form: $this->data = $user; When this form is resubmitted with the updated

using Scaffold

2007-07-07 Thread salahuddin66
hello there, I am new to cakephp still learning. Scaffold create Form from my database, it was cool. But I need to change hardly 2-3 field out of 20+ form field . Is there anyway to preserver the form generated by scaffold and then modify only the 2-3 field that i need to customize ? --~--~-

Re: DB Schema Help

2007-07-07 Thread Geoff Ford
With a table homes_images id home_id image_id ordering An image can be assigned to many houses but each house will have an independent ordering. You will have to look into the hasMany, it has an order option but I'm not positive on how to use it, maybe someone else can give you a pointer on tha

Convert json notation to javascript notation

2007-07-07 Thread clarkvr
Hello everyBody!! I don't know how to convert an json notation like this: $javascript->object($jssignsfiles,false, '', '', array()); with this output: ["img/files/Slide1.GIF","img/files/Slide2.GIF","img/files/Slide4.GIF"] to ("img/files/Slide1.GIF","img/files/Slide2.GIF","img/files/Slide4.GIF")