Re: Is Model::findCount supposed to work?!?!?!?!

2006-10-16 Thread AD7six


SoCalCakeBaker wrote:
> If anyone has any thoughts hit me ...
Look at, or wait for, the cake 1.2 code ;)

HTH,

AD7six


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: making controller methods private?

2006-10-16 Thread [EMAIL PROTECTED]

Dave wrote:
> > Also, check out the MySecurity component which prevents calling methods
> > of the controller base 
> > class:http://rossoft.wordpress.com/2006/08/23/mysecurity-component/
>
> Otherwise, users can call methods of the controller base class? What
> degree of security problem does that create?

You could call things like /accounts/render/update or whatever and
thereby executing code used in the view. I'm not familiar with all
available methods in the base class but there's bound to be one or more
the could pose a security threat if called directly. If not now, than
maybe in a future Cake version.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: CakePHP.org and IE 7

2006-10-16 Thread Armando Sosa

mmm... that would be me. I'll check this.

On 10/16/06, Hanzgroove <[EMAIL PROTECTED]> wrote:
>
> Hi guys,
>
> So I read this article today (I've pasted it below) about the release
> of IE 7 and how developers should download the preview version just to
> make sure their sites will look ok. Especially since Internet Explorer
> 7 will be pushed as an automatic update when its officially released
> this month.
>
> I downloaded a copy and looked at a few of my sites. No major issues, a
> few things out of place but nothing that can't be fixed quickly.
> Anyway, I decided to check out cakephp.org and there are definitely
> display problems on the cake homepage with IE 7. So just a heads up to
> the guys at Cake and to the rest of you guys so you're not surprised
> later this month.
>
> Here's the article:
>
>
>
> Time's Up: Internet Explorer 7 Coming This Month
>
> I've said it before, but if you haven't tested and corrected any issues
> that exist with your site in the new Internet Explorer 7 browser, you
> need to get on it right away. Microsoft has announced that the final
> version of the browser will be released before the end of this
> month-that's less than two weeks away, people!
>
> In the weeks following this initial release, Microsoft will deploy the
> browser to all Windows XP users via Automatic Updates. Although the
> installation of IE7 will not be forced as it was for Windows XP Service
> Pack 2 (users will be able to postpone or cancel the update if they so
> desire), a message will appear recommending that users proceed with the
> installation, which most of them undoubtedly will.
>
> Chris Wilson, group Program Manager of the Internet Explorer Platform
> team at Microsoft, spoke at the Fundamentos Web 2006 conference and
> implored the developers there to test their sites with IE7 and fix any
> issues that appeared. There are a number of people on the IE7 team that
> have put their jobs on the line by implementing the standards
> compliance fixes and CSS features that we have been demanding for
> years, in some cases breaking compatibility with sites that were
> designed for the browser's previous nonstandard behaviour.
>
> As the dominant browser, Internet Explorer has the potential to
> effectively break the Web if the sites that everyday users rely upon do
> not work correctly in this new version. Despite this, Microsoft has
> taken an enormous leap of faith by sacrificing compatibility in the
> name of standards compliance. It's up to us as developers to ensure
> that this leap of faith pays off, so that we can continue to see
> improvements to standards compliance in future releases of Internet
> Explorer.
>
> You're not on your own, here. Microsoft has produced an impressive
> array of tools and documentation to help developers migrate their sites
> to IE7, and the SitePoint Forums community is at your service to answer
> any lingering questions.
>
> Together, we can make IE7 the success it needs to be to secure the
> future development and adoption of web standards that make our jobs
> easier and more exciting!
>
> That's all for this issue-thanks for reading!
>
>
> >
>


-- 
Armando Sosa

www.nolimit-studio.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



CakePHP.org and IE 7

2006-10-16 Thread Hanzgroove

Hi guys,

So I read this article today (I've pasted it below) about the release
of IE 7 and how developers should download the preview version just to
make sure their sites will look ok. Especially since Internet Explorer
7 will be pushed as an automatic update when its officially released
this month.

I downloaded a copy and looked at a few of my sites. No major issues, a
few things out of place but nothing that can't be fixed quickly.
Anyway, I decided to check out cakephp.org and there are definitely
display problems on the cake homepage with IE 7. So just a heads up to
the guys at Cake and to the rest of you guys so you're not surprised
later this month.

Here's the article:



Time's Up: Internet Explorer 7 Coming This Month

I've said it before, but if you haven't tested and corrected any issues
that exist with your site in the new Internet Explorer 7 browser, you
need to get on it right away. Microsoft has announced that the final
version of the browser will be released before the end of this
month-that's less than two weeks away, people!

In the weeks following this initial release, Microsoft will deploy the
browser to all Windows XP users via Automatic Updates. Although the
installation of IE7 will not be forced as it was for Windows XP Service
Pack 2 (users will be able to postpone or cancel the update if they so
desire), a message will appear recommending that users proceed with the
installation, which most of them undoubtedly will.

Chris Wilson, group Program Manager of the Internet Explorer Platform
team at Microsoft, spoke at the Fundamentos Web 2006 conference and
implored the developers there to test their sites with IE7 and fix any
issues that appeared. There are a number of people on the IE7 team that
have put their jobs on the line by implementing the standards
compliance fixes and CSS features that we have been demanding for
years, in some cases breaking compatibility with sites that were
designed for the browser's previous nonstandard behaviour.

As the dominant browser, Internet Explorer has the potential to
effectively break the Web if the sites that everyday users rely upon do
not work correctly in this new version. Despite this, Microsoft has
taken an enormous leap of faith by sacrificing compatibility in the
name of standards compliance. It's up to us as developers to ensure
that this leap of faith pays off, so that we can continue to see
improvements to standards compliance in future releases of Internet
Explorer.

You're not on your own, here. Microsoft has produced an impressive
array of tools and documentation to help developers migrate their sites
to IE7, and the SitePoint Forums community is at your service to answer
any lingering questions.

Together, we can make IE7 the success it needs to be to secure the
future development and adoption of web standards that make our jobs
easier and more exciting!

That's all for this issue-thanks for reading!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Need multiple recursive levels

2006-10-16 Thread johnpfisk

Sure, I only meant that the first model contains a fair bit of
information which isn't really related to that model. If you start
altering the other related models (adding or removing associations for
example) you need to go back and change the first model too.

Mind you, I'm doing this in a beforeFind in the first Model. I suppose
it could be done in the controller...

I have to agree that it seems like a bit of a hack to me too, but it
seems to work!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: 2 forms and 1 submit button

2006-10-16 Thread Grant Cox

You can't really have two forms (without javascript/ajax hackery), but
you can submit a form with data from multiple models, to a single
action.

So, in your form just have fields for both models (ie
$html->input("Model1/name") ... $html->input("Model2/title") ), and in
your controller action that receives the form, look at
$this->data["Model1"] and $this->data["Model2"], and validate/save
accordingly.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Session and sessionid

2006-10-16 Thread Grant Cox

Well, this ( http://manual.cakephp.org/chapter/session ) would be the
short introduction to cake sessions.  If that doesn't answer your
question, perhaps be a little more specific as to what you want (I'm
not sure why you would want to handle the mechanics of sessions
yourself).


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Getting related records in a view

2006-10-16 Thread Grant Cox

First, you need to set up your associations in your Model files,
something like:

var $hasMany = array("HousePlan")

in your app/models/community.php, and

var $belongsTo = array("Community")

in your app/models/house_plan.php


Then, when retrieving your HousePlan model in
house_plan_controller.php, first set the $this->HousePlan->recursive to
2, this will retrieve two levels of associations from a HousePlan.  The
first level is to get the HousePlan's Community, the second level will
get the Community's House Plans.

Your house_plan_controller.php view() function will probably be
something like

function view($id){
  $this->HousePlan->recursive =2;
  $house_plan = $this->HousePlan->read( null, $id );
  $this->set("house_plan", $house_plan);
}

Now in your views/house_plan/view.thtml, have a look at the $house_plan
variable, it will be an associative array with all of the Community
details, and that Community's House Plans.

For more details on associations, check out
http://manual.cakephp.org/chapter/models


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Need multiple recursive levels

2006-10-16 Thread gourlay

So what I've figured out (i'm sure this is really obvious but I'm new)
is that i can reach into the  associated models from the active model
and "unhook" what I don't need using unbind.  Previously I was under
the impression I could only unhook direct assocaitions in the top level
model i was currently interacting with.

This allows me to alter any associations in any method, and tailor my
result from a findAll call to only the details i need.  It still seems
like this is a bit of a hack.

I don't follow exactly how this approach (if i'm using the same
approach as johnpfisk) creates dependencies on the first model?  I'm
curious if you could explain that more.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Cake PHP Zend Studio Templates

2006-10-16 Thread Andre Medeiros

Can you add me to the project then?

On Oct 15, 1:05 am, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> we can keep them all in the cakeforge project that has the textmate templates
>
> http://cakeforge.org/projects/tmbundle/
>
> I'll update the textmate links and add anyone who wants to work on
> other ide sets
>
> On 10/14/06, John David Anderson (_psychic_) <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > On Oct 14, 2006, at 4:23 PM, Marcelo de Moraes Serpa wrote:
>
> > > >Not right now.
>
> > > >I will install Eclipse + PHPEclipse tomorrow and create a conversion
> > > >script so I can publish that too.
>
> > Might not this stuff fit well into the cakedocs Cakeforge project
> > (alongside the manual, cakesheet, PDF, and others)?
>
> > -- John--
> ==
> S. DeVore
> (the old fart) the advice is free, the lack of crankiness will cost you


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: CakePHP on goDaddy?

2006-10-16 Thread [EMAIL PROTECTED]

Great! Exactly what I was looking for. I'll give it a try tonight and
let you know.  Thanks!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: making controller methods private?

2006-10-16 Thread Dave

> Just preceed the function name with a underscore.

That's beautiful. I had already done that just by convention. :-)

> Also, check out the MySecurity component which prevents calling methods
> of the controller base 
> class:http://rossoft.wordpress.com/2006/08/23/mysecurity-component/

Otherwise, users can call methods of the controller base class? What
degree of security problem does that create?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



ajax to update form fields?

2006-10-16 Thread [EMAIL PROTECTED]

How do use ajax to populate some form fields without a refresh?  For
example, I have a form with 10 elements.  The first element is a select
dropdown.  Upon choosing something from the dropdown, the other 9
elements get populated based on what was chosent ( radio buttons get
checked, checkboxes get checked, input fields get populated).  How do I
accomplish this with ajax?  I could not find a suitable tutorial
online.

Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Getting related records in a view

2006-10-16 Thread tracyfloyd

First CakePHP project. So far, I'm loving it. But I have hit a
roadblock...

I have two tables: "communities" and "house_plans"
A community can have many house plans, so I have a community_id field
set in my house_plans table.

in my plan view, I'd like to show that plans details, but also include
a list of all the other plans that are in the same community as the one
you're viewing... i.e. say you were at this page, viewing this
house_plan:

www.site.com/plans/view/5

And in the house_plans table, record ids 8, 9, and 10 also have the
same community_id as record 5 above.

How do I get these related plans to show up in my view?

Thanks!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Is Model::findCount supposed to work?!?!?!?!

2006-10-16 Thread SoCalCakeBaker

True, but I was just trying to do a findCount..., then modify the
$limit and $page params and allow the findAll to proceed and return the
bounded dataset.

I've seen the component approach, but I'm just not conviced that there
needs to be anything outside of the Model on this - if the Model (when
told to do) simply serves the requested data back in a decorated way -
it's seamless.  Then a view helper can be passed the result and render
the datagrid & paginate.

I accomplished for Model::find already by doing the following:

function query($sql){
if ($this->_datagrid){
$return_data = array();

// First Get Record count of unbounded query
$query_info = parent::query('EXPLAIN ('.$sql.')');
$total_records = $query_info[0][0]['rows'];
$return_data['pagination']['num_records'] = 
$total_records;
$return_data['pagination']['num_pages'] = 
(int)floor($total_records
/ $this->num_rows);
$return_data['pagination']['current_page'] = 
$this->current_page;

// Now bound the query and get the dataset
$record_offset = $this->findRecordOffset();
$sql .= ' LIMIT '.$record_offset.','.$this->num_rows;
$return_data['rows'] = parent::query($sql);
return $return_data;
} else {
return parent::query($sql);
}
}

This can done for findAll as well if I could just get the unbounded
count.  I have a hacked version that grabs the whole dataset and
returns only the rows for the given page - but NOT fetching the whole
dataset is the reason for pagination in the first place :)

If anyone has any thoughts hit me up - I'd love to get this posted to
cakeforge!

Best,

B.

On Oct 16, 11:59 am, "AD7six" <[EMAIL PROTECTED]> wrote:
> If you call a method that triggers a find in your beforeFind method you
> created a loop ;).
>
> If you goal is just pagination have you seen 
> this:http://bakery.cakephp.org/articles/view/65
>
> Also, cake 1.2 will have native pagination support.
> 
> HTH,
> 
> AD7six


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: using urlencoded params

