Re: Tutorial: ControlPanel

2007-04-30 Thread R. Rajesh Jeba Anbiah

On Apr 29, 3:19 pm, Mariano Iglesias [EMAIL PROTECTED]
wrote:

  Ok, already added into the Bakery:
 
  http://bakery.cakephp.org/articles/view/tutorial-control-panel

 I added comments to the article. If you have CHECKED the I agree to The
 Bakery Guidelines then the article should follow them, which it does not.
 Also use BBcode to format the article content.

   Please approve the article.  I'm getting Unable to provide the
article you requested; it is currently pending approval for public
viewing

--
  ?php echo 'Just another PHP saint'; ?
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


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



Re: Tutorial: ControlPanel

2007-04-30 Thread 浪漫様

Well, I think is just a matter of time, wait a little until it gets
approved (^-^)
Anyway, you have all the code written here too, so you can check it!
Regards,

Rohman


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



Re: sanitizing data with beforeValidate

2007-04-30 Thread ianh

Hi Graham - thanks for giving the function a whirl. If you can still
see the data after sanitization then the most obvious thing to ask is
are you calling it correctly? It must look like this:

function beforeValidate()
{
  $this-__sanitize($this-data);
  return true;
}

It is vital that the beforeValidate includes a return true statement
otherwise the save thinks validation has failed. If return true is
there are the thing still failes then you could break up your save
into components to find which bit fails like this (for 1.1.x only):

if($this-{$this-modelClass}-validates($this-data)) {
  if($this-{$this-modelClass}-save($this-data)) {
echo everything A Ok!;
  } else {
echo save failed;
  }
} else {
  echo validation failed;
}

Let me know what happens or paste up your code somewhere
(pastebin.co.uk) and I will take a look for you.

Cheers, Ian

On Apr 29, 10:45 pm, gmwebs [EMAIL PROTECTED] wrote:
 Hi Ian,

 I had a go using your __sanitize() function and while the actual
 sanitization is working, I don't seem to be able to save my model. If
 I view the input before calling __sanitize() in beforeValidate() and
 then after, it proves that the inputs are sanitized just as expected.
 Unfortunately the Model-save() fails after the __sanitize call and I
 can't seem to find where/how it is failing. If I remove the
 __sanitize() call then it saves perfectly (with clean inputs of
 course). I know it's a long shot, but do you have any ideas why this
 could be?

 Regards,

 Graham


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



Strange behaviour when saving data

2007-04-30 Thread ifcanduela

Hello, I'm having a strange problem when using the 'save' method to
insert new records.

This is what is happening: I have a Country with id=0 that belongs to
a region with, say, id=3. When the 'add' action of the
countries_controller is called, instead of adding a new country with
id=2 and region_id=3, it updates the country with id=0. I'm pretty
sure the rest of the code is right, however I've had some problems
with this saving related model stuff before, since the 'Blog
Tutorial' finishes without adding comments to the mix.

Anybody knows what might be causing this odd behaviour?


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



RE: Tutorial: ControlPanel

2007-04-30 Thread Mariano Iglesias

If you are in such a hurry you should consider checking the comments on the
article, and also you have checked I agree to The Bakery Guidelines
(http://bakery.cakephp.org/pages/guidelines) but still somehow the code
does not follow CakePHP Coding Standards
(https://trac.cakephp.org/wiki/Developement/CodingStandards).

So as I said on the Article:

The code is still not following CakePHP Coding Standards, and most
importantly, the source code should not be PHP5 dependent (so remove
declarations such as public)

PS: Coming from a family of lawyers YOU SHOULD ALWAYS READ WHAT YOU ARE
AGREEING TO ;)

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de R. Rajesh Jeba Anbiah
Enviado el: Lunes, 30 de Abril de 2007 03:06 a.m.
Para: Cake PHP
Asunto: Re: Tutorial: ControlPanel

Please approve the article.  I'm getting Unable to provide the article you
requested; it is currently pending approval for public viewing


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



SWFUpload problem

2007-04-30 Thread [EMAIL PROTECTED]

Dear bakers,

I'm a newbie at using cake and I really could use some help.

I've stripped down my project which can be found at 
http://www.2nfuse.nl/example.zip
In the dir database you can find the SQL script for creating the
corresponding tables in a database called example.
I'm using the latest stable release 1.1.14

In my project there are 2 models, article en file. An article has many
files.
When adding a file you will see a two possibilities for uploading a
file. The first is using a standard form. The second is the
javascript upload method.

Now my problem:
I'm trying to use de SWFUpload component made by James Revillini and I
can not seem to make it work when using the javascript method. The
strange thing is, when uploading a single file via a standard form,
it works perfect. But when doing the same thing via the javascript
method, the files are uploaded, but the corresponding database records
are not created.

Can somebody help me?

Jos


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



Undefined property: hashkey when using othAuth

2007-04-30 Thread matlin

I tried to reply to a thread where people were having problems with
oth_auth
I got the error below when I started to use the component/helper and
found a solotion.

Notice: Undefined property: hashkey in /afs/su.se/services/www/hosts/
www.lab.it.su.se/pages/cake/app/views/helpers/oth_auth.php on line 37

I figured it out, in the oth_auth.php helper init function you need to
change the check and loop from viewVars to _viewVars.

NOTE!! Add underscore to the variable.

I'm guessing this is something that could have been caught earlier if
I had read the change log between 1.1 and 1.2 ... ;)


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



Re: Tutorial: ControlPanel

2007-04-30 Thread 浪漫様

About the bakery... uhm... is too troublesome and i'm wasting too much
time checking if all the post and codes follows the rules of the
community... i just wanted to share what i had done for other users to
understand how to work with CakePHP with some nice example that covers
quite a big part of the basic functionalities to perform a website on
CakePHP as for some people the beginning is quite complex and there
are many doubts... so... i really don't want to waste my time checking
if my post is alright or not at the bakery, just cancel it if you
want.
My code is writen here at this threat on Google Group, so if it helps
to somebody is alright, if not, is ok.
Best Regards,

Rohman


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



Re: Dynamic Links with DS constant?

2007-04-30 Thread Anton Morrison

I can never use the $html-link when i want to link on an image as it  
turns all the  into gth;

has anyone ever found a way?


On 29 Apr 2007, at 21:18, Samuel DeVore wrote:


 btw r() is a convenience function for str_replace

 manual.cakephp.org/chapter/constants

 On 4/29/07, Mariano Iglesias [EMAIL PROTECTED] wrote:

 echo $html-link('Link','/' . r(DS, '/', $filepath));

 -MI

 - 
 --

 Remember, smart coders answer ten questions for every question  
 they ask.
 So be smart, be cool, and share your knowledge.

 BAKE ON!

 blog: http://www.MarianoIglesias.com.ar


 -Mensaje original-
 De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED]  
 En nombre
 de Lb-web
 Enviado el: Domingo, 29 de Abril de 2007 04:06 a.m.
 Para: Cake PHP
 Asunto: Dynamic Links with DS constant?

 I'm an newbie to CakePHP and I'm having a problem with links
 generated
 by my DS constant.






 -- 
 (the old fart) the advice is free, the lack of crankiness will cost  
 you

 - its a fine line between a real question and an idiot

 http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs- 
 me/

 

Anton Morrison
[EMAIL PROTECTED]




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



Re: sanitizing data with beforeValidate

2007-04-30 Thread gmwebs

Thanks Ian...

I had the return true in the beforeValidate() but I was trying
something in beforeSave() and had neglected to put the return true in
there. It works fine now.

Regards,

Graham


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



Re: Bad link without mod rewrite

2007-04-30 Thread sickrandir

Tried to figure out the problem by myself but without success...
Anyone can help?

thank you

sickrandir

On Apr 19, 6:26 pm, sickrandir [EMAIL PROTECTED] wrote:
 I'm running a site with the latest stable version of cake 1.1 .
 I disabled mod rewrite by uncommenting: define ('BASE_URL',
 env('SCRIPT_NAME')); in core.php and deleting all the .htaccess file.
 Everything seems to work except for the link inserted in the posts of
 the home page.
 The first time you load the home page the links don't have the
 index.php/ part, so they are broken.
 But if you browse another page of the site from the menu and you
 return on the home page then the links are correct.
 Links are insertedi in the posts like this: a href='pages/
 missuldisc07_pirates_eng'Missuldisc07/a
 Someone has any suggestion to avoid this strange behaviour?
 My site is:http://www.frasbadallac.it

 Thanks


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



Re: sanitizing data with beforeValidate

2007-04-30 Thread ianh

No worries - let me know how the function works out for you and any
improvements you think might be warranted. Ian

On Apr 30, 11:01 am, gmwebs [EMAIL PROTECTED] wrote:
 Thanks Ian...

 I had the return true in the beforeValidate() but I was trying
 something in beforeSave() and had neglected to put the return true in
 there. It works fine now.

 Regards,

 Graham


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



