handling timezone and DST opinions please

2009-11-23 Thread Jas
I've been researching this for the past few hours, and didn't really find a solid solution. I want to run this by anyone who has experienced this and get their opinion. Here is the Theory I'd like to verify with you.. Anytime a row is created or modified it should use "date_default_timezone_set(G

Re: handling timezone and DST opinions please

2009-11-23 Thread Amit Rawat
hello jas, i m little confused are you saving your data in GMT or converting it into user's timezone and then saving it -- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-...@googlegroups.com. To unsubscribe fro

Re: handling timezone and DST opinions please

2009-11-23 Thread Jas
Well I'd like to save it as a common timezone (GMT 0) for all users no matter what timezone they have set themselves. Then when retrieving the data I apply their timezone And if DST is in play minus 1 hour before saving (GMT -1) On Nov 23, 8:35 pm, Amit Rawat wrote: > hello jas, i m little conf

Re: handling timezone and DST opinions please

2009-11-23 Thread Amit Rawat
ok so whats your main problem? -- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-...@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. For more options, vis

Re: handling timezone and DST opinions please

2009-11-23 Thread Jas
I'd like to know the best way to store records on a server in another country. Some of the users will be in other countries. when they view their own records (they cant see records of the other users) the dates need to display in their local timezone. I don't want to store the date as their local t

Re: error baking on mac

2009-11-23 Thread Amirul
Hi, 1. Is that a gap (space) at the '/mufti ali/'? Possibly this cause the problem. 2. Good info for installing cake on mac with MAMP http://planetcakephp.org/aggregator/items/1732-installing-cakephp-with-mamp Cheers. Amirul. From: mupet To: CakePHP Sent

Re: render shared view file

2009-11-23 Thread ddaffy
amit, overriding render() function sounds just right, didn't tought of that.. :) thanks for the idea! walther, thanks. saw that at the very start of my research of this problem, but as i said in the first post, sounds like an overkill to me. IMO, what i need should be as easy as setting some varia

Re: handling timezone and DST opinions please

2009-11-23 Thread jacmoe
I had the same issue and now use gmdate everywhere. Tested it on two servers in different timezones, and it worked alright. On Nov 23, 11:29 am, Jas wrote: > I'd like to know the best way to store records on a server in another > country. Some of the users will be in other countries. when they vi

Creating a login screen

2009-11-23 Thread Dewayne Pinion
Hey All, I am wanting to create a login page for a cake app that allows a user to add products/pictures to their pages. I have the app worked out, but not sure on how to create the login. Any links or advice someone could give me to get me started? Thanks -- You received this message because you

Re: Creating a login screen

2009-11-23 Thread ddaffy
take a look at: http://book.cakephp.org/view/172/Authentication On Nov 23, 3:18 pm, Dewayne Pinion wrote: > Hey All, > I am wanting to create a login page for a cake app that allows a user to add > products/pictures to their pages. I have the app worked out, but not sure on > how to create the lo

Re: Creating a login screen

2009-11-23 Thread Dewayne Pinion
Great! Thank you On Mon, Nov 23, 2009 at 9:47 AM, ddaffy wrote: > take a look at: http://book.cakephp.org/view/172/Authentication > > On Nov 23, 3:18 pm, Dewayne Pinion wrote: > > Hey All, > > I am wanting to create a login page for a cake app that allows a user to > add > > products/pictures t

api_generator, where is the api docs generated?

2009-11-23 Thread greenl
Hi, there, looks like all API docs generated in the database, but how can I view them? sorry but am a newbie. Green -- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-...@googlegroups.com. To unsubscribe from

ClassRegistry::int() instead of $uses use on AppController

2009-11-23 Thread Franze
Good afternoon I'm using CakePHP to develop a system and would like to know how can I use the ClassResitry: init () instead of $uses. Currently the model of paper is as follows: array ( 'className' => 'Categoria',

Re: CAKEPHP Country Region Combobox via AJAX

2009-11-23 Thread JAY.Z
能看下代码吗? 2009/11/22 Pedro Nascimento > It seems it works, would you mind sharing the code? > > > On Thu, Nov 19, 2009 at 09:14, NRV wrote: > >> Hi ALL, >> >> >> I have implemented >> >> http://www.croyantdebridiers.com/CakePHP_AJAX_selectbox_demo/ajaxcombobox/users/add >> locally. >> >> Its work

Pass variables to Javascript