2006-10-16 Thread Rodrigo Tassinari

Thanks everyone for your replies, they were very helpful.

However I found a way to use the normal javascript urlencode functions
with CakePHP: all you have to do is pass the urlencoded parameters to
your action via GET, like:

http://mysite/controller/action?param1=urlencodedvalue1¶m2=urlencodedvalue2

The urlencoded values will be decoded only once (so it wont mess up
cake), and will be avaiable in your controller via
$this->params['url']['param1'] for example. You can use them directly,
without decoding. If you need to pass them to other actions, just
urlencode them again in PHP and pass them in a redirect in the same
manner.

Hope it helps you guys too.

Rodrigo.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Is Model::findCount supposed to work?!?!?!?!

2006-10-16 Thread AD7six

If you call a method that triggers a find in your beforeFind method you
created a loop ;).

If you goal is just pagination have you seen this:
http://bakery.cakephp.org/articles/view/65

Also, cake 1.2 will have native pagination support.

HTH,

AD7six


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Is Model::findCount supposed to work?!?!?!?!

2006-10-16 Thread John David Anderson (_psychic_)

Model::findCount() isn't supposed to work, we actually added it to  
fake people out back in 0.9. Sorry about that.

;o)

On Oct 16, 2006, at 11:09 AM, SoCalCakeBaker wrote:

> 
> This leads to my problem which occurs in AppModel::beforeFind.  To
> calculate num_pages, you have to know how many records are in your
> un-bounded dataset.  So I try to do a $this->findCount() and the page
> goes blank.  No error on the screen or in a log anywhere.

Did you turn up DEBUG?

Also, and this may just be me, but how can you find out how many  
records you've found in a beforeFind() callback that happens before  
you find anything?

-- John

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Is there a way to set individual TD properties?

2006-10-16 Thread Mikee Freedom

Hey Piaui,

looking at the function in /cake/libs/views/helpers/html.php in the
cake core it seems that you can't define classes or attributes of
particular cells but only oddTrOptions and evenTrOptions.

What properties are you trying to set?

you could try writing a wrapper function, or your own function that
performs that same task but with a little more detail involved.

HTH
freedom

On 17/10/06, Piaui <[EMAIL PROTECTED]> wrote:
>
> Hi everybody,
>
> I was using $html->tableCells and I was wondering if there is a way to
> set individual properties (like different width values, align values).
>
> Its just because if I use $html->tableCells I can only set properties
> to the entire row (odd or even), not only to just a cell ().
>
> Can anyone light things up?
>
> thank and sorry my english.
> Piaui
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: 1 of 3 input fields have to be filled - validate

