Re: really wierd problem

2009-08-24 Thread Martin Westin
I'd say the problem is a grammatical one. (I'm one to talk!) One Post, Many Posts One Location, Many Locations One PieceOfInformation, Many PiecesOfInformation Information is an odd substantive. It does not really have singular or plural forms in the normal sense. At the top of the controller,

New to PHP

2009-08-24 Thread Rakesh P
Hi guys, Just struck up in the middle of php cross roads. I will list out my problem any help is much appreciated. Just recently I started learing php and designed a small dynamic website using php to keep in my resume with own guest book, admin privilages, normal users and a shopping cart etc.

Re: Howto sort forum threads?

2009-08-24 Thread Martin Westin
I have two ideas but I can't be sure which is the best for you. One way to go is to force joins (or possibly sub-selects) and sort on the modified field from the replies table. You wouldn't want to or need to get all the records just the "most recent" one. Another way to go is to try to make som

Re: sanitize and echoing in html

2009-08-24 Thread ezekfred
hi all, forget about it: On Aug 24, 10:18 am, ezekfred wrote: > > Vielen danke! > > > > I didn't knew this "nl2br"! > > > > here is my way to do (with sanitize...) > > > > > App::import('Sanitize'); > > > > class MyController extends AppController { > > function add() { > > if (!empty($this

Re: Possible, saving null with saveField?

2009-08-24 Thread Martin Westin
I forgot to reply earlier. Thanks, that worked great. On Aug 19, 11:02 am, viktor wrote: > you could try > Model->saveField('fieldName', 'NULL'); > > On Aug 18, 10:00 am, Martin Westin wrote: > > > > > Hi, > > I would prefer to be abel to use saveField for a simple ajax inline- > > edit funct

Re: One app & db, many domains - what is the right mix?

2009-08-24 Thread Martin Westin
No, that's not it. That article is about how I switch configs based on domain name. I remember another one where they had example.com/name/controller/ action but made it name.example.com/controller/action... pretty close to what you describe. (a few minutes later) I was close... they did some "c

Howto sort forum threads?

2009-08-24 Thread Braindead
I want to build a forum with CakePHP. The forum actually consists of many forums. Each forum hasMany threads. A thread hasMany replies. Forums, threads and replies are stored in separate tables. All assossiations are setup correctly. How can I sort threads and replies by date, so that the newest

Re: Class and Model Naming Problems (wave becomes wafe)

2009-08-24 Thread Vijay Pandey
Yes...thats trueIt is NOT a bug but a "cake convention"all plurals ending in "ves" are converted in "fe" to make singular. To instruct cake not to do that...just add the entri in $irregularPlurals at app/config/inflector.php as Marcelo says. Regards, Vijay On Aug 24, 10:48 pm, Nancy

How to make pure html graphs in cakephp