2009-11-23 Thread thomaus
Hi there, I've been using CakePHP since 6 months and never had a single problem BUT now I have one issue I can't solve. Here it is: I need to Preload some images for my website. I did it using JQuery and it perfectly works: CODE $(document).ready(function(){ // Preload $.preloadImages("img/butt

cake-php@googlegroups.com

2009-11-23 Thread Ragnis
I need them as GET variables. My form is at /Accounts/Manage/?var=b73cr6xzr6z&var2=somethingelse and when i submit the form, the GET variables will be gone but i want them to stay. On Nov 22, 11:39 pm, Amit wrote: > Is there a reason you can't just include the vars in the form? > > $form->input('

About multilingual websites

2009-11-23 Thread thomaus
Hi there, One month ago, I did a multilanguage website using CakePHP but putting all the multilangual content in my dB. >From what I read today, this was the right way to display short messages in various languages with CakePHP : http://book.cakephp.org/view/162/Internationalizing-Your-Applicatio

requireAuth not working as expected (Security Component)

2009-11-23 Thread dhruv
I read this... "The authentication key is regenerated every time a form is evaluated with requireAuth. This means that if a user submits a form with a key that has already been used, the form submission will be considered invalid. There are several cases in which this could occur, including but no

alphaNumeric not allowing valid entry (1.2.5)

2009-11-23 Thread timstermatic
Hi All, I have PHP 5.1.6 with CakePHP 1.2.5 and I am having problems with validating user entry using the alphaNumeric rule. All other rules seem to work ok, so I am guessing it is an issue relating to how my version of PHP handles regex. Does anyone have any pointers or resources that could help

Re: alphaNumeric not allowing valid entry (1.2.5)

2009-11-23 Thread Dave
What is the problem you are having? Are there spaces in the input, because I believe this will cause it to fail. You may have already seen this but you can create your own validation rules as well. Here is a link to the cookbook describing this: http://book.cakephp.org/view/150/Custom-Validation

need a little help with model::saveAll function

2009-11-23 Thread Ernesto
hello i have a form like this: echo $form->create("Order"); echo $form->input("code") for($i=0,$i<10,$i++) { echo $form->input("Item.$i.code"); echo $form->input("Item.$i.quantity"); } echo $form->end(); i'm saving this form using saveAll with "validate" option set to "first" problems

Re: requireAuth not working as expected (Security Component)

2009-11-23 Thread Amit
So I'm still learning the Security Component but here's one suggestion. Put the following in your app_controller.php or specific controlle: if(!empty($this->data)) { $this->Security->requirePost('add'); $this->Security->requirePut('edit'); } This will let you use the Security component on actio

Re: requireAuth not working as expected (Security Component)

2009-11-23 Thread Dave
I can't seem to find the article but I am fairly certain I have read the requireAuth is pretty much dependent on requirePost. I believe even if they work separately, you lose all benefits without requirePost. I apologize because I cannot remember why or where I read this, so hopefully someone wit

cake-php@googlegroups.com

2009-11-23 Thread Dave
Something like this should work echo $form->create('YourForm',array('url'=>YOURURL . '?' . $this->passedArgs)); On Mon, Nov 23, 2009 at 10:22 AM, Ragnis wrote: > I need them as GET variables. > My form is at /Accounts/Manage/?var=b73cr6xzr6z&var2=somethingelse and > when i submit the form, the

Re: Pass variables to Javascript

2009-11-23 Thread Dave
If you have the javascript in your php file you can interject php syntax just like html ie. $.preloadImages("", "img/ if your javascript is in a separate .js file you have two options 1. Change the javascript function to allow you to specify anything dynamic (ie. the images that will need to be

how do you show validation errors in multi-model form?

2009-11-23 Thread Ernesto
Hello. i have a form like this one: echo $form->create("Order"); echo $form->input("code") for($i=0,$i<10,$i++) { echo $form->input("Item.$i.code"); echo $form->input("Item.$i.quantity"); } how do you show errors if more than 1 row fails validation? div @ the end of the form? -- You

Re: About multilingual websites

2009-11-23 Thread Larry E. Masters aka PhpNut
Ignore this section in the manual it in incorrect: "Remember that po files are useful for short messages, if you find you want to translate long paragraphs, or even whole pages - you should consider implementing a different solution. e.g.:" http://cakedc.com/ uses entire paragraphs. http://cakeq

Pagination on cached data?

2009-11-23 Thread leberle
Hi dudes, is there a way to paginate cached data? I wanna cache the result from a $controller->paginate() request an use it the next time the page is requested. But i've i bind the cached data for the view, i've the problem that paginate() wasn't called so the paginate-helper functions in the view

Re: Pass variables to Javascript

2009-11-23 Thread thomaus
Thanks for your answer. I tried by putting the javascript inside the PHP script and it works fine, thanks. Nevertheless, I would like to know how to do that by using an external javascript. The solution you propose is fine as long as you call the function somewhere but in my case, I just call inc

Re: alphaNumeric not allowing valid entry (1.2.5)

2009-11-23 Thread Marcelo Andrade
On Mon, Nov 23, 2009 at 6:51 AM, timstermatic wrote: > Hi All, > > I have PHP 5.1.6 with CakePHP 1.2.5 and I am having problems with > validating user entry using the alphaNumeric rule. All other rules > seem to work ok, so I am guessing it is an issue relating to how my > version of PHP handles r

Re: Pass variables to Javascript

2009-11-23 Thread Miles J
Instead of pre-loading images, just use css rollovers. On Nov 23, 9:20 am, thomaus wrote: > Thanks for your answer. > > I tried by putting the javascript inside the PHP script and it works > fine, thanks. > > Nevertheless, I would like to know how to do that by using an external > javascript. The

Re: ClassRegistry::int() instead of $uses use on AppController

2009-11-23 Thread Miles J
You dont place it in $uses, thats completey wrong PHP in general. Just set $uses = array() and then use ClassRegistry::init() within your action. On Nov 20, 11:43 am, Franze wrote: > Good afternoon > > I'm using CakePHP to develop a system and would like to know how can I > use the ClassResitry:

Beginning

2009-11-23 Thread Daniel
Hi guys... Sorry for any typos, I'm from Brazil. I'm new on cakePHP and I'd like to now one little thing. When I start one project, do I have to create a folder in the cake directory? Or the cake directory is my project folder?! I tried to watch a screencast on the Blog tutorial but I'm having

CakePHP performance 1.2 - is future any better?

2009-11-23 Thread Balrog
Hello! We are running quite growing social network in Poland for students at CakePHP, now 70k users and 0.5M hits a day. We have 3 app servers for it with CakePHP 1.2.5 installed on each. Servers are Quad Core i7 920 + 8G RAM, so rather good machines. DB on separate box + nginx frontend for stati

Re: need a little help with model::saveAll function

2009-11-23 Thread Marcelo Andrade
On Mon, Nov 23, 2009 at 12:29 PM, Ernesto wrote: > (..) > A - user can insert just 2 or 3 rows, it's not necesasry to fill all > the 10 "Item" rows. saveAll tries to save even empty insertions. Blank > rows = validation errors. is there any way to avoid this? You'll have to loop $this->data and u

Re: CakePHP performance 1.2 - is future any better?

2009-11-23 Thread Miles J
Haha funny you ask. The mozilla addons site actually runs CakePHP 1.1 and they recently announced they are switching to Django. All I can say is use APC for opcode caching and memcache for user caching. On Nov 23, 11:02 am, Balrog wrote: > Hello! > We are running quite growing social network in

Re: CakePHP performance 1.2 - is future any better?

2009-11-23 Thread Pablo Viojo
Yes, APC and Memcache is a must if you want good performance. Regards, Pablo Viojo pvi...@gmail.com http://pviojo.net ¿Que necesitas? http://needish.com On Mon, Nov 23, 2009 at 5:58 PM, Miles J wrote: > Haha funny you ask. The mozilla addons site actually runs CakePHP 1.1 > and they recently

Re: Beginning

2009-11-23 Thread majna
http://book.cakephp.org/view/19/CakePHP-Folder-Structure On Nov 23, 7:32 pm, Daniel wrote: > Hi guys... > > Sorry for any typos, I'm from Brazil. > > I'm new on cakePHP and I'd like to now one little thing. > > When I start one project, do I have to create a folder in the cake > directory? Or t

Re: Pass variables to Javascript

2009-11-23 Thread thomaus
I could do that but in my case, the images names must be dynamic so the problem would be the same. On Nov 23, 6:36 pm, Miles J wrote: > Instead of pre-loading images, just use css rollovers. > > On Nov 23, 9:20 am, thomaus wrote: > > > Thanks for your answer. > > > I tried by putting the javascr

Re: handling timezone and DST opinions please

2009-11-23 Thread Jas
date_default_timezone_set() sets the timezone for all other date and time functions used in the same script, so you wont have to keep specifying it. In what timezone do you store your records that have dates? Do you use a common one like GMT 0, Then use the users preferred timezone when displaying

Re: handling timezone and DST opinions please

2009-11-23 Thread Jas
date_default_timezone_set() sets the timezone for all other date and time functions used in the same script, so you wont have to keep specifying it. In what timezone do you store your records that have dates? Do you use a common one like GMT 0, Then use the users preferred timezone when displaying

Re: handling timezone and DST opinions please

2009-11-23 Thread Jas
date_default_timezone_set() sets the timezone for all other date and time functions used in the same script, so you wont have to keep specifying it. In what timezone do you store your records that have dates? Do you use a common one like GMT 0, Then use the users preferred timezone when displaying

Re: Pagination and Reverse Routing

2009-11-23 Thread axe6584
You must add one of the following at the begining of your router.php configuration file in order to use the 'page' parameter in url and get your url parsed by the router. This comment come from the Router class itself: * Do not parse any named parameters: * {{{ Router::connectNamed(false); }}}

Re: pagination, "pretty" URLs, and route

2009-11-23 Thread axe6584
You must add one of the following at the begining of your router.php configuration file in order to use the 'page' parameter in url and get your url parsed by the router. This comment come from the Router class itself: * Do not parse any named parameters: * {{{ Router::connectNamed(false); }}}

Validation Error

2009-11-23 Thread Dave
I have a select drop down for user to select a year. In before save I have: $this->data['Award']['year'] = $this->data['Award']['year']['year']; since when I insepect the request the data looks like [year] => Array ( [year] => 2009 ) validatio

Image Actas Behavior Problem

2009-11-23 Thread kaushik
I am facing some problem to use Image Actas Behavior where I want to add multiple data for a model. I have Business and Bizimage model. From a single form, I have to add an single entry for Business and multiple entry for Bizimage. When there is no image,it is working fine. But when i want to add

cake-php@googlegroups.com

2009-11-23 Thread Dr. Loboto
You can set form action as: array ('controller' => 'Accounts', 'action' => 'Manage', '?' => array ('var' => 'b73cr6xzr6z', 'var2' => 'somethingelse')) On Nov 23, 9:22 pm, Ragnis wrote: > I need them as GET variables. > My form is at /Accounts/Manage/?var=b73cr6xzr6z&var2=somethingelse and > when

Re: alphaNumeric not allowing valid entry (1.2.5)

2009-11-23 Thread Dr. Loboto
alphaNumeric rule accepts only latin letters and digits, nothing more. No spaces, no special symbols, no any non-latin letters. On Nov 23, 3:51 pm, timstermatic wrote: > Hi All, > > I have PHP 5.1.6 with CakePHP 1.2.5 and I am having problems with > validating user entry using the alphaNumeric ru

Re: Image Actas Behavior Problem

2009-11-23 Thread Amit Rawat
Its because when you upload a image contoller recieves it as an array with information like file name, size, type etc. you will have to extract then name of file before inserting it -- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this grou

Re: Pass variables to Javascript

2009-11-23 Thread oleonav
Hi, You could always first include a short inline javascript defining your variables and after that include the external scripts. Something like this codeblock(" var someJsArr = " . $someArraySetByCake . " "); ?> link('someExternalJsScript.js'); ?> This way you can use you variables inside

Re: CakePHP performance 1.2 - is future any better?

2009-11-23 Thread j0n4s.h4rtm...@googlemail.com
- Clone all of your application files/code (anything besides /app/ webroot but including /app/webroot/index.php) to a ram based file system on your *nix host. - Try lazyloader: http://github.com/mcurry/lazy_loader - Never use recursive > -1, make sure containable does not do multiple queries, if it

Re: Image Actas Behavior Problem

2009-11-23 Thread kaushik
In normal insertion case, it is all done by the behavior, no extra code is needed for that. But in the specific case where one form is used to enter multiple entry in hasmany relation, it is not working. What is solution for it. On Nov 24, 11:19 am, Amit Rawat wrote: > Its because when you upload

cake-php@googlegroups.com

2009-11-23 Thread Walther
What is wrong with using Accounts/Manage/var:b73cr6xzr6z/ var2:somethingelse ? It looks neater, and is just as easy to use from an application perspective. On Nov 22, 8:54 pm, Ragnis wrote: > So how can i do that? > And i don't want to use /Accounts/Manage/var:b73cr6xzr6z/ > var2:somethingelse

Re: CakePHP performance 1.2 - is future any better?

2009-11-23 Thread Crazy
Judging by your setup I believe you should start using a profiler, and optimize your code a bit or take a better look at why your machines perform poorly. I run a site that has around 250k hits/day and it's on one box (Core2Quad 8800 8GB RAM) with the db on the same machine + . It runs on average

Behavior problem

2009-11-23 Thread kaushik
I am using saveall function to save a user details and its multiple job details(user and job details is in hasmany-belongsto relatiobship) from a single form. I have written a behavior for job details. But when I am using saveall from user controller, the behavior for job details is not called. How

Re: need a little help with model::saveAll function

2009-11-23 Thread Ernesto
is there any example? i can't figure out where and when loop through $this->data On 23 Nov, 20:52, Marcelo Andrade wrote: > On Mon, Nov 23, 2009 at 12:29 PM, Ernesto wrote: > > (..) > > A - user can insert just 2 or 3 rows, it's not necesasry to fill all > > the 10 "Item" rows. saveAll tries to

Re: requireAuth not working as expected (Security Component)

2009-11-23 Thread j0n4s.h4rtm...@googlemail.com
This helped me, thanks! On Nov 23, 4:32 pm, Amit wrote: > So I'm still learning the Security Component but here's one > suggestion. Put the following in your app_controller.php or specific > controlle: > > if(!empty($this->data)) { >  $this->Security->requirePost('add'); >  $this->Security->requi