load images with Ajax and use of lightbox

2012-06-18 Thread georgio ch
hi there

i am  want to load on a static page 10 images with Ajax and use a
lightbox for these images can anyone give me  some help i have read
tutorial but it's  not so clear i have cakephp 2.0.

thanks

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: load images with Ajax and use of lightbox

2012-06-18 Thread Naresh Kumar
you can do using jquery. it has everything...

On Mon, Jun 18, 2012 at 1:28 PM, georgio ch 
chatziefstratiougeorg...@gmail.com wrote:

 hi there

 i am  want to load on a static page 10 images with Ajax and use a
 lightbox for these images can anyone give me  some help i have read
 tutorial but it's  not so clear i have cakephp 2.0.

 thanks

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


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php




-- 
Cheers,
Naresh

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: load images with Ajax and use of lightbox

2012-06-18 Thread giorgo ch
example ?

2012/6/18 Naresh Kumar reachme.nare...@gmail.com

 you can do using jquery. it has everything...

 On Mon, Jun 18, 2012 at 1:28 PM, georgio ch 
 chatziefstratiougeorg...@gmail.com wrote:

 hi there

 i am  want to load on a static page 10 images with Ajax and use a
 lightbox for these images can anyone give me  some help i have read
 tutorial but it's  not so clear i have cakephp 2.0.

 thanks

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


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php




 --
 Cheers,
 Naresh

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


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php


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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: load images with Ajax and use of lightbox

2012-06-18 Thread giorgo ch
if you see this is very complex
http://book.cakephp.org/1.3/view/1358/AJAX

2012/6/18 giorgo ch chatziefstratiougeorg...@gmail.com

 example ?


 2012/6/18 Naresh Kumar reachme.nare...@gmail.com

 you can do using jquery. it has everything...

 On Mon, Jun 18, 2012 at 1:28 PM, georgio ch 
 chatziefstratiougeorg...@gmail.com wrote:

 hi there

 i am  want to load on a static page 10 images with Ajax and use a
 lightbox for these images can anyone give me  some help i have read
 tutorial but it's  not so clear i have cakephp 2.0.

 thanks

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


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this
 group at http://groups.google.com/group/cake-php




 --
 Cheers,
 Naresh

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


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php




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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Check table for a particular entry

2012-06-18 Thread JonStark
Damn, really stuck with this, any idea ?

Many thanks !

Le jeudi 14 juin 2012 14:40:16 UTC+2, JonStark a écrit :

 I have a table with the following fields : 

 id follower_id following_id

 So when a user clicks follow on an other user's profile, an entry like 
 this is created :

 15 1 3

 meaning user with id 1 follows user with id 3.

 If user 3 follows 1, then an entry like 

 16 3 1 

 is created.

 But, in order to prevent users for following many time a same user, 
 leading to entry such as :

 17 3 1
 18 3 1
 19 3 1

 and so on, I want to replace follow by unfollow if the entry is 
 already saved.

 So my question is : how can i scan the table to check if an entry as 
 both X as follower_id AND Y as following_id ?

 Thanks a lot.


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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


JsHelper

2012-06-18 Thread Renato Carvalho
Hello guys,

I am trying to set the 'value' of a select using the cake 2.x
JsHelper, but unlucky so far.

I`ve managed to change all options of the select, but I have no clue
on how to change only the 'value'.

I have 2 selects with constant options (the options doesn`t change).
I want to set the 'value' of the second select, depending on the
'value' of the first select.

Does anyone here knows how to do this?

Thanks.

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


CakePHP2.1.3 does not work on PHP5.4.3?

2012-06-18 Thread тoяisu
Hi, there

I set up cakephp2.1.3 with PHP5.4.3 on CentOS 6.2 server.
following error message appeared. On PHP 5.3.14 was everything fine.

Fatal error: Class 'Debugger' not found in /path/to/Model/Hoge.php on line 
 10