Re: sanitizing data with beforeValidate

2007-04-30 Thread gmwebs

How would I echo the sanitized input in my form rather than the
unsanitized input? If a user were to input non-alphanumeric characters
in a username on a registration page for instance, the input is
sanitized before validation which means the form validates and the
data is saved, but the user will not know that the username he entered
in has been stripped of non-alpanumeric characters.


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



Re: sanitizing data with beforeValidate

2007-04-30 Thread ianh

Interesting point. Perhaps it would be better if the function gets
called beforeSave() instead?

On Apr 30, 12:47 pm, gmwebs [EMAIL PROTECTED] wrote:
 How would I echo the sanitized input in my form rather than the
 unsanitized input? If a user were to input non-alphanumeric characters
 in a username on a registration page for instance, the input is
 sanitized before validation which means the form validates and the
 data is saved, but the user will not know that the username he entered
 in has been stripped of non-alpanumeric characters.


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



User model: unique validation and beforeValidate help

2007-04-30 Thread R. Rajesh Jeba Anbiah


I have a User model similar to https://svn.cakeforge.org/svn/bakery/
trunk/bakery/models/user.php (has unique check in beforeValidate()
callback)

I wanted the unique check only on users/register. But, it rather
checks on every User-validates() and User-save() call. I thought of
filtering the check inside beforeValidate() by checking the action,
but I don't get $this-action there.

Does anyone has any patterns or solutions for this? TIA

--
  ?php echo 'Just another PHP saint'; ?
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


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



Re: sanitizing data with beforeValidate

2007-04-30 Thread gmwebs

Quite a conundrum... If the function is called beforeSave() then the
input is not sanitized before being used for validation. Could be an
issue when using isUnique() as the database is queried at validation
time using unsanitized input data. Could this be a candidate for SQL
injection?


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



? Set::filter (Was Re: allowEmpty in validate)

2007-04-30 Thread R. Rajesh Jeba Anbiah

On Apr 19, 3:59 am, nate [EMAIL PROTECTED] wrote:
 As of 1.2 current SVN:

 function beforeValidate() {
$this-data[$this-name] = Set::filter($this-data[$this-name],
 true);
return true;

 }

 Works for me.
   snip

I don't find Set::filter http://api.cakephp.org/1.2/search.php?
query=Set::filter. Do you know where to find? TIA

--
  ?php echo 'Just another PHP saint'; ?
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


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



Re: User model: unique validation and beforeValidate help

2007-04-30 Thread Dr. Tarique Sani

On 4/30/07, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote:
 I wanted the unique check only on users/register. But, it rather
 checks on every User-validates() and User-save() call. I thought of
 filtering the check inside beforeValidate() by checking the action,

If your users/register is equivalent of add you can check if $this-id
is set or not in beforeValidate() if id is set then do not
validate

Similarly if id is set then check for id != !this-id - to give an
example if you want the username to be unique - then in add you just
check if username is unique while adding however while editing you
will have to exclude $this-id

Hope that makes sense :)

Cheers
Tarique

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



strange error msg

2007-04-30 Thread wewo

hi there,

maybe it'a a stupid question, but since the update to the actual
1.2.0.4798 release, I get some strange error messages in my app:

Notice (8): Undefined property:  Folder::$table [CORE/cake/libs/model/
model.php, line 671]
Notice (8): Undefined property:  Folder::$name [CORE/cake/libs/model/
model.php, line 717]
Notice (8): Undefined property:  Folder::$useDbConfig [CORE/cake/libs/
model/datasources/dbo_source.php, line 595]

Fatal error: ConnectionManager::getDataSource - Non-existent data
source in cake/libs/model/connection_manager.php on line 110

in my app folder (model, view + controller) exists for data storage
reasons, could this cause the conflict?

what am i doing wrong?
cheers,
wewo


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



Re: cake 1.1 cake1.2 on Windows apache 2.2.4 Crashes

2007-04-30 Thread [EMAIL PROTECTED]

When you disabled mod rewrite, did you delete the .htaccess file, or
comment out the mod rewrite directive?


On Apr 28, 1:42 pm, Sam Sherlock [EMAIL PROTECTED] wrote:
 APPLYS TO cake 1.1  cake 1.2

 using php 5.2.1 and mysql 4.1 and apache 2.2.4

 every is fine with either version of cake until I start using custom models,
 view  control

 pages work fine.

 These are the errors listed in my apache error log, mod write is working and
 when enabled I get

 [Sat Apr 28 18:38:43 2007] [notice] Server built: Jan  9 2007 23:17:20
 [Sat Apr 28 18:38:43 2007] [notice] Parent: Created child process 1824
 [Sat Apr 28 18:38:43 2007] [notice] Child 1824: Child process is running
 [Sat Apr 28 18:38:43 2007] [notice] Child 1824: Acquired the start mutex.
 [Sat Apr 28 18:38:43 2007] [notice] Child 1824: Starting 250 worker threads.
 [Sat Apr 28 18:38:43 2007] [notice] Child 1824: Starting thread to listen on
 port 80.

 when mod rewrite is disabled I get error 404

 I have followed advice on this 
 pagehttp://cakebaker.42dh.com/2007/02/15/baking-a-cake-installation-confi...

 any pointers is greatly appreciated - thankx


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



RE: ? Set::filter (Was Re: allowEmpty in validate)

2007-04-30 Thread Mariano Iglesias

That's because the API docs haven't been updated yet since the Set::filter
function was added after last CakePHP 1.2 release. API docs get updated
after each release.

Look into cake/libs/set.php and search for function filter()

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de R. Rajesh Jeba Anbiah
Enviado el: Lunes, 30 de Abril de 2007 09:05 a.m.
Para: Cake PHP
Asunto: ? Set::filter (Was Re: allowEmpty in validate)

I don't find Set::filter. Do you know where to find? TIA


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



Re: ? Set::filter (Was Re: allowEmpty in validate)

2007-04-30 Thread Dr. Tarique Sani

On 4/30/07, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote:

 On Apr 19, 3:59 am, nate [EMAIL PROTECTED] wrote:
  As of 1.2 current SVN:
 
  function beforeValidate() {
 $this-data[$this-name] = Set::filter($this-data[$this-name],
  true);
 return true;
 
  }
 
  Works for me.
snip

 I don't find Set::filter http://api.cakephp.org/1.2/search.php?
 query=Set::filter. Do you know where to find? TIA

Use the source

https://trac.cakephp.org/browser/trunk/cake/1.2.x.x/cake/libs/set.php#L112

T

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog needs you!: http://cheesecake-photoblog.org
=

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



Re: Question: Join two tables, count and sort result

2007-04-30 Thread dardosordi

Try:

SELECT `Vendor`.`id`, COUNT(`Model`.`vendor_id`) as `Vendor`.`count`
FROM `vendors` AS
`Vendor` LEFT JOIN `models` AS `Model` ON (`Model`.`vendor_id` =
`Vendor`.`id`) WHERE 1=1 GROUP BY `Vendor`.`id`



On Apr 29, 3:18 pm, thequietlab [EMAIL PROTECTED] wrote:
 I don't think so..

 Bakers, is there a way to do this ?

 On 29 Kwi, 16:13, Alexey Kuimov [EMAIL PROTECTED] wrote:

  Ok, thank you very much! All are working right! But I have another
  question. Now my result looks like:
  Array
  (
  [0] = Array
  (
  [Vendor] = Array
  (
  [name] = Sony
  )

  [0] = Array
  (
  [count] = 10
  )

  )
  ...
  )
  Is it possible to move [count] from [0] to [Vendor]? Current result's
  array structure is not useful for Views

  On Apr 27, 1:47 pm, thequietlab [EMAIL PROTECTED] wrote:

   ahh.. and if you want to sort it then, just :

   $this-Vendor-bindModel(array('hasOne'=array('Model')));
   $fields = array('Vendor.id','COUNT(Model.vendor_id)');
   $conditions = 'GROUP BY Vendor.id';
   $order = 'COUNT(Model.vendor_id) DESC';
   $this-Vendor-findAll( $conditions, $fields, $order );

   On Apr 27, 9:44 am, thequietlab [EMAIL PROTECTED] wrote:

hey guys,

try this :

$this-Vendor-bindModel(array('hasOne'=array('Model')));
$fields = array('Vendor.id','COUNT(Model.vendor_id)');
$conditions = 'GROUP BY Vendor.id';
$this-Vendor-findAll( $conditions, $fields );

This should make a query like this :

SELECT `Vendor`.`id`, COUNT(`Model`.`vendor_id`) FROM `vendors` AS
`Vendor` LEFT JOIN `models` AS `Model` ON (`Model`.`vendor_id` =
`Vendor`.`id`) WHERE 1=1 GROUP BY `Vendor`.`id`

Hope it helps

