Counting Tags. What is the find() syntax?

2009-01-17 Thread RichardAtHome
Given the following Model relations: article -- HABTM (articles_tags) -- tag How do I fetch back a list of Tags with the count of associated Articles? I've tried (in the Tag Model): $data = $this-find(all, array( fields=array(

Re: Counting Tags. What is the find() syntax?

2009-01-17 Thread Miles J
Put it in the finderQuery of your association in the model. --~--~-~--~~~---~--~~ 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

Re: Counting Tags. What is the find() syntax?

2009-01-17 Thread Amit Badkas
For our photoblog, at http://cheesecake-photoblog.org/demo/tags/, we use something like following query SELECT tags.*, COUNT(photos_tags.tag_id) AS totalPhotos FROM tags LEFT JOIN photos_tags ON tags.id = photos_tags.tag_id GROUP BY tags.id ORDER BY tags.tag ASC to generate tag cloud Hope this

Form intermediate confirmation step in Modalbox

2009-01-17 Thread Jakob Malm
Hi. I have an order form and would like to show a summary in a Modalbox box with the options to cancel or confirm the order. Connecting the Modalbox to the onClick function of the form submit button (as below) does not seem to work, as it sends the user off to a new page instead of showing the

Re: Form intermediate confirmation step in Modalbox

2009-01-17 Thread WebbedIT
There is no 'label' parameter with a submit button, this needs to be changed to 'value'. Your 'onclick' parameter also needs a lot of extra information, the main part being 'return: false;' to stop the form from submitting in it's usual manner. Because you are submitting a form through ModalBox

Problems with requireAuth()

2009-01-17 Thread volka
Hi there, i have put a form in my index.ctp to perform a custom query in the index() action of my controller. It worked fine until I used 'Security'. So, I added beforeFilter() in my controller and defined $this-Security-requireAuth('add', 'edit', 'delete'); BUT, it still leads to a 404, when

Re: Form intermediate confirmation step in Modalbox

2009-01-17 Thread fly2279
Jakob: I am very interested in doing the same thing. Please let me know if you get it working. Mint.com has a really great interface for submitting and confirming forms. Does anyone know of a good tutorial that covers something like this? On Jan 17, 7:53 am, WebbedIT p...@webbedit.co.uk wrote:

how to enable or disable buton

2009-01-17 Thread vikas
Hello all.. I am working on application in which i have to add functionality like attendance. there are two buttons 1. Mark In and 2. Mark Out Database has 'attendances' table. When user Marked In table get new entry. and when he mark out that entry is updated. So once user click Mark In

Associations on the Fly - Good or Bad?

2009-01-17 Thread Chad Casselman
Are there any known advantages or disadvantages of 1) doing all associations ONLY when needed and only the ones that are needed or 2) putting lots of associations in the models and trying to unbind / contain them out of the urls ? Just trying to find a consistent way to get the most out of the

Re: Installation on a shared server (Hostmysite.com)

2009-01-17 Thread Robert Curl
Ok, thanks for some direction stefano. I'll look into that. Cheers :) On Fri, Jan 16, 2009 at 10:18 PM, stefano ssalvat...@gmail.com wrote: maybe is the rewrite mod :P or the .htaccess On Fri, Jan 16, 2009 at 10:34 PM, PHPScriptKiddy curl.rob...@gmail.com wrote: Hi guys, I am new to

Re: Possible to change row results index to value of field?

2009-01-17 Thread WebbedIT
I expect you are approaching a problem from the wrong angle and there may be a better solution which could be offered if you tell us what it is you are trying to achieve. Can you explain why you would want to do this? What would you do with the result set after altering the top level key

Re: database.php file change to postgresql stops graphics

2009-01-17 Thread reidster
Here is the bottom part of my database.php file. I don't think it has a syntax error. class DATABASE_CONFIG { var $default = array( 'driver' = 'postgres', 'host' = 'localhost', 'login' = 'postgres', 'password' = 'postgres',

Re: how to enable or disable buton

2009-01-17 Thread WebbedIT
Are you using ajax calls or submitting and reloading the page each time a button is pressed? If using ajax calls then you need some javascript to disable/enable the relevant buttons, give them unique ids and call something like onclick=this.disabled=false; otherButtonId.disabled=true when a

