Retrieve getID(), does not work

2009-06-29 Thread Louie Miranda
$last_id = $this-Pdf-getID();

Is this the proper way of getting the latest ID on a table? (NOT after
save), just want to get the latest ID.
--
Louie Miranda (lmira...@gmail.com)
http://www.louiemiranda.net

Quality Web Hosting - www.axishift.com
Pinoy Web Hosting, Web Hosting Philippines

--~--~-~--~~~---~--~~
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: Paypal Integration

2009-06-29 Thread Vijay Kumbhar
Hello Bhushan,

Please follow the following links,

http://bakery.cakephp.org/articles/view/paypal-direct-payment-api-component

I also used this link for the paypal integration in my project  it works
nice.


On Mon, Jun 29, 2009 at 11:12 AM, bhushan A bhushanahir...@gmail.comwrote:


 Hi All,
  Can anybody tell me any link which guides me how to implement payment
 gateway in cake? Please mail me on bhushanahir...@gmail.com.

 Thanks
 Bhushan
 



-- 
Thanks  Regards,
Vijayk.
Co-founder (www.weboniselab.com)

You Bring the Dreams, We'll Bring the Means

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



Re: How to deploy ACL-permissions on several envirnoments?

2009-06-29 Thread Jeroen

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



Re: Problem returning array from function

2009-06-29 Thread John Andersen

Assuming you are passing an array with one ID, then if I understand
your problem correctly, a parent will be read from the database and as
it will not be 0, the function will enter the else statement.

There is will add the parent ID to the array and then pass this array
plus the parent ID via a recursive call to the function.

In the (recursive) function a parent will be read and it will be 0,
thus entering into the main if statement, where the array is reversed,
and returned ...

... returning to the function ... ups, the returned (reversed array)
is lost in the null land, because no variable is defined to receive
id! And the $array will just contain the values as before the call
(recursive) to the function.

And furthermore, I don't see any statement returning anything from
hereon!

Please check your code !! Turn on Debug, add debug statements and try
again!
Enjoy,
   John


On Jun 28, 11:53 pm, Sanfly san...@gmail.com wrote:
 No, I dont think so.  I have no trouble building the array because
 this line:

 print_r($reverse); echo brbr;

 does print the entire correct array.  Its returning it from the
 function when there is more than one value in the array that gives me
 a problem.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



css sharing not working.

2009-06-29 Thread Ernesto

Hello.

i'm having some troubles with css sharing.

my cake folder tree looks like this

cake
apps
 app_1
  webroot //note: this folder is empty
 app_2
  webroot //note: this folder is empty
shared_items
 views
 vendors
  css
   test.css
  js
  tcpdf

as stated in this ---
http://groups.google.com/group/cake-php/browse_frm/thread/b4414e0a78d37a63/01fcac2a00ae08de?lnk=gstq=share+css#01fcac2a00ae08de
thread i created a vendors/css folder

i also added additional paths to both apps in bootstrap.php

 if (!defined(SHARED_ITEMS_FOLDER)) {
define(SHARED_ITEMS_FOLDER, dirname(ROOT) . DS .shared items.
DS);
}

$viewPaths = array(SHARED_ITEMS_FOLDER .views. DS);
$vendorPaths = array(SHARED_ITEMS_FOLDER .vendors. DS);

now... cake is still searching for css in app/webroot/css folder.
--~--~-~--~~~---~--~~
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: Using FCKEditor in a Plugin

2009-06-29 Thread Miles J

If you are using jQuery, I highly suggest you use MarkItUp. Its about
90% lighter and easier then Tiny MCE and FCK Edit.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



load css from a subfolder by default

2009-06-29 Thread Ernesto

Hello.

is there any way to load css files from a subfolder by default?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



'add' action and auto-setting model id

2009-06-29 Thread Raph

I have weird (I think) problem. When I've added add() action to the
contoller, the id of coresponding model has been set automaticlly to
add() method parameter, and when I try to save data using that
action update instead of save is made.

This method singature looks like this:

public function add($someId).

Is it normal behavior? Do I have to manually call create() method in
my model if I want to save, not update data?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Issue in validation

2009-06-29 Thread bhushan A

Hi  all,

 I am facing issue in displaying error message for validation.
I have added following code in model

var $validate = array(
 'product_name' = VALID_NOT_EMPTY
 );

and following code in view file i.e. add.thtml

