Re: Problem in save Data into DB and with Created and modified fields.

2010-08-09 Thread Techinfocomp.com
sorry that was $this->User->create();

You are right if my data array contain ID then it will update. i
checked i never pass any id i am creating new user but with $this-
>ModelName->save($this->data);  upade my 1st record. in cakePHP 1.3.3
version :(

why is this happening ?




On Aug 10, 11:09 am, Jeremy Burns | Class Outfit
 wrote:
> $this->ModelName->create() [[NB NOT created ]] does exactly what it says it 
> will; it creates a new record. In any event, your two blocks of code are 
> different; one has a create statement, the other does not. What you should 
> check is whether there is an id element in your data array. If there is one, 
> Cake will update that row. If there isn't one, Cake will create a new row.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 10 Aug 2010, at 06:48, Techinfocomp.com wrote:
>
>
>
> > Hi,
>
> > i am using 1.3.3 stable version.
>
> > i am heaving problem with this version.
>
> > let take an example:-
>
> > if i do this
>
> > $this->ModelName->save($this->data);
>
> > this link will update my 1st row every time i run this.
>
> > but
>
> > if i do this
>
> > $this->ModelName->created();
> > $this->ModelName->save($this->data);
>
> > this will create new record in table.
>
> > why is this happen all the time, i never face this king of problem in
> > version 1.2.
>
> > now another problem.
>
> > on my local pc i am running vista with xampp and cakePHP version 1.3.3
>
> > created filed in table is working fine. model automatically create
> > data for this column but it's not working on live server which is
> > running php 5 , my sql 5.
>
> > any help ?
>
> > waiting for your reply
>
> > Thanks
> > Harsh Gupta
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > 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
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Problem in save Data into DB and with Created and modified fields.

2010-08-09 Thread Jeremy Burns | Class Outfit
$this->ModelName->create() [[NB NOT created ]] does exactly what it says it 
will; it creates a new record. In any event, your two blocks of code are 
different; one has a create statement, the other does not. What you should 
check is whether there is an id element in your data array. If there is one, 
Cake will update that row. If there isn't one, Cake will create a new row.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 10 Aug 2010, at 06:48, Techinfocomp.com wrote:

> Hi,
> 
> i am using 1.3.3 stable version.
> 
> i am heaving problem with this version.
> 
> let take an example:-
> 
> if i do this
> 
> $this->ModelName->save($this->data);
> 
> this link will update my 1st row every time i run this.
> 
> but
> 
> if i do this
> 
> $this->ModelName->created();
> $this->ModelName->save($this->data);
> 
> this will create new record in table.
> 
> why is this happen all the time, i never face this king of problem in
> version 1.2.
> 
> 
> now another problem.
> 
> on my local pc i am running vista with xampp and cakePHP version 1.3.3
> 
> created filed in table is working fine. model automatically create
> data for this column but it's not working on live server which is
> running php 5 , my sql 5.
> 
> 
> any help ?
> 
> waiting for your reply
> 
> Thanks
> Harsh Gupta
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Problem in save Data into DB and with Created and modified fields.

2010-08-09 Thread Techinfocomp.com
Hi,

i am using 1.3.3 stable version.

i am heaving problem with this version.

let take an example:-

if i do this

$this->ModelName->save($this->data);

this link will update my 1st row every time i run this.

but

if i do this

$this->ModelName->created();
$this->ModelName->save($this->data);

this will create new record in table.

why is this happen all the time, i never face this king of problem in
version 1.2.


now another problem.

on my local pc i am running vista with xampp and cakePHP version 1.3.3

created filed in table is working fine. model automatically create
data for this column but it's not working on live server which is
running php 5 , my sql 5.


any help ?

waiting for your reply

Thanks
Harsh Gupta

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Differences with extract and classicExtract

2010-08-09 Thread fly2279
I've noticed a difference in the extract and classicExtract methods of
the Set class. When extracting data from an array that only has one
numeric key set the results aren't the same when using extract and
classicExtract if the numeric key isn't 0. For example:
$data = array(
  15 =>
'Post' => array(
  'id' => 15,
)

)
$results = Set::extract('/Post/id', $data);

Using extract with xpath syntax $results is an empty array. When using
classicExtract it works either way. However if you have sequential
numeric indexes starting at zero then Set::extract does return
results. There are many times when I use Set::combine  to change the
keys of a find operation to the id of whatever is being found.

The below works with both because the numeric key is 0.

$data = array(
  0 =>
'Post' => array(
  'id' => 15,
)

)
$results = Set::extract('/Post/id', $data);

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: relationship advice

2010-08-09 Thread Andras Kende
Felix,

for a simple cart not sure if habtm is needed...

could be:


products
id | name | description | image | price | qty


orders
id | name | address | grandtotal | tracking | status |

order hasmany orderi_tems


order_items
id | order_id | product_id | qty | price |etc...

order_items belongsto order , product


Andras Kende
http://www.kende.com



On Aug 9, 2010, at 12:27 PM, Felix wrote:

> Hi, I was wondering if anyone can help with a problem I'm having.
> 
> I'm building a simple shopping cart system for which I have two
> objects
> 
> 1. Product (stores product details - name, cost, SKU, etc.)
> 
> 2. Order (Stores order details - customer address, shipping type,
> etc.)
> 
> In the database these are joined using the table, orders_products.
> 
> Cake correctly recognises the HABTM relationship between the two, so
> far so good.
> 
> What I'm now stuck at is how to incorporate a quantity variable.
> 
> Each product in an order must have a quantity but I don't know where
> to put it,
> 
> I don't think it belongs in the products table or the order table, so
> the only place I can think of is in the join table (orders_products).
> 
> If I add this field in how would I then set or read its value, seeing
> as it has no model I don;t know how to address it.
> 
> The join table does show up when baking so I could add one, but I
> don't know if this would mess up the HABTM between the product and
> order models, and if it does what relationships I need to define in
> the relevant models to resolve such issues.
> 
> I may of course be missing something or asking a very stupid question,
> in which case sorry but could you point out my idiocy!
> 
> Thanks, Felix
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: relationship advice

2010-08-09 Thread Jeremy Burns | Class Outfit
I'd be tempted to have an order_items table that is not ruled by habtm. Then 
you can add columns for product_id, quantity, price_charged, tax, dispatched 
etc.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 9 Aug 2010, at 17:27, Felix wrote:

> Hi, I was wondering if anyone can help with a problem I'm having.
> 
> I'm building a simple shopping cart system for which I have two
> objects
> 
> 1. Product (stores product details - name, cost, SKU, etc.)
> 
> 2. Order (Stores order details - customer address, shipping type,
> etc.)
> 
> In the database these are joined using the table, orders_products.
> 
> Cake correctly recognises the HABTM relationship between the two, so
> far so good.
> 
> What I'm now stuck at is how to incorporate a quantity variable.
> 
> Each product in an order must have a quantity but I don't know where
> to put it,
> 
> I don't think it belongs in the products table or the order table, so
> the only place I can think of is in the join table (orders_products).
> 
> If I add this field in how would I then set or read its value, seeing
> as it has no model I don;t know how to address it.
> 
> The join table does show up when baking so I could add one, but I
> don't know if this would mess up the HABTM between the product and
> order models, and if it does what relationships I need to define in
> the relevant models to resolve such issues.
> 
> I may of course be missing something or asking a very stupid question,
> in which case sorry but could you point out my idiocy!
> 
> Thanks, Felix
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


relationship advice

2010-08-09 Thread Felix
Hi, I was wondering if anyone can help with a problem I'm having.

I'm building a simple shopping cart system for which I have two
objects

1. Product (stores product details - name, cost, SKU, etc.)

2. Order (Stores order details - customer address, shipping type,
etc.)

In the database these are joined using the table, orders_products.

Cake correctly recognises the HABTM relationship between the two, so
far so good.

What I'm now stuck at is how to incorporate a quantity variable.

Each product in an order must have a quantity but I don't know where
to put it,

I don't think it belongs in the products table or the order table, so
the only place I can think of is in the join table (orders_products).

If I add this field in how would I then set or read its value, seeing
as it has no model I don;t know how to address it.

The join table does show up when baking so I could add one, but I
don't know if this would mess up the HABTM between the product and
order models, and if it does what relationships I need to define in
the relevant models to resolve such issues.

I may of course be missing something or asking a very stupid question,
in which case sorry but could you point out my idiocy!

Thanks, Felix

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to resolve this? One table per type of object, many users, user can access only his objects

2010-08-09 Thread cricket
On Sun, Aug 8, 2010 at 11:16 AM, Mariaczi.PL  wrote:
> Hi!
>
> I have a problem.
>
> I need to create card indexes.
>
> Group has Files(e.g. Families), Group has many users, and users from
> one group have to have access only for records which have correct
> group_id.
> Families is one table, and family have memberships :) like parents,
> childrens.
> Security is very important. Users from other groups shouldnt can see
> or edit files which is property of another group.
>
> How to resolve this... ?