2006-10-16 Thread Mikee Freedom

morning Felix,

looks like you'll be needing some advanced validation:

http://wiki.cakephp.org/tutorials:advanced_validation
http://wiki.cakephp.org/tutorials:alternate_advanced_validation

by using this method you can pretty much define whatever validation
methods you like. have a read, and if anything is not clear let me
know.

HTH
freedom

On 17/10/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hi there,
>
> I have 3 Input-fields and I would like to check, if at least one field
> has data in it to store in the database.
> Right now I have this code in my model:
>
>  var $validate = array(
>'field1'   => VALID_NOT_EMPTY,
>'field2'   => VALID_NOT_EMPTY,
>'field3'   => VALID_NOT_EMPTY
>  );
>
> But with this validation the user has to type into all of these 3
> fields and not only 1.
>
> Thanks
> Felix
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Generating & displaying images doesn't quite work, ever.

2006-10-16 Thread HalfBaked

When I had the same problem, actually Three newlines before the PNG, it
ended up being a single newline after the ?> in Three completely
unrelated controller files.  It took me days to figure this one out.
Make sure you are looking for extra whitespace in ALL your files, not
just the ones that are related to your image generation.

I also determined that having DEGUG = 1 did not affect the PNG.  The
browser seemed to ignore the HTML comment in the image file.

Good Luck.

meek wrote:
> Looking at the image source, I'm pretty sure there's some extra
> whitespace in there. - two newlines before the 'PNG' is outputted.
> Maybe you have some newlines outwith the  tags?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Is there a way to set individual TD properties?

2006-10-16 Thread Piaui

Hi everybody,

I was using $html->tableCells and I was wondering if there is a way to
set individual properties (like different width values, align values).

