Re: Ajax Question

2011-03-21 Thread Qu xiaowei
maybe you can use isDefaultPrevented() to determine if preventDefault() works. and i wondering if the "return false" is necessary preventDefault() 2011/3/22 Krissy Masters > No I do not want the page to “jump” the page has header block about 250px > high so when user is visiting the site you wil

Re: my app developer with cakephp is slow

2011-03-21 Thread Dr. Tarique Sani
#1 See how many SQL queries your page runs and if any of them are long runing #2 Use Xdebug and profile your code HTH Tarique On Tue, Mar 22, 2011 at 5:16 AM, cake-learner wrote: > Is there anything I need to do before putting my app on live. > > Now i set false to Cache.disable and 0 to debu

Re: MySQL Password Hashing

2011-03-21 Thread cricket
On Mon, Mar 21, 2011 at 8:55 PM, RhythmicDevil wrote: > PHP: 5.3.5 > Cake: 1.3.7 > MySQL: 5.1.47 > > So if I understand it right the PHP mysql driver that cake uses does > not support the password hashes in MySQL, If this is true, what is the > proper solution given that I have a shared host and c

MySQL Password Hashing

2011-03-21 Thread RhythmicDevil
PHP: 5.3.5 Cake: 1.3.7 MySQL: 5.1.47 So if I understand it right the PHP mysql driver that cake uses does not support the password hashes in MySQL, If this is true, what is the proper solution given that I have a shared host and cannot enable short passwords or user the old_passwords() function?

my app developer with cakephp is slow

2011-03-21 Thread cake-learner
Is there anything I need to do before putting my app on live. Now i set false to Cache.disable and 0 to debug, but looks like it takes quite some time to load the page. If there is any way to find a bottle neck I would appreciate, too. -- Our newest site for the community: CakePHP Video Tutorial

RE: Internal Actions

2011-03-21 Thread Krissy Masters
Sorry nevermind. I do not need actions afterall. Not sure what I was thinking... I can access the models function thru my relations / load Model / Class Reg / which is all I need. K -Original Message- From: Krissy Masters [mailto:naked.cake.ba...@gmail.com] Sent: Monday, March 21, 2011

Internal Actions

2011-03-21 Thread Krissy Masters
Maybe I just simply overlooked that chapter but like related models you can use functions from various controllers easily. Can this be done for controller actions? I have an application and upon logging in every controller / page is locked restricting user from doing anything except completeting r

Re: Pretty URLs and Lighttpd

2011-03-21 Thread gremlin
More important - why are you trying to use lua scripts for lighthttpd when you seem to be working on a MAMP install? (apache) On Mar 21, 4:08 am, AD7six wrote: > On Mar 21, 1:27 am, axel9641 wrote: > > > Hi Folks > >  I am new to CakePHP. I am going through the > > manual:http://book.cakephp.o

RE: Ajax Question

2011-03-21 Thread Krissy Masters
No I do not want the page to “jump” the page has header block about 250px high so when user is visiting the site you will have to scroll down the page to get to the ajax link that when clicked loads content into a div right beside it. So when it gets click the page jumps up to the top forcing the u

complex multi model save