On Apr 26, 7:22 pm, rtconner [EMAIL PROTECTED] wrote:

 Yeah I'm wondering this also. Is there a cake way of going this? Get
 some sort of count(*)/GROUP BY select using cake associations?

 On Apr 26, 8:50 am, Alexey Kuimov [EMAIL PROTECTED] wrote:

  Hello. I'm a beginner in CakePHP and have a question:

  I have two tables: Vendors (id, name) and Models (id, vendor_id,
  name). Could somebody tell me how to get in query result Vendors 
  names
  and a number of their Model. Also I need sort result by Vendors 
  names
  or by a number of Models. Now I'm using hasMany association and 
  count
  Models in my controller.


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



Re: sanitizing data with beforeValidate

2007-04-30 Thread ianh

Yes - it is for this reason that I call the function in
beforeValidate, because an isUnique query using unchanged data which
then gets changed is not ideal. My approach with usernames and
passwords is to say by the field what characters are not allowed and
then confirm what got saved to the DB in a welcome/confirmation email.

On Apr 30, 1:02 pm, gmwebs [EMAIL PROTECTED] wrote:
 Quite a conundrum... If the function is called beforeSave() then the
 input is not sanitized before being used for validation. Could be an
 issue when using isUnique() as the database is queried at validation
 time using unsanitized input data. Could this be a candidate for SQL
 injection?


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



Re: Question: Join two tables, count and sort result

2007-04-30 Thread Alexey Kuimov

In this case I get error message:

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 '.`count`

:-(

On Apr 30, 5:45 pm, dardosordi [EMAIL PROTECTED] wrote:
 Try:

 SELECT `Vendor`.`id`, COUNT(`Model`.`vendor_id`) as `Vendor`.`count`
 FROM `vendors` AS
 `Vendor` LEFT JOIN `models` AS `Model` ON (`Model`.`vendor_id` =
 `Vendor`.`id`) WHERE 1=1 GROUP BY `Vendor`.`id`

 On Apr 29, 3:18 pm, thequietlab [EMAIL PROTECTED] wrote:

  I don't think so..

  Bakers, is there a way to do this ?

  On 29 Kwi, 16:13, Alexey Kuimov [EMAIL PROTECTED] wrote:

   Ok, thank you very much! All are working right! But I have another
   question. Now my result looks like:
   Array
   (
   [0] = Array
   (
   [Vendor] = Array
   (
   [name] = Sony
   )

   [0] = Array
   (
   [count] = 10
   )

   )
   ...
   )
   Is it possible to move [count] from [0] to [Vendor]? Current result's
   array structure is not useful for Views

   On Apr 27, 1:47 pm, thequietlab [EMAIL PROTECTED] wrote:

ahh.. and if you want to sort it then, just :

$this-Vendor-bindModel(array('hasOne'=array('Model')));
$fields = array('Vendor.id','COUNT(Model.vendor_id)');
$conditions = 'GROUP BY Vendor.id';
$order = 'COUNT(Model.vendor_id) DESC';
$this-Vendor-findAll( $conditions, $fields, $order );

On Apr 27, 9:44 am, thequietlab [EMAIL PROTECTED] wrote:

 hey guys,

 try this :

 $this-Vendor-bindModel(array('hasOne'=array('Model')));
 $fields = array('Vendor.id','COUNT(Model.vendor_id)');
 $conditions = 'GROUP BY Vendor.id';
 $this-Vendor-findAll( $conditions, $fields );

 This should make a query like this :

 SELECT `Vendor`.`id`, COUNT(`Model`.`vendor_id`) FROM `vendors` AS
 `Vendor` LEFT JOIN `models` AS `Model` ON (`Model`.`vendor_id` =
 `Vendor`.`id`) WHERE 1=1 GROUP BY `Vendor`.`id`

 Hope it helps

 On Apr 26, 7:22 pm, rtconner [EMAIL PROTECTED] wrote:

  Yeah I'm wondering this also. Is there a cake way of going this? Get
  some sort of count(*)/GROUP BY select using cake associations?

  On Apr 26, 8:50 am, Alexey Kuimov [EMAIL PROTECTED] wrote:

   Hello. I'm a beginner in CakePHP and have a question:

   I have two tables: Vendors (id, name) and Models (id, vendor_id,
   name). Could somebody tell me how to get in query result Vendors 
   names
   and a number of their Model. Also I need sort result by Vendors 
   names
   or by a number of Models. Now I'm using hasMany association and 
   count
   Models in my controller.


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



SQL Transactions

2007-04-30 Thread xavi

Hello!

I'm looking for information about sql transactions in Cake with Mysql5

I'm using 3 models with 3 separates $this-themodel-save($data), and
I'm interested i control the transaction itself, doing a commit after
3 save will be ok.

Is this possible?
I've only read the $model-transaction boolean, but no info about how
to use it.

Thanks in advance!!!


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



Re: User model: unique validation and beforeValidate help

2007-04-30 Thread R. Rajesh Jeba Anbiah

On Apr 30, 5:12 pm, Dr. Tarique Sani [EMAIL PROTECTED] wrote:
 On 4/30/07, R.RajeshJebaAnbiah[EMAIL PROTECTED] wrote:

  I wanted the unique check only on users/register. But, it rather
  checks on every User-validates() and User-save() call. I thought of
  filtering the check inside beforeValidate() by checking the action,

 If your users/register is equivalent of add you can check if $this-id
 is set or not in beforeValidate() if id is set then do not
 validate

 Similarly if id is set then check for id != !this-id - to give an
 example if you want the username to be unique - then in add you just
 check if username is unique while adding however while editing you
 will have to exclude $this-id

 Hope that makes sense :)

Thanks for your input, though it sounds good, it doesn't work in
my case:

My setup is that username is unique, but not the emails (as opposed to
bakery code)

For me, it seems to be intuitive to use the validation of User model
in users/register, users/reset (where I'll get username and email) and
users/login (using User-validates()).

In users/reset and users/login, I haven't used User-save(), but User-
validates() (In bakery code, they have duplicated the validation in
controller).

--
  ?php echo 'Just another PHP saint'; ?
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


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



Re: ? Set::filter (Was Re: allowEmpty in validate)

2007-04-30 Thread R. Rajesh Jeba Anbiah

On Apr 30, 5:22 pm, Dr. Tarique Sani [EMAIL PROTECTED] wrote:
 On 4/30/07, R.RajeshJebaAnbiah[EMAIL PROTECTED] wrote:
   snip
  I don't find Set::filter http://api.cakephp.org/1.2/search.php?
  query=Set::filter. Do you know where to find? TIA

 Use the source

 https://trac.cakephp.org/browser/trunk/cake/1.2.x.x/cake/libs/set.php...

   Oh, thanks. I think, it's been just committed 'coz I use the svn
version only.

--
  ?php echo 'Just another PHP saint'; ?
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


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



RE: Question: Join two tables, count and sort result

2007-04-30 Thread Mariano Iglesias

Can you show how you are issuing the query?

I added a test to test for field parsing as you entered here and it
succeeds:

https://trac.cakephp.org/changeset/4951

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Alexey Kuimov
Enviado el: Lunes, 30 de Abril de 2007 10:13 a.m.
Para: Cake PHP
Asunto: Re: Question: Join two tables, count and sort result

In this case I get error message:

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 '.`count`

:-(


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



Re: cake 1.1 cake1.2 on Windows apache 2.2.4 Crashes

2007-04-30 Thread Sam Sherlock
I renamed the .htaccess to htaccess.txt  changed the directive for internal
rewrite.

On 30/04/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:


 When you disabled mod rewrite, did you delete the .htaccess file, or
 comment out the mod rewrite directive?


 On Apr 28, 1:42 pm, Sam Sherlock [EMAIL PROTECTED] wrote:
  APPLYS TO cake 1.1  cake 1.2
 
  using php 5.2.1 and mysql 4.1 and apache 2.2.4
 
  every is fine with either version of cake until I start using custom
 models,
  view  control
 
  pages work fine.
 
  These are the errors listed in my apache error log, mod write is working
 and
  when enabled I get
 
  [Sat Apr 28 18:38:43 2007] [notice] Server built: Jan  9 2007 23:17:20
  [Sat Apr 28 18:38:43 2007] [notice] Parent: Created child process 1824
  [Sat Apr 28 18:38:43 2007] [notice] Child 1824: Child process is running
  [Sat Apr 28 18:38:43 2007] [notice] Child 1824: Acquired the start
 mutex.
  [Sat Apr 28 18:38:43 2007] [notice] Child 1824: Starting 250 worker
 threads.
  [Sat Apr 28 18:38:43 2007] [notice] Child 1824: Starting thread to
 listen on
  port 80.
 
  when mod rewrite is disabled I get error 404
 
  I have followed advice on this
 pagehttp://cakebaker.42dh.com/2007/02/15/baking-a-cake-installation-confi...
 
  any pointers is greatly appreciated - thankx


 


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



Re: Autocomplete

2007-04-30 Thread majna

This component is very limited , there is echo in component...
You can customize and create your own autocomplete stuff using this
example :

/** EXAMPLE
 * Create  users db table with id, username, email...
 * Create user model...
**/

/**
 *  1. Test controller: controller/tests.php
**/
class TestsController extends AppController
{
var $name = 'Tests';
var $uses = array('User') ;
var $helpers = array('Ajax');


function index()
{
$this-render('autocomplete');
}


function autocomplete()
{
$users = $this-User-findAll( User.username LIKE '%{$this-
data['User']['username']}%', array('User.username','User.email'),
'User.username ASC', 20);
$this-set('users',$users );
#now render element
$this-render('autocomplete', 'ajax',
VIEWS.'elements'.DS.'tests'.DS.'autocomplete.thtml');
}





/**
 *  2. Test view: views/tests/index.php
**/
form name=form id=form

label for=user_autocompleteUser:/label
?php echo $ajax-autocomplete('User/username','/tests/autocomplete',
array('minChars'=1,'frequency'=0.2)) ?
/form


/**
 * 3.  Autocomplete element :views/elements/tests/autocomplete.php
 * U can add stuff like  $user['User']['email']...here
**/
ul class=autocompleteList
?php foreach($users as $user){ ?
li class=autocompleteList?php echo $user['User']['username']; ?
/li
?php }?
/ul


/**
 * 4. Autocomplete css:
**/
div.auto_complete
{
  position: absolute;
  width: 150px;
  background-color: white;
  border:1px solid #888;
  margin:0;
  padding:0;
  z-index:200;
}

div.auto_complete ul.autocompleteList  {
  list-style-type: none;
  margin: 0px;
  padding: 0px;
}

div.auto_complete ul.autocompleteList li.selected {
 background-color: #ffb;
 cursor: pointer;
}

div.auto_complete li.autocompleteList {
  clear: none;
  list-style-type: none;
  display: block;
  margin: 0;
  padding: 2px;
  height: 25px;
  cursor: pointer;
}

On Apr 27, 1:46 pm, regi [EMAIL PROTECTED] wrote:
 hi majna...
 Thanks... now it is working... but i have got one more problem..
 the items are not listing in alphabetical order..Can you please help
 me to solve this .

 thanks
 Regi

 On Apr 27, 4:19 pm, junal [EMAIL PROTECTED] wrote:

  hey majnathx for this solution ...i had similar problem :)

  On Apr 27, 5:17 pm, junal [EMAIL PROTECTED] wrote:

   thx majan ...i had similar problem .thx for this solution :)

   On Apr 27, 4:19 pm, majna [EMAIL PROTECTED] wrote:

class AutocompleteComponent extends Object {

add:
var $ac_limit = 10;
var $ac_order = 10;
var $ac_fields= null;
...

and:

$results = $controller-{$model}-findAll($conditions,$this-ac_fields,
$this-ac_order,$this-ac_limit);

In controller :

$this-Autocomplete-ac_limit=10;

*not tested

or just change this line
$results = $controller-{$model}-findAll($conditions,null,null,10);


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



Re: Dynamic Links with DS constant?

2007-04-30 Thread Samuel DeVore

On 4/29/07, Anton Morrison [EMAIL PROTECTED] wrote:

 I can never use the $html-link when i want to link on an image as it
 turns all the  into gth;

 has anyone ever found a way?

If you look at the api

http://api.cakephp.org/class_html_helper.html#444f26b63f2193142b80169b8d04cf95

you will notice the param $escapeTitle defaults to true, make the call
with it set to true


 On 29 Apr 2007, at 21:18, Samuel DeVore wrote:

 
  btw r() is a convenience function for str_replace
 
  manual.cakephp.org/chapter/constants
 
  On 4/29/07, Mariano Iglesias [EMAIL PROTECTED] wrote:
 
  echo $html-link('Link','/' . r(DS, '/', $filepath));
 
  -MI
 
  -
  --
 
  Remember, smart coders answer ten questions for every question
  they ask.
  So be smart, be cool, and share your knowledge.
 
  BAKE ON!
 
  blog: http://www.MarianoIglesias.com.ar
 
 
  -Mensaje original-
  De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED]
  En nombre
  de Lb-web
  Enviado el: Domingo, 29 de Abril de 2007 04:06 a.m.
  Para: Cake PHP
  Asunto: Dynamic Links with DS constant?
 
  I'm an newbie to CakePHP and I'm having a problem with links
  generated
  by my DS constant.
 
 
 
 
 
 
  --
  (the old fart) the advice is free, the lack of crankiness will cost
  you
 
  - its a fine line between a real question and an idiot
 
  http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-
  me/
 
  

 Anton Morrison
 [EMAIL PROTECTED]




 



-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

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



multi language site

2007-04-30 Thread Anton Morrison

Hi I am trying to build a micro content management system so have  
more than one langage, with human translation.

I want the amount of langages to be changeable so thought the best  
way to do this was have different 'content' tables for the different  
langages then have a foren key linking to each of the translations.

Here is my schema to help explane

Page
id : int primary key
title :int
body :int

content_english
id :int primary key
content : text

content_spanish
id int primaty key
content :text

So an excample page would be

page.id = 1
page.title = 99
page.body = 100

content_english.id = 99
content_english.content = 'hello world'

content_english.id = 100
content_english.content = 'body copy for hello world'

content_spanish.id=99
content_spanish.content = 'hola mundo'

...

So basically the content_english row ids match with the  
content_spanish and represent the translation.

Now if i was on the page with id one

I would have page_array with the id numbers fo rthe content and  
depending on which langague the user was on the site i would go to  
that database.

My question is this would i be able to set up the relationships in  
cake php to automatically get the content into the page array?

i am new to cake but i am finding it really good to use and thinking  
it could save me a lot of time if i could set this up.

thanks in advance




Anton Morrison
[EMAIL PROTECTED]




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



Re: User model: unique validation and beforeValidate help

2007-04-30 Thread R. Rajesh Jeba Anbiah

On Apr 30, 6:22 pm, R. Rajesh Jeba Anbiah
[EMAIL PROTECTED] wrote:
 On Apr 30, 5:12 pm, Dr. Tarique Sani [EMAIL PROTECTED] wrote:
snip

   While on this topic, but for solution, I'm wondering if I can have
action based validation. Say, for example, on a user search page, I
may want to disable validation on username field. Generic way of
validation looks quite messy, IMHO.

--
  ?php echo 'Just another PHP saint'; ?
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


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



RE: Dynamic Links with DS constant?

2007-04-30 Thread Mariano Iglesias

?php echo $html-link($html-image('test.gif'), '#',
array('escape'=false)); ?

Or:

?php echo $html-link($html-image('test.gif'), '#', array(), false, false,
false);

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Samuel DeVore
Enviado el: Lunes, 30 de Abril de 2007 11:09 a.m.
Para: cake-php@googlegroups.com
Asunto: Re: Dynamic Links with DS constant?

If you look at the api

http://api.cakephp.org/class_html_helper.html#444f26b63f2193142b80169b8d04cf
95

you will notice the param $escapeTitle defaults to true, make the call
with it set to true


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



RE: multi language site

2007-04-30 Thread Mariano Iglesias

If you are using CakePHP 1.2 take a look at the Translation behavior:

https://trac.cakephp.org/browser/branches/1.2.x.x/cake/libs/model/behaviors/
translate.php

poLK added a small documentation somewhere but can't remember where.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Anton Morrison
Enviado el: Lunes, 30 de Abril de 2007 11:04 a.m.
Para: cake-php@googlegroups.com
Asunto: multi language site

Hi I am trying to build a micro content management system so have  
more than one langage, with human translation.


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



Upgrade Path From 1.1 to 1.2

2007-04-30 Thread Sliv

The current app I'm working on has been keeping up with the latest
release versions of the 1.1 branch.  I'm seeing more and more posts
about 1.2, including folks building prod apps using this branch.

I'm looking for opinions on whether it would be a good idea for me to
upgrade to 1.2 on my current app and spend some time moving towards
the new functionality, or just continue on with 1.1.

My concern is being left in the dust on some of these new functions
that 1.2 is apparently producing as time goes on...

If it helps provoke a response, there's still months of dev left in
this current app; it's just me working on it and I don't consider
myself an expert by any stretch of the imagination, but I have built
some basic apps and scripts in the past on ye olde LAMP setup.


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



Pagination

2007-04-30 Thread Sourabh Sharma

I want to use the multiple pagination in the single page if any one
can  guide me as soon as possible

Thanks  Regards
Sourabh Sharma


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



view blob image

2007-04-30 Thread christianandradet

hi,
I am trying to view an image that is store in the database with a blob
data type, this is the code i am trying
?php header(Content-type: image/jpg); ?
?php echo $funcionario['Funcionario']['fun_foto']?

When i display this, the binary data is displayed