2009-08-24 Thread mona
I want functions that create pure html graphs. The functions should take an array as a parameter. The array will look like array('data' => array( array('label' => 'Nokia N95', 'number' => 95, 'axislabel' => ''), array('label' => 'Apple iPhone', 'number' => 120, 'axislabel' => 'iPhone')

Re: Edit function not working properly it always returns ID=(1)

2009-08-24 Thread Vijay Pandey
Hi, Thanks for response Status model has relationship with two tables "projects" and "tasks". both relationships are one two many (one status can have many projects and tasks) here is status model (I have followed cake convention) class Status extends AppModel { var $name = 'Status';

component->startup taking more time in new cake than old cake

2009-08-24 Thread abc
We ported our apps from alpha to 1.2. We observed that component->startup is taking more time in new cake than previously (100ms more). Thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" g

Re: Changing datasource or database of a model during runtime

2009-08-24 Thread Dr. Loboto
http://groups.google.com/group/cake-php/browse_thread/thread/21717ae54545aaa9/a092d6c27a291b91?#a092d6c27a291b91 With such approach I ordinary have problems only with save callbacks and need wrap above common save(), and do not have problems at all with find(). Also after model config change you

Re: Configure::listObjects() and bootstrap.php

2009-08-24 Thread brian
On Mon, Aug 24, 2009 at 2:44 PM, Pixelastic wrote: > > I don't think that would work. ::constructClasses() can't be called > statically, it does use the $uses variable to instanciate the models. Why do you need to call it statically? > And additionnaly, AppController isn't even loaded in bootstr

Re: no pages_controller.php?

2009-08-24 Thread cralls
Thanks Schreck, I was able to copy it over and update it as necessary. In previous versions of CakePHP that I have used the pages_controller.php was in my app's controllers directory after baking the project. With this latest release it did not do that. I'm not sure I see the reason behind NOT c

No Listbox for HABTM Relationship using Scaffold

2009-08-24 Thread josephusbrown
I am unable to get the list box to display for my HABTM relationship between requests table and services table. I have created a requests_services join table with the ids from both original tables and the query that the bottom of the screen completes fine (SELECT `Service`.`id`, `Service`.`name` F

Re: no pages_controller.php?

2009-08-24 Thread schreck84
The pages_controller is in the core library. You can find it under cake/libs/controller/pages_controller.php (if memory serves) Schreck -Original Message- From: cralls <208...@gmail.com> Date: Mon, 24 Aug 2009 17:33:22 To: CakePHP Subject: no pages_controller.php? I'm running version

Re: One app & db, many domains - what is the right mix?

2009-08-24 Thread jonoa
Ahh ok that sort of makes sense - in my 'CMS' controller I could look at the hostname, look the domain up and get the associated models.. I guess I need to just find some way of rewriting the URL so they stay pretty. On Aug 25, 9:08 am, Pixelastic wrote: > Maybe you could create a general contr

no pages_controller.php?

2009-08-24 Thread cralls
I'm running version 1.2.4.8284 and I have no pages_controller.php. In past versions it's just always been there. Is this a bug or is it functions as designed? Either way, I need to know how to generate the pages_controller.php. What really blows me away is that I have the views/pages and the hom

Cake's built-in caching in i18n.php

2009-08-24 Thread A Smiley
My company uses CakePHP as our application framework, and recently upgraded to the 1.2 release. Recently while doing performance testing we noticed that the localization functions are eating up a lot more time than they did with our old Cake version, and traced it to the new caching scheme found

Re: One app & db, many domains - what is the right mix?

2009-08-24 Thread Pixelastic
Maybe you could create a general controller, that will be triggered by any request to the cake app. And in a method inside it catch the hostname and make the appropriate db find operation to get the relevant content and then pass it to the view. On Aug 24, 11:21 pm, jonoa wrote: > I think you ar

Re: $ajax->form - NOT WORKING!!!!! ARGHHHH

2009-08-24 Thread yaronh
Hi, I have the same problem, did anyone found a solution for it? On Jul 23, 12:24 am, David wrote: > Hello, > > I am trying to work with ajax helper to do a comments form on a test > blog system. > I am fairly new...but have managed to pick most things up...but this > is doing my head in! > > O

Re: One app & db, many domains - what is the right mix?

2009-08-24 Thread jonoa
I think you are referring to http://bakery.cakephp.org/articles/view/one-core-one-app-multiple-domains I believe this scenario is where the author has multiple domains, a single app but a different DB containing the application specific data for each domain. He hacks bootstrap to match the heade

OAuth Serving

2009-08-24 Thread eusef
Hi all, Has anyone had any experince with putting together an OAuth server for an existing service using a library for PHP or a component for Cake? T.I.A. Phil --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakeP

Geocode Plugin

2009-08-24 Thread Mariano Iglesias
Bakers, I've just added a Geocode plugin to my github repository (based mostly on the work by Nate at http://bakery.cakephp.org/articles/view/geocoding-in-cakephp and lababidi at http://bakery.cakephp.org/articles/view/adding-a-google-map-to-your-app): Check it out at (geocode plugin): http:

Re: Dying on blank white page

2009-08-24 Thread Pixelastic
Maybe a chmod problem, making the cache uneffective ? On Aug 24, 7:36 pm, brian wrote: > Do you have access to Apache's error log? The blank page may be due to > a fatal PHP error > > On Sun, Aug 23, 2009 at 11:40 AM, Arvind wrote: > > > Yes of course. But as i mentioned above no cache files wer

Re: Configure::listObjects() and bootstrap.php

2009-08-24 Thread Pixelastic
I don't think that would work. ::constructClasses() can't be called statically, it does use the $uses variable to instanciate the models. And additionnaly, AppController isn't even loaded in bootstrap. If that's of any help, I'm trying to grab the plugin list by calling Configure::listObjects('pl

Re: really wierd problem

2009-08-24 Thread Pixelastic
It seems that you are trying to access a class variable from a static call. Make sure that you are using an instance of your InformationsController and not the class itself. On Aug 24, 8:16 pm, Paulos23 wrote: > Hi people, > I am facing a really wierd problem.I am building my app with cake > sin

really wierd problem

2009-08-24 Thread Paulos23
Hi people, I am facing a really wierd problem.I am building my app with cake since previous September and for 1st time i can't find any solution.In particular,i am trying to save some data and i am taking this message > Notice (8): Undefined property: InformationsController::$Information [APP

Re: class Overloadable2

2009-08-24 Thread mark_story
The key to Overloadable and Overloadable lies in the php4 versions of the files. Basically both classes serve as workarounds for PHP4's lack of magic methods. By using overload() you can add magic methods into PHP4 classes. So the overloadable classes are the base classes for all objects that h

Re: Class and Model Naming Problems (wave becomes wafe)

2009-08-24 Thread Nancy
This isn't going to help but I bet maybe it uses the the same rules for waves/wafe as it does for wives/wife. :D On Aug 21, 12:10 pm, JDRopp wrote: > Thanks Marcelo for pointing to the relevant code. > > I decided to change the model, table, and controller names instead. > > I'll submit the defe

Re: Dying on blank white page

2009-08-24 Thread brian
Do you have access to Apache's error log? The blank page may be due to a fatal PHP error On Sun, Aug 23, 2009 at 11:40 AM, Arvind wrote: > > Yes of course. But as i mentioned above no cache files were being > written to tmp cache directory. > > On Aug 21, 3:00 pm, "rich...@home" wrote: >> Also w

Re: Configure::listObjects() and bootstrap.php

2009-08-24 Thread brian
AppController::constructClasses()? On Mon, Aug 24, 2009 at 8:42 AM, Pixelastic wrote: > > Hello, > > I have some code I would like to put in my bootstrap.php that needs > the Configure::listObjects() function. Unfortunately, this function > does not return anything when called from inside the boo

Re: pages not diplayed

2009-08-24 Thread brian
Check Apache's logs if you can access them. Check Cake's error log. Set debug = 2. On Sun, Aug 23, 2009 at 5:24 AM, xxbeta wrote: > > My project is working properly on my local server, apache on windows > xp. However, after uploading all the files onto the hosting server, > some pages just can no

Re: Request help with a model definition.

2009-08-24 Thread brian
On Sun, Aug 23, 2009 at 9:23 AM, gedm wrote: > > Hi, > > I am very new to Cake and have searched for an answer to this but > can't quite get my head around it enough to ask ask the right > question. I'm not sure you asked anything. What's your question? The debug array you posted looks ok to me.

Re: Changing datasource or database of a model during runtime

2009-08-24 Thread DavidH
Is this something you can define at the database level rather than at the application level? If I were designing an application I would try and present a coherent and consistent view of the data to the application layer. I'd have to ask you why you have invoices stored in different databases accor

Re: Data Validation

2009-08-24 Thread DavidH
Have you tried array('rule' => 'notEmpty', 'message' => '.') I.e. don't put the notEmpty into an array. This is the format in the CookBook http://book.cakephp.org/view/338/Data-Validation David On Aug 24, 8:28 am, Juan Jose Marquez wrote: > I have a small problem with the validation of so

Re: Connecting to ORACLE Database !

2009-08-24 Thread DavidH
Have you tried setting up the connection as in this thread: http://groups.google.com/group/cake-php/browse_thread/thread/48df05d640ce3276 It's possible you need the oci_connect and to use the database SID rather than the service name. David On Aug 24, 4:21 pm, Xanax wrote: > Hello, > > I've b

Re: CakePHP Install Issue

2009-08-24 Thread majna
You are using php 5.3? http://groups.google.com/group/cake-php/browse_thread/thread/cc8b71d4b7aa5217 On Aug 24, 8:39 am, Lostprophetpunk wrote: > I get this error (plus many others that are basically the same) when > trying to view CakePHP onhttp://localhost/cake/ > > Deprecated: Assigning the r

Re: Edit function not working properly it always returns ID=(1)

2009-08-24 Thread DavidH
I guess there's some relationship between Tasks Projects and Statuses because the SQL you're reproduced here shows what's being selected from the related models not from the statuses model. Does anything get selected from statuses at all? What does your statuses model look like? Do the underlyin

Edit function not working properly it always returns ID=(1)

2009-08-24 Thread Vijay Pandey
Hi ! I have a little problem with edit function...I have developed a small application to manage projects. Every project has a status...there are totoal 5 statuses..I want to change the name of 5th status but I can not do it...no matter which "status" I select to "edit" it always displays status

Re: Certain strings crashing CakePHP - where do I look first?

2009-08-24 Thread Brendon Kozlowski (Realm)
My apologies, Chris. I didn't click on the "newer" link at the bottom of the Google Group topic to see it had been resolved prior to sending my last email. Like I said in my direct email reply though, I am glad you got everything working as it should be. It's possible (and completely plausible)

Re: Timing an AJAX effect

2009-08-24 Thread MattyHead
If you want to try to be as consistent as possible on the feel, time the call and subtract it from your fake delay... Drop delay if calltime exceeds delay. On Mon, Aug 24, 2009 at 9:46 AM, Brendon Kozlowski (Realm) wrote: > > It is an ironic time when developers ask for a way to SLOW the > respo

Re: One app & db, many domains - what is the right mix?

2009-08-24 Thread Martin Westin
Did you check the bakery? I think I remember seeing something like that in some article a while back. /Martin On Aug 24, 3:38 pm, jonoa wrote: > Hello all > > Big thanks to all the people who contribute to CakePHP - has certainly > put some structure in to my development and I'll be donating as

ajax-form/form-create vs ajax-submit/form-end

2009-08-24 Thread Marcelo Andrade
Hi there, I have an form that works well. But as I've created a component that write to a PDF file, the submit request could take a long time to complete. So, I'd like to convert the normal submit to an AJAX one. I can do it using the $ajax->submit and passing the adequate value to the options

Re: Find all

2009-08-24 Thread cakephp_rocks
figured it out thank you all $questions = $this->Question->find('all', array('conditions' => array ('AND' => array('OR' => array('Question.tip' => 'yes'),'NOT'=> array ('Question.active' => '0'); On Aug 24, 7:15 am, cakephp_rocks wrote: > how to do this complex find with this table > > i

Connecting to ORACLE Database !

2009-08-24 Thread Xanax
Hello, I've been developing my cakephp application with MySQL sor far and now i must migrate the database to an oracle one. I've created an oracle database and import the tables, everything wrked fine. Here an extract of the tsnames.ora entry concerning this databse : ORACLE_DPRO = (DESCRIPT

One app & db, many domains - what is the right mix?

2009-08-24 Thread jonoa
Hello all Big thanks to all the people who contribute to CakePHP - has certainly put some structure in to my development and I'll be donating as soon as I can monetize what I'm working on. :) I'm writing an app at the moment - basically it will allow the user to login, fill out some forms and ba

Re: Fulltext Index with schema console

2009-08-24 Thread miceno
I also has this problem, The issue is that "schema generate" does not create valid MySQL syntax to create the appropriate tables. I know how to generate the right MySQL syntax, but I would like to know how to automatically generate a valid CakePHP file schema. Or is it a bug of "schema generate"

class Overloadable2

2009-08-24 Thread Biaggi
I've been looking for a use of this class but i cant find any changeset or documentation about the need of that class or what the class resolves. The main diference between class Overloadable and Overloadable2 are the __get and __set functions, this functions appears in commit [3957] and seems to

Translate behavior and relation models

2009-08-24 Thread silentwf
Hi everyone I'm trying to get CakePHP to translate stuff for me, and I recently followed the book on the Translate behavior and all is working fine... kind of. I have a model (lets say 'UserProfile') that $actsAs Translate. The UserProfile model belongsTo a User model, and User hasOne UserProfile

CakePHP Install Issue

2009-08-24 Thread Lostprophetpunk
I get this error (plus many others that are basically the same) when trying to view CakePHP on http://localhost/cake/ Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\cake\cake\libs\file.php on line 96 I look at the url in the address bar and it is http

Changing datasource or database of a model during runtime

2009-08-24 Thread Marco Pietschmann
Hi, got the following problem. Need to combine several tables from different datasources that are associated to each other. So far so good. But I've got the following problem: The data retreived from the default database defines which datasource should be used. Example: Project belongsTo Cust

Re: Data Validation

2009-08-24 Thread Juan Jose Marquez
I have a small problem with the validation of some fields in a model The particular problem is that the system validates the data if the model but I painted the error messages in sight and it is not possible and have tried some things but nothing and I'm desperate. This is the code I have

Re: Timing an AJAX effect

2009-08-24 Thread Brendon Kozlowski (Realm)
It is an ironic time when developers ask for a way to SLOW the response time. If the user interaction interface you have chosen is not the most appropriate, perhaps a different route would be more desirable, such as flashing the background color once the action completes, or flashing a "completed

Find all

2009-08-24 Thread cakephp_rocks
how to do this complex find with this table id question answer tip= 0/1 default is 0 active = 0/1 default is 0 so what i want to do is if its tip= 1 it should show tip or if its tip = 0 its show the question it should not show if its active = 0 thanks --~--~-~--~~

HABTM not saving

2009-08-24 Thread Bryan Paddock
Hey all, Ok I'm pulling my hair out here. HABTM save/edit/removes are not happening. I have two models. Channel and Area. The model definitions are configured properly (channel: *var $hasAndBelongsToMany = array( 'Area' )* and area: *var $hasAndBelongsToMany = array( 'Channel' )* ) I have no clu

Re: How to save a record but not clear an empty field?

2009-08-24 Thread gedm
delocalizer and Dr. Loboto, It works a treat. In the controller after fetching the data I unset the password field. The password then comes up blank in the edit form. I then entered the beforeValidate function, you gave me, in the model and it works perfectly. Thanks for your help. On Aug 24

Re: Certain strings crashing CakePHP - where do I look first?

2009-08-24 Thread Chris P
Hi Brendon Thank you SO much for helping me out with this - it was indeed a server issue - mod_security2 is the culprit and after a brief battle they agreed to turn it off. As mentioned on the weekend, I couldn't have ascertained this without your and everyone else's help to rule out my code a

Re: logged in users list

2009-08-24 Thread Brendon Kozlowski (Realm)
Would a JavaScript/AJAX onunload event (or similar for navigation away from current domain) called to a user/logout achieve the same result? On Aug 24, 7:29 am, Junaed Halim wrote: > Thank you all for your advices. I am gonna apply them in my project. > > > > On Mon, Aug 24, 2009 at 6:15 PM, Dr.

Re: Certain strings crashing CakePHP - where do I look first?

2009-08-24 Thread Brendon Kozlowski (Realm)
I've been thinking about this over the weekend, and...to be honest, if it's a server issue (you're testing with the same version of CakePHP on both your development machine, and production server, right?), I think you're probably going to have to resolve this with your host. To see what options a

Configure::listObjects() and bootstrap.php

2009-08-24 Thread Pixelastic
Hello, I have some code I would like to put in my bootstrap.php that needs the Configure::listObjects() function. Unfortunately, this function does not return anything when called from inside the bootstrap.php, likely because bootstrap is called very very early. I finally had to put my code in t

Re: Please Help!! my password is always null!!!

2009-08-24 Thread Martin Westin
If you want to do it all yourself then just remove "Auth" from your list of components. Most likely you want to let AuthComponent help you out and in that case there are numerous tutorials to choose from. You can always start with the cookbook: http://book.cakephp.org/view/172/Authentication /Mar

Prefix for Internationalization

2009-08-24 Thread blablu
Hi, I want to internationalize a cake website. My intention was to use prefixes like /eng/posts/index /fra/posts/index /deu/posts/index to differentiate the languages for the user, search machines and the app itself. Whit the routing I do something like that: Router::connect('/:language/posts/:a

Re: logged in users list

2009-08-24 Thread Junaed Halim
Thank you all for your advices. I am gonna apply them in my project. On Mon, Aug 24, 2009 at 6:15 PM, Dr. Loboto wrote: > > You _cannot_ know for sure is user logged in or not. That's why > "last_activity_time" column is used (not "last_login_time") and > updated on each user page request. And

Re: logged in users list

2009-08-24 Thread Dr. Loboto
You _cannot_ know for sure is user logged in or not. That's why "last_activity_time" column is used (not "last_login_time") and updated on each user page request. And you just set user period of inactivity value for yourself and query for all users which have last_activity_time > now - inactivity

Re: Export to Excel

2009-08-24 Thread Braindead
There are at least 2 articles in the bakery that describe how to create a real Excel file (no csv): http://bakery.cakephp.org/articles/view/generate-excel-spreadsheets-from-your-database http://bakery.cakephp.org/articles/view/excel-xls-helper Personally I use the second one and it works quite g

Announcing CakeXT: Bind CakePHP and ExtJS together

2009-08-24 Thread wirtsi
Hi ... I have started a new project to bind CakePHP and ExtJS together. I've been using CakePHP for the last few years and found that the further you push your projects into the Web 2.0 / heavy Ajax domain, the more difficult it gets to keep track of all the html / javascript dependencies you nee

How to get admin to use the right login action

2009-08-24 Thread DavidH
Hi I've been implementing an admin prefix route in my application because I want only the admin user to be able to administer users and groups. The admin prefix is enabled in core.php and I've created admin views (admin_add.ctp, admin_edit.ctp etc) and the equivalent admin actions in my controll

Re: saveAll with a hasMany relationship

2009-08-24 Thread Luke
Hi Nancy, I have a setup where I save the hasMany and HABTM in 1 go. It was a bit tricky and took me aswell, I think 3 weeks (shame) to finally get it sorted when I got the hint with the array setup. It really is all about having the $this->data set up in the right way. I suppose you have a form

Re: logged in users list

2009-08-24 Thread Miles J
Well you dont know if people log out. I guess you would have to save sessions to a database or something, it can get quite complicated. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this

Re: sanitize and echoing in html

2009-08-24 Thread ezekfred
Vielen danke! I didn't knew this "nl2br"! here is my way to do (with sanitize...) data)) { $this->data = Sanitize::clean($this->data); $this->Mydata->create(); } function edit($id = null) { if (!empty($this->data)) { $this->data = Sanitize::clean($this->data); if ($this->My

Re: logged in users list

2009-08-24 Thread buzachis.a...@gmail.com
Hey, I do the following thing to get all logged in users in my app: - column lastActivity; - in AppController, beforeRender I update that field with current timestamp; - then take from DB the users which did an action in the last 60 seconds or so (you choose a timeout). (this is crappy I think,

Re: Getting Xdebug to work under CakePHP 1.2 and NetBeans 6.5

2009-08-24 Thread Freight
Hi, take a look here: http://groups.google.ch/group/cake-php/browse_thread/thread/73bcf80a3d626c75 For me I have to set the webroot correct to the cake-webroot-dir in project-properties. Greetz On 20 Jul., 20:16, MarcS wrote: > have you (or anyone else) figured this out? > > On Jun 15, 2:26 a

Re: Please Help!! my password is always null!!!

2009-08-24 Thread liaogz82
so if i want to use authentication, how should i go about doing it? Gangzheng On Aug 24, 2:03 pm, Martin Westin wrote: > My guess is that Auth component is doing it. > If you are doing your own authentication you have to remove Auth from > your list of components. And if you do want to use Auth