/path/to/Model/Hoge.php is here.
-
  1 ?php
  2
  3 class Hoge extends AppModel
  4 {
  5 public $name = 'Hoge';
  6
  7 public function beforeValidate() {
  8 // Noting to do..
  9 }
 10 }
 11
 12 ?
-

Anyone had the same problem?

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


cakephp2.1.3 does not work on PHP5.4.3?

2012-06-18 Thread тoяisu
Hi, there

I set up cakephp2.1.3 with PHP5.4.3 on CentOS 6.2 server.
following error message appeared. On PHP 5.3.14 was everything fine.

Fatal error: Class 'Debugger' not found in /path/to/Model/Hoge.php on line 
 10


/path/to/Model/Hoge.php is here.
-
  1 ?php
  2
  3 class Hoge extends AppModel
  4 {
  5 public $name = 'Hoge';
  6
  7 public function beforeValidate() {
  8 // Noting to do..
  9 }
 10 }
 11
 12 ?
-

Anyone had the same problem?

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: load images with Ajax and use of lightbox

2012-06-18 Thread Alok Mishra
http://krewenki.github.com/jquery-lightbox/

Using light box jquery

On Mon, Jun 18, 2012 at 1:32 PM, giorgo ch 
chatziefstratiougeorg...@gmail.com wrote:

 if you see this is very complex
 http://book.cakephp.org/1.3/view/1358/AJAX


 2012/6/18 giorgo ch chatziefstratiougeorg...@gmail.com

 example ?


 2012/6/18 Naresh Kumar reachme.nare...@gmail.com

 you can do using jquery. it has everything...

 On Mon, Jun 18, 2012 at 1:28 PM, georgio ch 
 chatziefstratiougeorg...@gmail.com wrote:

 hi there

 i am  want to load on a static page 10 images with Ajax and use a
 lightbox for these images can anyone give me  some help i have read
 tutorial but it's  not so clear i have cakephp 2.0.

 thanks

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


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this
 group at http://groups.google.com/group/cake-php




 --
 Cheers,
 Naresh

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


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this
 group at http://groups.google.com/group/cake-php



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


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php




-- 
*ALOK KUMAR MISHRA*

Software Engg-A1 Technology Inc
Chandigarh Mohali.
Mobile@9569881400
aloksoft2...@gmail.com

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Core php session with cakephp session

2012-06-18 Thread Vamseedhar
Hi

I am trying to convert core php  application to cakephp and for time being 
i want to use both instances in live how can i maintain one session in both 
instances. The login and registration will be in cakephp instance but i 
need to access same session in core php instance also. how can i solve this 
issue.

Thanks in advance

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Manage large multilingual project

2012-06-18 Thread Heidi Anselstetter
@ lubomir lubomir.st...@gmail.com

Great, I didn't think about this way that I can copy the .pot and the .po
file together into the same directory!
I will try this out! Thanks a lot!!

2012/6/9 stork lubomir.st...@gmail.com

 Workflow is simple.

 1. use I18n shell to generate .pot template from sources
 http://book.cakephp.org/2.0/en/console-and-shells/i18n-shell.html
 2. copy .pot file to .po files into lang-specific subdirectories and use
 Poedit - tell it which .pot and .po files belongs together
 3. translate msgstr in .po files (with Poedit)
 4. do some changes in sources (add/change/remove texts)
 5. regenerate .pot template by I18n shell
 6. use Poedit - it will merge changes in new .pot into all .po files and
 highlight changes for translators
 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php


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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Core php session with cakephp session

2012-06-18 Thread Vamseedhar
I found the solution for this

session_name('CAKEPHP');

session_start();

print_r($_SESSION);

the print_r gave me all the session set in the cakephp



On Monday, June 18, 2012 11:09:23 AM UTC+5:30, Vamseedhar wrote:

 Hi

 I am trying to convert core php  application to cakephp and for time being 
 i want to use both instances in live how can i maintain one session in both 
 instances. The login and registration will be in cakephp instance but i 
 need to access same session in core php instance also. how can i solve this 
 issue.

 Thanks in advance


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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: load images with Ajax and use of lightbox