What should I do??


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



Re: multi language site

2007-04-30 Thread R. Rajesh Jeba Anbiah

Anton Morrison wrote:
 Hi I am trying to build a micro content management system so have
 more than one langage, with human translation.
   snip

Possibly http://groups.google.com/group/cake-php/msg/
13afbe9841b91314

--
  ?php echo 'Just another PHP saint'; ?
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


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



Re: view blob image

2007-04-30 Thread John David Anderson (_psychic_)


On Apr 30, 2007, at 8:36 AM, christianandradet wrote:


 hi,
 I am trying to view an image that is store in the database with a blob
 data type, this is the code i am trying
 ?php header(Content-type: image/jpg); ?
 ?php echo $funcionario['Funcionario']['fun_foto']?

 When i display this, the binary data is displayed

Where is this code? In the controller or the layout?

-- John

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



Re: view blob image

2007-04-30 Thread christianandradet

in the layout, in the view.ctp file,


On 30 abr, 10:01, John David Anderson (_psychic_)
[EMAIL PROTECTED] wrote:
 On Apr 30, 2007, at 8:36 AM, christianandradet wrote:



  hi,
  I am trying to view an image that is store in the database with a blob
  data type, this is the code i am trying
  ?php header(Content-type: image/jpg); ?
  ?php echo $funcionario['Funcionario']['fun_foto']?

  When i display this, the binary data is displayed

 Where is this code? In the controller or the layout?

 -- John


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



Re: multi language site

2007-04-30 Thread Anton Morrison

I cant find the documentation either. Is this a automatic translation  
script?

I dont want that i want to set it up so humans enter all the content.


On 30 Apr 2007, at 16:13, Mariano Iglesias wrote:


 If you are using CakePHP 1.2 take a look at the Translation behavior:

 https://trac.cakephp.org/browser/branches/1.2.x.x/cake/libs/model/ 
 behaviors/
 translate.php

 poLK added a small documentation somewhere but can't remember where.

 -MI

 -- 
 -

 Remember, smart coders answer ten questions for every question they  
 ask.
 So be smart, be cool, and share your knowledge.

 BAKE ON!

 blog: http://www.MarianoIglesias.com.ar


 -Mensaje original-
 De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En  
 nombre
 de Anton Morrison
 Enviado el: Lunes, 30 de Abril de 2007 11:04 a.m.
 Para: cake-php@googlegroups.com
 Asunto: multi language site

 Hi I am trying to build a micro content management system so have
 more than one langage, with human translation.


 

Anton Morrison
[EMAIL PROTECTED]




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



Re: Upgrade Path From 1.1 to 1.2

2007-04-30 Thread Dr. Tarique Sani

On 4/30/07, Sliv [EMAIL PROTECTED] wrote:
 I'm looking for opinions on whether it would be a good idea for me to
 upgrade to 1.2 on my current app and spend some time moving towards
 the new functionality, or just continue on with 1.1.

I would say if it is not a commercial app ready to go live soon - move
over to 1.2 and if you have done your programming the Cake way moving
should not be more than a matter of correcting deprecated calls

HTH

T

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog needs you!: http://cheesecake-photoblog.org
=

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



Re: Pagination

2007-04-30 Thread Dr. Tarique Sani

On 4/30/07, Sourabh Sharma [EMAIL PROTECTED] wrote:

 I want to use the multiple pagination in the single page if any one
 can  guide me as soon as possible


WOW! another chance for me to earn my $ million - don't spoil it for me MI ;)

T

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog needs you!: http://cheesecake-photoblog.org
=

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



Re: Upgrade Path From 1.1 to 1.2

2007-04-30 Thread John David Anderson (_psychic_)


On Apr 30, 2007, at 8:10 AM, Sliv wrote:


 The current app I'm working on has been keeping up with the latest
 release versions of the 1.1 branch.  I'm seeing more and more posts
 about 1.2, including folks building prod apps using this branch.

 I'm looking for opinions on whether it would be a good idea for me to
 upgrade to 1.2 on my current app and spend some time moving towards
 the new functionality, or just continue on with 1.1.

 My concern is being left in the dust on some of these new functions
 that 1.2 is apparently producing as time goes on...

 If it helps provoke a response, there's still months of dev left in
 this current app; it's just me working on it and I don't consider
 myself an expert by any stretch of the imagination, but I have built
 some basic apps and scripts in the past on ye olde LAMP setup.

It kinda depends: I like to stay with 1.2 SVN because I get the  
latest fixes and features.

The drawback with 1.2 is that there won't be any official docs until  
the dust starts to settle. We're already working on the new manual,  
but not everything will get covered really soon. If you can see  
yourself getting frustrated at using things that aren't yet  
documented, you might want to wait.

However, if you're willing to work with us and understand that 1.2 is  
in the works, I'd give 1.2 a try.

-- John

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



Re: view blob image

2007-04-30 Thread Dr. Tarique Sani

On 4/30/07, christianandradet [EMAIL PROTECTED] wrote:

 in the layout, in the view.ctp file,


Use a tool like httpliveheaders under firefox to see what are the
exact headers that your browser is recieveing

HTH

T

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog needs you!: http://cheesecake-photoblog.org
=

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



Re: SQL Transactions

2007-04-30 Thread John David Anderson (_psychic_)


On Apr 30, 2007, at 7:17 AM, xavi wrote:


 Hello!

 I'm looking for information about sql transactions in Cake with Mysql5

 I'm using 3 models with 3 separates $this-themodel-save($data), and
 I'm interested i control the transaction itself, doing a commit after
 3 save will be ok.

 Is this possible?
 I've only read the $model-transaction boolean, but no info about how
 to use it.

You might try using $this-ModelName-execute() and -query() to get  
your transactional statements processed.

-- John

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



Re: Upgrade Path From 1.1 to 1.2

2007-04-30 Thread Gonzalo Servat
On 4/30/07, Sliv [EMAIL PROTECTED] wrote:


 [..snip..]
 If it helps provoke a response, there's still months of dev left in
 this current app; it's just me working on it and I don't consider
 myself an expert by any stretch of the imagination, but I have built
 some basic apps and scripts in the past on ye olde LAMP setup.


I think this would be the key deciding factor. You still have months left of
dev so moving over 1.2 is probably not a bad idea. In my case, I have an app
to finish super-mega-ASAP and I went over to 1.2 hoping to make use of some
new features of 1.2, but ran into a few problems to do with the fact that
it's still in development, so I had to go back to 1.1 again (luckily I'm
using SVN so it wasn't too much of a big deal to go back)

Cheers,
Gonzalo

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



Re: multi language site

2007-04-30 Thread Anton Morrison

This is more about translating the core stuff. I want my client to  
update there own pages and translate them.

I was more asking if there was a way i could bind the fields from the  
content_english table with there corresponding fields in the page  
table. In rails you can use 'bind' is there anything like this in cake?


On 30 Apr 2007, at 16:54, R. Rajesh Jeba Anbiah wrote:


 Anton Morrison wrote:
 Hi I am trying to build a micro content management system so have
 more than one langage, with human translation.
snip

 Possibly http://groups.google.com/group/cake-php/msg/
 13afbe9841b91314

 --
   ?php echo 'Just another PHP saint'; ?
 Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


 

Anton Morrison
[EMAIL PROTECTED]




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



Re: Pagination

2007-04-30 Thread Sourabh Sharma

You now how to use the multiple pagination in the same page

On 30 Apr, 20:15, Dr. Tarique Sani [EMAIL PROTECTED] wrote:
 On 4/30/07, Sourabh Sharma [EMAIL PROTECTED] wrote:



  I want to use the multiple pagination in the single page if any one
  can  guide me as soon as possible

 WOW! another chance for me to earn my $ million - don't spoil it for me MI ;)

 T

 --
 =
 PHP for E-Biz:http://sanisoft.com
 Cheesecake-Photoblog needs you!:http://cheesecake-photoblog.org
 =


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



Re: view blob image

2007-04-30 Thread christianandradet

hi,
thanks for your help,
i tried with firefox, and i get this error message:
La imagen http:///cake/appja/funcionarios/view/45; no puede
mostrarse, porque contiene errores.
the image http:///cake/appja/funcionarios/view/45; can't be
shown, because it has errors.

I don't know what to do please help. i already installed
httpliveheaders.

On 30 abr, 10:17, Dr. Tarique Sani [EMAIL PROTECTED] wrote:
 On 4/30/07, christianandradet [EMAIL PROTECTED] wrote:



  in the layout, in the view.ctp file,

 Use a tool like httpliveheaders under firefox to see what are the
 exact headers that your browser is recieveing

 HTH

 T

 --
 =
 PHP for E-Biz:http://sanisoft.com
 Cheesecake-Photoblog needs you!:http://cheesecake-photoblog.org
 =


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



RE: Pagination

2007-04-30 Thread Mariano Iglesias

