Re: routes.php - getting missing controller issue

2010-01-26 Thread leafchild
circket, thank you for the replay.

actually i set to 'id'='[0-9a-zA-Z]+' in the beginning but make it
simple since nothing was working for me.


code below gives me a Missing controller error it say I don't have a
Hp Controller
=
Router::connect('/hp/:id/', array(
 'controller' = 'users',
 'action' = 'homepage',
 ), array(
'id'='[0-9a-zA-Z]', 'pass'='id'
));
=

then if i have this code then it bring  to home page
=
Router::connect('/hp/:id/', array(
 'controller' = 'users',
 'action' = 'homepage',
 ), array(
'id'='[0-9a-zA-Z]+', 'pass'='id'
));
=

What am I missing?




On Jan 25, 5:08 pm, cricket zijn.digi...@gmail.com wrote:
 What does the error msg say? That UsersController is missing, or
 something else?

 Are your usernames limited to lowercase letters only and no digits?

 And you might want to pass the ID to your action:

 Router::connect(
     '/hp/:id/',
     array('controller' = 'users', 'action' = 'homepage'),
     array('id'='[a-z]', 'pass' = 'id')
 );

 On Jan 25, 5:19 pm, leafchild leafchild.b...@gmail.com wrote:



  I'm tring to fix URL

 www.mysite.com/users/homepage/{user's login name}
  -www.mysite.com/{user's login name}

  but I couldn't figure it out so I'm tesing with this 
  firstwww.mysite.com/users/homepage/{user's login name}
  -www.mysite.com/hp/{user's login name}

  Router::connect('/hp/:id/', array( 'controller' = 'users',  'action'
  = 'homepage', ),
                                array('id'='[a-z]',  )
                         );

  then when I access, mysite.com/hp/{user's login name}, I'm getting a
  missing controller error.

  What I'm I doing wrong? I was expected to see the page with this URL.

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Displaying apostrophes

2010-01-26 Thread Céryl
Hi all,

I have currently developed a new problem in my website.
When storing a name into the database wich contains an apostrophe
( ' ), it stores this in the DB as #39; the ASCII code for it.
(that's Amperand, Poundsign, 39, semicolon in case googlegroups parses
it also)

Now some of my pages parse this correctly and display the apostrophe,
some display the ASCII code. I can't find what makes it display it
differently on some pages and not on the others... Even escaping it
with a \ just makes it display \' on one page and \$#39 on the other.

Both get the same data through the same model... Well, it's just
simply the same site, just consistently different per page... Any
clues what might be the problem?

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Query multiple tables

2010-01-26 Thread Celso
Use joins in you find array options

On 22 jan, 14:49, Pedro84 a.osmialow...@gmail.com wrote:
 Hello Everybody!

 I'm learning CakePHP since few days and got problems now. I'm
 rewritting my portal to CakePHP. Sorry for any bad things, this is my
 first question to google groups ever :-)

 I got following query:
 select avg(Ratings.vote) as rating, count(Ratings.username) as votes,
 title, type, Albums.band_name, Albums.salt, Albums.id as id,
 release_date from portal_albums AS Albums join portal_albums_ratings
 AS Ratings on Albums.id=Ratings.album_id group by Albums.id order by
 rating DESC, votes DESC LIMIT 3

 Also I put following function in app_model.php:
         function afterFind($results, $primary=false)
         {
                 if($primary == true) {
                         if(Set::check($results, '0.0')) {
                                 $fields = array_keys( $results[0][0] );
                                 foreach($results as $key=$value) {
                                         foreach( $fields as $fieldName ) {
                                                 
 $results[$key][$this-alias][$fieldName] = $value[0]
 [$fieldName];
                                         }
                                         unset($results[$key][0]);
                                 }
                         }
                 }
                 return $results;

 So now, I can display results of my custom query by using $var['Model']
 ['field']

 Is there any easy way to convert this query to use $this-find()
 method? I'm quering currently using $this-query() and it works
 perfectly but just thinking if I should use find method.

 What's your opinions?

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: question about automagic 'modified' field

2010-01-26 Thread Javier
Thank you for the suggestion. I tried creating a parent behavior, but,
proved too complex for a newbie like me.
Instead I just handled it the afterSave() of the child method. I
just force the update of the 'modified' field there.
I'll work on a more generic way to do this when I have more cake
experience = )

Thank You.

On Jan 25, 9:56 am, euromark dereurom...@googlemail.com wrote:
 i would use a behavior ModifyUpdatable or something
 that checks if there are any parent relations and if so triggers the
 update of the timestamps

 for performance issues you could manually define the parent relations
 to be modified
 so it can update right away instead of checking on existing modified
 fields in the table

 i guess lots of cakers could find this piece of snippet very useful -
 including me :)

 On 25 Jan., 16:25, Javier domingo_deje...@sbcglobal.net wrote:



  Is it possible to automagically update 'modified' field in a
  'belongsTo' table when a table is updated.

  my example is this: I have two tables with 'modified'
  fields...'families' and 'family_members'. models are Family hasMany
  FamiyMember, FamilyMember belongsTo Family.

  When I edit an existing family_member the 'modified' field gets
  updated in 'family_members' table. I would like 'modified' to get
  updated in the 'families' table as well. How can I do that?

  thanx in advance

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Loop Issue Cakephp

2010-01-26 Thread alex
Hi, I'm trying to develop a mailing list  In the controller
CONTENTS there's a function called sendMailingList
[code]
$list = $this-Content-query(SELECT * FROM mails WHERE sub =
'1');
$data = $this-Content-find($id);

$this-Email-smtpOptions = array(
  .
);

foreach($list as $info){
$this-Email-subject = 'Test';
$this-Email-replyTo = 'no-re...@.it;
$this-Email-from = 'xxx x...@.it';

$this-Email-to = 'mailingl...@alexgenovese.it';
$this-Email-delivery = 'smtp';
$this-Email-template = 'html/default';
$this-Email-sendAs = 'html';
$this-Email-to = $info['mails']['mail'];
$this-set('title', $data['Content']['titolo']);
$this-set('content_for_layout', 
$data['Content']['descrizione']);
$this-set('image', $data['Content']['link']);
$this-set('mail', $this-Email-to);
$this-Email-send();
}

$this-flash(__('Email sent', true), array
('action'='index'));
[/code]

it works for one email ( without foreach($list as $info){...} ), but
when i trying to send with this method I see this nex pic...

http://www.flickr.com/photos/davidale/4306633066/

...I wait your answers 

Thanks a lot!
Alex.

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


scaffold isn't working

2010-01-26 Thread andrei.b
Hello,
I have 2 tables: authors(id, name, email) and books(id, title,
author_id).
I've created models for authors and books:

class Author extends AppModel {
var $name = 'Author';
var $hasMany = 'Book';
}

class Book extends AppModel {
var $name = 'Book';
var $belongsTo = 'Author';
}

And the 2 controllers:

class AuthorsController extends AppController{
var $name = 'Authors';
var $scaffold;
}

class BooksController extends AppController {
  var $name = 'Books';
  var $scaffold;
 }

When I run http://localhost/relationship/books/ instead of showing at
author the name of the autor it shows me the id of the author.
Can somebody help me?

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: scaffold isn't working

2010-01-26 Thread Jeremy Burns
If it isn't already there, try turning debug to 2 as this clears the model 
cache.

You can find the setting, which looks like this:

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

...in app/config/core.php

Jeremy Burns

On 26 Jan 2010, at 14:47, andrei.b wrote:

 Hello,
 I have 2 tables: authors(id, name, email) and books(id, title,
 author_id).
 I've created models for authors and books:
 
 class Author extends AppModel {
var $name = 'Author';
var $hasMany = 'Book';
 }
 
 class Book extends AppModel {
var $name = 'Book';
var $belongsTo = 'Author';
 }
 
 And the 2 controllers:
 
 class AuthorsController extends AppController{
var $name = 'Authors';
var $scaffold;
 }
 
 class BooksController extends AppController {
  var $name = 'Books';
  var $scaffold;
 }
 
 When I run http://localhost/relationship/books/ instead of showing at
 author the name of the autor it shows me the id of the author.
 Can somebody help me?
 
 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.
 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/cake-php?hl=en

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Loop Issue Cakephp

2010-01-26 Thread John Andersen
It is stated the CakePHP manual, that you have to reset the Email
fields using the reset method as specified in:

http://book.cakephp.org/view/270/Class-Attributes-and-Variables#Sending-Multiple-Emails-in-a-loop-528

Your final flash message invokes the action index in the current
controller. What is the content of that action?
Enjoy,
   John

On Jan 26, 3:34 pm, alex gen...@gmail.com wrote:
 Hi, I'm trying to develop a mailing list  In the controller
 CONTENTS there's a function called sendMailingList
 [code]
                 $list = $this-Content-query(SELECT * FROM mails WHERE sub =
 '1');
                 $data = $this-Content-find($id);

                 $this-Email-smtpOptions = array(
                   .
                 );

                 foreach($list as $info){
                     $this-Email-subject = 'Test';
                     $this-Email-replyTo = 'no-re...@.it;
                     $this-Email-from = 'xxx x...@.it';

                         $this-Email-to = 'mailingl...@alexgenovese.it';
                         $this-Email-delivery = 'smtp';
                         $this-Email-template = 'html/default';
                         $this-Email-sendAs = 'html';
                         $this-Email-to = $info['mails']['mail'];
                         $this-set('title', $data['Content']['titolo']);
                         $this-set('content_for_layout', 
 $data['Content']['descrizione']);
                         $this-set('image', $data['Content']['link']);
                         $this-set('mail', $this-Email-to);
                         $this-Email-send();
                 }

                 $this-flash(__('Email sent', true), array
 ('action'='index'));
 [/code]

 it works for one email ( without foreach($list as $info){...} ), but
 when i trying to send with this method I see this nex pic...

 http://www.flickr.com/photos/davidale/4306633066/

 ...I wait your answers 

 Thanks a lot!
 Alex.

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: scaffold isn't working

2010-01-26 Thread andrei.b
I already did that. The response is:
SELECT `Book`.`id`, `Book`.`isbn`, `Book`.`title`,
`Book`.`description`, `Book`.`author_id` FROM `books` AS `Book` WHERE
1 = 1 LIMIT 20



On Jan 26, 4:50 pm, Jeremy Burns jeremybu...@me.com wrote:
 If it isn't already there, try turning debug to 2 as this clears the model 
 cache.

 You can find the setting, which looks like this:

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

 ...in app/config/core.php

 Jeremy Burns

 On 26 Jan 2010, at 14:47, andrei.b wrote:

  Hello,
  I have 2 tables: authors(id, name, email) and books(id, title,
  author_id).
  I've created models for authors and books:

  class Author extends AppModel {
     var $name = 'Author';
     var $hasMany = 'Book';
  }

  class Book extends AppModel {
     var $name = 'Book';
     var $belongsTo = 'Author';
  }

  And the 2 controllers:

  class AuthorsController extends AppController{
     var $name = 'Authors';
     var $scaffold;
  }

  class BooksController extends AppController {
   var $name = 'Books';
   var $scaffold;
  }

  When I runhttp://localhost/relationship/books/instead of showing at
  author the name of the autor it shows me the id of the author.
  Can somebody help me?

  Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
  with their CakePHP related questions.

  You received this message because you are subscribed to the Google Groups 
  CakePHP group.
  To post to this group, send email to cake-php@googlegroups.com
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com For more options, visit this group 
  athttp://groups.google.com/group/cake-php?hl=en

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Loop Issue Cakephp

2010-01-26 Thread alex
I notice that removing $this-flash(...) and writing only the code of
redirecting $this-redirect('action'='index'); that pic isn't
appeared again...

my index function is that standard :

function index() {
$this-Content-recursive = 0;
$this-set('contents', $this-paginate());
}

why ?

On 26 Gen, 15:53, John Andersen j.andersen...@gmail.com wrote:
 It is stated the CakePHP manual, that you have to reset the Email
 fields using the reset method as specified in:

 http://book.cakephp.org/view/270/Class-Attributes-and-Variables#Sendi...

 Your final flash message invokes the action index in the current
 controller. What is the content of that action?
 Enjoy,
    John

 On Jan 26, 3:34 pm, alex gen...@gmail.com wrote:



  Hi, I'm trying to develop a mailing list  In the controller
  CONTENTS there's a function called sendMailingList
  [code]
                  $list = $this-Content-query(SELECT * FROM mails WHERE 
  sub =
  '1');
                  $data = $this-Content-find($id);

                  $this-Email-smtpOptions = array(
                    .
                  );

                  foreach($list as $info){
                      $this-Email-subject = 'Test';
                      $this-Email-replyTo = 'no-re...@.it;
                      $this-Email-from = 'xxx x...@.it';

                          $this-Email-to = 'mailingl...@alexgenovese.it';
                          $this-Email-delivery = 'smtp';
                          $this-Email-template = 'html/default';
                          $this-Email-sendAs = 'html';
                          $this-Email-to = $info['mails']['mail'];
                          $this-set('title', $data['Content']['titolo']);
                          $this-set('content_for_layout', 
  $data['Content']['descrizione']);
                          $this-set('image', $data['Content']['link']);
                          $this-set('mail', $this-Email-to);
                          $this-Email-send();
                  }

                  $this-flash(__('Email sent', true), array
  ('action'='index'));
  [/code]

  it works for one email ( without foreach($list as $info){...} ), but
  when i trying to send with this method I see this nex pic...

 http://www.flickr.com/photos/davidale/4306633066/

  ...I wait your answers 

  Thanks a lot!
  Alex.

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: scaffold isn't working

2010-01-26 Thread andrei.b
I found the error. The name of the controllers was at the plural
instead of singular.

On Jan 26, 4:56 pm, andrei.b andrei.bogdan.m...@gmail.com wrote:
 I did that. The select looks like this:
 SELECT `Book`.`id`, `Book`.`isbn`, `Book`.`title`,
 `Book`.`description`, `Book`.`author_id` FROM `books` AS `Book` WHERE
 1 = 1 LIMIT 20

 I use Cake 1.2.5 and php 5.3.1 if this is relevant.

 On Jan 26, 4:50 pm, Jeremy Burns jeremybu...@me.com wrote:

  If it isn't already there, try turning debug to 2 as this clears the model 
  cache.

  You can find the setting, which looks like this:

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

  ...in app/config/core.php

  Jeremy Burns

  On 26 Jan 2010, at 14:47, andrei.b wrote:

   Hello,
   I have 2 tables: authors(id, name, email) and books(id, title,
   author_id).
   I've created models for authors and books:

   class Author extends AppModel {
      var $name = 'Author';
      var $hasMany = 'Book';
   }

   class Book extends AppModel {
      var $name = 'Book';
      var $belongsTo = 'Author';
   }

   And the 2 controllers:

   class AuthorsController extends AppController{
      var $name = 'Authors';
      var $scaffold;
   }

   class BooksController extends AppController {
    var $name = 'Books';
    var $scaffold;
   }

   When I runhttp://localhost/relationship/books/insteadof showing at
   author the name of the autor it shows me the id of the author.
   Can somebody help me?

   Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
   with their CakePHP related questions.

   You received this message because you are subscribed to the Google Groups 
   CakePHP group.
   To post to this group, send email to cake-php@googlegroups.com
   To unsubscribe from this group, send email to
   cake-php+unsubscr...@googlegroups.com For more options, visit this group 
   athttp://groups.google.com/group/cake-php?hl=en

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: scaffold isn't working

2010-01-26 Thread euromark
but it is supposed to be plural
class BooksController extends AppController {



On 26 Jan., 16:30, andrei.b andrei.bogdan.m...@gmail.com wrote:
 I found the error. The name of the controllers was at the plural
 instead of singular.

 On Jan 26, 4:56 pm, andrei.b andrei.bogdan.m...@gmail.com wrote:

  I did that. The select looks like this:
  SELECT `Book`.`id`, `Book`.`isbn`, `Book`.`title`,
  `Book`.`description`, `Book`.`author_id` FROM `books` AS `Book` WHERE
  1 = 1 LIMIT 20

  I use Cake 1.2.5 and php 5.3.1 if this is relevant.

  On Jan 26, 4:50 pm, Jeremy Burns jeremybu...@me.com wrote:

   If it isn't already there, try turning debug to 2 as this clears the 
   model cache.

   You can find the setting, which looks like this:

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

   ...in app/config/core.php

   Jeremy Burns

   On 26 Jan 2010, at 14:47, andrei.b wrote:

Hello,
I have 2 tables: authors(id, name, email) and books(id, title,
author_id).
I've created models for authors and books:

class Author extends AppModel {
   var $name = 'Author';
   var $hasMany = 'Book';
}

class Book extends AppModel {
   var $name = 'Book';
   var $belongsTo = 'Author';
}

And the 2 controllers:

class AuthorsController extends AppController{
   var $name = 'Authors';
   var $scaffold;
}

class BooksController extends AppController {
 var $name = 'Books';
 var $scaffold;
}

When I runhttp://localhost/relationship/books/insteadofshowing at
author the name of the autor it shows me the id of the author.
Can somebody help me?

Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers 
with their CakePHP related questions.

You received this message because you are subscribed to the Google 
Groups CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this 
group athttp://groups.google.com/group/cake-php?hl=en

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Loop Issue Cakephp

2010-01-26 Thread John Andersen
Did you try to reset the email fields?

I wanted to see that your index action didn't loop!
Enjoy,
   John

On Jan 26, 5:05 pm, alex gen...@gmail.com wrote:
 I notice that removing $this-flash(...) and writing only the code of
 redirecting $this-redirect('action'='index'); that pic isn't
 appeared again...

 my index function is that standard :

         function index() {
                 $this-Content-recursive = 0;
                 $this-set('contents', $this-paginate());
         }

 why ?

 On 26 Gen, 15:53, John Andersen j.andersen...@gmail.com wrote:

  It is stated the CakePHP manual, that you have to reset the Email
  fields using the reset method as specified in:

 http://book.cakephp.org/view/270/Class-Attributes-and-Variables#Sendi...

  Your final flash message invokes the action index in the current
  controller. What is the content of that action?
  Enjoy,
     John

  On Jan 26, 3:34 pm, alex gen...@gmail.com wrote:

   Hi, I'm trying to develop a mailing list  In the controller
   CONTENTS there's a function called sendMailingList
   [code]
                   $list = $this-Content-query(SELECT * FROM mails WHERE 
   sub =
   '1');
                   $data = $this-Content-find($id);

                   $this-Email-smtpOptions = array(
                     .
                   );

                   foreach($list as $info){
                       $this-Email-subject = 'Test';
                       $this-Email-replyTo = 'no-re...@.it;
                       $this-Email-from = 'xxx x...@.it';

                           $this-Email-to = 'mailingl...@alexgenovese.it';
                           $this-Email-delivery = 'smtp';
                           $this-Email-template = 'html/default';
                           $this-Email-sendAs = 'html';
                           $this-Email-to = $info['mails']['mail'];
                           $this-set('title', $data['Content']['titolo']);
                           $this-set('content_for_layout', 
   $data['Content']['descrizione']);
                           $this-set('image', $data['Content']['link']);
                           $this-set('mail', $this-Email-to);
                           $this-Email-send();
                   }

                   $this-flash(__('Email sent', true), array
   ('action'='index'));
   [/code]

   it works for one email ( without foreach($list as $info){...} ), but
   when i trying to send with this method I see this nex pic...

  http://www.flickr.com/photos/davidale/4306633066/

   ...I wait your answers 

   Thanks a lot!
   Alex.

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Loop Issue Cakephp

2010-01-26 Thread alex
Yes I tried! it works!!...
Thanks !

On 26 Gen, 18:05, John Andersen j.andersen...@gmail.com wrote:
 Did you try to reset the email fields?

 I wanted to see that your index action didn't loop!
 Enjoy,
    John

 On Jan 26, 5:05 pm, alex gen...@gmail.com wrote:



  I notice that removing $this-flash(...) and writing only the code of
  redirecting $this-redirect('action'='index'); that pic isn't
  appeared again...

  my index function is that standard :

          function index() {
                  $this-Content-recursive = 0;
                  $this-set('contents', $this-paginate());
          }

  why ?

  On 26 Gen, 15:53, John Andersen j.andersen...@gmail.com wrote:

   It is stated the CakePHP manual, that you have to reset the Email
   fields using the reset method as specified in:

  http://book.cakephp.org/view/270/Class-Attributes-and-Variables#Sendi...

   Your final flash message invokes the action index in the current
   controller. What is the content of that action?
   Enjoy,
      John

   On Jan 26, 3:34 pm, alex gen...@gmail.com wrote:

Hi, I'm trying to develop a mailing list  In the controller
CONTENTS there's a function called sendMailingList
[code]
                $list = $this-Content-query(SELECT * FROM mails 
WHERE sub =
'1');
                $data = $this-Content-find($id);

                $this-Email-smtpOptions = array(
                  .
                );

                foreach($list as $info){
                    $this-Email-subject = 'Test';
                    $this-Email-replyTo = 'no-re...@.it;
                    $this-Email-from = 'xxx x...@.it';

                        $this-Email-to = 
'mailingl...@alexgenovese.it';
                        $this-Email-delivery = 'smtp';
                        $this-Email-template = 'html/default';
                        $this-Email-sendAs = 'html';
                        $this-Email-to = $info['mails']['mail'];
                        $this-set('title', $data['Content']['titolo']);
                        $this-set('content_for_layout', 
$data['Content']['descrizione']);
                        $this-set('image', $data['Content']['link']);
                        $this-set('mail', $this-Email-to);
                        $this-Email-send();
                }

                $this-flash(__('Email sent', true), array
('action'='index'));
[/code]

it works for one email ( without foreach($list as $info){...} ), but
when i trying to send with this method I see this nex pic...

   http://www.flickr.com/photos/davidale/4306633066/

...I wait your answers 

Thanks a lot!
Alex.

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Displaying apostrophes

2010-01-26 Thread Nathan Lane
Is there something different about your different pages? Like encoding. For
example are you maybe not encoding a page as text/html for the content
type? I doubt this is the problem though, since the entity #39; should work
for XML also. But it may be a possibility.

Nathan

On Tue, Jan 26, 2010 at 5:05 AM, Céryl c.a.h.wilt...@student.tue.nl wrote:

 Hi all,

 I have currently developed a new problem in my website.
 When storing a name into the database wich contains an apostrophe
 ( ' ), it stores this in the DB as #39; the ASCII code for it.
 (that's Amperand, Poundsign, 39, semicolon in case googlegroups parses
 it also)

 Now some of my pages parse this correctly and display the apostrophe,
 some display the ASCII code. I can't find what makes it display it
 differently on some pages and not on the others... Even escaping it
 with a \ just makes it display \' on one page and \$#39 on the other.

 Both get the same data through the same model... Well, it's just
 simply the same site, just consistently different per page... Any
 clues what might be the problem?

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

 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en




-- 
Nathan Lane
Blog, http://blog.nathandelane.com

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Marking comments as read

2010-01-26 Thread asbestospiping
Hi all, I am trying to do something, and cant work out where to start.
I have the blog app running, and have the comments paginated under the
post. I have auth working, and would like to track when a user views a
comment (Think marking as read)

I have a db table viewedcomments, with the fields id, user_id,
comment_id

I simply want to add the relevent data when a comment is displayed,
either on its own, or as part of the post page.

Any ideas?

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: datasource and count()

2010-01-26 Thread fain182
no one ever tried to write a datasource with count included and not
for an SQL  database?

2010/1/21 fain182 fain...@gmail.com:
 Hello,
 I wrote a little datasource that i need to browse the filesystem..
 find('all'), find('first') works without any problem, but I tried to
 use find('count') and I discovered that I need to implement
 calculate() on my datasource..
 but calculate documentation says that Returns an SQL calculation,
 i.e. COUNT() or MAX() !?
 find(count) can be used only by SQL based datasource??

 or I am missing something?
 thank you

 PS: it would be cool add some information about this in the cookbook too..

 --
 pietro




-- 
pietro

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: datasource and count()

2010-01-26 Thread John Andersen
How do you search for your files that fulfill your criteria?

If you are using a pattern, like *.txt, then you could just use the
function glob(*.txt) to return the filenames and dirnames that
comply with the pattern. The result is an array, which you can
count :)

There is no need to worry about the reference to COUNT in MySql, that
is only if you are using a database.

Enjoy,
   John

On Jan 26, 7:32 pm, fain182 fain...@gmail.com wrote:
 no one ever tried to write a datasource with count included and not
 for an SQL  database?

 2010/1/21 fain182 fain...@gmail.com:



  Hello,
  I wrote a little datasource that i need to browse the filesystem..
  find('all'), find('first') works without any problem, but I tried to
  use find('count') and I discovered that I need to implement
  calculate() on my datasource..
  but calculate documentation says that Returns an SQL calculation,
  i.e. COUNT() or MAX() !?
  find(count) can be used only by SQL based datasource??

  or I am missing something?
  thank you

  PS: it would be cool add some information about this in the cookbook too..

  --
  pietro

 --
 pietro

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Marking comments as read

2010-01-26 Thread John Andersen
Can I understand that you are only showing one comment at a time, even
together with a post?

In case that is correct, then one solution is to specific read all the
ViewedComment records for the post and the user, and ask in the view,
is the current comment in the ViewedComment array of records.
If it is, then show current comment in one colour or whatever you
want.

Another is to include the ViewedComment records in the Comment set
using a hasMany relationship with condition that the user_id equals
the current user. Then act upon it in the view.

Hope this gives you some ideas, enjoy,
   John

On Jan 26, 6:31 pm, asbestospiping asbestospip...@gmail.com wrote:
 Hi all, I am trying to do something, and cant work out where to start.
 I have the blog app running, and have the comments paginated under the
 post. I have auth working, and would like to track when a user views a
 comment (Think marking as read)

 I have a db table viewedcomments, with the fields id, user_id,
 comment_id

 I simply want to add the relevent data when a comment is displayed,
 either on its own, or as part of the post page.

 Any ideas?

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Does ffmpeg adapter need ffmpeg-php extension or is ffmpeg sufficient?

2010-01-26 Thread Deine Mutter
just wanted to add the info for interested people that they might
consider the perl module ffmpeg-perl (http://search.cpan.org/~ALLENDAY/
FFmpeg-6036/FFmpeg.pm) as an alternative to ffmpeg-php.

On 24 Jan., 14:05, David Persson davidpers...@gmx.de wrote:
 Oh that's great to hear!

 As for interfacing with the ffmpeg binary you may want to have a look
 into the ImagickShell adapter[1] which comes with the plugin for a
 working example. Regarding the (blocking) on the fly manipulation,
 I've been using (as cricket pointed out) a queue for spinning the task
 off to workers. My favourite queue server is beanstalkd which I also
 wrote a plugin for.

 - David

 [1]http://github.com/davidpersson/media/blob/1.3/vendors/media/adapter/i...

 On 21 Jan., 19:11, Deine Mutter

 heyichwuerdgernwissenwerdub...@googlemail.com wrote:
  okay, i'll look into it, since i am in need of a working adapter. it
  might however take some time since my personal resources are scarce as
  well.

  besides, have you ever considered implementing a built-in
  functionality that outsources the version generation of uploaded media
  to a cron job? a basic setup would probably be rather simple, just
  marking respective data sets in the table as todo or sth alike and
  treating them as nonexistent in the application as long as they're in
  this state. it just occurs to me, because especially video
  manipulation shouldn't be something you do on the fly.

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Marking comments as read

2010-01-26 Thread cricket
I think the most efficient thing to do would be to update a timestamp
whenever a user views a post. Maybe have a posts_users table with an
extra column and use contain to include it in your results. Update the
column in afterFind() maybe?

Then, in the view, compare the original ts that you got from your find
() with the Comment.created value. Any newer comments get a class
NewComment.

I've never done this, btw. But I happen to be just starting on a
posts_controller. I think I'll give it a go.

On Jan 26, 11:31 am, asbestospiping asbestospip...@gmail.com wrote:
 Hi all, I am trying to do something, and cant work out where to start.
 I have the blog app running, and have the comments paginated under the
 post. I have auth working, and would like to track when a user views a
 comment (Think marking as read)

 I have a db table viewedcomments, with the fields id, user_id,
 comment_id

 I simply want to add the relevent data when a comment is displayed,
 either on its own, or as part of the post page.

 Any ideas?

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Displaying apostrophes

2010-01-26 Thread cricket
I'd guess that what's happening is that, first, the content is being
encoded somewhere before it's inserted into the DB. That may or may
not be what you want. Secondly, on the pages where you see the entity
displayed, something is encoding it once again. So you end up with
amp;#39; and it appears as #39; Check the HTML source.

On Jan 26, 7:05 am, Céryl c.a.h.wilt...@student.tue.nl wrote:
 Hi all,

 I have currently developed a new problem in my website.
 When storing a name into the database wich contains an apostrophe
 ( ' ), it stores this in the DB as #39; the ASCII code for it.
 (that's Amperand, Poundsign, 39, semicolon in case googlegroups parses
 it also)

 Now some of my pages parse this correctly and display the apostrophe,
 some display the ASCII code. I can't find what makes it display it
 differently on some pages and not on the others... Even escaping it
 with a \ just makes it display \' on one page and \$#39 on the other.

 Both get the same data through the same model... Well, it's just
 simply the same site, just consistently different per page... Any
 clues what might be the problem?

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: pagination and routes

2010-01-26 Thread Saleh Souzanchi
this is my problam, plz help

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Dojo toolkit integration with CakePHP now supported!!

2010-01-26 Thread LordZardeck
There is now an open source project dedicated to providing integration
between Dojo and CakePHP! It's called DojoCake and is found at
http://dojocake.googlecode.com

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


I need help with checkbox

2010-01-26 Thread Edinei Luis Cipriani

The view...

$form-input('Curse.0.curse_id',array('type' = 'checkbox', 'value' =  
13));
$form-input('Curse.1.curse_id',array('type' = 'checkbox', 'value' =  
14));
$form-input('Curse.2.curse_id',array('type' = 'checkbox', 'value' =  
15));



how do I recoup the fields checked for edition?


my controller:
function edit($id=null){
...
 $this-data = $this-User-read(null, $id);
...
}



Regards...

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Table Joins

2010-01-26 Thread Uresh

Hi...I am Uresh Patel from india.
I am cakephp beginner.
I took reference from your Table Rename Join Error topic.
I am trying to use inner join between only two tables.

Tables : 
1.user_profiles
   fields :- userid (PK)

2. Memberships
   fields :-membid , userid (reference to users profile )

Can you help me over this issue.?

Thank You

Regards,
Uresh Patel
[ uresh.pa...@ifuturz.com ]
http://old.nabble.com/file/p27334701/controllers.rar controllers.rar 
-- 
View this message in context: 
http://old.nabble.com/Table-Joins-tp27334701p27334701.html
Sent from the CakePHP mailing list archive at Nabble.com.

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Table Joins

2010-01-26 Thread Jeremy Burns
Table joins take place in the model using the $belongsTo, $hasMany and 
$hasAndBelongsToMany variables. See 
http://book.cakephp.org/view/78/Associations-Linking-Models-Together.

Jeremy Burns


On 27 Jan 2010, at 06:31, Uresh wrote:

 
 Hi...I am Uresh Patel from india.
 I am cakephp beginner.
 I took reference from your Table Rename Join Error topic.
 I am trying to use inner join between only two tables.
 
 Tables : 
 1.user_profiles
   fields :- userid (PK)
 
 2. Memberships
   fields :-membid , userid (reference to users profile )
 
 Can you help me over this issue.?
 
 Thank You
 
 Regards,
 Uresh Patel
 [ uresh.pa...@ifuturz.com ]
 http://old.nabble.com/file/p27334701/controllers.rar controllers.rar 
 http://old.nabble.com/file/p27334701/models.rar models.rar 
 -- 
 View this message in context: 
 http://old.nabble.com/Table-Joins-tp27334701p27334701.html
 Sent from the CakePHP mailing list archive at Nabble.com.
 
 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.
 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/cake-php?hl=en

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Loop Issue Cakephp

2010-01-26 Thread Walther
Why are you using raw SQL?

I take a very hard stand on this. If you are using raw SQL then you
should stop using CakePHP, simple as that (There are exceptions to the
rule, but they are very few). By using raw SQL you are entirely
negating all the benefits using a framework like CakePHP gives you.

On Jan 26, 7:11 pm, alex gen...@gmail.com wrote:
 Yes I tried! it works!!...
 Thanks !

 On 26 Gen, 18:05, John Andersen j.andersen...@gmail.com wrote:

  Did you try to reset the email fields?

  I wanted to see that your index action didn't loop!
  Enjoy,
     John

  On Jan 26, 5:05 pm, alex gen...@gmail.com wrote:

   I notice that removing $this-flash(...) and writing only the code of
   redirecting $this-redirect('action'='index'); that pic isn't
   appeared again...

   my index function is that standard :

           function index() {
                   $this-Content-recursive = 0;
                   $this-set('contents', $this-paginate());
           }

   why ?

   On 26 Gen, 15:53, John Andersen j.andersen...@gmail.com wrote:

It is stated the CakePHP manual, that you have to reset the Email
fields using the reset method as specified in:

   http://book.cakephp.org/view/270/Class-Attributes-and-Variables#Sendi...

Your final flash message invokes the action index in the current
controller. What is the content of that action?
Enjoy,
   John

On Jan 26, 3:34 pm, alex gen...@gmail.com wrote:

 Hi, I'm trying to develop a mailing list  In the controller
 CONTENTS there's a function called sendMailingList
 [code]
                 $list = $this-Content-query(SELECT * FROM mails 
 WHERE sub =
 '1');
                 $data = $this-Content-find($id);

                 $this-Email-smtpOptions = array(
                   .
                 );

                 foreach($list as $info){
                     $this-Email-subject = 'Test';
                     $this-Email-replyTo = 'no-re...@.it;
                     $this-Email-from = 'xxx x...@.it';

                         $this-Email-to = 
 'mailingl...@alexgenovese.it';
                         $this-Email-delivery = 'smtp';
                         $this-Email-template = 'html/default';
                         $this-Email-sendAs = 'html';
                         $this-Email-to = $info['mails']['mail'];
                         $this-set('title', 
 $data['Content']['titolo']);
                         $this-set('content_for_layout', 
 $data['Content']['descrizione']);
                         $this-set('image', $data['Content']['link']);
                         $this-set('mail', $this-Email-to);
                         $this-Email-send();
                 }

                 $this-flash(__('Email sent', true), array
 ('action'='index'));
 [/code]

 it works for one email ( without foreach($list as $info){...} ), but
 when i trying to send with this method I see this nex pic...

http://www.flickr.com/photos/davidale/4306633066/

 ...I wait your answers 

 Thanks a lot!
 Alex.

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Dojo toolkit integration with CakePHP now supported!!

2010-01-26 Thread Walther
This looks very promising (I don't use dojo, but still).

However, the javascript helper has been deprecated in CakePHP 1.3. 1.3
offers the new Js helper along with library engines (jQuery, MooTools
and Prototype engines are included by default).

Instead of using your time writing helpers that will no longer work in
a month or two (My guestimate as to when the final version of 1.3 will
be out), you should write a dojo engine for the new CakePHP javascript
methods.

See: http://cakephp.lighthouseapp.com/projects/42648/13-new-features-js-helper

On Jan 26, 9:37 pm, LordZardeck s...@blackfireweb.com wrote:
 There is now an open source project dedicated to providing integration
 between Dojo and CakePHP! It's called DojoCake and is found 
 athttp://dojocake.googlecode.com

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Displaying apostrophes

2010-01-26 Thread Dr. Loboto
Do not use Sanitize or h() or something similar before save. Do not
use them twice on output.

On Jan 26, 6:05 pm, Céryl c.a.h.wilt...@student.tue.nl wrote:
 Hi all,

 I have currently developed a new problem in my website.
 When storing a name into the database wich contains an apostrophe
 ( ' ), it stores this in the DB as #39; the ASCII code for it.
 (that's Amperand, Poundsign, 39, semicolon in case googlegroups parses
 it also)

 Now some of my pages parse this correctly and display the apostrophe,
 some display the ASCII code. I can't find what makes it display it
 differently on some pages and not on the others... Even escaping it
 with a \ just makes it display \' on one page and \$#39 on the other.

 Both get the same data through the same model... Well, it's just
 simply the same site, just consistently different per page... Any
 clues what might be the problem?

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

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en