2012-06-18 Thread giorgo ch
This is from jquey .This has nothing  to do with cakephp  i thought there
is another way

2012/6/18 Alok Mishra aloksoft2...@gmail.com

 http://krewenki.github.com/jquery-lightbox/

 Using light box jquery

 On Mon, Jun 18, 2012 at 1:32 PM, giorgo ch 
 chatziefstratiougeorg...@gmail.com wrote:

 if you see this is very complex
 http://book.cakephp.org/1.3/view/1358/AJAX


 2012/6/18 giorgo ch chatziefstratiougeorg...@gmail.com

 example ?


 2012/6/18 Naresh Kumar reachme.nare...@gmail.com

 you can do using jquery. it has everything...

 On Mon, Jun 18, 2012 at 1:28 PM, georgio ch 
 chatziefstratiougeorg...@gmail.com wrote:

 hi there

 i am  want to load on a static page 10 images with Ajax and use a
 lightbox for these images can anyone give me  some help i have read
 tutorial but it's  not so clear i have cakephp 2.0.

 thanks

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


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this
 group at http://groups.google.com/group/cake-php




 --
 Cheers,
 Naresh

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


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this
 group at http://groups.google.com/group/cake-php



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


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php




 --
 *ALOK KUMAR MISHRA*

 Software Engg-A1 Technology Inc
 Chandigarh Mohali.
 Mobile@9569881400
 aloksoft2...@gmail.com


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


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php


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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Return a certain value from an array

2012-06-18 Thread Steve Found
$records = Set::extract('/UsersUser[follower_id=' . $logged_user_id . 
']', $data );

foreach( $records as $record ){
$id = $record['UsersUser']['id'];
...  Do something with the ID ...
}


On 18/06/12 12:34, JonStark wrote:

Lets say this is my array :

array(
(int) 0 =  array(
'UsersUser' =  array(
'id' =  '38',
'follower_id' =  '1',
'following_id' =  '2'
)
),
(int) 1 =  array(
'UsersUser' =  array(
'id' =  '41',
'follower_id' =  '3',
'following_id' =  '2'
)
)
)

I want to perform a simple check to recover a data.
Is this possible to ask cake to check this array to see if any 
follower_id == $logged_user_id, and if so, return the id 
associated. *In this example*, lets say that if $logged_user_id = 1, 
then cake should return 38.


Is there any way to do this ? It's driving me nuts !

Thank a lot for your time.


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



To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this 
group at http://groups.google.com/group/cake-php


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



To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Return a certain value from an array

2012-06-18 Thread JonStark
It worked like a charm, thanks a lot !

Le lundi 18 juin 2012 13:34:03 UTC+2, JonStark a écrit :

 Lets say this is my array :

 array(
   (int) 0 = array(
   'UsersUser' = array(
   'id' = '38',
   'follower_id' = '1',
   'following_id' = '2'
   )
   ),
   (int) 1 = array(
   'UsersUser' = array(
   'id' = '41',
   'follower_id' = '3',
   'following_id' = '2'
   )
   )
 )


 I want to perform a simple check to recover a data.
 Is this possible to ask cake to check this array to see if any 
 follower_id == $logged_user_id, and if so, return the id associated. *In 
 this example*, lets say that if $logged_user_id = 1, then cake should 
 return 38.

 Is there any way to do this ? It's driving me nuts !

 Thank a lot for your time.



Le lundi 18 juin 2012 13:34:03 UTC+2, JonStark a écrit :

 Lets say this is my array :

 array(
   (int) 0 = array(
   'UsersUser' = array(
   'id' = '38',
   'follower_id' = '1',
   'following_id' = '2'
   )
   ),
   (int) 1 = array(
   'UsersUser' = array(
   'id' = '41',
   'follower_id' = '3',
   'following_id' = '2'
   )
   )
 )


 I want to perform a simple check to recover a data.
 Is this possible to ask cake to check this array to see if any 
 follower_id == $logged_user_id, and if so, return the id associated. *In 
 this example*, lets say that if $logged_user_id = 1, then cake should 
 return 38.

 Is there any way to do this ? It's driving me nuts !

 Thank a lot for your time.