?php echo $form-input('product_name', array('size' = '15', 'name'
= 'product_name', 'error' = false)); ?/td
?php echo $form-error('table_name.product_name', 'Please enter
product name'); ?


But it is not displaying error message. Can anybody help me? Do we
need to modify controller also for validation?
--~--~-~--~~~---~--~~
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: Issue in validation

2009-06-29 Thread Vijay Kumbhar
Hello Bhushan,

Cake php uses that default layout file to show the common layout.And it
takes the home.ctp in pages folder.

Are you using default.ctp for default layout?

If not please refer that file.
You can get that file in the project
folder=app=views=layouts=default.ctp

In default.ctp  you will get a line of code that is,

?php echo $session-flash();?

This line produce the inbuilt errors that are from the validate.

So if you are not using that default.ctp file then use that line of code
every where in the code at the top.

On Mon, Jun 29, 2009 at 6:00 PM, bhushan A bhushanahir...@gmail.com wrote:


 Hi  all,

  I am facing issue in displaying error message for validation.
 I have added following code in model

 var $validate = array(
 'product_name' = VALID_NOT_EMPTY
 );

 and following code in view file i.e. add.thtml

 ?php echo $form-input('product_name', array('size' = '15', 'name'
 = 'product_name', 'error' = false)); ?/td
?php echo $form-error('table_name.product_name', 'Please enter
 product name'); ?


 But it is not displaying error message. Can anybody help me? Do we
 need to modify controller also for validation?
 



-- 
Thanks  Regards,
Vijayk.
Co-founder (www.weboniselab.com)

You Bring the Dreams, We'll Bring the Means

--~--~-~--~~~---~--~~
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: 'add' action and auto-setting model id

2009-06-29 Thread Adam Royle

Yes, whether it is right or not, that is the way cake behaves. You should 
always use Model::create() before saving a new record just in case.

For the extra paranoid, you can do this on your add() action:

$this-Model-create($this-data, false);
$this-Model-save();

The second parameter (false) means that if there is an id set in $this-data 
then it will be reset, so an insert will always occur.

Cheers,
Adam

- Original Message - 
From: Raph ra...@epoczta.pl
To: CakePHP cake-php@googlegroups.com
Sent: Monday, June 29, 2009 10:14 PM
Subject: 'add' action and auto-setting model id



 I have weird (I think) problem. When I've added add() action to the
 contoller, the id of coresponding model has been set automaticlly to
 add() method parameter, and when I try to save data using that
 action update instead of save is made.

 This method singature looks like this:

 public function add($someId).

 Is it normal behavior? Do I have to manually call create() method in
 my model if I want to save, not update data?
 

 


--~--~-~--~~~---~--~~
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: 'add' action and auto-setting model id

2009-06-29 Thread Vijay Kumbhar
Hello Raph,

I think you are making a mistake that you are providing a id while adding a
record.
If you provide the id to the save method it fires the update query.

For further explanation Can you please paste the code here?

On Mon, Jun 29, 2009 at 5:44 PM, Raph ra...@epoczta.pl wrote:


 I have weird (I think) problem. When I've added add() action to the
 contoller, the id of coresponding model has been set automaticlly to
 add() method parameter, and when I try to save data using that
 action update instead of save is made.

 This method singature looks like this:

 public function add($someId).

 Is it normal behavior? Do I have to manually call create() method in
 my model if I want to save, not update data?
 



-- 
Thanks  Regards,
Vijayk.
Co-founder (www.weboniselab.com)

You Bring the Dreams, We'll Bring the Means

--~--~-~--~~~---~--~~
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: load css from a subfolder by default

2009-06-29 Thread Vijay Kumbhar
Hello Ernesto,

You can use the following code,if your css file is in webroot/abc/abc.css
folder,

$html-css('abc/abc.css');

By default cakephp searches for the css in webroot folder. So better way to
store the css , js, images in the webroot folder.



On Mon, Jun 29, 2009 at 5:14 PM, Ernesto e.fanz...@gmail.com wrote:


 Hello.

 is there any way to load css files from a subfolder by default?
 



-- 
Thanks  Regards,
Vijayk.
Co-founder (www.weboniselab.com)

You Bring the Dreams, We'll Bring the Means

--~--~-~--~~~---~--~~
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: Issue in validation

2009-06-29 Thread bhushan A

Yes i am using default.ctp. ?php echo $session-flash();? line is
present in that file. .. I Have fount that if i will enter wrong data
then after submitting form, it is not inserted in DB but not
displaying error message also. Any other file which needs to be
modified for this. Please guide.. thanks for reply..

On Jun 29, 6:00 pm, Vijay Kumbhar k.vidn...@gmail.com wrote:
 Hello Bhushan,

 Cake php uses that default layout file to show the common layout.And it
 takes the home.ctp in pages folder.

 Are you using default.ctp for default layout?

 If not please refer that file.
 You can get that file in the project
 folder=app=views=layouts=default.ctp

 In default.ctp  you will get a line of code that is,

 ?php echo $session-flash();?

 This line produce the inbuilt errors that are from the validate.

 So if you are not using that default.ctp file then use that line of code
 every where in the code at the top.



 On Mon, Jun 29, 2009 at 6:00 PM, bhushan A bhushanahir...@gmail.com wrote:

  Hi  all,

   I am facing issue in displaying error message for validation.
  I have added following code in model

  var $validate = array(
                  'product_name' = VALID_NOT_EMPTY
                  );

  and following code in view file i.e. add.thtml

  ?php echo $form-input('product_name', array('size' = '15', 'name'
  = 'product_name', 'error' = false)); ?/td
         ?php echo $form-error('table_name.product_name', 'Please enter
  product name'); ?

  But it is not displaying error message. Can anybody help me? Do we
  need to modify controller also for validation?

 --
 Thanks  Regards,
 Vijayk.
 Co-founder (www.weboniselab.com)

 You Bring the Dreams, We'll Bring the Means
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



bakeme tool

2009-06-29 Thread zecoelho

Hello All,

I wonder if anyone can help me with the bakeme tool?
I am digging around in this code for a solution to the following
problem. Maybe you can help!

When it comes to sorting data in the Deleted Tag, the whole page is
refreshed (instead of just the table view) and as a result the tabular
layout for the view is lost.

It seems that the call to the Ajax object is lost when it comes to a
second idName in admin_index.ctp.

element('datatable', array('controllerPath' = 'ade_fotos', 'idName'
= 'AdeFotosdeleted', 'filters' = array('deleted' = '1')));?
the last piece of code works only when idName matches a model... check
the default users tabular view that comes with instalation.

Thanks.
zecoelho

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



association with 'external' attribute

2009-06-29 Thread BoogieBug

Hi,

Please anyone suggest me any readings about the attribute 'external'
in the model association? What is the role of the 'external' attribute
take in the association? I've searched through the CakePHP web site
but cannot find any clue about this. Thanks.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Sitepoint tutorial with Flickr component

2009-06-29 Thread Hols Kay

Hi guys,

Quite new to this - I'm doing this tutorial:
http://www.sitepoint.com/article/photo-gallery-cakephp-flickr/ and I'm
having issues on index.ctp. This is the troublesome code:
-
img id=mainimg src=?php echo $flickr-buildPhotoURL($thumbs
['photo'][0], 'medium')? title=?php echo $thumbs['photo'][0]
['title']?  alt=?php echo $thumbs['photo'][0]['title']? /
-

and this is the output I'm getting from it:

Notice (8): Undefined index: photo [APP\views\gallery\index.ctp, line
12] http://farm.static.flickr.com//_.jpg; title= alt= /


buildPhotoURL() looks like this:

function buildPhotoURL ($photo, $size = Medium) {
//receives an array (can use the individual photo data returned
//from an API call) and returns a URL (doesn't mean that the
//file size exists)
$sizes = array(
square = _s,
thumbnail = _t,
small = _m,
medium = ,
large = _b,
original = _o
);

$size = strtolower($size);
if (!array_key_exists($size, $sizes)) {
$size = medium;
}

if ($size == original) {
$url = http://farm; . $photo['farm'] . 
.static.flickr.com/ .
$photo['server'] . / . $photo['id'] . _ . $photo
['originalsecret'] . _o . . . $photo['originalformat'];
} else {
$url = http://farm; . $photo['farm'] . 
.static.flickr.com/ .
$photo['server'] . / . $photo['id'] . _ . $photo['secret'] . $sizes
[$size] . .jpg;
}
return $url;
}


I know the tutorial is quite out-of-date now, so something might have
changed in either API that I don't know about it, or I could just be
doing something wrong. Does anybody have any ideas, am I missing
something obvious?

Thanks!

--~--~-~--~~~---~--~~
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: 'add' action and auto-setting model id

2009-06-29 Thread Adam Royle
Hi Vijay,

Have a look at the source of controller.php in constructClasses() and you will 
see what Ralph is experiencing. Line numbers are indicative of r8204 (current 
branch).

line 448:
$id = $this-passedArgs['0'];

line 452:
$this-loadModel($this-modelClass, $id);

Cheers,
Adam
  - Original Message - 
  From: Vijay Kumbhar 
  To: cake-php@googlegroups.com 
  Sent: Monday, June 29, 2009 11:03 PM
  Subject: Re: 'add' action and auto-setting model id


  Hello Raph,

  I think you are making a mistake that you are providing a id while adding a 
record.
  If you provide the id to the save method it fires the update query.

  For further explanation Can you please paste the code here?


  On Mon, Jun 29, 2009 at 5:44 PM, Raph ra...@epoczta.pl wrote:


I have weird (I think) problem. When I've added add() action to the
contoller, the id of coresponding model has been set automaticlly to
add() method parameter, and when I try to save data using that
action update instead of save is made.

This method singature looks like this:

public function add($someId).

Is it normal behavior? Do I have to manually call create() method in
my model if I want to save, not update data?





  -- 
  Thanks  Regards,
  Vijayk.
  Co-founder (www.weboniselab.com)

  You Bring the Dreams, We'll Bring the Means

  

--~--~-~--~~~---~--~~
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: Issue in validation

2009-06-29 Thread Vijay Kumbhar
Hello Bhushan,

What type of validation you want to apply for that fileld.
You are applying now only not empty validation only. So please refer the
following link for further help,

http://book.cakephp.org/view/125/Data-Validation



On Mon, Jun 29, 2009 at 6:38 PM, bhushan A bhushanahir...@gmail.com wrote:


 Yes i am using default.ctp. ?php echo $session-flash();? line is
 present in that file. .. I Have fount that if i will enter wrong data
 then after submitting form, it is not inserted in DB but not
 displaying error message also. Any other file which needs to be
 modified for this. Please guide.. thanks for reply..

 On Jun 29, 6:00 pm, Vijay Kumbhar k.vidn...@gmail.com wrote:
  Hello Bhushan,
 
  Cake php uses that default layout file to show the common layout.And it
  takes the home.ctp in pages folder.
 
  Are you using default.ctp for default layout?
 
  If not please refer that file.
  You can get that file in the project
  folder=app=views=layouts=default.ctp
 
  In default.ctp  you will get a line of code that is,
 
  ?php echo $session-flash();?
 
  This line produce the inbuilt errors that are from the validate.
 
  So if you are not using that default.ctp file then use that line of code
  every where in the code at the top.
 
 
 
  On Mon, Jun 29, 2009 at 6:00 PM, bhushan A bhushanahir...@gmail.com
 wrote:
 
   Hi  all,
 
I am facing issue in displaying error message for validation.
   I have added following code in model
 
   var $validate = array(
   'product_name' = VALID_NOT_EMPTY
   );
 
   and following code in view file i.e. add.thtml
 
   ?php echo $form-input('product_name', array('size' = '15', 'name'
   = 'product_name', 'error' = false)); ?/td
  ?php echo $form-error('table_name.product_name', 'Please
 enter
   product name'); ?
 
   But it is not displaying error message. Can anybody help me? Do we
   need to modify controller also for validation?
 
  --
  Thanks  Regards,
  Vijayk.
  Co-founder (www.weboniselab.com)
 
  You Bring the Dreams, We'll Bring the Means
 



-- 
Thanks  Regards,
Vijayk.
Co-founder (www.weboniselab.com)

You Bring the Dreams, We'll Bring the Means

--~--~-~--~~~---~--~~
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: Sitepoint tutorial with Flickr component

2009-06-29 Thread Vijay Kumbhar
Hey Hols,

Can you please checked  printing that $photo array??
Please check that one. If that array is blank / or please check the
structure of that array then it gives the error.

On Mon, Jun 29, 2009 at 6:22 PM, Hols Kay hol...@googlemail.com wrote:


 Hi guys,

 Quite new to this - I'm doing this tutorial:
 http://www.sitepoint.com/article/photo-gallery-cakephp-flickr/ and I'm
 having issues on index.ctp. This is the troublesome code:
 -
 img id=mainimg src=?php echo $flickr-buildPhotoURL($thumbs
 ['photo'][0], 'medium')? title=?php echo $thumbs['photo'][0]
 ['title']?  alt=?php echo $thumbs['photo'][0]['title']? /
 -

 and this is the output I'm getting from it:
 
 Notice (8): Undefined index: photo [APP\views\gallery\index.ctp, line
 12] http://farm.static.flickr.com//_.jpg; title= alt= /
 

 buildPhotoURL() looks like this:
 
function buildPhotoURL ($photo, $size = Medium) {
//receives an array (can use the individual photo data
 returned
//from an API call) and returns a URL (doesn't mean that the
//file size exists)
$sizes = array(
square = _s,
thumbnail = _t,
small = _m,
medium = ,
large = _b,
original = _o
);

$size = strtolower($size);
if (!array_key_exists($size, $sizes)) {
$size = medium;
}

if ($size == original) {
$url = http://farm; . $photo['farm'] . .
 static.flickr.com/ .
 $photo['server'] . / . $photo['id'] . _ . $photo
 ['originalsecret'] . _o . . . $photo['originalformat'];
} else {
$url = http://farm; . $photo['farm'] . .
 static.flickr.com/ .
 $photo['server'] . / . $photo['id'] . _ . $photo['secret'] . $sizes
 [$size] . .jpg;
}
return $url;
}
 

 I know the tutorial is quite out-of-date now, so something might have
 changed in either API that I don't know about it, or I could just be
 doing something wrong. Does anybody have any ideas, am I missing
 something obvious?

 Thanks!

 



-- 
Thanks  Regards,
Vijayk.
Co-founder (www.weboniselab.com)

You Bring the Dreams, We'll Bring the Means

--~--~-~--~~~---~--~~
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: Sitepoint tutorial with Flickr component

2009-06-29 Thread Hols Kay

Hi Vijay - thanks for your help!

The photo array is blank while all the other key pairs are populated,
and photo is the only keypair that uses an array:
---
$thumbs =   array(
photoset = array(
id = 72157620559969985,
primary = 65816580,
owner = 23548...@n00,
ownername = algo,
photo = array(),
page = 1,
per_page = 500,
perpage = 500,
pages = 1,
total = 1
),


Photo is the only key pair that has an array - so I guess that's
significant. If I change $this-set('thumbs',$this-flickr-
photosets_getPhotos($currset)); in GalleryController to $this-set
('thumbs',$this-flickr-photosets_getPhotos(array($currset))); then
that switches $thumbs to false, so it looks like my syntax is off,
also!

Is there a special way to push the array through?

Thanks again!
Hols

On Jun 29, 2:22 pm, Vijay Kumbhar k.vidn...@gmail.com wrote:
 Hey Hols,

 Can you please checked  printing that $photo array??
 Please check that one. If that array is blank / or please check the
 structure of that array then it gives the error.



 On Mon, Jun 29, 2009 at 6:22 PM, Hols Kay hol...@googlemail.com wrote:

  Hi guys,

  Quite new to this - I'm doing this tutorial:
 http://www.sitepoint.com/article/photo-gallery-cakephp-flickr/and I'm
  having issues on index.ctp. This is the troublesome code:
  -
  img id=mainimg src=?php echo $flickr-buildPhotoURL($thumbs
  ['photo'][0], 'medium')? title=?php echo $thumbs['photo'][0]
  ['title']?  alt=?php echo $thumbs['photo'][0]['title']? /
  -

  and this is the output I'm getting from it:
  
  Notice (8): Undefined index: photo [APP\views\gallery\index.ctp, line
  12]http://farm.static.flickr.com//_.jpg; title= alt= /
  

  buildPhotoURL() looks like this:
  
         function buildPhotoURL ($photo, $size = Medium) {
                 //receives an array (can use the individual photo data
  returned
                 //from an API call) and returns a URL (doesn't mean that the
                 //file size exists)
                 $sizes = array(
                         square = _s,
                         thumbnail = _t,
                         small = _m,
                         medium = ,
                         large = _b,
                         original = _o
                 );

                 $size = strtolower($size);
                 if (!array_key_exists($size, $sizes)) {
                         $size = medium;
                 }

                 if ($size == original) {
                         $url = http://farm; . $photo['farm'] . .
  static.flickr.com/ .
  $photo['server'] . / . $photo['id'] . _ . $photo
  ['originalsecret'] . _o . . . $photo['originalformat'];
                 } else {
                         $url = http://farm; . $photo['farm'] . .
  static.flickr.com/ .
  $photo['server'] . / . $photo['id'] . _ . $photo['secret'] . $sizes
  [$size] . .jpg;
                 }
                 return $url;
         }
  

  I know the tutorial is quite out-of-date now, so something might have
  changed in either API that I don't know about it, or I could just be
  doing something wrong. Does anybody have any ideas, am I missing
  something obvious?

  Thanks!

 --
 Thanks  Regards,
 Vijayk.
 Co-founder (www.weboniselab.com)

 You Bring the Dreams, We'll Bring the Means
--~--~-~--~~~---~--~~
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: load css from a subfolder by default

2009-06-29 Thread Ernesto

hi Vijay. Thx for the response.

i'm looking for a method to change the default css folder.

your code surely works but that's not exactly what i'm looking for :)

On 29 Giu, 15:05, Vijay Kumbhar k.vidn...@gmail.com wrote:
 Hello Ernesto,

 You can use the following code,if your css file is in webroot/abc/abc.css
 folder,

 $html-css('abc/abc.css');

 By default cakephp searches for the css in webroot folder. So better way to
 store the css , js, images in the webroot folder.

 On Mon, Jun 29, 2009 at 5:14 PM, Ernesto e.fanz...@gmail.com wrote:

  Hello.

  is there any way to load css files from a subfolder by default?

 --
 Thanks  Regards,
 Vijayk.
 Co-founder (www.weboniselab.com)

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



Re: How to deploy ACL-permissions on several envirnoments?

2009-06-29 Thread brian

I can't speak for others, but I don't understand the question. If
you're migrating your DB from one server to the other, why wouldn't
that include your ACL info?

Also, why do you have 'foreign_key' = 0? How can you have 0 as a foreign key?

And Guest is misspelled, btw.

On Mon, Jun 29, 2009 at 4:40 AM, Jeroenjeroenin...@gmail.com wrote:

 nobody know's it?
 


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Flash messages and Session Destroy

2009-06-29 Thread lordG

Hi Guys,

I have a slight issue and I suspect its related to how Session-
destroy works.

If I destroy a session, and then set a flashmessage, it never appears
or exists in the page after I redirect. For example, when a use logs
out, I set a message after Session-destroy to you have been logged
out.

The other scenario is if a user logs in, and there is already a user
logged in, I destroy the session, and then log the user in, which is
suppose to set the the user details into the session. However,
anything set after the Session-destroy is lost.

My redirects are also only set last. So first Session-destroy, then
Session-setFlash, and then finally Session-redirect.

I looked at the SessionComponent file an thought the following lines
looked incorrect...

function destroy() {
if ($this-__active === true) {
$this-__start();
parent::destroy();
}
}

Surely it should be:

function destroy() {
if ($this-__active === true) {
parent::destroy();
$this-__start();
}
}

I changed it to test, and the second scenario above worked fine,
however, my setFlashes are still getting lost.

Is this correct, is there possible something I should be doing?

Much appreciated.

G


--~--~-~--~~~---~--~~
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: Sitepoint tutorial with Flickr component

2009-06-29 Thread Vijay Kumbhar
Hello Hols,

hey thats good :) .

Yes sure you can add that array in the main $thumbs array by using simple
php function array_push();
if it not works please explain it properly.

please check that one.

On Mon, Jun 29, 2009 at 7:29 PM, Hols Kay hol...@googlemail.com wrote:


 Hi Vijay - thanks for your help!

 The photo array is blank while all the other key pairs are populated,
 and photo is the only keypair that uses an array:
 ---
 $thumbs =   array(
photoset = array(
id = 72157620559969985,
primary = 65816580,
owner = 23548...@n00,
ownername = algo,
photo = array(),
page = 1,
per_page = 500,
perpage = 500,
pages = 1,
total = 1
 ),

 

 Photo is the only key pair that has an array - so I guess that's
 significant. If I change $this-set('thumbs',$this-flickr-
 photosets_getPhotos($currset)); in GalleryController to $this-set
 ('thumbs',$this-flickr-photosets_getPhotos(array($currset))); then
 that switches $thumbs to false, so it looks like my syntax is off,
 also!

 Is there a special way to push the array through?

 Thanks again!
 Hols

 On Jun 29, 2:22 pm, Vijay Kumbhar k.vidn...@gmail.com wrote:
  Hey Hols,
 
  Can you please checked  printing that $photo array??
  Please check that one. If that array is blank / or please check the
  structure of that array then it gives the error.
 
 
 
  On Mon, Jun 29, 2009 at 6:22 PM, Hols Kay hol...@googlemail.com wrote:
 
   Hi guys,
 
   Quite new to this - I'm doing this tutorial:
  http://www.sitepoint.com/article/photo-gallery-cakephp-flickr/and I'm
   having issues on index.ctp. This is the troublesome code:
   -
   img id=mainimg src=?php echo $flickr-buildPhotoURL($thumbs
   ['photo'][0], 'medium')? title=?php echo $thumbs['photo'][0]
   ['title']?  alt=?php echo $thumbs['photo'][0]['title']? /
   -
 
   and this is the output I'm getting from it:
   
   Notice (8): Undefined index: photo [APP\views\gallery\index.ctp, line
   12]http://farm.static.flickr.com//_.jpg; title= alt= /
   
 
   buildPhotoURL() looks like this:
   
  function buildPhotoURL ($photo, $size = Medium) {
  //receives an array (can use the individual photo data
   returned
  //from an API call) and returns a URL (doesn't mean that
 the
  //file size exists)
  $sizes = array(
  square = _s,
  thumbnail = _t,
  small = _m,
  medium = ,
  large = _b,
  original = _o
  );
 
  $size = strtolower($size);
  if (!array_key_exists($size, $sizes)) {
  $size = medium;
  }
 
  if ($size == original) {
  $url = http://farm; . $photo['farm'] . .
   static.flickr.com/ .
   $photo['server'] . / . $photo['id'] . _ . $photo
   ['originalsecret'] . _o . . . $photo['originalformat'];
  } else {
  $url = http://farm; . $photo['farm'] . .
   static.flickr.com/ .
   $photo['server'] . / . $photo['id'] . _ . $photo['secret'] . $sizes
   [$size] . .jpg;
  }
  return $url;
  }
   
 
   I know the tutorial is quite out-of-date now, so something might have
   changed in either API that I don't know about it, or I could just be
   doing something wrong. Does anybody have any ideas, am I missing
   something obvious?
 
   Thanks!
 
  --
  Thanks  Regards,
  Vijayk.
  Co-founder (www.weboniselab.com)
 
  You Bring the Dreams, We'll Bring the Means
 



-- 
Thanks  Regards,
Vijayk.
Co-founder (www.weboniselab.com)

You Bring the Dreams, We'll Bring the Means

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



phpThumb with Web Hosted Images

2009-06-29 Thread gbd

Hey,

I'm trying to use phpThumb with web hosted images, none of the other
options i.e. width/height are working.

This is the relevant line in my view:

img src=?php echo $html-url('/webroot/phpThumb/phpThumb.php'); ??
src=?php echo $pic_source?
class=polaroid

I've tried something like the following but it does not work:

img src=?php echo $html-url('/webroot/phpThumb/phpThumb.php'); ??
src=?php echo $pic_source?w=200 class=polaroid


Any insight into my issue?

Thanks

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Delete current login user sessions

2009-06-29 Thread lordG

Hi Guys,

Does anyone know of a method to delete/destroy any sessions created by
a user when they re login? I.E. If 2 people login using the same
login, the first person should get kicked out (session destroyed)
when the second person logs in.

From looking at the Session base class, __regenerateId() does a
similar action, but obviously for a different instance.

I would imagine a simple extension to the Session class called
$Session-destroy($id) where id is the session id of the currently
logged in person.

Much Appreciated.

G
--~--~-~--~~~---~--~~
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: Flash messages and Session Destroy

2009-06-29 Thread lordG

Ok, this has been fixed in the latest release 1.2.3.8166.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Fieldset Issues under IE 8

2009-06-29 Thread j-rod

Does anyone know if there is a change coming in the 1.2.x or 1.3.x
versions that have different handling for the fieldset with $form-
create than the display: none. It just came to my attention that IE 8
running normally (not in capatability mode) is now hiding the entire
form contents with this set.I just checked and I had the Strict XHTML
DTD in place. Perhaps a 0 border/padding/margin option withing a CSS
class would work better than display:none inline ?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Models and SOAP

2009-06-29 Thread RhythmicDevil

Hi,
some of my application's models will use SOAP or MySQL. I am trying to
figure out where to put the common SOAP stuff.

User Model will use MySQL
Subscriber Model will use SOAP
Device Model will use SOAP

In my SOAP models I need to have this:

$api_config = Configure::read('API');

$this-TransactionParams['loginName'] = $api_config
['loginName'];
$this-TransactionParams['loginPassword'] = $api_config
['loginPassword'];
$this-TransactionParams['orgName'] = $api_config['orgName'];

$this-TransactionParams['transaction']['id'] = date('d-m-y-
i:s:a').' - ';
$this-TransactionParams['transaction']['wait'] = $api_config
['wait'];
$this-TransactionParams['transaction']['version'] =
$api_config['version'];
$this-TransactionParams['transaction']
['TransactionCommandList'] = array ();

Currently this sits in the constructor for Subscriber but I know thats
wrong as I would then have to repeat that for each subsequent model
that uses SOAP. I am using this for my datasource:
http://www.pagebakers.nl/2008/12/18/soapsource-a-soap-client-datasource-for-cakephp/

I thought a behavior would be the trick but I am not sure. The docs
dont seem to point in that direction.
I dont want to extend app_model because that would then add it to the
models that use MySQL.

Any ideas?

Thanks.
--~--~-~--~~~---~--~~
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: Models and SOAP

2009-06-29 Thread Carlos Gonzalez Lavin
How about a little class hierarchy?

Soap extends AppModel and Suscriber-Device extend Soap

You put that in Soap's constructor and then just super() it in
Suscriber-Device

2009/6/29 RhythmicDevil rhythmicde...@gmail.com


 Hi,
 some of my application's models will use SOAP or MySQL. I am trying to
 figure out where to put the common SOAP stuff.

 User Model will use MySQL
 Subscriber Model will use SOAP
 Device Model will use SOAP

 In my SOAP models I need to have this:

$api_config = Configure::read('API');

$this-TransactionParams['loginName'] = $api_config
 ['loginName'];
$this-TransactionParams['loginPassword'] = $api_config
 ['loginPassword'];
$this-TransactionParams['orgName'] = $api_config['orgName'];

$this-TransactionParams['transaction']['id'] = date('d-m-y-
 i:s:a').' - ';
$this-TransactionParams['transaction']['wait'] = $api_config
 ['wait'];
$this-TransactionParams['transaction']['version'] =
 $api_config['version'];
$this-TransactionParams['transaction']
 ['TransactionCommandList'] = array ();

 Currently this sits in the constructor for Subscriber but I know thats
 wrong as I would then have to repeat that for each subsequent model
 that uses SOAP. I am using this for my datasource:

 http://www.pagebakers.nl/2008/12/18/soapsource-a-soap-client-datasource-for-cakephp/

 I thought a behavior would be the trick but I am not sure. The docs
 dont seem to point in that direction.
 I dont want to extend app_model because that would then add it to the
 models that use MySQL.

 Any ideas?

 Thanks.
 


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Simple relationship problem

2009-06-29 Thread Bryan Paddock

Heya all,

Theres something I'm not doing right here...

I have a User model which has one Seller model linked to it which in
turn can have an Agency model linked to it.

User Model:
hasOne seller.
Seller Model: belongsTo user
Agency Model: belongsTo seller

--~--~-~--~~~---~--~~
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: Simple relationship problem

2009-06-29 Thread Bryan Paddock

Argh.. I hate gmail shortcut keys.

Anyways continuing mail:

Heya all,

Theres something I'm not doing right here...

I have a User model which has one Seller model linked to it which in
turn can have an Agency model linked to it.

User Model:
hasOne seller.

Seller Model:
 belongsTo user

Agency Model:
belongsTo seller

Now when I call $this-User-find('all') it complains that there is no
foreign key in the agency table. That would be impossible because then
that would mean only one agency can belong to one seller.

How do I set it up so that any number of agencies can belong to any
number of sellers? I'm missing something really stupid here

Thanks!

Bryan






On Mon, Jun 29, 2009 at 7:06 PM, Bryan Paddockbryanpadd...@gmail.com wrote:
 Heya all,

 Theres something I'm not doing right here...

 I have a User model which has one Seller model linked to it which in
 turn can have an Agency model linked to it.

 User Model:
 hasOne seller.
 Seller Model: belongsTo user
 Agency Model: belongsTo seller


--~--~-~--~~~---~--~~
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: Models and SOAP

2009-06-29 Thread RhythmicDevil

Thats what I thought too, but when I do that I get an error that the
SoapModel class cannot be found.

class SoapModel extends AppModel
{
public function __construct()
{
parent::__construct();

$api_config = Configure::read('API');

$this-TransactionParams['loginName'] = $api_config
['loginName'];
$this-TransactionParams['loginPassword'] = $api_config
['loginPassword'];
$this-TransactionParams['orgName'] = $api_config['orgName'];

$this-TransactionParams['transaction']['id'] = date('d-m-y-
i:s:a').' - ';
$this-TransactionParams['transaction']['wait'] = $api_config
['wait'];
$this-TransactionParams['transaction']['version'] =
$api_config['version'];
$this-TransactionParams['transaction']
['TransactionCommandList'] = array ();
}
}



class Subscriber extends SoapModel
{
/**
 * @var useDbConfig
 * @description The name of the DataSource connection that this
Model uses. Defined in core/database.php
 */
public $useDbConfig = 'soap';
public $useTable = false;

public $TransactionParams = array ();

public function __construct()
{
parent::__construct();
}

}


Both these files are in the app/models directory.


Steve




On Jun 29, 12:58 pm, Carlos Gonzalez Lavin carloslavi...@gmail.com
wrote:
 How about a little class hierarchy?

 Soap extends AppModel and Suscriber-Device extend Soap

 You put that in Soap's constructor and then just super() it in
 Suscriber-Device

 2009/6/29 RhythmicDevil rhythmicde...@gmail.com



  Hi,
  some of my application's models will use SOAP or MySQL. I am trying to
  figure out where to put the common SOAP stuff.

  User Model will use MySQL
  Subscriber Model will use SOAP
  Device Model will use SOAP

  In my SOAP models I need to have this:

         $api_config = Configure::read('API');

         $this-TransactionParams['loginName'] = $api_config
  ['loginName'];
         $this-TransactionParams['loginPassword'] = $api_config
  ['loginPassword'];
         $this-TransactionParams['orgName'] = $api_config['orgName'];

         $this-TransactionParams['transaction']['id'] = date('d-m-y-
  i:s:a').' - ';
         $this-TransactionParams['transaction']['wait'] = $api_config
  ['wait'];
         $this-TransactionParams['transaction']['version'] =
  $api_config['version'];
         $this-TransactionParams['transaction']
  ['TransactionCommandList'] = array ();

  Currently this sits in the constructor for Subscriber but I know thats
  wrong as I would then have to repeat that for each subsequent model
  that uses SOAP. I am using this for my datasource:

 http://www.pagebakers.nl/2008/12/18/soapsource-a-soap-client-datasour...

  I thought a behavior would be the trick but I am not sure. The docs
  dont seem to point in that direction.
  I dont want to extend app_model because that would then add it to the
  models that use MySQL.

  Any ideas?

  Thanks.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Tutorial won't validate

2009-06-29 Thread 0plus1

Dear cake,

I'm deciding which php framework to use for a pretty big project.
I'm pretty fluent with code igniter but i'm looking to switch to cake
php or symphony because they are simply on another planet, features
and codewise.

I was following the tutorial but I've encountered a problem: the form
won't validate, everything has been set according to the tutorial and
everything works except for the fact that sending an empty form
doesn't return any error at all and saves empty title and body
fields.
I understand that:

if ($this-Post-save($this-data)) {}

but the validation section in the documentation states this command:

if ($this-Post-validates()) {}

What of the two is right, can you tell me what I'm doing wrong?

Thank you very much

--~--~-~--~~~---~--~~
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: Using FCKEditor in a Plugin

2009-06-29 Thread craig.kaminsky

Thanks, so much for that tip, Miles. This is really nice and
definitely lighter weight than FCK  Tiny. Appreciate it!

--~--~-~--~~~---~--~~
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: Simple relationship problem

2009-06-29 Thread JD Daniels
You need to look at hasAndBelongsToMany

http://book.cakephp.org/view/83/hasAndBelongsToMany-HABTM

Bryan Paddock wrote:
 Argh.. I hate gmail shortcut keys.

 Anyways continuing mail:

 Heya all,

 Theres something I'm not doing right here...

 I have a User model which has one Seller model linked to it which in
 turn can have an Agency model linked to it.

 User Model:
 hasOne seller.

 Seller Model:
  belongsTo user

 Agency Model:
 belongsTo seller

 Now when I call $this-User-find('all') it complains that there is no
 foreign key in the agency table. That would be impossible because then
 that would mean only one agency can belong to one seller.

 How do I set it up so that any number of agencies can belong to any
 number of sellers? I'm missing something really stupid here

 Thanks!

 Bryan






 On Mon, Jun 29, 2009 at 7:06 PM, Bryan Paddockbryanpadd...@gmail.com wrote:
   
 Heya all,

 Theres something I'm not doing right here...

 I have a User model which has one Seller model linked to it which in
 turn can have an Agency model linked to it.

 User Model:
 hasOne seller.
 Seller Model: belongsTo user
 Agency Model: belongsTo seller

 

 
   


--~--~-~--~~~---~--~~
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: 'add' action and auto-setting model id

2009-06-29 Thread Raph

Hello,

I can't paste exactly the same code, but I can tell you what I want to
do. In controller where I have that add() method I want to save an
entry to a journal which model is in belongsTo relation with User
model, so I tried to use add() method in journal's controller with
user id as a parameter. Somehing like that (very simple version):

public function add($userId) {
$this-data['Journal']['user_id'] = $userId;

$this-Journal-saveEntry($this-data);
}

The problem is $userId is automaticlly set like that:
$this-Jounral-id = $userId.

On 29 Cze, 15:03, Vijay Kumbhar k.vidn...@gmail.com wrote:
 Hello Raph,

 I think you are making a mistake that you are providing a id while adding a
 record.
 If you provide the id to the save method it fires the update query.

 For further explanation Can you please paste the code here?

 On Mon, Jun 29, 2009 at 5:44 PM, Raph ra...@epoczta.pl wrote:

  I have weird (I think) problem. When I've added add() action to the
  contoller, the id of coresponding model has been set automaticlly to
  add() method parameter, and when I try to save data using that
  action update instead of save is made.

  This method singature looks like this:

  public function add($someId).

  Is it normal behavior? Do I have to manually call create() method in
  my model if I want to save, not update data?

 --
 Thanks  Regards,
 Vijayk.
 Co-founder (www.weboniselab.com)

 You Bring the Dreams, We'll Bring the Means
--~--~-~--~~~---~--~~
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: Tutorial won't validate

2009-06-29 Thread mike karthauser

On 29 Jun 2009, at 14:59, 0plus1 wrote:

 I understand that:

 if ($this-Post-save($this-data)) {}

 but the validation section in the documentation states this command:

 if ($this-Post-validates()) {}

this is not required if you are saving see [1]


 What of the two is right, can you tell me what I'm doing wrong?

use the if ($this-Post-save($this-data)) {}

and set validate array at the top  of the model you wish to validate.

details [2]


hth
mikek


[1] http://book.cakephp.org/view/443/validate
[2] http://book.cakephp.org/view/125/Data-Validation

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


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



RE: How to deploy ACL-permissions on several envirnoments?

2009-06-29 Thread Paul

Hi Jeroen,

Basically the question you asking of course goes beyond the scope of just
acl itself and does indeed fit into the category of database synchronization
or deployment, and as far as that goes there are any number of solutions. We
have had similar situations specifically with acl of course, and another big
one we use a lot - configuration stored in the database - similar scenario.

We've tried a couple of different solutions - including like you mention
just dumping to file and loading that in the production environment, to
pinging of the data to the live servers or requesting from the live to our
development to load the data, either triggered automatically in certain
parts of your application or run by cron, or just even calling it manually
in the application or via a shell.

Basically it's a pretty wide scope and there is no clear cut solution, it'll
be heavily governed by your server setup and preferred methods of doing
things - deployment, production cycle etc.

In the end our solution that fitted our needs was having the data dumped to
file in our dev env, that  resided in our project config, then in our
production environment a simple interface for checking and loading this
config when/if it had been updated.

So it's a big subject, and there are a huge number of solutions, there is a
couple ideas on how we did it - we just wrote custom code to do it all btw,
no pre rolled solutions we could find that fitted the task at hand.

HTH,

Paul.

-Original Message-
From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf
Of Jeroen
Sent: Monday, 29 June 2009 8:40 p.m.
To: CakePHP
Subject: Re: How to deploy ACL-permissions on several envirnoments?


nobody know's it?


__ Information from ESET NOD32 Antivirus, version of virus signature
database 4197 (20090629) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


 

__ Information from ESET NOD32 Antivirus, version of virus signature
database 4197 (20090629) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
 

__ Information from ESET NOD32 Antivirus, version of virus signature
database 4197 (20090629) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



return true or false

2009-06-29 Thread Dave Maharaj :: WidePixels.com
I have a function that checks if a users profile is public or private
 
function checkPublicAccess ($profile_user_id)
 {
  // check if profile is public or private
  //0 = private 1 = public
  $params = array(
 'conditions' = array('Profile.user_id' = $profile_user_id,
'Profile.public' = '1'), 
 'contain' = false, 
 'fields' = array('Profile.public'));

  $q = $this-find('first', $params);
  
  // profile is not public so you must be logged in
  if (empty($q)) {
  return false;
} 
 }
 
My question is how do I in the controller use the 'false' return?
 
if ($this-Profile-checkPublic ($profile_user_id) == false)?
 
 
Thanks
 
Dave 

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Time redirection in cakePHP ?

2009-06-29 Thread Techinfocomp.com

header(refresh:5; url='pagetoredirect.php');

we can use this if we want to redirect our page in 5 second ,

is there any way to redirect page in 5 second in cakephp ?

if yes please let me know

--~--~-~--~~~---~--~~
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: 'add' action and auto-setting model id

2009-06-29 Thread Vijay Kumbhar
hello Raph,

Can you please  tell me is this Users controller function or Journal
controllers function?
Then i can provide you exact solution.

On Tue, Jun 30, 2009 at 12:13 AM, Raph ra...@epoczta.pl wrote:


 Hello,

 I can't paste exactly the same code, but I can tell you what I want to
 do. In controller where I have that add() method I want to save an
 entry to a journal which model is in belongsTo relation with User
 model, so I tried to use add() method in journal's controller with
 user id as a parameter. Somehing like that (very simple version):

 public function add($userId) {
 $this-data['Journal']['user_id'] = $userId;

 $this-Journal-saveEntry($this-data);
 }

 The problem is $userId is automaticlly set like that:
 $this-Jounral-id = $userId.

 On 29 Cze, 15:03, Vijay Kumbhar k.vidn...@gmail.com wrote:
  Hello Raph,
 
  I think you are making a mistake that you are providing a id while adding
 a
  record.
  If you provide the id to the save method it fires the update query.
 
  For further explanation Can you please paste the code here?
 
  On Mon, Jun 29, 2009 at 5:44 PM, Raph ra...@epoczta.pl wrote:
 
   I have weird (I think) problem. When I've added add() action to the
   contoller, the id of coresponding model has been set automaticlly to
   add() method parameter, and when I try to save data using that
   action update instead of save is made.
 
   This method singature looks like this:
 
   public function add($someId).
 
   Is it normal behavior? Do I have to manually call create() method in
   my model if I want to save, not update data?
 
  --
  Thanks  Regards,
  Vijayk.
  Co-founder (www.weboniselab.com)
 
  You Bring the Dreams, We'll Bring the Means
 



-- 
Thanks  Regards,
Vijayk.
Co-founder (www.weboniselab.com)

You Bring the Dreams, We'll Bring the Means

--~--~-~--~~~---~--~~
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: Time redirection in cakePHP ?

2009-06-29 Thread Miles J

You would have to use javascript or meta refresh.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Validate

2009-06-29 Thread Dave Maharaj :: WidePixels.com

I have  created rules 
example:
 
'someRule-1' = array(
'rule' = 'alphaNumeric',  
'message' = 'Only alphabets and numbers allowed',
'last' = true
 ),
'someRule-2' = array(
'rule' = array('minLength', '8'),  
'message' = 'Minimum length of 8 characters'
),  

And these rules are used in other models thruout the site.

How can I define these common rules in app_model I would guess and then
apply them to the individual models? Rather than typing out the exact same
rules over and over for every model requiring the exact same rule set.



Dave 


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



cake_livesearch.zip copy?

2009-06-29 Thread Louie Miranda
Anyone who have a copy of cake_livesearch.zip?

Because... http://justkez.com/wp-content/uploads/2008/04/cake_livesearch.zip

Seems to be down. :(
--
Louie Miranda (lmira...@gmail.com)
http://www.louiemiranda.net

Quality Web Hosting - www.axishift.com
Pinoy Web Hosting, Web Hosting Philippines

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



find with unrelated model

2009-06-29 Thread Dave

I am trying to create a validation function where I check the
User.slug field against a tables of banned words

So if a user tries to use a slug profile it will come back invalid

I have Restrictions table with all banned words which is not related
to any model on the site.

How do I do a query from the users model to check restrictions table?

Tried App::Import('Model', 'Restriction'); method but all i get is
error - Trying to get property of non-object
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



SMTP - Not working

2009-06-29 Thread si-mon

Hi all...

In my application, I need to send mails using smtp server. I have
given all parameters but it is not working. Then I have tracked the
errors in the email component. Then I got the following status
messages:

503 AUTH command used when not advertised
550 bosauthsmtp16: No unauthenticated relaying permitted

My mailing function is as follows:

function _sendMail()
{
$this-Email-to = 'sijumo...@gmail.com';
$this-Email-bcc = array();
$this-Email-subject = 'Test Mail';
$this-Email-replyTo = 'smtp username';
$this-Email-from = 'smtp username';
$this-Email-template = 'test';
$this-Email-sendAs = 'html';

$this-Email-smtpOptions = array(  'port'='25',
'timeout'='30',
'auth'=true,
'host' = 'smtp 
host',

'username'='smtp username',

'password'='smtp password'
 );
   $this-Email-delivery = 'smtp';
   $this-Email-send();
}

Please help me to solve this issue...

Thank you all...
--~--~-~--~~~---~--~~
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: Validate

2009-06-29 Thread Miles J

Well yes you could apply them in app model. Is that your main question?
--~--~-~--~~~---~--~~
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: find with unrelated model

2009-06-29 Thread Paul

$result = ClassRegistry::init('Restriction')-find('all', array('conditions'
=array('Restriction.badword' =$wordtotest)));


HTH,

Paul


-Original Message-
From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf
Of Dave
Sent: Tuesday, 30 June 2009 4:41 p.m.
To: CakePHP
Subject: find with unrelated model


I am trying to create a validation function where I check the
User.slug field against a tables of banned words

So if a user tries to use a slug profile it will come back invalid

I have Restrictions table with all banned words which is not related
to any model on the site.

How do I do a query from the users model to check restrictions table?

Tried App::Import('Model', 'Restriction'); method but all i get is
error - Trying to get property of non-object


__ Information from ESET NOD32 Antivirus, version of virus signature
database 4198 (20090629) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


 

__ Information from ESET NOD32 Antivirus, version of virus signature
database 4198 (20090629) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 


--~--~-~--~~~---~--~~
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: Validate

2009-06-29 Thread Dave Maharaj :: WidePixels.com

 Just not sure how to go about it...

How do I define them in app_model then relate them to each  model when
needed.

-Original Message-
From: Miles J [mailto:mileswjohn...@gmail.com] 
Sent: June-30-09 2:53 AM
To: CakePHP
Subject: Re: Validate


Well yes you could apply them in app model. Is that your main question?


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---