CakePHP for commercial use

2009-01-17 Thread reidster
I'm wondering if many people use CakePHP for commercial use. I'm planning to start a business and I'd like to use CakePHP and PostgreSQL to support this business. However, it seems like it takes quite a while to get support when it's needed, even for basic needs. And, yes, I do check the

Re: getLastInsertId or something similar

2009-01-17 Thread WebbedIT
If Event belongsTo User then you need a user_id field in the Event table If you have a two part form which first creates an Event then creates a User after submitting the Event part of the form you could then pass $data['Event']['id'] to the User form (will be available after saving the Event

Re: CakePHP for commercial use

2009-01-17 Thread WebbedIT
I am looking to move to CakePHP as my commercial solution and I have shared the same concerns over my lengthy learning curve. I've submitted a lot of questions to this group and sometimes I have had to resubmit the same questions in various different ways to get an answer, but I accept that

Re: database.php file change to postgresql stops graphics

2009-01-17 Thread brian
You have an extra comma here: 'prefix' = '', I can't think of why this is happening, though. Weird On Sat, Jan 17, 2009 at 11:50 AM, reidster reidmckin...@gmail.com wrote: Here is the bottom part of my database.php file. I don't think it has a syntax error. class DATABASE_CONFIG {

AuthComponent usage

2009-01-17 Thread Robert
Hello, I wonder if it is possible to login a user automatically with Auth? Typically You allow anonymous access to some actions and require login for others. What if You want on session start to login user lets call him anonymous and later if user log in - change them with real credentials (I use

Re: Form intermediate confirmation step in Modalbox

2009-01-17 Thread Jakob Malm
Thanks WebbedIT! Your answer was almost perfect. For some reason, method: 'post' has to come before Form.serialize( 'FormID' ) in the list. Now I have /orders/ add showing in Modalbox. The code: ?php echo $form-create ( 'Order' ); ? Form items... ?php echo $form-end ( array(

Re: Form intermediate confirmation step in Modalbox

2009-01-17 Thread Jakob Malm
On 17 Jan, 20:45, Jakob Malm jakob.m...@gmail.com wrote: Thanks WebbedIT! Your answer was almost perfect. For some reason, method: 'post' has to come before Form.serialize( 'FormID' ) in the list. Now I have /orders/ By the way, I found out about the ordering on

Re: CakePHP for commercial use

2009-01-17 Thread reidster
Although I'd certainly like to get to the rapid part of cakePHP development, I'm not as concerned about the development time as I am concerned about production downtime. I do not have infrastructure to test code under load and for every possible query combination and software version combination

Re: CURRENT_TIMESTAMP being quoted in the created field when INSERT ing

2009-01-17 Thread Leandro Lucarella
On Jan 16, 6:20 pm, Leandro Lucarella llu...@gmail.com wrote: PS: I'm using 1.2.0.7962 final. If it's of any help, I've upgraded to 1.2.1.8004 and the problem remains... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Forms to create Users from another controller

2009-01-17 Thread WidePixels
Ok here is the dilema. I need to create 2 user forms basically the same, but they have different validations. The forms are identical only differance is the validation on the contractor checks the email field for free email accounts which are not allowed so i split the forms up into separate

Re: batch controller

2009-01-17 Thread asciimo
I'm not sure I understand fully, but it sounds like you want the controller to run automatically, without a request from a Web client? In that case, you should create a command-line script and call it with crond. Of course, you'll need command-line access to the server. Here's a discussion

RE: Associations on the Fly - Good or Bad?

2009-01-17 Thread websta*
Our standard practice for efficiency, consistency, and of course minimal extra code, is - to define all model associations in our model: You would soon get sick of binding them all on the fly, you could of course come up with a custom behavior or similar to do it in short hand via

Re: AuthComponent usage

2009-01-17 Thread Miles J
Store the data in a cookie, in this case Anonymous should be be a user in the system as well. Just use/look at the $this-Auth-login() method. Could probably do something with that. Also how would an anonymous login to another user account, if the system always logs him in as anonymous?

Re: CakePHP for commercial use

2009-01-17 Thread asciimo
Your concerns are legitimate for any open source software. Perhaps you can find a consultancy that can offer you support for more rigorous challenges. That way, you get the best of both worlds: free, friendly-licensed, extensible, community-supported software; and dependable experts who will

Re: CakePHP for commercial use

2009-01-17 Thread ache...@gmail.com
There is in fact such a group. I would say they are the last resort, white night, zombie hunting, bug assassins but they can and will do the job with perfection in mind. That of course is the CakeDC ( http://cakedc.com/ ). Team members: * Larry E. Master * Garrett J. Woodworth *

RE: CakePHP for commercial use

2009-01-17 Thread websta*
To me, at least, your asking a few questions here. I have personally used cake for commercial purposes for a couple of years now, and the company I currently develop for (with a number of large high traffic apps) are busy getting things switched over to cake. Cake offers such an awesome

Re: Associations on the Fly - Good or Bad?

2009-01-17 Thread Adam Royle
Personally I find it easier to define all associations and use Containable or recursive = -1 to define what data I get back. It's easier to understand for me and works fairly well, makes it quick to develop and easy to debug. The only potential downside is that every associated model is loaded,

Re: getLastInsertId or something similar

2009-01-17 Thread mike
The user does not already exist. The event is being created, then immediately after the user is being created. I forgot to mention, it occured to me to save the user first, then the event, but its just for this specific application we decided to do it this way. So how do I set the value of the

Re: AuthComponent usage

2009-01-17 Thread Robert
Also how would an anonymous login to another user account, if the system always logs him in as anonymous? After getting data from the login page I will change user data saved in session... I did thing like this in .net, I am not sure It is possible with cake Auth, but it is quite versatile :)

Re: CakePHP for commercial use

2009-01-17 Thread reidster
Thank you Paul, Andrew, and asciimo for your responses. Your opinions were very thoughtful and thorough and provided me with some good perspectives to think about as I weigh my options. Thanks again, Reid On Jan 17, 4:20 pm, websta* subscripti...@webprogression.co.nz wrote: To me, at least,

Re: (Bad) Tip: Checking HTTP Auth against your normal users table

2009-01-17 Thread Dardo Sordi Bogado
I think this is worth of become an bakery post... Regards, - Dardo. On Mon, Jan 12, 2009 at 2:19 PM, Martin Westin martin.westin...@gmail.com wrote: Hi all, It is not overtly documented but you can check your http authentication against your normal users table, just like Auth Component

Re: Confusion with $uniqueIds in dbo_source.php

2009-01-17 Thread Brenton B
After a bit of a hiatus, I'm back ... and very saddened to see this still isn't fixed ... seriously? Has no one else run into this?? On Nov 28 2008, 1:25 pm, Brenton B brenton.bar...@gmail.com wrote: Yup, and was met with a need test case reply ... which I understand is required ...

Re: Confusion with $uniqueIds in dbo_source.php

2009-01-17 Thread Miles J
All my rows are returned in a HABTM. Are you using the new version? --~--~-~--~~~---~--~~ 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

Re: Confusion with $uniqueIds in dbo_source.php

2009-01-17 Thread Nate
In my book, something needs to be broken before it should be fixed. ;-) In a default HABTM relationship, multiple records with the same foreign key pair are not allowed. Simple as that. If you want to do something custom, set 'unique' to false, and/or create a join model and set up your

Re: Finds: Contain vs. Unbind-on-the-fly

2009-01-17 Thread Brenton B
Anyone had any luck with these? There are still a ridiculous amount of large queries going on. On Nov 28 2008, 1:22 pm, Brenton B brenton.bar...@gmail.com wrote: Overall, looks like 'depth' and 'recursive' are conflicting and causing the extra queries. Anyone had the time to take look? When

Re: getLastInsertId or something similar

2009-01-17 Thread brian
You can't have an Event.user_id if there's no User. You're doing this backwards. On Sat, Jan 17, 2009 at 5:43 PM, mike mwu...@gmail.com wrote: The user does not already exist. The event is being created, then immediately after the user is being created. I forgot to mention, it occured to

Re: CakePHP for commercial use

2009-01-17 Thread keymaster
before I abandon this effort in favor of commercial software... What commercial software? As far as I know, in the php world at least, there are no commerical frameworks which come close to cake's features and tested reliability. --~--~-~--~~~---~--~~ You