Le lundi 18 juin 2012 13:34:03 UTC+2, JonStark a écrit :

 Lets say this is my array :

 array(
   (int) 0 = array(
   'UsersUser' = array(
   'id' = '38',
   'follower_id' = '1',
   'following_id' = '2'
   )
   ),
   (int) 1 = array(
   'UsersUser' = array(
   'id' = '41',
   'follower_id' = '3',
   'following_id' = '2'
   )
   )
 )


 I want to perform a simple check to recover a data.
 Is this possible to ask cake to check this array to see if any 
 follower_id == $logged_user_id, and if so, return the id associated. *In 
 this example*, lets say that if $logged_user_id = 1, then cake should 
 return 38.

 Is there any way to do this ? It's driving me nuts !

 Thank a lot for your time.




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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Controller render different view and pass var

2012-06-18 Thread iFemke
Hi,

I have two controllers. 
- In one controller (OptionsController) you can create, edit, add and 
delete your own options. This is working as it is supposed to. 
- Next to that I have a different controller (let's name that one 
SecondController) that needs a view from the first controller 
(OptionsController).

Normally I would just use $this-render(), but the thing here is that I 
need to pass a var along with the render.In a view from the 
SecondController I need to embed a view from the OptionsController, which 
needs a variable (like an ID or something). 

So if you go to /options/view/2 then it would show you the option with id 
2, this is working because it's basic stuff. But when you go to 
/second/index I want to render the options view. You can do this with 
$this-render(), but then you can't pass the variable that is needed to 
show the view. So how can I do this? Or is it not possible?

I hope you understand what I am trying to do and have a solution for this.

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Associate an array with a variable ?

2012-06-18 Thread JonStark


Here is the function I use to display posts that have a User.id equal to 
$id :

Code: php

   1. $data = $this-paginate('Post', array http://www.php.net/array(
   2.   'User.id' = $id,
   3. )
   4.   );
   5. $this-set('posts', $data)
   
I have an array produced when researching user IDs matching certain 
criterias :
Code: php

   1. array http://www.php.net/array(
   2.   (int) 0 = '2',
   3.   (int) 1 = '4',
   4.   (int) 2 = '7' //etc
   5. )
   

Is there a way for cake to associate this array to $id,so that 
$this-paginate would display only posts whose ID is (in this exemple) 2, 4 
or 7 ?

Thanks a lot !

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Associate an array with a variable ?

2012-06-18 Thread Tilen Majerle
before you call $this-paginate('Post')

do this

$this-paginate = array('Post' = array('conditions = array('User.id' =
$id)));
--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2012/6/18 JonStark jean...@gmail.com

 Here is the function I use to display posts that have a User.id equal to
 $id :

 Code: php

1. $data = $this-paginate('Post', array http://www.php.net/array(
2.   'User.id' = $id,
3. )
4.   );
5. $this-set('posts', $data)

 I have an array produced when researching user IDs matching certain
 criterias :
  Code: php

1. array http://www.php.net/array(
2.   (int) 0 = '2',
3.   (int) 1 = '4',
4.   (int) 2 = '7' //etc
5. )


 Is there a way for cake to associate this array to $id,so that
 $this-paginate would display only posts whose ID is (in this exemple) 2, 4
 or 7 ?

 Thanks a lot !

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


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php


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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: actAs Tree : generatetreelist error

2012-06-18 Thread Ish
Had the same problem in cakephp 2.0

Later realized *generatetreelist* function got renamed to *generateTreeList*

