Generate Excel from cakephp

2011-05-11 Thread abhimanyu bv
Hi all,
How to generate Excel sheet from cakephp in a format??

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Security::cipher not compatible cross operating systems

2011-05-11 Thread Simon Males
Hello,

I'm migrating some infrastructure from 32bit CentOS PHP 5.2 to 64bit
Ubuntu PHP 5.3.

Unfortunately I've discovered a cipher encrypted by the Ubuntu systems
cannot decrypted by the CentOS systems.

Is there a work around for this?

-- 
Simon Males

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: CakePHP App - server switch causing phpMySQL extreme query speed/results variants (but my query IS returning results as expected)

2011-05-11 Thread Zaky Katalan-Ezra
Check for differences in php.ini, my.cnf, apache2.conf etc.

On Thu, May 12, 2011 at 1:04 AM, OldWest  wrote:

> I am really a bit lost on why this is happening. I have read a considerable
> amount of online info regarding CakePHP and slow queries, but *I don't 
> *believe
> its anything wrong with CakePHP. There has got to be a way to speed things
> up.
>
> My CakePHP query is below.
>
> Processing of query is considerably slower on new server. (all details
> below). I am running a php/MySQL query. I have some peculiar (slow down)
> things happening when I transferred the site to another server. *I am
> running the exact same php script (and query options) on both servers. The
> database tables and data are also identical. *
>
> Test #1 (Server #1): (default) 32 queries took 1 ms
> Test #1 (Server #2): (default) 32 queries took 10 ms (9ms longer)
>
> Test #2 (Server #1): (default) 132 queries took 5 ms
> Test #2 (Server #2): (default) 144 queries took 60 ms (55ms longer)
>
> To translate the difference into seconds of waiting time, server #1
> generally processes any query (meaning results are displayed) within 3
> seconds. And server #2 generally 7-14 seconds.
>
> I am sorry to post my entire search() function (which is returning the
> results as expected), but if anyone can evaluate it for problem points and
> *harsh *critique I am all ears!
>
> function search($ApplicantAge = 0, $SpouseAge = 0, $NumberChildren = 0,
> $Vision = 0, $Zip = 0) {
> $search = $this->data['Plan'];
> $searchdetails = array();
> if (isset($search['ApplicantAge'])) {
> $this->Plan->set($this->data);
> if ($this->Plan->validates()) {
> $ApplicantAge = $search['ApplicantAge'];
> } else {
> $errors = $this->Plan->invalidFields();
> $error_messages = implode(' ', $errors);
> $this->Session->setFlash($error_messages);
> $this->redirect('/');
> }
> }
> $searchdetails[0] = $ApplicantAge;
> if (isset($search['SpouseAge']) && !empty($search['SpouseAge'])) {
> $SpouseAge = $search['SpouseAge'];
> }
> $searchdetails[1] = $SpouseAge;
> if (isset($search['NumberChildren']) &&
> !empty($search['NumberChildren'])) {
> $NumberChildren = $search['NumberChildren'];
> }
> $searchdetails[2] = $NumberChildren;
> if (isset($search['Vision']) && !empty($search['Vision'])) {
> $Vision = $search['Vision'];
> }
> $searchdetails[3] = $Vision;
> if (isset($search['ZipCode']) && !empty($search['ZipCode'])) {
> $Zip = $search['ZipCode'];
> }
> $searchdetails[4] = $Zip;
> $memberCount = 1;
> if ($SpouseAge > 0) {
> $memberCount += 1;
> }
> if ($NumberChildren > 0) {
> $memberCount += $NumberChildren;
> }
> $comboType = 'sa';
> if ($ApplicantAge < 18) {
> $comboType = 'sc';
> }
> if ($SpouseAge > 0) {
> if ($NumberChildren > 0) {
> $comboType = 'asc';
> } else {
> $comboType = 'as';
> }
> } else {
> if ($NumberChildren > 0) {
> $comboType = 'ac';
> }
> }
> $options = array(
> 'joins'  => array(
> array(
> 'table'  => 'plans_zips',
> 'alias'  => 'PZips',
> 'type'   => 'inner',
> 'foreignKey' => false,
> 'conditions' => array('Plan.id = PZips.plan_id')
> ),
> array(
> 'table'  => 'zips',
> 'alias'  => 'Zips',
> 'type'   => 'inner',
> 'foreignKey' => false,
> 'conditions' => array('Zips.id = PZips.zip_id')
> )
> ),
> 'conditions' => array(
> "AND" => array(
> array($ApplicantAge . ' BETWEEN Age.Min_Age AND
> Age.Max_age'),
> 'Zips.title'   => $Zip,
> 'Applicant.amount' => array($comboType, $memberCount)
> )
> ),
> 'contain'=> array(
> 'PlanDetail' => array(
> 'fields'   => array(
> 'id',
> 'effective_date',
> 'expiration_date',
> 'active',
> 'name',
> 'plan_type_id',
> 'max_benefit',
> 'deductible',
> 'preventive',
> 'basic',
> 'major',
> 'ortho',
> 'application_url',
> 'company_id',
> 'plan_type_id',
> 'plan_detail_note_id'),
> 'Company'  => array('fields' => array(
> 'id',
> 'name',
> 'company_logo_url'
> )),
> 'PlanType' => array(

Re: Cookbook is partially offline/broken

2011-05-11 Thread huoxito
someone had a good intention trying to improve the book and setting up a new 
layout, but i miss the old one. for all the server erros, broken layout, and 
horizontal scroll bar that i see on the new one.  

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Auth - You are not authorized to access that location

2011-05-11 Thread Harish Amur
I know this issue has been discussed quite a bit early on. I did read many
posts, however I am not finding a solution, so I am going to ask again.

I use Auth to authenticate. It is a simple user, password screen. However
whenever I start, I am taken to the login page with the error message 'You
are not authorized to access that location' already displayed and the
user/pass fields populated. If I click on login it works and I am redirected
to the right page.

I have included $this->Auth->allow('display') in the controller
beforeFilter() function(for the relevant redirected page(s)). I have also
included 'value'=>'' in the login.ctp.

Is this to do with Cache? Some settings in the core.php?

Regards,
Harish

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Complex find

2011-05-11 Thread Rob Maurer
Hi: I'm taking a liberty with your Models, because I don't know how
Post can belongTo Post, so I'm making Post belongTo Topic, and I'm
thinking of something along the lines of this:

'fields' => array(
'TopicCategory.title',
'COUNT(DISTINCT Topic.id) As topic_total',
'COUNT(DISTINCT Post.id) As post_total'
),
'joins' =>  array(  array(  'type' => 'INNER',
'table' => 'topics',
'alias' => 'Topic',
'conditions' => array(
'Topic.id = 
TopicCategory.topic_id'
 )
),
array(  'type' => 'LEFT',
'table' => 'posts',
'alias' => 'Post',
'conditions' => array(
'Post.topic_id = 
Topic.id'
 )
)
)
'group' => array('TopicCategory.id')

- Rob

On May 11, 10:39 am, "Carlos Eduardo Sotelo Pinto"
 wrote:
> Hi people
> I need a help on a find query like this
>
> Models
> ===
> TopicCategory => ( habtm=>Topic )
> Topic => (habtm => TopicCategory, hasMany=>Post)
> Post => (belongsToPost)
>
> I need something like
>
> 
> TopicCategory.title
> Topic total
> Post total
> 
>
> HOw could be the find query for this result, that as you can see it is a  
> forum
>
> thanks
>
> --
> Carlos Eduardo Sotelo Pinto
>      PHP Senior Web Developer
>      Cell (preferred): (Mov)+51, 959980794 :: (Claro)+51, 952707662
>      http://www.csotelo.org
>      Skype: csotelop
>      Yahoo: csotelop
>      MSN: carlos.sotelo.pi...@gmail.com
>      GTalk: carlos.sotelo.pi...@gmail.com
> GPG FP:697E FAB8 8E83 1D60 BBFB 2264 9E3D 5761 F855 4F6B
> GNULinux RU #379182 || GNULinux RM #277661

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: How to control the content (text) to display in a $form->input ?

2011-05-11 Thread Miles J
Theres some magic that happens. If you have an ID field (user_id), it
will usually be a select. If you set a variable called $users to the
view, that input field will populate with that data.

You can overwrite that by just placing array('type' => 'text') as the
second argument of the input method.

On May 11, 10:54 am, Alonso  wrote:
> Hi, folks.
> I'm starting with CakePHP and after reviewing this tutorial 
> (http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application
> )  and also after having  used the "cake bake" command to generate my
> models,
> controllers and views , everything is fine, but when I visit the
> Post's add view (views \ posts
> \ add.php), I find that instead of showing a input text for the
> username, it shows a select with all the usernames.
>
> this is the line in  the Post's add view that show the select.
>
>     echo $this->Form->input('user_id');
>
> Although I know how to display only the username of the currently
> logged-in user,  I don't know how to control the content to show in
> $this->Form->input()  because if I use a variable that is not part of
> the "Post" model , it's shown , but as the label for the input.
>
> Have you any idea how to solve this??

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: What's the best way to upload an image in cakephp 1.3

2011-05-11 Thread dreamingmind
That upload class looks pretty nice! Thanks!

Don

On May 11, 6:07 pm, huoxito  wrote:
> I had that same question when i began with cake, tried meio upload and media
> plugin. I ended up with none of them ... didnt like the way media upload
> arrange the upload / image configs.
>
> I think you should consider studying how model callbacks work and try to
> implement your own behavior with your own needs. Its really not that
> difficult even for a beginner.
>
> As for a general class to use on your behavior to treat images you could use
> this onehttp://www.verot.net/php_class_upload_docs.htmIt has lots of
> useful methods.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: What's the best way to upload an image in cakephp 1.3

2011-05-11 Thread huoxito
I had that same question when i began with cake, tried meio upload and media 
plugin. I ended up with none of them ... didnt like the way media upload 
arrange the upload / image configs. 

I think you should consider studying how model callbacks work and try to 
implement your own behavior with your own needs. Its really not that 
difficult even for a beginner.

As for a general class to use on your behavior to treat images you could use 
this one http://www.verot.net/php_class_upload_docs.htm It has lots of 
useful methods.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Retrieving large data set... can see entire array with debug() but failure if array is passed to view

2011-05-11 Thread dreamingmind
Tesla,

I don't think set(compact... is what you want to be doing.
http://us.php.net/manual/en/function.compact.php

To move your massive array (or some other value) to the view you
would:

$this->set('viewVarName', $variableOrArrayName);

so in your specific case

$this->set('data', $data);

Then in your view you will have the $data array available with all
your thousands of records.

Regards,
Don
On May 11, 11:48 am, tesla100  wrote:
> In my model, I have something like...
> $data = $this->MyModel->getData();
>
> $data is an array with ~ 1200 records, where each record has 3
> associative arrays inside, and each of these has maybe 3 or 4 indexes.
>
> If I do, debug($data); and die();, the entire array is spit out to the
> screen.
> All the data is there.  It's even fast.
>
> However, if I do, $this->set(compact('data')); the page never loads.
> I just get a white screen or get that cakephp exceeded the max
> execution time of 30 seconds.  The problem is ,I don't want to
> increase that 30 second limit.  i need this to be faster.  There has
> to be a way.  If I can call debug() and see the whole thing, but is it
> not being passed to the view properly without timing out?  Please help.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: TDD in CakePHP

2011-05-11 Thread huoxito
a bit off topic.

euromark answer might be rude but its really funny, havent seen that yet, 
rsrsrs

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: What's the best way to upload an image in cakephp 1.3

2011-05-11 Thread dreamingmind
This is not the best tutorial, but it got me started. And the behavior
works as advertised:

http://tv.cakephp.org/video/jasonwydro/2011/01/29/cakephp_1_3_-_meio_image_upload_resize_gallery_tutorial

Regards,
Don

On May 11, 4:16 pm, MeatSandwich 
wrote:
> Yeah thats the one that I've spotted most often, only problem is I
> can't find any decent instructions on how to use it... The best I
> could find was only a few lines and I didn't even understand what I
> was meant to do. It does look like exactly what I want, and seems to
> be the most comprehensively and securely written but I had to give up
> because I didn't understand what I was meant to do with it.
>
> Does anyone know if there's any better tutorials for this?
>
> On May 11, 11:30 pm, Ryan Schmidt  wrote:
>
>
>
>
>
>
>
> > On May 11, 2011, at 17:19, MeatSandwich wrote:
>
> > > Firstly I'm totally new to cakephp and only a novice with php. I want
> > > to be able to upload image files which correspond with records in a
> > > table charities which I have. It would be good if the images were
> > > processed a little, ie maybe a few different sizes of thumbnail would
> > > be created when they got uploaded, maybe even there would be a way of
> > > cropping the images in case they're too large for what I want.
>
> > > I've had a good look around for the past bunch of hours and found
> > > loads of tutorials and behaviours and helpers etc which purport to do
> > > what I want, but none which I've tried seems to work for me. I believe
> > > issues to do with them being written for old versions of cake.
>
> > > Can anyone suggest what is the best way to achieve what I want? Is
> > > there maybe something in built in cakephp 1.3 which removes the need
> > > for plug-ins or behaviours?
>
> > The David Persson Media Plugin is the one I see referenced here constantly.
>
> >https://github.com/davidpersson/media#readme

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Javascript/Ajax Helpers Not Functioning

2011-05-11 Thread brandon buster
@Sherlock. I'm not sure where in either of my posts you gathered
enough information to assume with such certainty this question had
anything to do with migration. I believe this is the second time
you've posted a snyde and off topic answer to one of my questions. I,
and I'm sure other newcomers to the cake community would appreciate it
if you framed your responses to be more helpful.

@Ryan. Again I thank you for your help. Though I am working with a 1.2
version of Cake. I'm studying 1.2 because I have a large legacy system
I'm trying to debug and eventually upgrade. The issues I'm
encountering here are not likely being caused by Cake versioning.

Unless I've missed something, the online documentation doesn't mention
anything about common incompatibilities or volitilities with these
Helpers. So I'm completely dumbfounded as to why these functions are
not working on my system.

I'm not sure if my assumptions of the HttpRequests being at fault are
correct or not, though any clues someone could give me would be MUCH
appreciated.





On May 11, 6:37 pm, Ryan Schmidt  wrote:
> On May 11, 2011, at 16:18, Sam Sherlock wrote:
>
> > Ryan answered your question.
>
> > you'll find out by reading the migrating link - to me it seems silly to 
> > list here
> > what is listed there especially when you can just get info straight from 
> > source there
>
> > assuming all code is correct
>
> > if you using 1.3 then the code is out of date and therefore not correct for 
> > the version
>
> Well, the documentation says it's *deprecated* (not that it's obsolete or 
> removed) so there is the expectation that the old methods would still work.
>
> http://en.wikipedia.org/wiki/Deprecation
>
> ("Features are deprecated—rather than being removed—in order to provide 
> backward compatibility and give programmers who have used the feature time to 
> bring their code into compliance with the new standard.")
>
> I have not attempted to use these features, so I don't know whether they 
> actually do still work in 1.3, or whether they're really broken (if the 
> latter, the documentation should be updated to say so and not give false 
> expectations).
>
> I guess the lesson is that if you really want to learn using a CakePHP 1.2 
> book, you might have better success by using CakePHP 1.2. Once you've learned 
> how that works, you can read through the 1.2-to-1.3 migration docs to upgrade 
> to 1.3.
>
> Or, forget the book you have, and instead read the online cookbook and/or 
> tutorials written for CakePHP 1.3 and start with that.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: What's the best way to upload an image in cakephp 1.3

2011-05-11 Thread MeatSandwich
Yeah thats the one that I've spotted most often, only problem is I
can't find any decent instructions on how to use it... The best I
could find was only a few lines and I didn't even understand what I
was meant to do. It does look like exactly what I want, and seems to
be the most comprehensively and securely written but I had to give up
because I didn't understand what I was meant to do with it.

Does anyone know if there's any better tutorials for this?



On May 11, 11:30 pm, Ryan Schmidt  wrote:
> On May 11, 2011, at 17:19, MeatSandwich wrote:
>
> > Firstly I'm totally new to cakephp and only a novice with php. I want
> > to be able to upload image files which correspond with records in a
> > table charities which I have. It would be good if the images were
> > processed a little, ie maybe a few different sizes of thumbnail would
> > be created when they got uploaded, maybe even there would be a way of
> > cropping the images in case they're too large for what I want.
>
> > I've had a good look around for the past bunch of hours and found
> > loads of tutorials and behaviours and helpers etc which purport to do
> > what I want, but none which I've tried seems to work for me. I believe
> > issues to do with them being written for old versions of cake.
>
> > Can anyone suggest what is the best way to achieve what I want? Is
> > there maybe something in built in cakephp 1.3 which removes the need
> > for plug-ins or behaviours?
>
> The David Persson Media Plugin is the one I see referenced here constantly.
>
> https://github.com/davidpersson/media#readme

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Javascript/Ajax Helpers Not Functioning

2011-05-11 Thread Ryan Schmidt

On May 11, 2011, at 16:18, Sam Sherlock wrote:

> Ryan answered your question.
> 
> you'll find out by reading the migrating link - to me it seems silly to list 
> here
> what is listed there especially when you can just get info straight from 
> source there
> 
> assuming all code is correct
> 
> if you using 1.3 then the code is out of date and therefore not correct for 
> the version 

Well, the documentation says it's *deprecated* (not that it's obsolete or 
removed) so there is the expectation that the old methods would still work.

http://en.wikipedia.org/wiki/Deprecation

("Features are deprecated—rather than being removed—in order to provide 
backward compatibility and give programmers who have used the feature time to 
bring their code into compliance with the new standard.")

I have not attempted to use these features, so I don't know whether they 
actually do still work in 1.3, or whether they're really broken (if the latter, 
the documentation should be updated to say so and not give false expectations).


I guess the lesson is that if you really want to learn using a CakePHP 1.2 
book, you might have better success by using CakePHP 1.2. Once you've learned 
how that works, you can read through the 1.2-to-1.3 migration docs to upgrade 
to 1.3.

Or, forget the book you have, and instead read the online cookbook and/or 
tutorials written for CakePHP 1.3 and start with that.



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: What's the best way to upload an image in cakephp 1.3

2011-05-11 Thread Sam Sherlock
Jose diaz G has a plugin named upload

it does what you have outlined.

I found that it needed some tweaks to work with 1.3 but nothing major

you may also find a simular plugin by webtechnick

both on github

On 11/05/2011, MeatSandwich  wrote:
> Firstly I'm totally new to cakephp and only a novice with php. I want
> to be able to upload image files which correspond with records in a
> table charities which I have. It would be good if the images were
> processed a little, ie maybe a few different sizes of thumbnail would
> be created when they got uploaded, maybe even there would be a way of
> cropping the images in case they're too large for what I want.
>
> I've had a good look around for the past bunch of hours and found
> loads of tutorials and behaviours and helpers etc which purport to do
> what I want, but none which I've tried seems to work for me. I believe
> issues to do with them being written for old versions of cake.
>
> Can anyone suggest what is the best way to achieve what I want? Is
> there maybe something in built in cakephp 1.3 which removes the need
> for plug-ins or behaviours?
>
> thanks in advance
>
> Meat
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> 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
>


-- 
 - S

+44 (0)7908 069 219

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: What's the best way to upload an image in cakephp 1.3

2011-05-11 Thread Ryan Schmidt

On May 11, 2011, at 17:19, MeatSandwich wrote:

> Firstly I'm totally new to cakephp and only a novice with php. I want
> to be able to upload image files which correspond with records in a
> table charities which I have. It would be good if the images were
> processed a little, ie maybe a few different sizes of thumbnail would
> be created when they got uploaded, maybe even there would be a way of
> cropping the images in case they're too large for what I want.
> 
> I've had a good look around for the past bunch of hours and found
> loads of tutorials and behaviours and helpers etc which purport to do
> what I want, but none which I've tried seems to work for me. I believe
> issues to do with them being written for old versions of cake.
> 
> Can anyone suggest what is the best way to achieve what I want? Is
> there maybe something in built in cakephp 1.3 which removes the need
> for plug-ins or behaviours?

The David Persson Media Plugin is the one I see referenced here constantly.

https://github.com/davidpersson/media#readme



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Cookbook is partially offline/broken

2011-05-11 Thread Ryan Schmidt

On May 11, 2011, at 14:39, failure wrote:

> To me it appears totally random. Opening a page in another browser
> helps just as much as going to the bathroom and back. Trying a
> thousand times also seems to be a solution most of the times. Been
> fighting with this bug for 2 days and I feel like forgetting about
> cakePHP altogether, to be honest (besides wanting to hit my keyboard
> against the walls, that is). I've got it open in Chrome, Firefox, IE8,
> Opera and Safari, and switching from one to another when I get tired
> of trying with the current one. Worst is: it works.
> 
> 500 errors are the worst. They kinda say "something's wrong but I got
> no clue what". Somebody fix it while I still got some hair in my head,
> thanks in advance.

Did you try clearing your cookies? Though I don't understand why it would, it 
does help for me when the cookbook misbehaves.


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


What's the best way to upload an image in cakephp 1.3

2011-05-11 Thread MeatSandwich
Firstly I'm totally new to cakephp and only a novice with php. I want
to be able to upload image files which correspond with records in a
table charities which I have. It would be good if the images were
processed a little, ie maybe a few different sizes of thumbnail would
be created when they got uploaded, maybe even there would be a way of
cropping the images in case they're too large for what I want.

I've had a good look around for the past bunch of hours and found
loads of tutorials and behaviours and helpers etc which purport to do
what I want, but none which I've tried seems to work for me. I believe
issues to do with them being written for old versions of cake.

Can anyone suggest what is the best way to achieve what I want? Is
there maybe something in built in cakephp 1.3 which removes the need
for plug-ins or behaviours?

thanks in advance

Meat

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Cookbook is partially offline/broken

2011-05-11 Thread failure
To me it appears totally random. Opening a page in another browser
helps just as much as going to the bathroom and back. Trying a
thousand times also seems to be a solution most of the times. Been
fighting with this bug for 2 days and I feel like forgetting about
cakePHP altogether, to be honest (besides wanting to hit my keyboard
against the walls, that is). I've got it open in Chrome, Firefox, IE8,
Opera and Safari, and switching from one to another when I get tired
of trying with the current one. Worst is: it works.

500 errors are the worst. They kinda say "something's wrong but I got
no clue what". Somebody fix it while I still got some hair in my head,
thanks in advance.



On 18 abr, 19:28, Veraxus  wrote:
> I think I sort of figured it out. Viewing the pages in Chrome or Opera gave
> me a 500 error. But if opened the webpage in Firefox or Safari, it worked.
> More strangely, if I then tried the same web page in one of the
> aforementioned "problem" browsers *again*, it now worked. Any page currently
> "broken" remains broken until I visit the page in Firefox first, then it
> miraculously works in everything.
>
> I guess I'll just use Firefox when I need to look at the cookbook, but this
> is by far one of the most bizarre things I've seen.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


How to control the content (text) to display in a $form->input ?

2011-05-11 Thread Alonso
Hi, folks.
I'm starting with CakePHP and after reviewing this tutorial (
http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application
)  and also after having  used the "cake bake" command to generate my
models,
controllers and views , everything is fine, but when I visit the
Post's add view (views \ posts
\ add.php), I find that instead of showing a input text for the
username, it shows a select with all the usernames.

this is the line in  the Post's add view that show the select.

echo $this->Form->input('user_id');

Although I know how to display only the username of the currently
logged-in user,  I don't know how to control the content to show in
$this->Form->input()  because if I use a variable that is not part of
the "Post" model , it's shown , but as the label for the input.

Have you any idea how to solve this??

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


CakePHP App - server switch causing phpMySQL extreme query speed/results variants (but my query IS returning results as expected)

2011-05-11 Thread OldWest
I am really a bit lost on why this is happening. I have read a considerable 
amount of online info regarding CakePHP and slow queries, but *I don't *believe 
its anything wrong with CakePHP. There has got to be a way to speed things 
up.

My CakePHP query is below.

Processing of query is considerably slower on new server. (all details 
below). I am running a php/MySQL query. I have some peculiar (slow down) 
things happening when I transferred the site to another server. *I am 
running the exact same php script (and query options) on both servers. The 
database tables and data are also identical. *

Test #1 (Server #1): (default) 32 queries took 1 ms 
Test #1 (Server #2): (default) 32 queries took 10 ms (9ms longer) 

Test #2 (Server #1): (default) 132 queries took 5 ms 
Test #2 (Server #2): (default) 144 queries took 60 ms (55ms longer) 

To translate the difference into seconds of waiting time, server #1 
generally processes any query (meaning results are displayed) within 3 
seconds. And server #2 generally 7-14 seconds. 

I am sorry to post my entire search() function (which is returning the 
results as expected), but if anyone can evaluate it for problem points and 
*harsh 
*critique I am all ears!

function search($ApplicantAge = 0, $SpouseAge = 0, $NumberChildren = 0, 
$Vision = 0, $Zip = 0) {
$search = $this->data['Plan'];
$searchdetails = array();
if (isset($search['ApplicantAge'])) {
$this->Plan->set($this->data);
if ($this->Plan->validates()) {
$ApplicantAge = $search['ApplicantAge'];
} else {
$errors = $this->Plan->invalidFields();
$error_messages = implode(' ', $errors);
$this->Session->setFlash($error_messages);
$this->redirect('/');
}
}
$searchdetails[0] = $ApplicantAge;
if (isset($search['SpouseAge']) && !empty($search['SpouseAge'])) {
$SpouseAge = $search['SpouseAge'];
}
$searchdetails[1] = $SpouseAge;
if (isset($search['NumberChildren']) && 
!empty($search['NumberChildren'])) {
$NumberChildren = $search['NumberChildren'];
}
$searchdetails[2] = $NumberChildren;
if (isset($search['Vision']) && !empty($search['Vision'])) {
$Vision = $search['Vision'];
}
$searchdetails[3] = $Vision;
if (isset($search['ZipCode']) && !empty($search['ZipCode'])) {
$Zip = $search['ZipCode'];
}
$searchdetails[4] = $Zip;
$memberCount = 1;
if ($SpouseAge > 0) {
$memberCount += 1;
}
if ($NumberChildren > 0) {
$memberCount += $NumberChildren;
}
$comboType = 'sa';
if ($ApplicantAge < 18) {
$comboType = 'sc';
}
if ($SpouseAge > 0) {
if ($NumberChildren > 0) {
$comboType = 'asc';
} else {
$comboType = 'as';
}
} else {
if ($NumberChildren > 0) {
$comboType = 'ac';
}
}
$options = array(
'joins'  => array(
array(
'table'  => 'plans_zips',
'alias'  => 'PZips',
'type'   => 'inner',
'foreignKey' => false,
'conditions' => array('Plan.id = PZips.plan_id')
),
array(
'table'  => 'zips',
'alias'  => 'Zips',
'type'   => 'inner',
'foreignKey' => false,
'conditions' => array('Zips.id = PZips.zip_id')
)
),
'conditions' => array(
"AND" => array(
array($ApplicantAge . ' BETWEEN Age.Min_Age AND 
Age.Max_age'),
'Zips.title'   => $Zip,
'Applicant.amount' => array($comboType, $memberCount)
)
),
'contain'=> array(
'PlanDetail' => array(
'fields'   => array(
'id',
'effective_date',
'expiration_date',
'active',
'name',
'plan_type_id',
'max_benefit',
'deductible',
'preventive',
'basic',
'major',
'ortho',
'application_url',
'company_id',
'plan_type_id',
'plan_detail_note_id'),
'Company'  => array('fields' => array(
'id',
'name',
'company_logo_url'
)),
'PlanType' => array('fields' => array(
'id',
'name',
'description'
))),
'Age'=> array('fields' => array(
'id',
'name',
)),
'Applicant'  => array('fields' => array(
'id',
'name',
 

Re: Javascript/Ajax Helpers Not Functioning

2011-05-11 Thread Sam Sherlock
Ryan answered your question.

you'll find out by reading the migrating link - to me it seems silly to list
here
what is listed there especially when you can just get info straight from
source there

assuming all code is correct
>

if you using 1.3 then the code is out of date and therefore not correct for
the version

 - S



On 11 May 2011 21:59, brandon buster  wrote:

> Thanks for trying to answer my question. Though my main question here
> is a question of "assuming all code is correct, are there any common
> problems with getting these deprecated helpers to work?"
>
>
>
> On May 11, 4:33 pm, Ryan Schmidt  wrote:
> > On May 11, 2011, at 14:28, brandon buster wrote:
> >
> > > I've been reading Beginning Cakephp and Practical Cakephp Projects,
> > > both printed by Apress. Both books use version 1.2 and so far in all
> > > the tutorials I can't get the Javascript or Ajax functions to work.
> >
> > > It seems there're problems with the HttpRequests, but I'm sure it's
> > > not the code as I've copied it straight from the books.
> >
> > > Are there any issues that are likely the root of the problem here?
> > > Perhaps PHP 5.3.5 is not compatible with the Prototype library?
> >
> > PHP is a server-side scripting language. Prototype is a client-side
> JavaScript library. They have nothing to do with one another, no opportunity
> to cause each other any incompatibilities.
> >
> > CakePHP 1.2 is old. In CakePHP 1.3 the JavaScript functions were
> rewritten -- the JavaScript helper is deprecated and replaced with the new
> Js and Html so any CakePHP documentation you are following about using
> CakePHP to generate JavaScript code will probably not be correct. I would
> refer you to the online CakePHP cookbook:
> >
> > http://book.cakephp.org/
> >
> > See "Deprecated Helpers" under here:
> >
> > http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3#V...
> >
> > You may want to read that entire page, to see what other information
> you've learned from your CakePHP 1.2 book needs to be changed to be
> applicable to CakePHP 1.3.
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> 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
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Javascript/Ajax Helpers Not Functioning

2011-05-11 Thread brandon buster
Thanks for trying to answer my question. Though my main question here
is a question of "assuming all code is correct, are there any common
problems with getting these deprecated helpers to work?"



On May 11, 4:33 pm, Ryan Schmidt  wrote:
> On May 11, 2011, at 14:28, brandon buster wrote:
>
> > I've been reading Beginning Cakephp and Practical Cakephp Projects,
> > both printed by Apress. Both books use version 1.2 and so far in all
> > the tutorials I can't get the Javascript or Ajax functions to work.
>
> > It seems there're problems with the HttpRequests, but I'm sure it's
> > not the code as I've copied it straight from the books.
>
> > Are there any issues that are likely the root of the problem here?
> > Perhaps PHP 5.3.5 is not compatible with the Prototype library?
>
> PHP is a server-side scripting language. Prototype is a client-side 
> JavaScript library. They have nothing to do with one another, no opportunity 
> to cause each other any incompatibilities.
>
> CakePHP 1.2 is old. In CakePHP 1.3 the JavaScript functions were rewritten -- 
> the JavaScript helper is deprecated and replaced with the new Js and Html so 
> any CakePHP documentation you are following about using CakePHP to generate 
> JavaScript code will probably not be correct. I would refer you to the online 
> CakePHP cookbook:
>
> http://book.cakephp.org/
>
> See "Deprecated Helpers" under here:
>
> http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3#V...
>
> You may want to read that entire page, to see what other information you've 
> learned from your CakePHP 1.2 book needs to be changed to be applicable to 
> CakePHP 1.3.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Javascript/Ajax Helpers Not Functioning

2011-05-11 Thread Ryan Schmidt

On May 11, 2011, at 14:28, brandon buster wrote:

> I've been reading Beginning Cakephp and Practical Cakephp Projects,
> both printed by Apress. Both books use version 1.2 and so far in all
> the tutorials I can't get the Javascript or Ajax functions to work.
> 
> It seems there're problems with the HttpRequests, but I'm sure it's
> not the code as I've copied it straight from the books.
> 
> Are there any issues that are likely the root of the problem here?
> Perhaps PHP 5.3.5 is not compatible with the Prototype library?

PHP is a server-side scripting language. Prototype is a client-side JavaScript 
library. They have nothing to do with one another, no opportunity to cause each 
other any incompatibilities.

CakePHP 1.2 is old. In CakePHP 1.3 the JavaScript functions were rewritten -- 
the JavaScript helper is deprecated and replaced with the new Js and Html so 
any CakePHP documentation you are following about using CakePHP to generate 
JavaScript code will probably not be correct. I would refer you to the online 
CakePHP cookbook:

http://book.cakephp.org/

See "Deprecated Helpers" under here:

http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3#View-and-Helpers-1566

You may want to read that entire page, to see what other information you've 
learned from your CakePHP 1.2 book needs to be changed to be applicable to 
CakePHP 1.3.


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Share session

2011-05-11 Thread Juliano Bordignon
I is possible to share a session of a CakePHP application in for a php
application?

Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Javascript/Ajax Helpers Not Functioning

2011-05-11 Thread brandon buster
I've been reading Beginning Cakephp and Practical Cakephp Projects,
both printed by Apress. Both books use version 1.2 and so far in all
the tutorials I can't get the Javascript or Ajax functions to work.

It seems there're problems with the HttpRequests, but I'm sure it's
not the code as I've copied it straight from the books.

Are there any issues that are likely the root of the problem here?
Perhaps PHP 5.3.5 is not compatible with the Prototype library?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Retrieving large data set... can see entire array with debug() but failure if array is passed to view

2011-05-11 Thread tesla100
In my model, I have something like...
$data = $this->MyModel->getData();

$data is an array with ~ 1200 records, where each record has 3
associative arrays inside, and each of these has maybe 3 or 4 indexes.

If I do, debug($data); and die();, the entire array is spit out to the
screen.
All the data is there.  It's even fast.

However, if I do, $this->set(compact('data')); the page never loads.
I just get a white screen or get that cakephp exceeded the max
execution time of 30 seconds.  The problem is ,I don't want to
increase that 30 second limit.  i need this to be faster.  There has
to be a way.  If I can call debug() and see the whole thing, but is it
not being passed to the view properly without timing out?  Please help.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Ajax POST form does not work

2011-05-11 Thread heavylu
Hi,

I developed a site using cakephp 1.1, It has a lot of ajax elements
for updating multiple divs simultaneously and they worked pretty
well.  Now, I am migrating to cakephp 1.3, but I am not having such a
great experience.

Thanks to this [blog][2] I was able to get multiple divs updated, but
soon I got stuck again.

My current problem is with an ajax form which does not complete the
request to the url '/logs/logIn' ('/controller/action').

After submiting the form, Firebug shows me an error: "POST
http://localhost/logs/logIn 404 not found", the request is interrupted
in the function request() of prototype, line 1530:

this.transport.send(this.body);

When I write the url directly in the browser, the site seems to work
as I would expect.  And when I change the type of the form from 'POST'
to 'GET' the ajax request is completed and the response is the one I
expected, but I DO NEED to do it with 'POST'.

I have read a lot of forums in which similar issues are discussed, but
no suggestion has help me to solve the problem:

 - I have checked my hhtp.conf and .htaccess files, they seem to be
fine according to the installation instructions (but I am not sure).
 - The action I am requesting does not use any view (in fact, 'GET'
and direct url requets function whit no need of the log_in.ctp view
file), and I have created the respective view when I try the 'POST'
ajax request, but It still does not work.

I am using the latest version of scriptaculous and protoype.js (1.7),
I am working with Firefox 3.6.17 on ubuntu.

Many thaks in advance for any trick, tip, advice or whatever you can
do to help me.

[2]: 
http://schneimi.wordpress.com/2007/10/27/update-multiple-fields-with-one-ajax-request-response/

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: parse error in Html->link onclick statement.

2011-05-11 Thread Ryan Schmidt
On May 11, 2011, at 10:45, varai wrote:

> the onclick statement in the following code is giving an error:
> Parse error: parse error, expecting `')'' in C:\wamp\www\merry_flowers
> \views\pages\faq.ctp on line 13
> 
> Html->link('Q.Are admissions
> to Merry Flowers program open throughout the
> year?','#',array('class'=>'question_link,'
> 'onClick'=>'toogle_answerDiv(\'answerDiv1\');return false;')); ?> div>
> Playgroup admissions are open for most part of
> the year. Admissions to the programs of Nursery, JR KG & SR KG
> though close by 31st August in that given year.
> 
> Can somebody tell me on what is my mistake?

You're missing a comma, or rather, it's probably in the wrong place.

Instead of:

'class'=>'question_link,'

you need:

'class'=>'question_link',



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


parse error in Html->link onclick statement.

2011-05-11 Thread varai
Hi

the onclick statement in the following code is giving an error:
Parse error: parse error, expecting `')'' in C:\wamp\www\merry_flowers
\views\pages\faq.ctp on line 13

Html->link('Q.Are admissions
to Merry Flowers program open throughout the
year?','#',array('class'=>'question_link,'
'onClick'=>'toogle_answerDiv(\'answerDiv1\');return false;')); ?>
Playgroup admissions are open for most part of
the year. Admissions to the programs of Nursery, JR KG & SR KG
though close by 31st August in that given year.

Can somebody tell me on what is my mistake?

thank you.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: javascript function toogle not working

2011-05-11 Thread varai
Hi,

Yes, I understand dreamingmind's point. I am in the process of
changing it to question1/answer1, etc

thanks.

On May 11, 2:00 am, dreamingmind  wrote:
> Ryan,
>
> I'm not SURE what the problem is, but I see your id's are pretty
> generic. If there's more than one question/answer on the page and the
> id's aren't unique things can break mysteriously.
>
> Don
>
> On May 10, 9:46 am, Ryan Schmidt  wrote:
>
>
>
> > On May 10, 2011, at 10:43,varaiwrote:
>
> > > The following is a very simple view that should display the answer to
> > > question when the question is clicked. Otherwise the answer should not
> > > display. ie. the question is a toogle key.
>
> > Actually, it's a toggle.
>
> > > function toogle_answerDiv()
> > > {  var a=document.getElementById('answerDiv');
>
> > >    if (a.style.display=="block")
> > >            a.style.display="none";
> > >    else
> > >            a.style.display=="block";
> > > }
>
> > The last line should have "=" not "==".- Hide quoted text -
>
> - Show quoted text -

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Complex find

2011-05-11 Thread Carlos Eduardo Sotelo Pinto


Hi people
I need a help on a find query like this

Models
===
TopicCategory => ( habtm=>Topic )
Topic => (habtm => TopicCategory, hasMany=>Post)
Post => (belongsToPost)

I need something like



TopicCategory.title
Topic total
Post total


HOw could be the find query for this result, that as you can see it is a  
forum


thanks

--
Carlos Eduardo Sotelo Pinto
PHP Senior Web Developer
Cell (preferred): (Mov)+51, 959980794 :: (Claro)+51, 952707662
http://www.csotelo.org
Skype: csotelop
Yahoo: csotelop
MSN: carlos.sotelo.pi...@gmail.com
GTalk: carlos.sotelo.pi...@gmail.com
GPG FP:697E FAB8 8E83 1D60 BBFB 2264 9E3D 5761 F855 4F6B
GNULinux RU #379182 || GNULinux RM #277661

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.



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


Re: Debug Errors in Cakephp 1.3

2011-05-11 Thread euromark
it still does not help you in the long run

you shouldnt have any such errors - either in debug 0 or in debug 2
especially because with cake1.3 all errors are usually logged
this would flood your logs quite soon if you programmed this sloppy in
your whole project...


On 11 Mai, 09:42, Sanfly  wrote:
> Perfect, thank you :)
>
> On May 11, 7:17 pm, mike karthauser  wrote:
>
>
>
>
>
>
>
> > On 11 May 2011, at 08:03, Sanfly wrote:
>
> > > Hi
>
> > > In my old Cakephp (I think 1.1?) I could hide all errors by heading
> > > into my core.php file and setting
>
> > > define('DEBUG', 0);
>
> > > However, this doesnt appear to be in the core.php file in my 1.3
> > > version I have been working with.
>
> > > I want to be able to hide errors for production mode eg:
>
> > > Notice (8): Undefined variable: agreeError [APP\views\members
> > > \signup.ctp, line 149]
>
> > > Can anyone point me in the right direction?
>
> > its there but changed its syntax
>
> > just look for
>
> >         Configure::write('debug', 2);
>
> > around line 36
>
> > in core.php
>
> > --
> > Mike Karthäuser
> > Managing Director - Brightstorm Ltd
> > Email: mi...@brightstorm.co.uk
> > Web:http://www.brightstorm.co.uk
> > Tel: 07939 252144
> > Address: 1 Brewery Court, North Street, Bristol, BS3 1JS

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Debug Errors in Cakephp 1.3

2011-05-11 Thread Sanfly
Perfect, thank you :)

On May 11, 7:17 pm, mike karthauser  wrote:
> On 11 May 2011, at 08:03, Sanfly wrote:
>
>
>
>
>
>
>
>
>
> > Hi
>
> > In my old Cakephp (I think 1.1?) I could hide all errors by heading
> > into my core.php file and setting
>
> > define('DEBUG', 0);
>
> > However, this doesnt appear to be in the core.php file in my 1.3
> > version I have been working with.
>
> > I want to be able to hide errors for production mode eg:
>
> > Notice (8): Undefined variable: agreeError [APP\views\members
> > \signup.ctp, line 149]
>
> > Can anyone point me in the right direction?
>
> its there but changed its syntax
>
> just look for
>
>         Configure::write('debug', 2);
>
> around line 36
>
> in core.php
>
> --
> Mike Karthäuser
> Managing Director - Brightstorm Ltd
> Email: mi...@brightstorm.co.uk
> Web:http://www.brightstorm.co.uk
> Tel: 07939 252144
> Address: 1 Brewery Court, North Street, Bristol, BS3 1JS

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Debug Errors in Cakephp 1.3

2011-05-11 Thread mike karthauser

On 11 May 2011, at 08:03, Sanfly wrote:

> Hi
> 
> In my old Cakephp (I think 1.1?) I could hide all errors by heading
> into my core.php file and setting
> 
> define('DEBUG', 0);
> 
> However, this doesnt appear to be in the core.php file in my 1.3
> version I have been working with.
> 
> I want to be able to hide errors for production mode eg:
> 
> Notice (8): Undefined variable: agreeError [APP\views\members
> \signup.ctp, line 149]
> 
> Can anyone point me in the right direction?

its there but changed its syntax

just look for 

Configure::write('debug', 2);

around line 36

in core.php

-- 
Mike Karthäuser
Managing Director - Brightstorm Ltd 
Email: mi...@brightstorm.co.uk 
Web: http://www.brightstorm.co.uk 
Tel: 07939 252144
Address: 1 Brewery Court, North Street, Bristol, BS3 1JS

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Facebook

2011-05-11 Thread AD7six


On May 10, 10:35 pm, alexsandro andre  wrote:
> Ok sorry ..
>
> Someone has already implemented a fan page in jquery? or any site with
> tutorial?

Why don't you ask that somewhere on topic - like a portuguese jquery
group?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Debug Errors in Cakephp 1.3

2011-05-11 Thread Sanfly
Hi

In my old Cakephp (I think 1.1?) I could hide all errors by heading
into my core.php file and setting

define('DEBUG', 0);

However, this doesnt appear to be in the core.php file in my 1.3
version I have been working with.

I want to be able to hide errors for production mode eg:

Notice (8): Undefined variable: agreeError [APP\views\members
\signup.ctp, line 149]

Can anyone point me in the right direction?

Cheers

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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