2011-03-21 Thread oozo
I have the following situation: cake 1.3 / php5 / mysql 5 Companies** table **1:m ->** **Company_addresses** table **and Users table. Users** table has **1:m -> User_telephonenumbers table I want to save from one form using multiple CompanyAddresses and multiple UserTelephonenumbers. (code

Radio Boxes

2011-03-21 Thread Kole Reece
I have been having a little trouble with radio boxes here is the code $options=array('green'=>''1',); echo $form->input('Location.location',array('type'=>'radio','options'=>$options)); echo $form->input('Location.proposal_id',array('type'=>'hidden','value' =>'1')) In database is seems that th

Radio Boxes

2011-03-21 Thread Kreece
I am working with radio boxes trying to save a specific value to the Lcation.location feild in database.Here is the code I use echo $form->radio('Location.location',array(1=>'Transfer Hall in the A1900',2=>'N2 Vault',3=>'N2 Vault',4=>'S2 ,Vault' 5=>'S3 Vault' ).Each proposal has many locations.This

login and register system

2011-03-21 Thread Robert Bodley
hi, I just started learning php and would like to know if anyone would like or would help me build a login and register system I would like the features to be: •login, log out, register • on the register page I would like a name, email, password, date of birth, school, relationship status( in rel

Re: Ajax Question

2011-03-21 Thread Qu xiaowei
i'am not sure i've really understood your question. if you just want to make the content to top. you could get the top attribute of the content. then asign it to the page offset.it's easy to get this effect with JQuery. like this var v = $('#pageCore').offset().top; $(document).scrollTop(v); is t

CakePHP 1.3.8 - commit 5464ed8 introduced a new bug in Form helper?

2011-03-21 Thread Peter Jankovich
After upgrading form 1.3.7 to 1.3.8 we encountered a problem with handling custom field names. This commit is supposed to fix custom name attributes, but when we pass a name that ends in a "[]" it is not handled correctly. This example code produces the following: $this->Form->fields = array( 'Mod

Re: route being ignored

2011-03-21 Thread cricket
On Mon, Mar 21, 2011 at 7:14 AM, AD7six wrote: > > > On Mar 20, 9:44 pm, cricket wrote: >> Using 1.3.7 >> >> Some of my routes are apparently being ignored. > > Routes don't get ignored, they simply don't match and are skipped. I found Router's interpretation: CakeRoute Object ( [keys]

Re: Agnostic model function

2011-03-21 Thread Jeremy Burns | Class Outfit
Interesting thought, but unless I was moving this into a behaviour I can't see I'd need it as $this->primaryKey is always going to refer to Status.id. This works exactly as I need it: function activeStatuses() { $activeStatuses = $this->find( 'all', array

Re: Agnostic model function

2011-03-21 Thread cricket
On Mon, Mar 21, 2011 at 2:05 PM, Jeremy Burns | Class Outfit wrote: > So simple. Perfect, thanks. You could make it more agnostic by using $this->pimaryKey, also. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http:

RE: Ajax Question

2011-03-21 Thread Krissy Masters
Thanks guys. I was hoping it was something obvious. Will experiment and let you know if I get it solved. K -Original Message- From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of cricket Sent: Monday, March 21, 2011 3:22 PM To: cake-php@googlegroups.com Subjec

Re: Agnostic model function

2011-03-21 Thread Jeremy Burns | Class Outfit
So simple. Perfect, thanks. Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 21 Mar 2011, at 16:58, euromark wrote: > $this->alias should have to corresponding name > try that > > > On 21 Mrz., 17:18, Jeremy Burns wrote: >> I have a Status model with a func

Re: Ajax Question

2011-03-21 Thread cricket
On Mon, Mar 21, 2011 at 6:38 AM, Krissy Masters wrote: > I have stripped everything out to barebones pretty much to see if it was > something in the code but this below still makes the page jump (FF / IE / > Chrome that I tested in) > > $("a.is_ajax").live('click',function(e) { >        var page_u

Re: route being ignored

2011-03-21 Thread cricket
On Mon, Mar 21, 2011 at 7:14 AM, AD7six wrote: > > > On Mar 20, 9:44 pm, cricket wrote: >> Using 1.3.7 >> >> Some of my routes are apparently being ignored. > > Routes don't get ignored, they simply don't match and are skipped. By "ignored" I meant that it is not matching and so being skipped. A

Re: Agnostic model function

2011-03-21 Thread euromark
$this->alias should have to corresponding name try that On 21 Mrz., 17:18, Jeremy Burns wrote: > I have a Status model with a function that is called from a few > related models. The related models use different aliases, for example > UserStatus, CompanyStatus, AccountStatus and so on. Here's th

Re: Documentation changes

2011-03-21 Thread mark_story
I've started work on converting the documentation into the format sphinx uses, as well as updating the content for 2.0. If you want to help you can fork the repository and make the changes you'd like to see. https://github.com/markstory/cakebook-experiment is the url for the repo, it will soon m

Agnostic model function

2011-03-21 Thread Jeremy Burns
I have a Status model with a function that is called from a few related models. The related models use different aliases, for example UserStatus, CompanyStatus, AccountStatus and so on. Here's the function: function activeStatuses() { $activeStatuses = $this->find( 'all',

Re: Form Validation with more than one model

2011-03-21 Thread Jeremy Burns | Class Outfit
What I understood from your original post was that you wanted to store the users address in more than one model, i.e. the same data in multiple places, as opposed to storing the data once in one place and creating references to it from other places. Forgive me if I misunderstood. Jeremy Burns C

Re: searching recursively doesnt work

2011-03-21 Thread duderion
sounds cool shaz, thanks for your reply, i'll try On 21 Mrz., 12:52, Shaz wrote: > Can you put up your $this->find() statements and the results you get > with them? > > I would've thought (in the Agreement Model) you could do something > along the lines of this->Definition->Article find(all) > co

Re: Query not limiting results

2011-03-21 Thread Kevin Vandenborne
Thanks, I found the problem. I'm using the Cache::read('PostsController-index-archives'); in another method which doesn't limit results, I use that function for my archives page. However the latest 5 articles uses that same cache and if the cache is set, it doesn't execute the query wich has th

Re: Small help required...

2011-03-21 Thread Tapan Kumar Thapa
Thanks it works... (http://book.cakephp.org/view/1414/checkbox) On Mon, Mar 21, 2011 at 5:25 PM, Shaz wrote: > http://book.cakephp.org/view/1414/checkbox > http://book.cakephp.org/view/1031/Saving-Your-Data > > ^^ Have a quick read - it's explained there. > > On Mar 21, 10:45 am, Tapan Kumar Tha

Re: Small help required...

2011-03-21 Thread Shaz
http://book.cakephp.org/view/1414/checkbox http://book.cakephp.org/view/1031/Saving-Your-Data ^^ Have a quick read - it's explained there. On Mar 21, 10:45 am, Tapan Kumar Thapa wrote: > Hello Group, > > I am stuck in one situation and i don't know how to come out from that > issue. > > I have c

Re: searching recursively doesnt work

2011-03-21 Thread Shaz
Can you put up your $this->find() statements and the results you get with them? I would've thought (in the Agreement Model) you could do something along the lines of this->Definition->Article find(all) conditions(article.field => '%string%') contain( user, agreement, definition) groupBy(definition

Re: Form->year returns Array

2011-03-21 Thread euromark
i had the same problem with years i think its because input() with type date/datetime needs an array to parse it before validation my solution was to use an input (as a select box) with a manual range(20xx-20xx) for the options array :) then its sure as hell a string On 21 Mrz., 04:17, lunanoko

searching recursively doesnt work

2011-03-21 Thread duderion
hi cakies, i got the following model relations User->hasmany->Agreement->hasmany- >Definition->hasOne->Article my problem is, in my Agreement Search (in the A.Model) i want to find the Definitions where it's Article matches a string. the problem is, even if i do $this->recursive=2, the Agreement

Re: route being ignored

2011-03-21 Thread AD7six
On Mar 20, 9:44 pm, cricket wrote: > Using 1.3.7 > > Some of my routes are apparently being ignored. Routes don't get ignored, they simply don't match and are skipped. >I've simplified things > as much as possible, including putting the following (unrealistic) > route at the top of router.php.

Re: Pretty URLs and Lighttpd

2011-03-21 Thread AD7six
On Mar 21, 1:27 am, axel9641 wrote: > Hi Folks >  I am new to CakePHP. I am going through the > manual:http://book.cakephp.org/view/918/Pretty-URLs-and-Lighttpd > where is explained that in order to use Pretty URLs in cakephp, we > have to place a lua script in / > etc/lighttpd/cake. > But the

Re: Query not limiting results

2011-03-21 Thread vovich
I've checked your function and it works for me. What cake do you use? And try to print_r $archives in the controller action - may be problems with $latest var in the view. You can easily find any info at http://book.cakephp.org and at the code ;) On 20 мар, 19:13, Kevin Vandenborne wrote: > Hey,

Form->year returns Array

2011-03-21 Thread lunanoko
Dear CakePHP users, I built a form which worked fine, up until I installed the CakePHP Tags Plugin from CakeDC. Since that plugin started working, my Form- >year() input returns Array, instead of an integer. Does anyone have any idea how this could happen? My form code is as follows: echo $t

Pretty URLs and Lighttpd

2011-03-21 Thread axel9641
Hi Folks I am new to CakePHP. I am going through the manual: http://book.cakephp.org/view/918/Pretty-URLs-and-Lighttpd where is explained that in order to use Pretty URLs in cakephp, we have to place a lua script in / etc/lighttpd/cake. But the big question is : Whereabouts in my project am I supp

Re: needed opinion from experienced cakephp user

2011-03-21 Thread Simon Males
> Also, is MySQL going to work properly because it is a lot of queries > and a large database is needed for this.. I'm not an experienced CakePHP developer but my suggestions from a DB point of view are: * Use InnoDB as a storage engine. * INSERTs are cheaper then UPDATEs. So the 'vote' is writte

Small help required...

2011-03-21 Thread Tapan Kumar Thapa
Hello Group, I am stuck in one situation and i don't know how to come out from that issue. I have created a view with form helper where in i am asking users to select start and end date. Once user is clicking on submit button after selecting start and end date, i am fetching record from my databa

RE: Ajax Question

2011-03-21 Thread Krissy Masters
I have stripped everything out to barebones pretty much to see if it was something in the code but this below still makes the page jump (FF / IE / Chrome that I tested in) $("a.is_ajax").live('click',function(e) { var page_url = $(this).attr("href"); e.preventDefault(); $.a

Re: Form Validation with more than one model

2011-03-21 Thread duderion
what do you mean with 'but it isn't storing the same data multiple times' ? On 15 Mrz., 05:49, Jeremy Burns | Class Outfit wrote: > Yes, this takes your data array and stores parts of it in different models, > but it isn't storing the same data multiple times. That's an admin nightmare, > so as

Re: Ajax Question

2011-03-21 Thread Ryan Schmidt
On Mar 21, 2011, at 04:41, Krissy Masters wrote: > No # used. Regular link created with standard $this->Html->link('title', > array(controller action), array(class => is_ajax)) so the js will make the > ajax request based on the class. I would just like the new content to load > into the div wher

RE: Ajax Question

2011-03-21 Thread Krissy Masters
No # used. Regular link created with standard $this->Html->link('title', array(controller action), array(class => is_ajax)) so the js will make the ajax request based on the class. I would just like the new content to load into the div where the page is currently at rather than forcing the page to

Re: needed opinion from experienced cakephp user

2011-03-21 Thread Miloš Vučinić
Thanks for the responses, it's quite a relief :) I'm glad that this kind of traffic is not actually large amount of traffic. Yes I will have more polls at the time, so I will have to make an add action view cached, which will basically generate poll from the information about questions in DB. (Add

Re: Ajax Question

2011-03-21 Thread Ryan Schmidt
On Mar 20, 2011, at 23:52, Krissy Masters wrote: > I am loading content into a div so left menu click loads the element into the > right side…pretty simple. But how do you prevent the page from always jumping > to the top? Layout has header, intro, page title then the content starts but > every

Re: RE: New project, what version?

2011-03-21 Thread keymaster
I wouldn't make any forecasts, because no one can really know for sure - I don't even think the devs themselves know. They are developing out of a labour of love, so what they feel like doing they do (within some general goals). If something new comes up they think will be useful, they may de