On Thursday, January 27, 2011 9:44:58 PM UTC-5, raymond wrote:

 Hi. 
 I have tried Tree behavior just according to manual, but it reports 
 error following: 

 Warning (512): SQL Error: 1064: You have an error in your SQL syntax; 
 check the manual that corresponds to your MySQL server version for the 
 right syntax to use near 'generatetreelist' at line 1 
 Query: generatetreelist 

 I debugged and found that cakePHP does not understand the method 
 generatetreelist() 

 I have created table 'lkp_itemcate' with following columns: 
 id, parent_id, lft, rght, name, img_url, level, created, modified. 

 And then created model file: 

 class Itemcate extends AppModel { 
 var $name = 'Itemcate'; 
 var $tablePrefix = 'lkp_'; 
 var $useTable = 'itemcate'; 

 var $actAs = array('Tree'); 
 } 

 and inserted following code to controller action: 

 $list = $this-Itemcate-generatetreelist(null, null, null, 
 'nbsp;nbsp;nbsp;'); 

 Any advice? 
 Thanks. 



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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Associate an array with a variable ?

2012-06-18 Thread JonStark
You mean something like this ?

 $id = $myArray;
$this-paginate = array('Post' = array('conditions' = array('User.id' 
= $id)));
$data = $this-paginate('Post');
$this-set('posts', $data);

?

Many thanks.

Le lundi 18 juin 2012 17:26:21 UTC+2, JonStark a écrit :

 Here is the function I use to display posts that have a User.id equal to 
 $id :

 Code: php

1. $data = $this-paginate('Post', array http://www.php.net/array(
2.   'User.id' = $id,
3. )
4.   );
5. $this-set('posts', $data)

 I have an array produced when researching user IDs matching certain 
 criterias :
 Code: php

1. array http://www.php.net/array(
2.   (int) 0 = '2',
3.   (int) 1 = '4',
4.   (int) 2 = '7' //etc
5. )


 Is there a way for cake to associate this array to $id,so that 
 $this-paginate would display only posts whose ID is (in this exemple) 2, 4 
 or 7 ?

 Thanks a lot !


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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Associate an array with a variable ?

2012-06-18 Thread JonStark
Seems to work perfectly,

Thanks a lot !

Le lundi 18 juin 2012 17:26:21 UTC+2, JonStark a écrit :

 Here is the function I use to display posts that have a User.id equal to 
 $id :

 Code: php

1. $data = $this-paginate('Post', array http://www.php.net/array(
2.   'User.id' = $id,
3. )
4.   );
5. $this-set('posts', $data)

 I have an array produced when researching user IDs matching certain 
 criterias :
 Code: php

1. array http://www.php.net/array(
2.   (int) 0 = '2',
3.   (int) 1 = '4',
4.   (int) 2 = '7' //etc
5. )


 Is there a way for cake to associate this array to $id,so that 
 $this-paginate would display only posts whose ID is (in this exemple) 2, 4 
 or 7 ?

 Thanks a lot !


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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problem associating models with linux (working fine on windows using xampp)

2012-06-18 Thread Flo ßbau
Hi, as a member of the team that discovered the problem above, I'm happy to 
tell you that the problem was caused by different Apache settings on the 
Windows and Linux system.

In some models we used SHORT OPENING PHP TAGS while these tags were not 
enabled in the Apache config on the Linux box. After changing the server 
config the models have been interpreted correctly. Thanks a lot to Ceeram 
from the Freenode-IRC-Channel #cakephp for giving this hint!

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Return a certain value from an array

2012-06-18 Thread stork
$path = '/UsersUser[follower_id=' . $logged_user_id . ']/id';
debug(Set::extract($path, $data));

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Problem with CakeEmail - rewrite default config and bcc delivery does not work

2012-06-18 Thread Anna P
Hello.

I have set following default config in app/Config/email.php :
public $default = array(
'transport' = 'Mail',
'charset' = 'utf-8',
'headerCharset' = 'utf-8',
'layout' = 'default',
'emailFormat' = 'both',
);