Its just because if I use $html->tableCells I can only set properties
to the entire row (odd or even), not only to just a cell ().

Can anyone light things up?

thank and sorry my english.
Piaui


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Is Model::findCount supposed to work?!?!?!?!

2006-10-16 Thread SoCalCakeBaker

Hi list,

I'll just preface the issue I'm having with what I'm trying to do...I'm
trying to extend Cake's AppModel to make it easier to return results
suited for producing a DataGrid with pagination controls.  The goal is
to setup Models to be worked with in the controller like:

$this->Model->dataGrid('true');
$data = $this->Model->findAll(..);
$this->set('data', $data);

The data that is returned back will look like this:

Array (
'num_pages' => 6
'rows' => Array(
  
  )

This leads to my problem which occurs in AppModel::beforeFind.  To
calculate num_pages, you have to know how many records are in your
un-bounded dataset.  So I try to do a $this->findCount() and the page
goes blank.  No error on the screen or in a log anywhere.

Does anyone know how to return a row count from within a Model without
pulling all the data?

Thanks!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: CakePHP on goDaddy?

2006-10-16 Thread Rick Tuttle

I have a site set up on GoDaddy.

Since you can't access any files/folders above the public webroot on
GoDaddy and you can't change the DocumentRoot to a subdirectory I had
to put cake and the app directory UNDERNEATH the webroot directory
which is at GoDaddy's "/".

Then modify webroot's index.php

if (!defined('ROOT'))
{
//define('ROOT', 'FULL PATH TO DIRECTORY WHERE APP DIRECTORY IS LOCATED
DO NOT ADD A TRAILING DIRECTORY SEPARATOR';
//You should also use the DS define to seperate your directories
//define('ROOT', dirname(dirname(dirname(__FILE__;
define('ROOT', '/home/content/y/o/u/yoursite/html');   // change to
whatever your GoDaddy root path is
}

if (!defined('APP_DIR'))
{
//define('APP_DIR', 'DIRECTORY NAME OF APPLICATION';
//define ('APP_DIR', basename(dirname(dirname(__FILE__;
define ('APP_DIR', 'app');
}

/**
 * This only needs to be changed if the cake installed libs are located
 * outside of the distributed directory structure.
 */
if (!defined('CAKE_CORE_INCLUDE_PATH'))
{
//define ('CAKE_CORE_INCLUDE_PATH', FULL PATH TO DIRECTORY WHERE CAKE
CORE IS INSTALLED DO NOT ADD A TRAILING DIRECTORY SEPARATOR';
//You should also use the DS define to seperate your directories
define('CAKE_CORE_INCLUDE_PATH', ROOT);
}


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



1 of 3 input fields have to be filled - validate

2006-10-16 Thread [EMAIL PROTECTED]

Hi there,

I have 3 Input-fields and I would like to check, if at least one field
has data in it to store in the database.
Right now I have this code in my model:

 var $validate = array(
   'field1'   => VALID_NOT_EMPTY,
   'field2'   => VALID_NOT_EMPTY,
   'field3'   => VALID_NOT_EMPTY
 );

But with this validation the user has to type into all of these 3
fields and not only 1.

Thanks
Felix


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Using Zendguard

2006-10-16 Thread Gustavo Barrón

Still not using it, I was just wondering what issues may appear,
because Im starting in the project, this week.

2006/10/14, Larry E. Masters aka PhpNut <[EMAIL PROTECTED]>:
> You may have to add specific class, method and var names to the config so
> those would not be encrypted.
> It has been a while since I used it, and I know that the highest setting to
> encode would spew errors when I would try to access the app.
>
> What problems are you having?
>
>
> --
> /**
> * @author Larry E. Masters
> * @var string $userName
> * @param string $realName
> * @returns string aka PhpNut
> * @access  public
> */
>  >
>


-- 
-- 
---
Gustavo Barron
http://idealabs.tk

--
ph33r t3h cut3 0n3s
--

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: *MPG-CAP* new product for saving of Gasoline and Diesel fuel from USA

2006-10-16 Thread Trevor Burton
cuntOn 10/16/06, Mr. Chan <[EMAIL PROTECTED]> wrote:
This is a new business chance from USA, Many drivers used MPG-CAP tosave more than 20% of gasoline and Diesel fuel in USA and Canada, youcan see the websites here:
http://biz.yahoo.com/prnews/060614/dcw024.html?.v=62http://www.fueltodream.com/WSAZ_2_sm.wmv
http://www.todaystmj4.com/VideoPlayer/video.aspx?fs=081706_10pm_GasPillSavingsThis is the company's website for introduction of this product:http://www.fat.myffi.biz/en/section_100.asp
Over 1000 people involved in this business within 1 month in Taiwan inthe first quarter of 2006, it will be successful in other Asia regions.GREAT BUSINESS CHANCE will happen once ten years!!!
If any inquiries, pls e-mail to [EMAIL PROTECTED]

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


*MPG-CAP* new product for saving of Gasoline and Diesel fuel from USA

2006-10-16 Thread Mr. Chan

This is a new business chance from USA, Many drivers used MPG-CAP to
save more than 20% of gasoline and Diesel fuel in USA and Canada, you
can see the websites here:

http://biz.yahoo.com/prnews/060614/dcw024.html?.v=62

http://www.fueltodream.com/WSAZ_2_sm.wmv
http://www.todaystmj4.com/VideoPlayer/video.aspx?fs=081706_10pm_GasPillSavings
This is the company's website for introduction of this product:

http://www.fat.myffi.biz/en/section_100.asp

Over 1000 people involved in this business within 1 month in Taiwan in
the first quarter of 2006, it will be successful in other Asia regions.

GREAT BUSINESS CHANCE will happen once ten years!!!

If any inquiries, pls e-mail to [EMAIL PROTECTED]


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Trying to assemple a cake group in Columbus Ohio

2006-10-16 Thread codecowboy

Does anyone know when that book (CakePHP Recipies) comes out?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Need multiple recursive levels

2006-10-16 Thread Mika

There already is a ticket for what he's talking about:
https://trac.cakephp.org/ticket/980


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Need multiple recursive levels

2006-10-16 Thread [EMAIL PROTECTED]

I'm guessing this quandary explains why most "easy" database
manipulation packages (say, FileMaker and Omnis) usually limit the
automatically-fetched associated records to one level deep. More
generally, I find that recursive fetching has a tendency to bring in
much more than I need. I have to go fishing around in the arrays to
find the things I actually want, simultaneously noticing how much data
that is fetched is not used.

I guess in effect what we're groping for here is like query
optimization, but at the application level. In effect cake is sitting
between the view's data specification and the database server.

The ideal cure would be for cake to generate queries based on what
fields at each level are actually used in the view. That would mean
deferring the queries until view requests have been accumulated. I
believe that would be very different from the present method.

The next best answer might be to have the application programmer
specify, at the controller level, some sort of outline as to what data
is going to be used. This latter method, if feasible, would eliminate
the simplistic specification of levels of recursion. If it were
optional that might preserve the easy part of cake data fetching, while
making more detailed specification possible.

(My apologies if what I've written here does not correctly address the
topic at hand.)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Session and sessionid

2006-10-16 Thread [EMAIL PROTECTED]

Hi there,

I've been looking for a short introduction to Sessions in cakephp, but
I couldn't find any.
Does anyone know of an example how to generate and handle sessionIDs?

Thanks
Felix


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



2 forms and 1 submit button

2006-10-16 Thread [EMAIL PROTECTED]

Hi there,

is it possible to have 2 forms on a page and only 1 submit button?
By clicking on the submit button, textfield1 is saved to table1 and
textfield2 is saved to table2. How would I do that?

if (($this->Table1->save($this->data['Table1']) AND
($this->Table2->save($this->data['Table2']))

Does this work?

Thanks
Felix


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: copy field from one table to another

2006-10-16 Thread [EMAIL PROTECTED]

Thanks for the hint!
I also had another error in my code:
findByLetter_id($tempid);
Because my id is called letter_id I have to use that name in the
findById function...

Cheers
Felix


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: count(*) in custom query

2006-10-16 Thread Kevin Uni

hi DJ Spark,
I am using 2 servers

Developer Sever:(works well)
Debian linux
php 4.4.2
mysql 4.1

Product Server:(problem occurred)
Redhat linux RS4
php4.3.9
mysql 4.1

So i changed my code,sample:
$keys = array_keys($result[$i]);
echo $result[$i][$keys[0]]['num'];



On Oct 9, 9:05 am, "DJ Spark" <[EMAIL PROTECTED]> wrote:
>  I had the same problem here. how is your configuration ?
> mine is:
> - winXP
> - mysql 5
> - php 5
> - apache 1.3
>
>  spark
>
> On 10/8/06, Kevin Uni <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi all,
> > I am using cake to do a custom query just like "selectcount(*) as num
> > .. from tab1 left join tab2 on tab1.id = tab2.tid inner join tab3 on
> > tab3.id =tab2.did group by tab1.id . "
> > and cake return an Array called $result , it has something like
> > $result[$i][0]['num'], but when I put it on another server(the same
> > cake version),it return : $result[$i]['#sql_e8b_0']['num'].
> > So why and when cake uses the special index like "#sql_e8b_0" instead
> > of [0] ?--
> [web]http://synapsisdi.com.br
> [livesets]http://djspark.com.br/mp3


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: help on view with image map

2006-10-16 Thread Gayathiri

Thank you so much..


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: observeField ajax helper and Firefox

2006-10-16 Thread Steniskis

Hi Zach,
your value for $field_id needs a quote...
Steniskis


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: copy field from one table to another

2006-10-16 Thread Eric C Blount
Maybe I'm wrong, but I think you should just use the $templetter array, not $this->data->templetter. Check the contents of that array, but I think it should be $temptext = $templetter['Letter']['text']; If not, check print_r($templetter); to see the array.

 
Eric
 
On 10/16/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Hi there,maybe the answer is very simple, but I don't get a solution for myproblem.
I have 2 table: "logs" (with log_id and text as columns) and "letters"(with letter_id and text as columns).Now I would like to copy the letter with the letter_id 4 to my logstable.I have tried this:
$tempid=4;$templetter = $this->Letter->findById($tempid);$temptext= $this->data->templetter['text'];$this->Logs->saveField('text',$temptext);But this doesn't work and also seems too complicated, I think.
ThanksFelix
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: help on view with image map

2006-10-16 Thread Eric C Blount
You need to feed the attributes as an array, as such:
$html->image('map.JPG', array('width' => '504', 'height' => '272', 'usemap' => '#worldmap'));?>HTH,
Eric
 
On 10/15/06, Gayathiri <[EMAIL PROTECTED]> wrote:
I need to create a view with an image map using cakephp. when i use the view works..but when i use $html->img..it doesnt work
why? The following is the code...can anyone please help..$html->image('map.JPG',$width="504",$height="272",$usemap="">
coords="145,266,143,252,151,232,-1,84,155,113,162,128,193,135,228,127,244,132,261,131,267,145,263"href="" target="_self">
coords="223,122,220,112,231,109,228,101,214,92,200,53,215,51,235,81,240,80,239,61,252,111,271,115,255,125,251,118,247,118,249,117"href="" target="_self">

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


copy field from one table to another

2006-10-16 Thread [EMAIL PROTECTED]

Hi there,

maybe the answer is very simple, but I don't get a solution for my
problem.

I have 2 table: "logs" (with log_id and text as columns) and "letters"
(with letter_id and text as columns).
Now I would like to copy the letter with the letter_id 4 to my logs
table.

I have tried this:

$tempid=4;
$templetter = $this->Letter->findById($tempid);
$temptext= $this->data->templetter['text'];
$this->Logs->saveField('text',$temptext);

But this doesn't work and also seems too complicated, I think.

Thanks

Felix


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: radio button inbetween param

2006-10-16 Thread [EMAIL PROTECTED]

Thanks for the help!

Works great!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



help on view with image map

2006-10-16 Thread Gayathiri

I need to create a view with an image map using cakephp. when i use
 the view works..but when i use $html->img..it doesnt work
why? The following is the code...can anyone please help..

image('map.JPG',$width="504",$height="272",$usemap="#worldmap");?>





 




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: ajax observeField on a select

2006-10-16 Thread leo.cacheux

Did you try an Ajax Autocompleter ? It works fine to replace a select
tag with a very long list.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Problem with associations

2006-10-16 Thread leo.cacheux

Thanks for your answers.

I use CakePHP 1.1.7.3363 (I should upgrade to the last version).

The main problem in this case with the hasMany association is that it
does a lot of requests, which are useless, everything I need can be
done with only one.
A profile can have many users.

Here is a "UML-like" schema of my tables :
|Profile|-[0,*][1,1]-|User|-[0,*][1,1]-|Post|

And the (shortened) request I'd like to have :
SELECT Post.*, User.*, Profile.*
FROM Post
LEFT JOIN User ON Post.userid = User.id
LEFT JOIN Profile ON User.profileid = Profile.id
SORT BY Profile.something


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---