It's difficult to say without a better idea of your models. Your
explanation is a bit confusing. But something like:

'conditions' => array(
'Model.group_id' => $this->Auth->user('group_id')
)

That'll work in the controller but, if your find() code is in the
model, you'll need to pass the group_id to the model method:

$data = $this->Model->fetchStuff($this->Auth->user('group_id'));

function fetchStuff($group_id = null)
{
   

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Problem with blog example - Cake 1.3.3 PHP version?

2010-08-09 Thread cricket
On Sat, Aug 7, 2010 at 11:48 AM, nick  wrote:
> This seems very basic but I am trying the "blog" example line by
> line.
> I am using Cake version 1.3.3
>
> When I try the add post basically adding functionality to add the
> post, everything works fine until I try to save the new record.
> I get the error - Fatal error: Cannot access empty property in /home/
> nick/www/blog/cake/libs/model/model.php on line 978
>
> I looked further and found on model.php#978 access like this -
>
>  $this->{$model}
>
> Now removing braces and $ worked!  i.e.
>  $this->model is fine without any errors.
>
> This is not the right fix, I know because $this->model is not even set
> but the property access itself was a problem before.
>
> Not sure if this is PHP4 / PHP5 difference, but I assumed Cake 1.3.3
> works on PHP5.
>
> Any insight will be highly appreciated. The server that I am using is
> -
> Apache/2.0.54 (Ubuntu) PHP/5.0.5-2ubuntu1.8
>
> Thanks in advance

Perhaps it's a problem with your DB schema. The $model var should be
the name of the model, as passed to the method, eg. 'Post.title'. The
list($model, $column) = explode('.', $column); line is where the
$model var should be populated. If that's empty then it's likely that
$column doesn't include the model name for some reason.

Try adding debug($column) or die(debug($column)) just before and after
this line:

$column = str_replace(array($db->startQuote, $db->endQuote), '', $column);

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: auto input value to a field

2010-08-09 Thread Jeremy Burns | Class Outfit
Use the default property: http://book.cakephp.org/view/1402/options-default

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 9 Aug 2010, at 16:00, james wrote:

> Hi,
> 
> I have a user field that at the moment is populated via a dropdown
> that is a list of all users in the tabel. What I'd like to do is auto
> populate that field from theAuth.User.username value so that the user
> never has to enter their name in a record.
> 
> How is this done?
> 
> thanks!
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


auto input value to a field

2010-08-09 Thread james
Hi,

I have a user field that at the moment is populated via a dropdown
that is a list of all users in the tabel. What I'd like to do is auto
populate that field from theAuth.User.username value so that the user
never has to enter their name in a record.

How is this done?

thanks!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: View, Layout and Element

2010-08-09 Thread Jonathan Querubina
What is the cake version?

try rename to default.ctp

By John Chronus



On Mon, Aug 9, 2010 at 10:12 AM, Mariano C.  wrote:
> I have completed my application's development, now I wanna start to
> style anything with my css. I have created a default.thtml and saved
> it under app/views/layouts but I still see the cakephp style. Why?
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


View, Layout and Element

2010-08-09 Thread Mariano C.
I have completed my application's development, now I wanna start to
style anything with my css. I have created a default.thtml and saved
it under app/views/layouts but I still see the cakephp style. Why?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Habtm maddness

2010-08-09 Thread bartez
this is the sql:


SELECT DISTINCT tags.title
FROM tags
INNER JOIN pages_tags ON pages_tags.tags_id = tags.id
WHERE pages_tags.pages_id
IN (

SELECT pages.id
FROM pages
INNER JOIN pages_tags ON pages_tags.pages_id = pages.id
INNER JOIN tags ON tags.id = pages_tags.tags_id

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Habtm maddness

2010-08-09 Thread bartez
Hey!

Ok i have pages which have and belong to many tags.

I do not want to use categories so i'm using tags instead.

For example, i'm tagging a page with help, development, design or
article, development, peace

When i load the page /views/article, i would like to load all the tags
that belong to pages that belong to articles tag.

I'm totally stuck on how to do this.

Can anyone help?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Any browser game powered by CakePHP?

2010-08-09 Thread Zippoxer
Looks great, But this is closed for testing now  =]
Any other games?

On Aug 9, 12:27 pm, Quess  wrote:
> http://racelords.pl/(gam is in polish)
>
> Currently the game status is still beta but I was playing it few
> months ago and game look quite nice and was very playable.
>
> Regards,
> Miro
>
> On 8 Sie, 16:44, Zippoxer  wrote:
>
>
>
> > I'm trying to create a browser game for few months already. A big
> > journey between the languages made me understand that PHP is the best
> > choice for creating very dynamic systems (like a browser game).
> > One of the best browser games ever is powered by Symfony, this game
> > called eRepublik.
> > But Symfony is not for me - there's almost no logic there, and things
> > are pretty messy (I hope Symfony2 will offer more logic less mess).
>
> > So I turned to CakePHP few days ago and I learned it good enough to
> > develop a browser game, but I have to see any examples of games or
> > very dynamic systems built with CakePHP.
> > Anyone knows where can I find it?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: how to make sum query on cake ?

2010-08-09 Thread Jeremy Burns | Class Outfit
Follow the MIN example, and replace the MIN with SUM.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 9 Aug 2010, at 10:34, Cruisine wrote:

> tq for ur answer.
> but i couldnt found any statement that explaining about how to sum a
> field in query on cakephp..
> so..any idea?
> 
> On Aug 9, 4:23 pm, Jeremy Burns | Class Outfit
>  wrote:
>> There is an example here 
>> (http://book.cakephp.org/view/1030/Complex-Find-Conditions) that shows how 
>> to do a MIN query, which is essentially the same thing.
>> 
>> Jeremy Burns
>> Class Outfit
>> 
>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>> 
>> On 9 Aug 2010, at 10:09, Cruisine wrote:
>> 
>>> hi i'm still newbie at cakephp.
>>> and i still wondering how to make sum query on cakephp ?
>>> for example i want to make a query like this :
>>> select count(id) as customer, sum(payment) as money from customer
>>> where department_id=1
>>> how to implement it on cakephp ??
>>> do you have the solution ?
>>> i need ur help..tq
>> 
>>> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
>>> with their CakePHP related questions.
>> 
>>> 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
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>>> athttp://groups.google.com/group/cake-php?hl=en
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: how to make sum query on cake ?

2010-08-09 Thread Cruisine
tq for ur answer.
but i couldnt found any statement that explaining about how to sum a
field in query on cakephp..
so..any idea?

On Aug 9, 4:23 pm, Jeremy Burns | Class Outfit
 wrote:
> There is an example here 
> (http://book.cakephp.org/view/1030/Complex-Find-Conditions) that shows how to 
> do a MIN query, which is essentially the same thing.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 9 Aug 2010, at 10:09, Cruisine wrote:
>
> > hi i'm still newbie at cakephp.
> > and i still wondering how to make sum query on cakephp ?
> > for example i want to make a query like this :
> > select count(id) as customer, sum(payment) as money from customer
> > where department_id=1
> > how to implement it on cakephp ??
> > do you have the solution ?
> > i need ur help..tq
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > 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
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: how to make sum query on cake ?

2010-08-09 Thread Jeremy Burns | Class Outfit
There is an example here 
(http://book.cakephp.org/view/1030/Complex-Find-Conditions) that shows how to 
do a MIN query, which is essentially the same thing.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 9 Aug 2010, at 10:09, Cruisine wrote:

> hi i'm still newbie at cakephp.
> and i still wondering how to make sum query on cakephp ?
> for example i want to make a query like this :
> select count(id) as customer, sum(payment) as money from customer
> where department_id=1
> how to implement it on cakephp ??
> do you have the solution ?
> i need ur help..tq
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Any browser game powered by CakePHP?

2010-08-09 Thread Quess
http://racelords.pl/ (gam is in polish)

Currently the game status is still beta but I was playing it few
months ago and game look quite nice and was very playable.

Regards,
Miro

On 8 Sie, 16:44, Zippoxer  wrote:
> I'm trying to create a browser game for few months already. A big
> journey between the languages made me understand that PHP is the best
> choice for creating very dynamic systems (like a browser game).
> One of the best browser games ever is powered by Symfony, this game
> called eRepublik.
> But Symfony is not for me - there's almost no logic there, and things
> are pretty messy (I hope Symfony2 will offer more logic less mess).
>
> So I turned to CakePHP few days ago and I learned it good enough to
> develop a browser game, but I have to see any examples of games or
> very dynamic systems built with CakePHP.
> Anyone knows where can I find it?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


how to make sum query on cake ?

2010-08-09 Thread Cruisine
hi i'm still newbie at cakephp.
and i still wondering how to make sum query on cakephp ?
for example i want to make a query like this :
select count(id) as customer, sum(payment) as money from customer
where department_id=1
how to implement it on cakephp ??
do you have the solution ?
i need ur help..tq

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Any CakePHP plugin to act as Module Builder?

2010-08-09 Thread majna
http://cakepackages.com/package_search/acl
http://github.com/Theaxiom/SuperAuth

On Aug 9, 5:06 am, weilies  wrote:
> thanks for the reply and i jz tried out IBM cakePHP tutorial
> yeah you are right, the only diff is one with UI but another via cmd
> line and code editor
>
> i m still learning the available feat by cakePHP.
> Plz let me know is there any cakePHP extension/forum out there? I
> didn't get any proper result from google
>
> would like to find out more on role/row level security, workflow
> extension which allow me to bake cake of ERP
>
> Thanks for the help
>
> On Aug 2, 9:11 pm, AD7six  wrote:
>
> > On Jul 30, 11:22 am, weilies  wrote:
>
> > > i understand that CakePHP is powerful enough to allow user create DB
> > > table, run a command to generate CRUD.
>
> > > But i wonder is there any available module/plugin which allow CakePHP
> > > to have a "module builder", which mean i dont need to dirty my hand by
> > > touch the script
>
> > If you don't want to get your hand's dirty, cake isn't for you as it's
> > a framework not a cms etc.
>
> > > or create record through phpmyadmin?
>
> > > If you have use SugarCRM, there is a powerful Module Builder, which
> > > allow user of the system create new component without touching code.
> > > They can also join two different Module by define the relationship.
> > > 1-1, 1-N, N-N
> > > and also a panel editor which allow to modify the layout.
>
> > What's the difference with what you describe and using bake?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: customize error message

2010-08-09 Thread Jeremy Burns | Class Outfit
Do you mean the style? If so, by default the message is placed into a div (for 
example, for an auth error, div id="flashMessage") which you can style using 
CSS. Or you can set a particular class when you set the flash message:

$this->Session->setFlash('Example message text', 'default', array('class' => 
'example_class'))

See http://book.cakephp.org/view/1313/setFlash

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 8 Aug 2010, at 05:38, hoss7 wrote:

> how can i customize error message(setflash or flash function)?
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


WWW engine for users and how to join CakePHP and wildcard...

2010-08-09 Thread Mariaczi.PL
Hi!

I have an application powered by cakephp.
users have some options in client panel (mydomain/manager),
and i want to create www module for every user and it need to be
accessed on login.domain
i dont know how to do this.

user should can add sites, galery, newses on his www site.
i thought about create controller like 'www' and use wildcard to pass
login.domain to domain/www/login

how to do this? when someone enter login.domain, and click e.g. link /
news, i need have still login.domain/news..

please help

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to disable prefixes on login or logout?

2010-08-09 Thread Tilen Majerle
then maybe this try...idk i'm not sure if work

 {{{

$this->Auth->authorize = 'actions';
 $this->Auth->loginAction = array('controller' => 'users', 'action' =>
'login', 'prefix' => false, 'prefix2' => false);
 $this->Auth->loginRedirect = array('controller' => 'users', 'action' =>
'login', 'prefix' => false, 'prefix2' => false);
 $this->Auth->logoutRedirect = array('controller' => 'users', 'action' =>
'login');
 }}}

and if this doesn't work...should work this:

 {{{

 if (isset($this->params["admin"]) && $this->params["admin"]) { $prefix =
"admin"; } else if (isset($this->params["yourprefix"]) &&
$this->params["yourprefix"]) ///do this. { $prefix = "yourprefix"; }
//until u don't go through all prefixes else { $prefix = false; }
$this->Auth->authorize = 'actions'; $this->Auth->loginAction =
array('controller' => 'users', 'action' => 'login', $prefix => false);
$this->Auth->loginRedirect = array('controller' => 'users', 'action' =>
'login', $prefix => false); $this->Auth->logoutRedirect = array('controller'
=> 'users', 'action' => 'login');

   ///i didn't try live but it should work...
 }}}

--
LP,
Tilen Majerle http://majerle.eu


2010/8/8 Marek Wojciech Urbanowicz 

>  but i have more prefixes .. not only admin
>
> W dniu 2010-08-08 22:29, Tilen Majerle pisze:
>
> something like that
>
>  {{{
>  $this->Auth->authorize = 'actions';
>  $this->Auth->loginAction = array('controller' => 'users',
> 'action' => 'login', 'prefix' => false); // prefix is admin
>  $this->Auth->loginRedirect = array('controller' => 'users',
> 'action' => 'login', 'prefix' => false); // prefix is admin
>  $this->Auth->logoutRedirect = array('controller' => 'users',
> 'action' => 'login');
> }}}
>
>
> --
> LP,
> Tilen Majerle http://majerle.eu
>
>
> 2010/8/8 Mariaczi.PL 
>
>> Hi!
>>
>> Is any way to disable prefixes when login is needed ?
>> I have in  my app_controller:
>> {{{
>>  $this->Auth->authorize = 'actions';
>>  $this->Auth->loginAction = array('controller' => 'users',
>> 'action' => 'login');
>>  $this->Auth->loginRedirect = array('controller' => 'users',
>> 'action' => 'login');
>>  $this->Auth->logoutRedirect = array('controller' => 'users',
>> 'action' => 'login');
>> }}}
>>
>> and when i try acces /prefix/controller/action and im not logged, cake
>> redirect me to /prefix/users/login, not to /users/login or /login (i
>> have routing - login -> users/login)
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> 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
>> cake-php+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php?hl=en
>
>
> --
> *z poważaniem
> Marek Wojciech Urbanowicz*
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: how can i tell cake to delete directories automatically after a specific time

2010-08-09 Thread Tomfox Wiranata
thx miles for the reply...

is there sth specific in cake to do this?

On 6 Aug., 20:35, Miles J  wrote:
> Just setup a cron job that runs every 1/24 hour(s) that cleans up the
> tmp directory.
>
> Why not just put all uploads into the same tmp directory? Very slim
> chance anything will ever overwrite each other.
>
> On Aug 6, 6:03 am, Tomfox Wiranata  wrote:
>
> > hi,
>
> > lets say  a user uploads an image. then i create a temp-folder to save
> > it temporarily. once the user is finished i delete this temp directory
> > and copy the image to the actual path.
>
> > now lets say, he uploads it, cake puts it to the temp directory and
> > the user cancels the process by shutting down the browser or just
> > leaving the website. if that happens, i want to delete the temp-dir.
> > so is it possible to check if the user left the site or shut down the
> > browser?
>
> > if not, then i'd like to check what temp directories have been created
> > 24hrs ago and still exist, so i can delete them. is that possible?
>
> > thank you so far. as usual :)
>
> > btw: i love this forum

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en