Sending e-mails to one e-mail address (without cc and bcc) based on
this config works good.
But I want to send newsletters based on different layout, and to
several e-mail addresses given in bcc config.
E-mails does not deliver to addresses specified in $this-bcc config.
I also try to override default layout, but it keeps sending e-mail
with the default one.

Here is what I do to send e-mail in my newsletter controller:

App::uses('CakeEmail','Network/Email');
$default_email=Configure::read('default_email');
$email = new CakeEmail();
$email-config('default');
$email-from(array($default_email='Sitename'));
$email-sender(array($default_email='Sitename'));
$email-replyTo($default_email);
$email-layout = 'newsletter';
$email-template('newsletter');
$email-emailFormat='html';
$email-viewVars(array('data'=$data));
$email-subject($data['Newsletter']['title']);

$email-to($default_email);
$email-bcc=$bcc;
$email-send();

What could be the problem?

I edited temporarily the send() function in lib/Cake/Network/Email/
CakeEmail.php and var_dump'ed $this-bcc and $this-layout and it
returned me the accurate values. But still, e-mail is not delivered to
bcc and the layout remains default.

I pass an array like this to a bcc:

array(1) {
  [0]=
  string(X) em...@domain.com
}

Thank you very much for help!

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: conditions in $belongsTo

2012-06-18 Thread lowpass
Thanks, Jeremy. I'll give that a try, although I'm not sure it will
help in this case. I'm working with a legacy DB schema and all of the
tables have a deleted_at column. I want only the data where this value
is 0. If Cake is ignoring the conditions in the one instance, I'm not
sure it'll pay any attention to those of the other model. Perhaps
there's something else I'm missing.

On Sun, Jun 17, 2012 at 11:26 PM, Jeremy Burns | Class Outfit
jeremybu...@classoutfit.com wrote:
 I hope I'm not missing the point here, but what I do is have a vanilla 
 $belongsTo/$hasMany/whatever that has no conditions and is called the same as 
 the remote model. Then I set up alternatives that include the conditions and 
 are named appropriately and are used when needed, for example:

 public $belongsTo = array(
        'Project' = array(
                'className' = 'Project',
                'foreignKey' = 'project_id'
        ),
        'ActiveProject' = array(
                'className' = 'Project',
                'foreignKey' = 'project_id',
                'conditions' = array('Project.active' = '1')
        )
 );

 Jeremy Burns
 Class Outfit

 http://www.classoutfit.com

 On 17 Jun 2012, at 00:01:19, lowpass wrote:

 From the fine manual:

 conditions: an array of find() compatible conditions or SQL strings
 such as array('User.active' = true)

 It doesn't appear to be used, however.

 public $belongsTo = array(
       'Project' = array(
               'className' = 'Project',
               'foreignKey' = 'project_id',
               'conditions' = array('Project.deleted_at' = '0')
       )
 );

 Project model:

 public $hasMany = array(
       'Expression' = array(
               'className' = 'Expression',
               'foreignKey' = 'project_id',
               'conditions' = array('Project.deleted_at' = '0'),
               'dependent' = true
       )
 );

 I know I can include it in the find() array but it would be nice not
 to have to include it each time. I presume that's why it's available
 here.

 I see that 'conditions' is not dealt with in
 Model::_generateAssociation() method. Has anyone seen this working?

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


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/cake-php

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


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/cake-php

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Check table for a particular entry

2012-06-18 Thread lowpass
On Sun, Jun 17, 2012 at 2:50 PM, JonStark jean...@gmail.com wrote:
 Ok, almost there, just need a little help with Set::

 I'm using

 Set::extract('/Follower/UsersUser', $user)

 to get all the data from the association table of a given user, wich when
 debugged produces an array like this one :

 array(
   (int) 0 = array(
   'UsersUser' = array(
   'id' = '36',
   'follower_id' = '1',
   'following_id' = '2'
   )
   ),
   (int) 1 = array(
   'UsersUser' = array(
   'id' = '37',
   'follower_id' = '3',
   'following_id' = '2'
   )
   )
 )

 Now, the only thing left is to find which Set:: to use :

 Indeed, I just have to check if any array contains a 'follower_id' wich is
 equal to $this-Session-read('Auth.User.id'), and if so, return the
 associated 'id' value. (wich will be passed to the delete button).