Ask for Euros, dollar is weak ;)

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Dr. Tarique Sani
Enviado el: Lunes, 30 de Abril de 2007 12:16 p.m.
Para: cake-php@googlegroups.com
Asunto: Re: Pagination

WOW! another chance for me to earn my $ million - don't spoil it for me MI


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



Re: view blob image

2007-04-30 Thread Dr. Tarique Sani

On 4/30/07, christianandradet [EMAIL PROTECTED] wrote:
 i tried with firefox, and i get this error message:
 La imagen http:///cake/appja/funcionarios/view/45; no puede
 mostrarse, porque contiene errores.
 the image http:///cake/appja/funcionarios/view/45; can't be
 shown, because it has errors.


U someone who understands the language will hopefully reply

T

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog needs you!: http://cheesecake-photoblog.org
=

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



RE: view blob image

2007-04-30 Thread Mariano Iglesias

He translated it.

Resides you ought to be learning spanish by now if you want to keep talking
to me :)

Need more hands on the Spanish google group, AD7six is just not enough.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Dr. Tarique Sani
Enviado el: Lunes, 30 de Abril de 2007 12:49 p.m.
Para: cake-php@googlegroups.com
Asunto: Re: view blob image

U someone who understands the language will hopefully reply


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



Re: view blob image

2007-04-30 Thread Dr. Tarique Sani

On 4/30/07, Mariano Iglesias [EMAIL PROTECTED] wrote:
 Resides you ought to be learning spanish by now if you want to keep talking
 to me :)


Not fair - I am yet to learn Hindi properly. Besides am too old to
learn new tricks :)

Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog needs you!: http://cheesecake-photoblog.org
=

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



Re: NULL values

2007-04-30 Thread codecowboy

what if that is only one of the conditions?

On Apr 29, 9:53 pm, Sergei [EMAIL PROTECTED] wrote:
 $sqlConditions=myfield IS NULL

 and that's all.

 Sergei.

 On 30 апр, 10:03, codecowboy [EMAIL PROTECTED] wrote:

  Hi All,

  Does anyone know how to check if a value is null when using the model-

  find($sqlConditions, ., ., .) function?

  I know that sql syntax is :

   select * from users where fieldname is NULL


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



Re: NULL values

2007-04-30 Thread Brian Dailey
Add the other conditions as a string, e.g.,

$sqlConditions = myfield IS NULL AND myfield2 = 'blarg';

On 4/30/07, codecowboy [EMAIL PROTECTED] wrote:

 what if that is only one of the conditions?

 On Apr 29, 9:53 pm, Sergei [EMAIL PROTECTED] wrote:
  $sqlConditions=myfield IS NULL
 
  and that's all.
 
  Sergei.
 
  On 30 апр, 10:03, codecowboy [EMAIL PROTECTED] wrote:
 
   Hi All,
 
   Does anyone know how to check if a value is null when using the model-
 
   find($sqlConditions, ., ., .) function?
 
   I know that sql syntax is :
 
select * from users where fieldname is NULL


 


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



Re: view blob image

2007-04-30 Thread christianandradet

Gracias Mariano mejor pregunto en el foro de español que es mas
chevere

On 30 abr, 10:51, Mariano Iglesias [EMAIL PROTECTED]
wrote:
 He translated it.

 Resides you ought to be learning spanish by now if you want to keep talking
 to me :)

 Need more hands on the Spanish google group, AD7six is just not enough.

 -MI

 ---

 Remember, smart coders answer ten questions for every question they ask.
 So be smart, be cool, and share your knowledge.

 BAKE ON!

 blog:http://www.MarianoIglesias.com.ar

 -Mensaje original-
 De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
 de Dr. Tarique Sani
 Enviado el: Lunes, 30 de Abril de 2007 12:49 p.m.
 Para: cake-php@googlegroups.com
 Asunto: Re: view blob image

 U someone who understands the language will hopefully reply


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



Re: Filtering/Searching/Sorting

2007-04-30 Thread phpsmitty


More or less I'd like to be able to sort my vaiours columns and be
able to search through them. If you have 1000 entries it becomes
cumbersome to find items you'd like to edit.


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



Re: Filtering/Searching/Sorting

2007-04-30 Thread phpsmitty

This is similar functionality that the masterbake.php file can bake up
but the code it produces is very messy. Seams like a couple include
files should be able to dynamically generate this functionality
automatically.



On Apr 27, 3:35 am, Jon Bennett [EMAIL PROTECTED] wrote:
  Sorting:

  Use the AjaxHelper::sortable helper
  Think this uses the scriptaculous sortable library??

 nope, this won?t do what you?re after, that?s for sortable lists (pick
 up and change order of items).
 I think you want to be looking at the Pagination 
 component,http://bakery.cakephp.org/articles/view/paginationshould get you
 started.

 cheers,

 Jon



  Filtering - not too sure what you mean by this, but maybe
  NeatArray::filter, which filters data from an array

  Winston

 --

 jon bennett
 t: +44 (0) 1225 341 039 w:http://www.jben.net/
 iChat (AIM): jbendotnet Skype: jon-bennett


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



Re: Problem with :Cook up Web sites fast with CakePHP, Part 1

2007-04-30 Thread lukemack

I think maybe you have misunderstood how the URLs work in cakePHP, in
conjunction with Apache's  mod_rewrite. You would be better to install
cake in a virtual host under apache rather than in a subdirectory.

On Apr 29, 6:20 am, Mariano Iglesias [EMAIL PROTECTED]
wrote:
 You shouldn't set the action manually.

 Either use $html-formTag('/users/register'), or use $html-url() to get
 proper CakePHP url.

 -MI

 ---

 Remember, smart coders answer ten questions for every question they ask.
 So be smart, be cool, and share your knowledge.

 BAKE ON!

 blog:http://www.MarianoIglesias.com.ar

 -Mensaje original-
 De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
 de johan_vm
 Enviado el: Domingo, 29 de Abril de 2007 06:42 a.m.
 Para: Cake PHP
 Asunto: Re: Problem with :Cook up Web sites fast with CakePHP, Part 1

 I had to change

 form action=/users/register method=post

 to

 form action=/CakePHP/users/register method=post


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



Re: view blob image

2007-04-30 Thread rtconner

Well I dont know spanish, but are you using a layout that looks just
like this?

?php echo $content_for_layout; ?


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



Newbie Approach to Image Uploading

2007-04-30 Thread rockit

what is the equiv of this in cake?

