Re: Behaviors called for COUNT queries in RC3

2008-10-12 Thread Mathew
Looks like RC3 has added an empty array for the model when a COUNT is performed. before I would do this in my afterFind method. foreach( $results as &$record ) { if(isset($record['Portfolio'])) { $record['Portfolio']['long_title'] = $this- >getTitle( $record['Portfolio'] ); } } Now, I

Re: Behaviors called for COUNT queries in RC3

2008-10-12 Thread Mathew
Really. Sorry about that. I am now getting errors in all my behaviors when COUNT queries are called, because the structure of the array appears to have changed. Is that one of the changes in RC3? --~--~-~--~~~---~--~~ You received this message because you are su

Re: Yet another site powered by Cakephp

2008-10-12 Thread Mathew
Congrats on your new site. --~--~-~--~~~---~--~~ 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 group, send email to [EMAIL PROTECTED

Behaviors called for COUNT queries in RC3

2008-10-12 Thread Mathew
Behaviors are now called after each COUNT query. The "afterFind" method is called with data like this. Array ( [0] => Array ( [count] => 14 ) ) Should behaviors have a new method called afterCount. How can you tell the difference between a COUNT query and a table that has a field call

Re: How to Create Subdomains on your localhost - host multiple projects at once

2008-10-10 Thread Mathew
I think I do this differently. I add the virtual server to Apache as so. ServerName www.yourdomain.local DocumentRoot "C:/work/project1/www" ServerName project2.yourdomain.local DocumentRoot "C:/work/project2/www" Then I add the line in my hosts file c:/windows/system32/dri

Re: Linking to non-admin action from admin-action

2008-10-10 Thread Mathew
$html->link('View User',array('admin'=>false,'controller'=>'users','action'=>'view','id' => $user['Users']['id'])); The prefix string needs a boolean value. If your prefix had been "chicken_add" then you would pass "chicken"=>false. I dislike Cake's implementation of the Router defaulting to the

Re: URL routing

2008-10-03 Thread Mathew Nik Foscarini
x27;=>'login')); - Original Message From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> To: CakePHP Sent: Friday, October 3, 2008 5:16:31 PM Subject: Re: URL routing Great, that helped a lot. A follow up issue I am having is what is the correct way to handle su

Re: Add user_id from session to db when adding a product