I might b wrong but I think you have this backwards. The
Following/Follower arrays will contain all of the other users which
the *current* user is following or being followed by, respectively. So
by definition, Auth.User.id will be found in every entry in both
arrays (ID #2 in the example above).

So, let's say you have an array of all users and are listing their
names. If the current user is following one of them you want to
include an unfollow link which will delete the relationship. What
you need to do is look for the ID of the other user in the Following
array.

For example, if your users are in a $data array which look slike this:

array(
'User' = array(
'id' = some_id
...
),
...
);

$followers = $this-Session-read('User.follower');
$followings = $this-Session-read('User.following');

foreach($data as $d)
{
// print the name and whatever other info ...

$follower = Set::extract('/UsersUser[follower_id='.$d['User']['id'],
$followers);

if (!empty($follower))
{
// create delete link, passing $follower['id'] to delete action
}
else
{
// create link to follow, passing $follower['id'] to add action
}
}

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Jquery mobile+Phonegap mobile app and authentication

2012-06-18 Thread Arash
Hi,
We are working on a mobile app for our SAAS website which uses Cake 1.3, 
we've decided to use Jquery mobile+ Phonegap so we will use the HTML5 power 
for building a mobile app.

The whole app is an HTML page with a few js ans css files which will be 
running natively on the mobile and will interact with server with Ajax. 

The problem we encountered here is that using the cakephp Auth the session 
id is not being saved on the browser (because the page is not being served 
from a webserver i think) so we don't have access to the session and we 
can't know for sure if the user is authenticated or not.

I've seen some mobile authentication systems that provide a Token after 
login, save it in browser local storage and send this token with each ajax 
request to the server, the server checks the token and if it is valid then 
severs the data.

Is there any reasonable way of authenticating users on a mobile app using 
the Auth component?! 

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Count (return as a number) associated data.

2012-06-18 Thread JonStark
Let's say USer hasMany Post.

If i debug my user it will produce an array like :

User

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Count (return as a number) associated data.

2012-06-18 Thread JonStark
Sorry, incomplete :

It will produce an array like :

array(
'User' = array(
'password' = '*',
'id' = '2',
'username' = 'test',

),
'Post' = array(
(int) 0 = array(
'id' = '36',
'user_id' = '2', (...)

)
),


How can I display the number of Posts this user have ? (in this example 1) ?

Thanks a lot.

Le mardi 19 juin 2012 00:21:25 UTC+2, JonStark a écrit :

 Let's say USer hasMany Post.

 If i debug my user it will produce an array like :

 User



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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Count (return as a number) associated data.

2012-06-18 Thread Max Dörfler
You could get the size of $result['Post'] if you already have the 
$result like you wrote. See count() or sizeof().
Or you could do a find('count') on the Post Model like 
$this-User-Post-find('count', array('conditions' = 
array('Post.user_id' = 2)));


On 06/19/2012 12:24 AM, JonStark wrote:

Sorry, incomplete :

It will produce an array like :

array(
'User' =  array(
'password' =  '*',
'id' =  '2',
'username' =  'test',

),
'Post' =  array(
(int) 0 =  array(
'id' =  '36',
'user_id' =  '2', (...)

)
),

How can I display the number of Posts this user have ? (in this 
example 1) ?


Thanks a lot.

Le mardi 19 juin 2012 00:21:25 UTC+2, JonStark a écrit :

Let's say USer hasMany Post.

If i debug my user it will produce an array like :

User

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



To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this 
group at http://groups.google.com/group/cake-php


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



To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: What is the proper way of testing controllers in CakePHP 2.0

2012-06-18 Thread merovinq
Did you ever figure this out?  My $this-header is always returning an 
empty array an empty array as well, I've been stuck on this for a couple 
days now..  Please help me if you figured this out

On Thursday, August 25, 2011 12:33:08 AM UTC-5, Christophe Roblin wrote:

 No, $this-headers seems to always return an empty array 

 On 25 Aug, 06:02, jeremyharris funeralm...@gmail.com wrote: 
  When you debug the $this-headers var, what do you get back? Anything 
  at all? 
  
  If you're not getting anything back then it might be a problem with 
  testAction, although there are tests that show it works. 
  
  On Aug 21, 1:48 am, Christophe Roblin crob...@lionsek.com wrote: 
  
  
  
  
  
  
  
   Hi, 
  
   I've tried searching the new docs about testing with the new PHPUnit 
   for CakePHP 2.0 Beta, without any success 
   Below is my code for testing the admin action of controller posts with 
   method add. 
  
   My issue is that I expected from the docs I received that headers were 
   set when using testAction, it is always blank 
  
   public function testAdminAdd() { 
   $Posts = $this-generate('Posts', array( 
   'components' = array( 
   'Session' 
   ) 
   ) 
   ); 
  
   $Posts-Session-expects($this-once())- 
  
   method('setFlash'); 
  
   $this-testAction('/admin/posts/add', array( 
   'data' = array( 
   'Post' = array('name' = 'New Post') 
   ) 
   ) 
   ); 
  // debug($this); 
   $this-assertEquals($this-headers['Location'], '/admin/ 
   posts/index'); 
   $this-assertEquals($this-vars['post']['Post']['name'], 
   'New Post'); 
  
   $this-assertPattern('/html/', $this-contents); 
   $this-assertPattern('/form/', $this-view);

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


how to generate this sql

2012-06-18 Thread elogic
Hi All,

How do I go about generating the following SQL line using cakePHP from the 
timesheets controller?

SELECT user_id, date, count(id) as count_name FROM `timesheets`GROUP BY 
user_id, date HAVING count_name  1 ORDER BY count_name;

Basically it is just checking for double up records mathching the date and 
user_id fields.

Thanks

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Security::cipher() and mysqldump

2012-06-18 Thread etipaced
I was never able to convert the encoding of my ciphered data back to its 
original form. I was able to find a random backup I didn't realize I had 
and used that to restore the corrupted fields. Just wanted to report back 
for anyone following this thread.

On Wednesday, April 11, 2012 7:03:11 PM UTC-7, cricket wrote:

 To get the char encoding:

 file -bi dumpfilename

 To convert it to UTF-8:

 iconv -f [encoding from above] -t utf8 dumpfilename  dumpfile_utf8.sql



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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Caching part of view and user-specific sidebar problem

2012-06-18 Thread Joris Vaesen
I've build an application with a where where users can see multiple items.
These items are sorted by pagination.

Because of the big amount of items per page would i like to do some caching.
Because the page is using pagination, I can't cache the query.

So I was thinking about caching the view, which works very well but one 
thing:
The sidebar on the page is user-specific and may not be cached.
So I separated this part in an element and used the !--nocache-- html 
comment technique.

Now is my problem that i can't get any data in this element. The data for 
this element may not be cached.
The only oppertunity thought of was doing some queries in de element to get 
recent data.

But is this in any way possible to query from an element?

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Count (return as a number) associated data.

2012-06-18 Thread Joris Vaesen
count($var['Post'])

On Tuesday, 19 June 2012 00:24:15 UTC+2, JonStark wrote:

 Sorry, incomplete :

 It will produce an array like :

 array(
   'User' = array(
   'password' = '*',
   'id' = '2',
   'username' = 'test',

   ),
   'Post' = array(
   (int) 0 = array(
   'id' = '36',
   'user_id' = '2', (...)

   )
   ),


 How can I display the number of Posts this user have ? (in this example 1) 
 ?

 Thanks a lot.

 Le mardi 19 juin 2012 00:21:25 UTC+2, JonStark a écrit :

 Let's say USer hasMany Post.

 If i debug my user it will produce an array like :

 User



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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php