if( is_uploaded_file($_FILES[profile_image][tmp_name]) ) {
move_uploaded_file( $_FILES[profile_image][tmp_name], ../attachments/
$path );


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



Re: Newbie Approach to Image Uploading

2007-04-30 Thread John David Anderson (_psychic_)


On Apr 30, 2007, at 1:24 PM, rockit wrote:


 what is the equiv of this in cake?

 if( is_uploaded_file($_FILES[profile_image][tmp_name]) ) {
   move_uploaded_file( $_FILES[profile_image][tmp_name], ../ 
 attachments/
 $path );

I don't see much I'd change here, except for putting quotes around  
array key names, and the destination path would probably in /app/ 
webroot/img somewheres.

-- John

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



Limiting Results with HABTM FindAll

2007-04-30 Thread Headzoo

Hi all,
I have a db setup that's nearly identical to the hasAndBelongsToMany
example in the CakePHP manual. There is a posts table, tags table, and
post_tags table.

If I want to find all posts with a particular tag, I use this code:

$tag_name = 'something';
$data = $this-Tag-findAll(Tag.tag = '$tag_name');

The problem I'm running into, is finding a way to limit the number of
posts that are returned.  The above code will return *all* the posts
with the particular tag, but I only want the last 20 or so.  Adding a
limit to the findAll() method only limits the number of rows returned
from the Tag model, not the Post model.

Can anyone tell me how to put limit clauses on the models related to
the model I'm using findAll() on?

- Sean


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



Re: Limiting Results with HABTM FindAll

2007-04-30 Thread Headzoo

Scratch that question. I found *an* answer, which is to change the
$hasAndBelongsToMany variable prior to the findAll() call, and adding
a limit clause to it.  That seems a little sloppy though, and I'm
wondering if there is a better way.

- Sean


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



Re: Pagination default order for each column

2007-04-30 Thread Defranco

no ideas?

defranco


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



Re: Newbie Approach to Image Uploading

2007-04-30 Thread alan

http://cakebaker.42dh.com/2006/04/15/file-upload-with-cakephp/

or

http://bakery.cakephp.org/articles/view/swfupload-and-multipurpose-uploader

thanks,
-alan-


  what is the equiv of this in cake?

  if( is_uploaded_file($_FILES[profile_image][tmp_name]) ) {
 move_uploaded_file( $_FILES[profile_image][tmp_name], ../
  attachments/
  $path );


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



Re: Saving multiple database records from a single form.

2007-04-30 Thread alan

I would think that you would need to do some custom parsing here...  I
usually solve this by creating a higher dimensional array...  perhaps
something along the lines of:

--
input name=data[m][item1][Model][Field1]/
input name=data[m][item1][Model][Field2]/
--
input name=data[m][item2][Model][Field1]/
input name=data[m][item2][Model][Field2]/
--

Then, in the controller, you simply do something like:

foreach ( $this-data['m'] as $itemkey = $data ) {
   $this-Model-create();
   if ( $this-Model-save($data) ) {
  ...
   }
}

thanks,
-alan-


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



Re: Accessing controller function from routes.php

2007-04-30 Thread Defranco

On Apr 25, 10:09 pm, Defranco [EMAIL PROTECTED] wrote:

 include(../../cake/libs/model/model.php);
 include(../../cake/app_model.php);
 include(../models/MyModel.php); //my model php file

Latter I discovered that these includes on routes.php was a bad idea
as the redeclaration of model.php caused an error white I tried to use
requestAction on a total different controller:

Fatal error: Cannot redeclare class Model in ...\cake\libs\model
\model_php5.php on line 1662:

any idea to avoid this? I think that I need to change the cake's files
to avoid redeclarations issues;

/defranco


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



Use of $conditions

2007-04-30 Thread k4mg

I have made a simple (my first!) application using CakePHP and Bake.
It works fine, but I am unable to figure out how to add two more
capabilities.  I would like to have my List view in order, and
paginated so that the headers are always available.  For the first,
reading the documentation, it seems I should use $conditions as I did
below.  Of course, the list is still in as entered order, not sorted.
Any help/examples for this and the pagination would be appreciated.


class ProgramsController extends AppController {

var $name = 'Programs';
var $conditions = ORDER BY p_date, p_time;
var $title_for_layout = 'Lake-Sumter Computer Society';
var $helpers = array('Html', 'Form' );

function index() {
$this-Program-recursive = 0;
$this-set('programs', $this-Program-findAll($conditions));
}
Barry


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



Re: Use of $conditions

2007-04-30 Thread rtconner

I always thought the docs were a little shady on this. To do what you
want to do...

$this-Program-findAll(null, null, 'p_date DESC, p_time ASC')

On Apr 30, 3:01 pm, k4mg [EMAIL PROTECTED] wrote:
 I have made a simple (my first!) application using CakePHP and Bake.
 It works fine, but I am unable to figure out how to add two more
 capabilities.  I would like to have my List view in order, and
 paginated so that the headers are always available.  For the first,
 reading the documentation, it seems I should use $conditions as I did
 below.  Of course, the list is still in as entered order, not sorted.
 Any help/examples for this and the pagination would be appreciated.

 class ProgramsController extends AppController {

 var $name = 'Programs';
 var $conditions = ORDER BY p_date, p_time;
 var $title_for_layout = 'Lake-Sumter Computer Society';
 var $helpers = array('Html', 'Form' );

 function index() {
 $this-Program-recursive = 0;
 $this-set('programs', $this-Program-findAll($conditions));
 }
 Barry


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



Re: Newbie Approach to Image Uploading

2007-04-30 Thread rockit

snippet:

p
Image:
?php echo $html-file('Inventory/image', array('size' = 
'40')); ?
p

For some reason it's trying to pass the value array to my model.
Something i'm missing here?

On Apr 30, 5:49 pm, alan [EMAIL PROTECTED] wrote:
 http://cakebaker.42dh.com/2006/04/15/file-upload-with-cakephp/

 or

 http://bakery.cakephp.org/articles/view/swfupload-and-multipurpose-up...

 thanks,
 -alan-

   what is the equiv of this in cake?

   if( is_uploaded_file($_FILES[profile_image][tmp_name]) ) {
  move_uploaded_file( $_FILES[profile_image][tmp_name], ../
   attachments/
   $path );


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



the onError() function

2007-04-30 Thread ram_64892

Hi,

   I'm using the latest stable version of cake (downloaded 3 days
ago), and while developing, noticed that on line 550 (and several
other locations) in dbo_source.php, there is a call to $model-
onError(). This function is called whenever a query to the database
returns an error. However, whenever this call is executed, the result
seems to be that that a query, which simply consists of the string
onError is issued to the database. Since this is not a valid sql
statement, it causes a second error on top of the original one,
causing two error messages to appear, similar to what i have pasted
below. I am not able to find definition of the function onError().
Anyone knows what the purpose of that call is? Thanks.

Ram


Query: INSERT INTO `users`
(`username`,`password`,`email`,`firstname`,`lastname`,`middlei`,`addr1`,`addr2`,`city`,`state`,`country`,`age`,`created`)
VALUES
('ajit','96e7db63cb94a44aabfec7d755eb8f68','[EMAIL 
PROTECTED]','ajit','ajit','ajit','sdflk','sd;flk','sdflk','sdflk','sd',
34,'2007-04-30 15:57:16')
Warning: SQL Error: 1062: Duplicate entry 'ajit' for key 2 in C:
\Projects\cartrack\cake\libs\model\datasources\dbo_source.php on line
476

Query: onError
Warning: 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 'onError' at line 1 in C:\Projects\cartrack\cake
\libs\model\datasources\dbo_source.php on line 476


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



Re: save fields but don't change MODIFIED filed

2007-04-30 Thread Sergei

So, no one knows? Is it possible?

Thanks.

On 30 апр, 10:51, Sergei [EMAIL PROTECTED] wrote:
 Hello,

 Is there a way to save some fields to a record but don't change
 modified field?

 Using latest stable CakePHP.
 Thank you.


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



Re: save fields but don't change MODIFIED filed

2007-04-30 Thread Samuel DeVore
If you have the modified set to the existing value in your data, I
don't think it sets it automatically.

so something like

$Item = $this-ModelName-read('modified',$id);

$this-data['ModelName']['modified'] = $Item['ModelName']['modified'];
$this-ModelName-id = $id;
$this-ModelName-save($this-data);

might work, or at least give you something to try




On 4/30/07, Sergei [EMAIL PROTECTED] wrote:

 So, no one knows? Is it possible?

 Thanks.

 On 30 апр, 10:51, Sergei [EMAIL PROTECTED] wrote:
  Hello,
 
  Is there a way to save some fields to a record but don't change
  modified field?
 
  Using latest stable CakePHP.
  Thank you.


 



-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

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



Re: save fields but don't change MODIFIED filed

2007-04-30 Thread John David Anderson (_psychic_)


On Apr 30, 2007, at 8:38 PM, Sergei wrote:


 So, no one knows? Is it possible?

$this-ModelName-execute(UPDATE `model_names` SET `field` =  
'$value' WHERE `model_names.id` = $id);

-- J

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



Search Engine for a CakePHP app

2007-04-30 Thread Gonzalo Servat
Hi All,

So I've gotten to a point in my app that I need to implement some sort of
(basic) search engine functionality. It wouldn't be that hard to do if all
the content was housed in database tables (as I could do something similar
to what gwoo suggested in
http://groups.google.com/group/cake-php/browse_thread/thread/d94d6521b70e6e09/b68f0389f18b8c5e?lnk=gstq=search+enginernum=6#b68f0389f18b8c5e)
but my main problem is that a fair bit of content is found in view files
(under app/views with .html extension to differentiate from .thtml files as
the latter often contain forms and stuff that shouldn't be searchable). I
thought about maybe doing a grep on any file under app/views with a .html
extension for the search term entered, but it's a pretty hacky way of doing
it (and wouldn't scale well if the site got busy), so, apart from doing my
own indexing, can anyone suggest a way I can achieve this? I've had a search
around but couldn't find any cakebaker/bakery articles on a scenario similar
to mine.

Thanks in advance!

- Gonzalo

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



Re: Search Engine for a CakePHP app

2007-04-30 Thread John David Anderson (_psychic_)

On Apr 30, 2007, at 9:19 PM, Gonzalo Servat wrote:

 Hi All,

 So I've gotten to a point in my app that I need to implement some  
 sort of (basic) search engine functionality. It wouldn't be that  
 hard to do if all the content was housed in database tables (as I  
 could do something similar to what gwoo suggested in http:// 
 groups.google.com/group/cake-php/browse_thread/thread/ 
 d94d6521b70e6e09/b68f0389f18b8c5e?lnk=gstq=search 
 +enginernum=6#b68f0389f18b8c5e ) but my main problem is that a  
 fair bit of content is found in view files (under app/views  
 with .html extension to differentiate from .thtml files as the  
 latter often contain forms and stuff that shouldn't be searchable).  
 I thought about maybe doing a grep on any file under app/views with  
 a .html extension for the search term entered, but it's a pretty  
 hacky way of doing it (and wouldn't scale well if the site got  
 busy), so, apart from doing my own indexing, can anyone suggest a  
 way I can achieve this? I've had a search around but couldn't find  
 any cakebaker/bakery articles on a scenario similar to mine.

I created a search engine using a few classes from the Zend  
Framework. They've got a nice port of the guts of Lucene, and its  
pretty easy to create your own search component.

My content is almost completely in static view templates, so I  
created a script that uses wget to pull down the content, and some ZF  
classes to plug it into the index.

-- John


 Thanks in advance!

 - Gonzalo


 


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



Re: Search Engine for a CakePHP app

2007-04-30 Thread Gonzalo Servat
On 5/1/07, John David Anderson (_psychic_) [EMAIL PROTECTED] wrote:


 On Apr 30, 2007, at 9:19 PM, Gonzalo Servat wrote:

 I created a search engine using a few classes from the Zend Framework.
 They've got a nice port of the guts of Lucene, and its pretty easy to create
 your own search component.

 My content is almost completely in static view templates, so I created a
 script that uses wget to pull down the content, and some ZF classes to plug
 it into the index.


Thanks for your reply John. Would you be able to provide more info on this?
I'd be interested to know what logic you used to write the script that
wget's the content, and if you have the ZF classes handy, that would rock
too :)

- Gonzalo

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



RE: Search Engine for a CakePHP app

2007-04-30 Thread Mariano Iglesias
Zend Framework? HERESY!

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar

  _  

De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de John David Anderson (_psychic_)
Enviado el: Martes, 01 de Mayo de 2007 12:31 a.m.
Para: cake-php@googlegroups.com
Asunto: Re: Search Engine for a CakePHP app

 

I created a search engine using a few classes from the Zend Framework.
They've got a nice port of the guts of Lucene, and its pretty easy to create
your own search component.



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



Re: Search Engine for a CakePHP app

2007-04-30 Thread John David Anderson (_psychic_)

On Apr 30, 2007, at 10:21 PM, Mariano Iglesias wrote:

 Zend Framework? HERESY!
They will be assimilated.

Resistance is futile.

All it took was about 60 lines.

That is all.

-- John


 -MI

 -- 
 -

 Remember, smart coders answer ten questions for every question they  
 ask.
 So be smart, be cool, and share your knowledge.

 BAKE ON!

 blog: http://www.MarianoIglesias.com.ar

 De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En  
 nombre de John David Anderson (_psychic_)
 Enviado el: Martes, 01 de Mayo de 2007 12:31 a.m.
 Para: cake-php@googlegroups.com
 Asunto: Re: Search Engine for a CakePHP app



 I created a search engine using a few classes from the Zend  
 Framework. They've got a nice port of the guts of Lucene, and its  
 pretty easy to create your own search component.


 



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



Re: Search Engine for a CakePHP app

2007-04-30 Thread Dr. Tarique Sani

On 5/1/07, John David Anderson (_psychic_) [EMAIL PROTECTED] wrote:


 On Apr 30, 2007, at 10:21 PM, Mariano Iglesias wrote:



 Zend Framework? HERESY!
 They will be assimilated.

Oh! they will say that It is by design ;)

Cheers
Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog needs you!: http://cheesecake-photoblog.org
=

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



Re: save fields but don't change MODIFIED filed

2007-04-30 Thread Sergei

OK, thank you.

On 1 май, 11:54, Samuel DeVore [EMAIL PROTECTED] wrote:
 If you have the modified set to the existing value in your data, I
 don't think it sets it automatically.


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



How can one detect whether the current language is left-to-right or right-to-left?

2007-04-30 Thread Aaron Shafovaloff

How can one, in CakePHP 1.2, detect whether the current language is
left-to-right or right-to-left? Do I have to resort to manually
putting it into the .po file?

Thanks,

Aaron


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



Routes Setup

2007-04-30 Thread phpappdev256

I've been looking all over for help on how to set up routes.  This is
what I need to do...

I want:

sitename/articles or sitename/articles/
to go to
controller: articles
action: index

ALSO

sitename/articles/article_name
to go to
controller: articles
action: view
and have it pass article_name to it.

I also need the pagenation for index to work properly, which is
breaking...  This is what I tried...

Router::connect('/articles', array('controller' = 'articles',
'action' = 'index'));
Router::connect('/articles/*', array('controller' = 'articles',
'action' = 'view'));

However the pagenation goes to: sitename/articles/index/page:2  which
redirects to the main /articles page.  Is there a modification in the
pagenation settings to handle this, or is there another way I can do
the Router::connect?


?php
class ArticlesController extends AppController {

var $name = 'Articles';
var $helpers = array('Html', 'Form' );
var $uses = array('Article','Tag');

function index($page_info=null) {
$this-Article-recursive = 0;
$this-set('articles', $this-paginate());
}

function view($id = null) {
if (($id)  !is_numeric($id)) {
$found = $this-Article-findBySlug($id);
} elseif($id) {
$found = $this-Article-read(null, $id);
} else {
$this-Session-setFlash('Invalid Article.');
$this-redirect(array('action'='index'), null, true);
exit;
}
if (empty($found)) $this-redirect(array('action'='index'), 
null,
true);
$this-set('article', $found);
}

}
?


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



Re: Newbie Approach to Image Uploading

2007-04-30 Thread rockit

http://bin.cakephp.org/view/1255326741 you can view more of the
script.

On Apr 30, 7:43 pm, rockit [EMAIL PROTECTED] wrote:
 snippet:

 p
 Image:
 ?php echo $html-file('Inventory/image', array('size' = 
 '40')); ?
 p

 For some reason it's trying to pass the value array to my model.
 Something i'm missing here?

 On Apr 30, 5:49 pm, alan [EMAIL PROTECTED] wrote:

 http://cakebaker.42dh.com/2006/04/15/file-upload-with-cakephp/

  or

 http://bakery.cakephp.org/articles/view/swfupload-and-multipurpose-up...

  thanks,
  -alan-

what is the equiv of this in cake?

if( is_uploaded_file($_FILES[profile_image][tmp_name]) ) {
   move_uploaded_file( $_FILES[profile_image][tmp_name], ../
attachments/
$path );


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



Thread Safety and getLastInsertID

2007-04-30 Thread [EMAIL PROTECTED]

Hello Cake Folk,
I have been trying to determine if Model::getLastInsertID is
thread safe. I'm looking to get the id of the record that I inserted
with the statement (I'm using save() for inserting, not just
updating):

$this-Thing-save($this-data)

I'd like to be able to use the ID of this record without retrieving it
again. I would like to continue to use the auto-increment feature of
my database.

Obviously, my concern here is having forty people all click a create
button at the same time.


Thanks for any light you can shed.


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



Cake 1.2 - Session woes

2007-04-30 Thread buzznut

I am having a difficult time working with sessions in my cake 1.2 app.
It doesn't appear to be behaving the way that I expect.

I have an action that sets a variable using the following line of
code.

$this-Session-write('companyName',$company['Company']['name']);


When I access this action and print out the session array, I see that
the value gets set properly. When I visit any other action under the
same controller and/or other controllers, the companyName value is
empty. If I use the following line of code in place of the command
above...

$this-Session-write('companyName','My Rockin Company');

The session variable works as expected until I delete the session
variable. I am confused why this would not work and would appreciate
any help.
Thanks,


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



Re: How can one detect whether the current language is left-to-right or right-to-left?

2007-04-30 Thread Dr. Tarique Sani

Well technically languages do not have direction it is the script
which has direction ;)

Guess, hard coding which scripts are written right to left will be a
simpler option, reading
http://www.w3.org/International/questions/qa-scripts may also help.

Cheers
Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog needs you!: http://cheesecake-photoblog.org
=


On 5/1/07, Aaron Shafovaloff [EMAIL PROTECTED] wrote:

 How can one, in CakePHP 1.2, detect whether the current language is
 left-to-right or right-to-left? Do I have to resort to manually
 putting it into the .po file?

 Thanks,

 Aaron


 


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



Re: Thread Safety and getLastInsertID

2007-04-30 Thread Dr. Tarique Sani

From 
http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_last-insert-id

The ID that was generated is maintained in the server on a
per-connection basis. This means that the value returned by the
function to a given client is the first AUTO_INCREMENT value generated
for most recent statement affecting an AUTO_INCREMENT column by that
client. This value cannot be affected by other clients, even if they
generate AUTO_INCREMENT values of their own. This behavior ensures
that each client can retrieve its own ID without concern for the
activity of other clients, and without the need for locks or
transactions.

HTH
Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog needs you!: http://cheesecake-photoblog.org
=


On 5/1/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Hello Cake Folk,
 I have been trying to determine if Model::getLastInsertID is
 thread safe. I'm looking to get the id of the record that I inserted
 with the statement (I'm using save() for inserting, not just
 updating):

 $this-Thing-save($this-data)

 I'd like to be able to use the ID of this record without retrieving it
 again. I would like to continue to use the auto-increment feature of
 my database.

 Obviously, my concern here is having forty people all click a create
 button at the same time.


 Thanks for any light you can shed.


 


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