2008-10-03 Thread Mathew
>  if(isset($this->data['Product']['user_id'] = $user_id)) { >  if(isset($this->data['Product']['user_id'] = $this->Auth->user('id');) { if(($this->Auth->user('id') != null) && isset($this->data['Product'] ['user_id'])) { $this->data['Product']['user_id'] = $this->Auth->user('id'); } --~--~-

Re: Release: CakePHP RC3 - The RC of Triumph!

2008-10-03 Thread Mathew
Thanks so much for all the hard work guys! Special thanks to Mark Story, because bugs I reported were fixed the next day by him. He's so fast! Thanks for all the hard work Mark! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Googl

Re: Help setting custom validation counting rule

2008-10-03 Thread Mathew
$count = $this->find('count',array('conditions'=> $data,'recursive'=>-1)); should be $count = $this->find('count',array('conditions'=>array('state'=> $data),'recursive'=>-1)); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Add user_id from session to db when adding a product

2008-10-03 Thread Mathew
Assuming you want the currently logged in administrator. $this->data['Product']['user_id'] = $this->Auth->user('id'); Otherwise, you'll need a belongsTo association in your Product model, and allow scaffolding to show a user drop down list. --~--~-~--~~~---~--~~

Re: URL routing

2008-10-03 Thread Mathew
Router::connect('/users/:username', array('controller'=>'users','action'=>'index'),array('pass'=>array('username'))); This routes /users/bobcostas to the function index( $username ) method of the controller, with the username passed as a parameter. Router::connect('/users/:username/:action', arr

Re: This Router test fails when using named parameters.

2008-09-29 Thread Mathew
I've been debugging this code, and I'm confused as to how Routing is suppose to work with named parameters. In the Router.php file in the function mapRouteElements there is this logic. if (!strpos($route[0], '*') && (!empty($pass) || !empty($named))) { return false; } This will return false f

This Router test fails when using named parameters.

2008-09-28 Thread Mathew
I'm trying to create a custom route for my profiles controller located in plugin. I need to pass the username as a named parameter, but it doesn't seem to be working for me. Router::connectNamed(array('username')); Router::connect('/profiles/:username', array('plugin'=>'gems','controller'=>'gemsP

Re: How to validate password length

2008-09-28 Thread Mathew
Don't call your field "password" on the form, because the Auth component always hashs posted data that has the field name as "password". For my user registration I created two fields called "secret" and "confirmsecret", and I use this in the validate rules. It doesn't matter that the secret field

Re: A small plugin for PDT&CakePHP - Open Cake File

2008-05-23 Thread Mathew Nik Foscarini
Can this be installed into Zend Studio? - Original Message From: kiang <[EMAIL PROTECTED]> To: CakePHP Sent: Friday, May 23, 2008 12:05:59 PM Subject: A small plugin for PDT&CakePHP - Open Cake File http://sourceforge.net/projects/opencakefile/ http://opencakefile.sourceforge.net/ It

Re: Restricting Login Attempts with Auth Component

2008-05-22 Thread Mathew Nik Foscarini
Assuming that your blocking their IP, because you think a hacking attempt is taking place. Usually, hacking attempts are performed by robots, and it wouldn't be hard to have the robot retry every 5 minutes. I think storing the IP address in the session isn't useful. If they fail to login after

Re: Why CakePHP always uses var?

2008-05-22 Thread Mathew Nik Foscarini
Thanks for the tip! :) - Original Message From: keymaster <[EMAIL PROTECTED]> To: CakePHP Sent: Thursday, May 22, 2008 10:01:19 AM Subject: Re: Why CakePHP always uses var? For symptomatic relief in Zend Studio: - right click in the debug messages window, - choose: Debug Message Fil

Re: Using pagination with requestAction()

2008-05-21 Thread Mathew Nik Foscarini
Thanks, I think your right about the component being the way to go, but the manual doesn't give much information about creating components. How would I access the Document model from the component, and how would I pass the pagination data to the view from the component? Sorry if these are basi

Re: 1.2 auth missing controller/action/view - redirect to login

2008-05-16 Thread Mathew Nik Foscarini
The beforeFilter of AppController wasn't executed, because the class wasn't instantiated. It wasn't instantiated because the controller didn't exist. AppController is an abstract class that controllers extend. So if the framework doesn't find a controller, then a Not Found error is the correct r

Re: Custom tags no longer working in 1.2 Beta...has something changed?

2008-05-14 Thread Mathew Nik Foscarini
What are tags? and where can I find more info on this in the documentation? Is this a feature of views or controllers? - Original Message From: Action <[EMAIL PROTECTED]> To: CakePHP Sent: Wednesday, May 14, 2008 3:15:17 PM Subject: Re: Custom tags no longer working in 1.2 Beta...has s

Re: Including a menu on some pages but not all

2008-05-14 Thread Mathew Nik Foscarini
http://book.cakephp.org/view/94/views#elements-97 - Original Message From: benjam <[EMAIL PROTECTED]> To: CakePHP Sent: Wednesday, May 14, 2008 2:05:18 PM Subject: Re: Including a menu on some pages but not all Exactly what I was looking for. Thanks. On May 14, 11:56 am, Kyle Decot

Re: Reusable Elements

2008-05-13 Thread Mathew Nik Foscarini
A model will return false if there was an error, and an empty(false) returns true. If the model works, but finds no records, then I think it returns array('Photo'=>array()) which is not empty. - Original Message From: Kyle Decot <[EMAIL PROTECTED]> To: CakePHP Sent: Tuesday, May 13,

Re: Reusable Elements

2008-05-13 Thread Mathew Nik Foscarini
You should be separating the index action, and the requested action. try creating function getPhotos() { return $this->Photo->findAll(); } and calling that from your element. - Original Message From: Kyle Decot <[EMAIL PROTECTED]> To: CakePHP Sent: Tuesday, May 13, 2008 1:51:52 P

Re: Popup color picker.

2008-05-13 Thread Mathew Nik Foscarini
thanks, that was exactly what I needed. - Original Message From: Dan Bair <[EMAIL PROTECTED]> To: CakePHP Sent: Monday, May 12, 2008 5:16:42 PM Subject: Re: Popup color picker. Do you have a specific color picker in mind? There are plenty of good color pickers for JQuery and Prototype

Re: include CSS and Javascript into layout 'on demand'

2008-05-12 Thread Mathew Nik Foscarini
I do this by rendering my HTML header with an element, and then passing it parameters from the controller. - Original Message From: MarcS <[EMAIL PROTECTED]> To: CakePHP Sent: Monday, May 12, 2008 3:45:23 PM Subject: include CSS and Javascript into layout 'on demand' Is it possible t

Re: Fatal Error when using $form

2008-05-12 Thread Mathew Nik Foscarini
var $helpers = array('Form'); put that in your controller. - Original Message From: jaredonline <[EMAIL PROTECTED]> To: CakePHP Sent: Monday, May 12, 2008 1:52:12 PM Subject: Fatal Error when using $form Controller: View: Please Login create('User', array('action' => 'login')); ?>

Re: Cookbook overhaul proposal

2008-05-12 Thread Mathew Nik Foscarini
While this subject is open. I would like to be able to download the manual, and read it offline. I find the Cake website feeds out pages from the manual very slowly. - Original Message From: Esoteric <[EMAIL PROTECTED]> To: CakePHP Sent: Monday, May 12, 2008 1:48:19 PM Subject: Re: Co

Re: Advanced web routing for webservices

2008-05-12 Thread Mathew Nik Foscarini
For cake 1.1.19.x In your /app/config/routes.php file add the following. $Route->connect('/sitemap.xml', array('controller'=>'xml','action'=>'sitemaps','sitemap') ); - Original Message From: deeps <[EMAIL PROTECTED]> To: CakePHP Sent: Monday, May 12, 2008 1:14:00 PM Subject: Advanced

Re: This is more of a general application design question than a CakePHP question...

2008-05-12 Thread Mathew Nik Foscarini
output, if its cli then its being invoked by the cron job since you would use php cli to invoke console jobs. place a check at the start of the controller if (php_sapi_name() == "cli") { // proceed } Thanks. On Mon, May 12, 2008 at 9:18 PM, Mathew Nik Foscarini <[EMAIL PROTECTED]>

Re: This is more of a general application design question than a CakePHP question...

2008-05-12 Thread Mathew Nik Foscarini
Well, wouldn't the remote address have the same IP address as the server? Then again, I can't remember if $_SERVER is defined when running from the command line? if( $_SERVER['SERVER_ADDR'] === $_SERVER['REMOTE_ADDR']) { // the client has the same IP as the server. } Another approach would

Re: Somebody konw any library for receive html code and generate document pdf?

2008-05-12 Thread Mathew Nik Foscarini
http://framework.zend.com/manual/en/zend.pdf.html - Original Message From: Dr. Tarique Sani <[EMAIL PROTECTED]> To: cake-php@googlegroups.com Sent: Monday, May 12, 2008 11:13:21 AM Subject: Re: Somebody konw any library for receive html code and generate document pdf? try html2fpdf T

Re: Sending POST to Cake website via PHP

2008-05-10 Thread Mathew Nik Foscarini
$data .="--$boundary--\r\n"; $header .= "Content-length: " . strlen($data) . "\r\n\r\n"; // Open the connection $fp = fsockopen($remote_server, 80); // then just fputs($fp, $header.$data); fclose($fp); ?&g

Re: Sending POST to Cake website via PHP

2008-05-10 Thread Mathew Nik Foscarini
Thanks, I didn't know wget could do HTTP POST operations. - Original Message From: Marcin Domanski <[EMAIL PROTECTED]> To: cake-php@googlegroups.com Sent: Saturday, May 10, 2008 12:56:28 PM Subject: Re: Sending POST to Cake website via PHP Look at wget[1] /curl (its supported in all ma

Re: Problems with open_basedir

2008-05-10 Thread Mathew Nik Foscarini
Did you define your absolute paths using your /home/username account for your web server? Mine are setup something like this. define('ROOT','/home/username/public_html'); define('APP_DIR','../../folder/cake_1_2.app'); define('CAKE_CORE_INCLUDE_PATH', '/home/username/folder/cake_1.2.0'); When yo

Re: Find Parent By Child

2008-05-09 Thread Mathew Nik Foscarini
Hi, Your very close. You have everything setup correctly, but your trying to find the project the wrong way. $this->Project->findall(array('Task.id' => 1)); A project has many tasks, but a task belongs to just one project and just one user. So, if you have the task.id and you need the project

Re: Integrating Zoom Search Engine into CakePHP

2008-05-09 Thread Mathew Nik Foscarini
Have you looked at the PHP port of Apache Lucene from Zend. http://bakery.cakephp.org/articles/view/integrating-zend-framework-lucene-with-your-cake-application http://framework.zend.com/manual/en/zend.search.lucene.html http://lucene.apache.org/java/docs/index.html - Original Message

Re: Migration from Version 1.1.19.6305 to 1.2

2008-05-09 Thread Mathew Nik Foscarini
I switch a site from 1.1.19 to 1.2 a month ago. Mind you, it was still in development and not that big. I had to modify the database description, the core parameters, and the caching has changed. Other then that. I didn't have to much of a problem. Give it a try in a safe sandbox area of your s

Re: Getting Cake build version?

2008-05-09 Thread Mathew Nik Foscarini
Thanks guys, Yes, I keep my core separated from my app. I keep everything in my own SVN repository, but it's been a while since I updated my build of Cake 1.2. - Original Message From: Sliv (Tim MacAleese) <[EMAIL PROTECTED]> To: CakePHP Sent: Thursday, May 8, 2008 2:33:19 PM Subject

Getting Cake build version?

2008-05-08 Thread Mathew Nik Foscarini
I hope this isn't a stupid question, but how can I check what version of Cake 1.2. is installed? I also need to update my Cake 1.2 install with the latest version. When copying files over top my existing install which files should not get modified? are there any I should worry about, or is

Re: What kind of authentication script?, tutorial? do you use?

2008-05-08 Thread Mathew Nik Foscarini
I'm switching from the default auth component to the DarthAuth component. Looks like it has everything you could need without the overhead of ACLs. - Original Message From: Louie Miranda <[EMAIL PROTECTED]> To: cake-php@googlegroups.com Sent: Thursday, May 8, 2008 1:28:19 PM Subject: Wh

<    1   2