Re: paypal integration in cakephp

2009-01-28 Thread Arthur Pemberton

On Wed, Jan 28, 2009 at 6:47 AM, Arafat  wrote:
>
> Dear i cant integrate the paypal in my site. The tutorial is too
> critical. Can any one make it easier.
> Thanks
>

It's not that hard

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: Fighting cakephp : can't add user count to group index

2009-01-13 Thread Arthur Pemberton

On Tue, Jan 13, 2009 at 12:59 PM, Webweave  wrote:
> Or even easier (although less cake-like, probably more efficient at
> the DB level):
>
> 'fields' => array('Group.*', '(select count(1) from users User where
> User.group_id = Group.id) as users_count')

Genius. I should have thought of that. I didn't try the first as many
things that apply to find don't apply to paginate. I had tried similar
to your first suggestion already.

Thanks.

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Fighting cakephp : can't add user count to group index

2009-01-12 Thread Arthur Pemberton

I was trying to do what would be a fairly simple thing in plain SQL.
The bake script generated a nice groups_controller for me which
paginated the groups listing. Fairly simple.

All I wanted to do was add a user count to the index. The required SQL would be:

 SELECT `Group`.`id` , `Group`.`name` , `Group`.`created` ,
`Group`.`modified` , `User`.`username` , COUNT( * )
FROM `groups` AS `Group`
INNER JOIN `users` AS `User` ON `User`.`group_id` = `Group`.`id`
GROUP BY `Group`.`id` , `Group`.`name` , `Group`.`created` ,
`Group`.`modified` , `User`.`username`
LIMIT 0 , 30

this compared to the original SQL before i touched the index action
generated by bake:
SELECT `Group`.`id`, `Group`.`name`, `Group`.`created`,
`Group`.`modified` FROM `groups` AS `Group` WHERE 1 = 1 LIMIT 20

While there is a lot more SQL, the result set is equivalent, and can
be ordered and limited just as before.

And hour later, I have not found a good way to get the user count.,
short of doing the paginate, and then manually inserting the user
counts after.

Is there any way to just force my own SQL into paginate?

I saw http://book.cakephp.org/view/249/Custom-Query-Pagination but it
doesn't what to override and where.

Is there a way i can have cake use an SQL view i make just for this query?

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: ACL/Auth Speed Issues

2009-01-10 Thread Arthur Pemberton

On Sat, Jan 10, 2009 at 2:36 AM, AussieFreelancer
 wrote:
>
> Hi,
>
> does anyone have a working example of where acl and auth components
> are being used for a membership base of 10,000+ and there are no speed
> issues? I really need to find an effective permissions solution, which
> i thought acl and auth was, but i have serious speed issues whenever
> im accessing the acl tables... any help or ideas would be very
> greatful, as well as an example of a site as above.


Have you put in indexes? The number of users doesn't have to be
directly proportional to the number of ACLs you have though.

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Better way to extend configuration to database table?

2009-01-09 Thread Arthur Pemberton

I can easily create a model which simply houses key/value/type
triplets and use that to store random user editable config. I am just
wondering if there is a better way to do this in CakePHP.

Thank you.

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Getting close to deploying my first CakePHP app, what should I know?

2009-01-09 Thread Arthur Pemberton

First of all, I started dev with the release candidate available at
the time, so I know I'm going to have to update to the latest release.

I will have to turn of debugging mode of course, but anything others
experience with this can share with me?

Thank you.

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: Any built in way to do lazy deletes?

2009-01-09 Thread Arthur Pemberton

On Fri, Jan 9, 2009 at 12:56 PM, Bernardo Vieira
 wrote:
>
> Try the delatable behavior. Not built in, but close.
> http://bakery.cakephp.org/articles/view/soft-delete-behavior
>
> Arthur Pemberton wrote:
>> "Lazy deletes" being setting a field appropriately so that the row is
>> 'deleted' but still in the database.


Thanks, will take a look. Just have some data I rather lazy delete
than delete if feasible.

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Any built in way to do lazy deletes?

2009-01-09 Thread Arthur Pemberton

"Lazy deletes" being setting a field appropriately so that the row is
'deleted' but still in the database.

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: Auth or Program First?

2009-01-07 Thread Arthur Pemberton

On Wed, Jan 7, 2009 at 2:13 PM, Chad Casselman  wrote:
>
> I am working on a complex app (for me) and at the same time I have yet
> to grasp how to use Auth correctly.

What I did, not necessarily the best thing:

Started getting the basic project together, then I arrived at the
point where I needed different users to test, so I implemented the
ACLs.

The language in the book isn't the clearest, and all the automagic can
be a bit misleading at times, but it works.

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



How to specify bind condition?

2009-01-06 Thread Arthur Pemberton

I am trying to bind a ModelC based on its relationship to ModelB which
is related to ModeA (my main mode).

If I set recursive to 2, i get all the data, but I can't seem to
include the second level items in the field list.

So I would like to bind ModelC to ModelA accordingly, however, cake is
adding its' own condition (ModelA.modec_id = ModelC.id) inspite of my
own condition (ModelB.modelc_id = ModelC.id). And this doesn't work
because ModeA doesn't have a modelc_id.

ModelC is pretty big, and I don't want to unnecessarily retrieve the data.

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: Selecting users who are not friends

2009-01-02 Thread Arthur Pemberton

On Fri, Jan 2, 2009 at 10:53 PM, Webweave  wrote:
>
> First, you should reall be using find('all') not findAll, as in:
>
>   $friends = $this->User-find('all', array('conditions' => array
> ('User.id' => $target)));
>
> To find all the users who are not friends, simply use the following:
>
>$notFriends = $this->User-find('all', array('conditions' => array
> ('NOT' => array('User.id' => $target;


That won't grab users who have no friends.


-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: checkbox groups in cakephp 1.2

2008-12-31 Thread Arthur Pemberton

On Wed, Dec 31, 2008 at 1:54 PM, mike  wrote:
>
> thanks for the response.  thats not quite what I want.  Each user can
> have multiple ethnicities, so its a many to many relationship.  In my
> models, I have User hadMany UsersEthnicities, Ethnicity hasMany
> UsersEthnicity and UsersEthnicity belongsTo User and Ethnicity.  Is
> this correct?


Are you following this:
http://book.cakephp.org/view/83/hasAndBelongsToMany-HABTM ?

I don't think you have to do 'UsersEthnicities' explicity, unless
you're doing some complex SELECT. For simple editing, defining the
HABTM in the model should be enough.

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: checkbox groups in cakephp 1.2

2008-12-30 Thread Arthur Pemberton

On Tue, Dec 30, 2008 at 9:19 PM, mike  wrote:
> can someone help me with this please?  the documentation is not good
> enough for dumbasses like me.  thanks.


You'll have to remind us what you are trying to do.


-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: Selecting users who are not friends

2008-12-29 Thread Arthur Pemberton

On Mon, Dec 29, 2008 at 4:21 PM, WebFeathers  wrote:
>
> Thank you Arthur - I figured I'd have to do it that way - was just
> looking for a more elegant solution.
>
> Thanks!
> ~R~

Keep in mind that I have only been using CakePHP for about a month
now, someone else may have a more elegant solution. If so, I haven't
seen it in the book however.

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: Selecting users who are not friends

2008-12-29 Thread Arthur Pemberton

On Mon, Dec 29, 2008 at 2:59 PM, WebFeathers  wrote:
>
> Hey-
> I'm trying to generate a list of users who are not friends of the
> currently logged in user.
> I have two tables: profiles, and users_users
> profiles includes the fields: id, first_name, last_name, etc...
> users_users includes: id, user_id, friend_id
>
> I can get the list of users who ARE friends:
> $friends = $this->User->findAll('User.id=' . $target);
>
> ...but can't figure out how to go the other way???
>
> My user model includes:
> class User extends AppModel
> {
>var $name = 'User';
>var $hasAndBelongsToMany = array(
>'Friends' => array(
>'className' => 'Profile',
>'joinTable' =>'users_users',
>'foreignKey' =>'user_id',
>'associationForeignKey' => 'friend_id',
>'unique'=> true
>),
>'FriendList' => array(
>'className' => 'users_users',
>'joinTable' =>'users_users',
>'foreignKey' =>'user_id',
>'associationForeignKey' => 'friend_id',
>'unique'=> true
>)
>);
> }


I believe if you did this in raw SQL, you would need to do a sub
query. I don't think CakePHPs ORM generates sub queries (subject to
correction).

The simplest solution would be to generate a list of the ids of the
friends, and get all users whose id is not in that list.

[1] show how to do an IN condition

[1] http://book.cakephp.org/view/74/Complex-Find-Conditions

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: How would I write this query

2008-12-27 Thread Arthur Pemberton

Assuming that translates to:

SELECT
Friend.*,
User.username,
User.avatar,
User.handler
FROM
friends AS Friend,
INNER JOIN users AS User
ON User.id = Friend.user_id
WHERE
Friend.status = 'approved' AND
(
(Friend.user_id = ':user_id') OR
(User.friend_id = ':user_id')
)
ORDER BY
Friend.requestTime ASC
LIMIT 0,5


I believe this may work, of course I haven't tested it, you may want
to read [1] and [2] to make the appropriate mods:

$condition =  array (
"Friend.status" => "approved",
"or" => array (
"Friend.user_id" => $user_id,
"User.friend_id  >" => $user_id
)
)

$this->Friend->bindModel(array(
'hasAndBelongsToMany' => array(
'FilterUsers' => array(
'className' => 'User',
'foreignKey' => false,
'conditions' => $conditions
;

$this->Friend->find('all');

[1] http://book.cakephp.org/view/74/Complex-Find-Conditions
[2] http://book.cakephp.org/view/83/hasAndBelongsToMany-HABTM

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



Re: checkbox groups in cakephp 1.2

2008-12-27 Thread Arthur Pemberton

On Sat, Dec 27, 2008 at 1:54 AM, mike  wrote:
>
> I saw a helper class for this for 1.1, but nothing for 1.2.
>
> Is their an example of a checkbox group that maps to the same database
> field?  for example, one checkbox maps to a value of 1, another maps
> to a value of 2.


http://book.cakephp.org/view/193/options-multiple


-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: Run Queries Unrelated to Controller

2008-12-27 Thread Arthur Pemberton

On Sat, Dec 27, 2008 at 1:09 PM, Chad Casselman  wrote:
> So does than mean I can't run MySQL commands beyonds selects or just for
> this one example?

I never said you can't do it, just said it would be easier. Consider
that you know everything necessary to do the calculations in PHP,
hence it is easier.

> How do I do run MySQL commands in cakephp,

No idea, I haven't had to do that myself.

> or do I just
> run raw sqls?

I'm sure it is possible, I have no idea how, may want to check the book.

> What is the downfall of running raw SQL?

Well for you, the downfall is you don't know how. Hence why I said it
would be easier to do it in PHP. Didn't say it would be more
efficient, or better practice, etc... just easier.


-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: HTML 4 specific CakePHP?

2008-12-27 Thread Arthur Pemberton

On Sat, Dec 27, 2008 at 10:47 AM, Marcelo Andrade  wrote:
> On Sat, Dec 27, 2008 at 12:43 PM, Bernardo Vieira
>  wrote:
>>
>> gearvOsh wrote:
>>> In CakePHP you can "choose" the Doctypes of XHTML or HTML but the
>>> taglist is all XHTML, which then causes markup errors.
>>>
>> gearvOsh,
>> It shouldn't be too much of hassle to create  a html4 helper based on
>> the existing html helper. If  you create your helper extending the
>> existing html helper, basically all you'd have to do is copy/paste the
>> tags array (lines 45-98 in 1.2 final) into your newly created class and
>> change as necessary.
>
> As a suggestion for the developers, maybe a better
> approach was to have some flag in the config that
> tells the doctype compliance mode (strict, transition
> for html 4.01 and xhtml 1.0).

That's going to be an arbitrary performance hit. I recently saw some
not too CakePHP friendly benchmarks. I don't think that would help.



-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: HTML 4 specific CakePHP?

2008-12-27 Thread Arthur Pemberton

On Sat, Dec 27, 2008 at 4:22 AM, gearvOsh  wrote:
>
> No thats the thing, XHTML is not supported.
>
> You would need to put the content-type as application/xhtml+xml which
> in most cases breaks the layout and always breaks IE. Everyone usually
> puts it as text/html which then renders the browser as regular HTML
> and NOT XHTML. Im not telling you XHTML is bad, all im saying is that
> in the end the browser outputs any type of XHTML as HTML 4.

So... then there is no reason for me to not use it then.

> In CakePHP you can "choose" the Doctypes of XHTML or HTML but the
> taglist is all XHTML, which then causes markup errors.


So then do you work in XHTML, since it gets parsed as HTML anyways.


-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: Run Queries Unrelated to Controller

2008-12-27 Thread Arthur Pemberton

On Sat, Dec 27, 2008 at 12:39 PM, Chad Casselman  wrote:
> Can someone explain this to me please.  I need to under cakephp better in
> order to really leverage it.
>
> If I just run find all, then everything is fine I get data back in the
> format below which is fine; however, if I pass in fields (only need 3 fields
> from all that information) as in the previous email examples is says that it
> doesn't know the table.field?  Why is this?
>
> How do I get the information below, but create a custom column like
> DateDiff(Package.created, now()).

Would be easiest to just calculate the date diff in PHP.

> Array
> (
> [0] => Array
> (
> [Package] => Array
> (
>
> [id] => 2
> [created] => 2008-12-24 10:48:39
> [modified] => 2008-12-24 11:39:17
> [name] => Welcome A - 2 day
> [mailing_id] => 1
>
> [interval] => 2
> )
>
> [Mailing] => Array
> (
> [id] => 1
> [created] => 2008-12-24 10:47:40
> [modified] => 2008-12-24 10:47:40
>
> [name] => Welcome A
> [description] => Welcome Letter
> [weight] => 1.25
> [us_shipping] => .42
> [mex_shipping] => 1.23
>
> [int_shipping] => 4.50
> )
>
> [Sequence] => Array
> (
> [0] => Array
> (
> [id] => 2
>
> [created] => 2008-12-26 14:14:05
> [modified] => 2008-12-26 14:14:05
> [name] => Sequence Trial 2
> [PackagesSequence] => Array
>
> (
> [id] => 3
> [package_id] => 2
> [sequence_id] => 2
> )
>
>
> )
>
> )
>
> )
>
> )
>
> Thanks,
>
> Chad
>
> On Sat, Dec 27, 2008 at 11:18 AM, Webweave  wrote:
>>
>> Your original post showed 'uses' for the tables in question, which
>> infers that you don't have them linked to the controller's model.
>>
>> If they are connected, you may not have recursive set properly to
>> cause Cake to include them. Cake needs to understand how the tables
>> get joined in order to build the SQL.
>>
>> On Dec 27, 6:45 am, "Chad Casselman"  wrote:
>> > Even though the binding is in the models correctly, I have to respecify
>> > the
>> > associations in this controller that are already in the models that are
>> > being "used"?  Assuming that that HABTM is not going to be a problem.
>> >
>> > Chad
>> >
>> > On Fri, Dec 26, 2008 at 11:11 PM, Webweave  wrote:
>> >
>> > > In order to fetch data from both tables, you need to join them, Cake
>> > > won't do this automagically.
>> >
>> > > On Dec 26, 5:40 pm, "Chad Casselman"  wrote:
>> > > > Should it bring in all hardcoded (model) associations when I import
>> > > > them?
>> >
>> > > > Here is what I have and I can't pull any fields from Sequences or
>> > > > PackagesSequence objects/tables
>> >
>> > > > var $uses = array('Package','Sequence','PackagesSequence');
>> > > > $extra = array(
>> > > > 'recursive' => 1, //int
>> > > > 'fields' => array('Package.name', 'Sequence.name'),
>> > > //array
>> > > > of field names
>> > > > );
>> >
>> > > >  $this->Package->find('all', $extra);
>> >
>> > > > I get an error that it doesn't know the Sequence table.  Thoughts?
>> > > >  Do I
>> > > > have to recode the associations already in the models?
>> >
>> > > > Chad
>> >
>> > > > On Fri, Dec 26, 2008 at 6:26 PM, Arthur Pemberton 
>> > > wrote:
>> >
>> > > > > On Fri, Dec 26, 2008 at 5:

Re: HTML 4 specific CakePHP?

2008-12-26 Thread Arthur Pemberton

On Sat, Dec 27, 2008 at 1:41 AM, gearvOsh  wrote:
>
> Most browsers dont support XHTML

I don't know, all the sites where I use XHTML seem to work just fine.

> and most people dont even write XHTML
> correctly.

Not exactly my problem now is it. That's kinda like saying don't do
maths because a lot of people don't do math well.

> If this is your site(http://www.pembo13.com/), your DTD is
> XHTML but its being parsed as HTML.

That's all well, and good. I prefer the markup to be as XML like as
possible. If I didn't, I'd be using HMTL.

> So basically thats kaput, did you

Fine, how does  any of that stop from integrating CakePHP into your site though?

> read the article I posted earlier?

I scanned it, didn't give any reasons why HTML was better than XHTML,
just seemed to say that HTML was good enough. It went as far as
mentioning HTML 5, which is at best months away -- not relevant for
the present.

And nothing you've said so far suggests that XHTML is a bad thing,
just that HMTL is good enough. And while I'm not up to date on my
HTML, I don't think there is much in XHTML that doesn't work in HTML.
So switching to HTML would just make CakePHP useful to less people.

Not that I care... I don't think HTML vs. XHTML is that big a deal.
The only reason I replied is that I don't like the idea of people
popping into other peoples projects and saying "hey, I don't like the
way you've done this, redo it to this way that I like it".

I should not that I am in no way affiliated with the CakePHP projects,
and I speak solely for and represent only myself.


> @Graham Weldon - Seems like a lot of work to overwrite it. Actually I
> dont see how that would work well.
> 

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: HTML 4 specific CakePHP?

2008-12-26 Thread Arthur Pemberton

On Sat, Dec 27, 2008 at 12:32 AM, gearvOsh  wrote:
>
> Please explain your cleanliness? HTML 4 can do everything XHTML can
> except self closing tags />.
>
> Also your XHTML is being parsed as HTML and removed, so whats your
> point?


What exactly is CakePHP doing that you find such a problem?

You can use XHTML in your HTML, but I can't use HTML in my XHTML, and
I prefer XHTML.

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: HTML 4 specific CakePHP?

2008-12-26 Thread Arthur Pemberton

On Fri, Dec 26, 2008 at 10:54 PM, gearvOsh  wrote:
>
> Honestly I really dislike the "xhtml" type of tags in CakePHP. There
> are no reasons for that, I think it would be a better idea to make it
> html 4 strict.
>
> Heres an article on why xhtml is retarded.
>
> http://www.webdevout.net/articles/beware-of-xhtml


Good luck with that. I prefer the cleanliness of XHTML myself.


-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: Run Queries Unrelated to Controller

2008-12-26 Thread Arthur Pemberton

On Fri, Dec 26, 2008 at 7:40 PM, Chad Casselman  wrote:
> Should it bring in all hardcoded (model) associations when I import them?
>
> Here is what I have and I can't pull any fields from Sequences or
> PackagesSequence objects/tables
>
> var $uses = array('Package','Sequence','PackagesSequence');
> $extra = array(
> 'recursive' => 1, //int
> 'fields' => array('Package.name', 'Sequence.name'), //array
> of field names
> );
>
>  $this->Package->find('all', $extra);
>
> I get an error that it doesn't know the Sequence table.  Thoughts?  Do I
> have to recode the associations already in the models?

you need to $this->Package->bindMode(...)

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: Run Queries Unrelated to Controller

2008-12-26 Thread Arthur Pemberton

On Fri, Dec 26, 2008 at 5:14 PM, Chad Casselman  wrote:
> I have a Controller for Jobs with a model Job.
>
> When I hit /jobs  (the index function of Job Controller), I need to run a
> query on 2 other tables (not joined to Job) to find values to manually
> insert into jobs before actually displaying the index.
>
> I have tried several things but can't seem to make any progress on this.
>
> Can anyone help me with this?
>
> 1) select fields from a join on customers and packages (complex conditions)

I believe you want to bind those models to each other [1]

> 2) iterate through results and insert/update values in job

Once you setup the appropriate bindings, you can do a find('all') on
them and iterate over the results of that. [2] may be clearer.

> 3) display jobs

I'm guessing that part already works with your index() action.

> Thank you in advance.
>
> Chad

[1] 
http://book.cakephp.org/view/86/Creating-and-Destroying-Associations-on-the-Fly
[2] http://book.cakephp.org/view/83/hasAndBelongsToMany-HABTM

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: problem with ACL...

2008-12-26 Thread Arthur Pemberton

On Fri, Dec 26, 2008 at 4:39 AM, vikas  wrote:
>
> Hi..
> I am learning cakephp myself and uptill now ACL is the tuffest topic..
> I am working on a project called TMS-Task Management System.
> In that
> There is groups table which has a entry like
> administrator,manager,developer,designer,client.
>
> And I have a users table. In which each user belongs to one of this
> group.
>
> I want to give limited access to each group of users. for example the
> users of client group can only see the tasks..
>
> so how to do entries in aro,aco and aro_aco tables?
> My tables are:
> -Groups
> -Users
> -Projects
> -tasks
> -attachments
> -comments
> -status


Assuming you follow this:
http://book.cakephp.org/view/641/Simple-Acl-controlled-Application

By the end of that tutorial, you should have set of AROs and a set of
ACOs. For each ARO of type 'Group' you want to associate it with one
or more ACOs using the aro_aco table.

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: Problem with CakePHP 1.2 recursive including content to page, big problem.

2008-12-21 Thread Arthur Pemberton
On Sun, Dec 21, 2008 at 2:44 AM, Petr Vytlačil  wrote:
>
> Hi i developing a application for my friends, i try this applicaton on
> two webhosting (on local and other) all go very fine, but when i
> uploaded application on webhosting my friends application show bad.
>
> My problem you can see on this url: http://www.pdreality.cz/, how you
> can see in content is show full page, its look like recursing include.
> If you want show in source output html, its look like very bad .-(
>
> There is source of my default layout:
>
>  www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> http://www.w3.org/1999/xhtml";>
> 
>
>
>
>
>
>PD Reality | 
>echo $html->meta('icon');
>echo $html->css('main');
>echo $html->css('jquery.lightbox.css');
>echo $scripts_for_layout;
>?>
>link('jquery.js'); ?>
>link('jquery.lightbox-0.5.pack.js'); ?>
> 
> 
>
>
>PD Reality
>element('topmenu');?>
>
>
>
>
>
>
>PD REALITY Vám 
> pomůže při prodeji
> nebo nákupu realit
>
>Naše realitní kancelář, Vám ráda 
> pomůže s prodejem nebo
> pronájmem Vaší reality.
>Pomůžeme Vám nalézt vhodné 
> bydlení, rekreační chatu nebo
> komerční prostory pro Vaše podnikání.
>Spotředkujeme Vám vhodný úvěr pro 
> financování nákupu vybrané
> nemovitosti.
>
>
>
>
>
>element('leftpanel');?>
>
>
>flash(); ?>
>
>
>
>element('rightpanel');?>
>
>
>
>
>Copyright (c) 2008 PD Reality - Realitní kancelář | 
> realizace:  href="http://www.4people.cz";>Webdesign 4People
>
>
>
> 
> 
>
> I tried show page only with blank default layout and in output is
> still in body tag is any h2.
> Im desperate, I dont know how solve this problem, on two webhosting
> application show good but on this no.
>

You may need to post your: /app/views/elements/leftpanel.ctp file.

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: A newbie question (I'm unable to find it answered)

2008-12-20 Thread Arthur Pemberton

On Sat, Dec 20, 2008 at 12:04 PM, ark0n3  wrote:
>
> Yes I've already accomplished it that way but it seems to me like a
> too low-level solution: CakePHP let us centralize models so I hope I
> could achieve the same result in the whole app.
> Is there no way to access the Helper classes?


Are you referring to things like

App:import('Helper', '{helper name here}')

or

ClassRegistry:init

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Question about Email component: Does it support 'POP before SMTP'?

2008-12-17 Thread Arthur Pemberton

Looks like I am going to need to use 'POP before SMTP' as that is what
my web hosts support (at least for code not running on the webserver,
such as my dev code).

Does the email component support this?

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: Email component parsing body to find headers?

2008-12-17 Thread Arthur Pemberton

On Wed, Dec 17, 2008 at 11:30 AM, caminante  wrote:
>
> Hello, I'm having a problem in which the Email component

This sucks so bar. For some reason I though Email wuld be a helper and
not a component.

Spent a few hours last night trying to get email to work properly,
only to find today that it had already been done in CakePHP :(


-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: Auth: Why has my user no access to this action?

2008-12-17 Thread Arthur Pemberton

On Wed, Dec 17, 2008 at 2:24 AM, Liebermann, Anja Carolin
 wrote:
>
> Hi Arthur,
>
> Thank you for your answer. I tackled my problem now in a kind I did hope I 
> didn't need.
>
> Instead of setting CRUD permissions for each controller and mapping the 
> actions to the CRUD options, I give now full permission to each action. That 
> seams to work.
>
> I wonder if $this->Auth->mapActions isn't working or if I used it the wrong 
> way.
>

Cool, I didn't use any CRUD my control myself.

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: Auth: Why has my user no access to this action?

2008-12-16 Thread Arthur Pemberton

On Tue, Dec 16, 2008 at 8:34 AM, Liebermann, Anja Carolin
 wrote:
>
> Another strange thing: my user has no rights to logout.
>
> Question: What are the proper permissions for the user controller? Do I have 
> to set the permissions for login and logout?
> I have heard here be some, who said never give permission to login, others 
> wrote, yes, do so.
>
> How are your permissions on users controller if you use Auth and ACL?
>
> Anja


I personally have a beforeFilter making login and logout pubic.
Tehcnically, only login needs to be public.


-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Capturing form errors

2008-12-10 Thread Arthur Pemberton

When using the form helper to bind controls to data, validation errors
are helpfully passed onto the page. How do I replicate this for custom
controlls (PHP in the views)?

Thank you.

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: How do I approach irc.freenode.net cakephp ??

2008-12-08 Thread Arthur Pemberton

On Mon, Dec 8, 2008 at 6:07 PM, xfhxfh <[EMAIL PROTECTED]> wrote:
>
> Hi,
> .. I was trying since half an hour but was not able to get close to
> cakephp @ irc.freenode.net
> like trying out irc.freenode.net/cakephp etc. in the addressvar of
> IExplorer
>
> What's the process ?


1. Install Firefox (http://www.mozilla.com/firefox/)
2. Install the Chatzilla addon for Firefox
(https://addons.mozilla.org/en-US/firefox/addon/16)
3. Restart Firefix (close then reopen)
4. Enter 'irc://irc.freenode.net/cakephp' in the Firefox location bar



-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: Getting all the acos a aro can access?

2008-12-02 Thread Arthur Pemberton

On Tue, Dec 2, 2008 at 3:00 AM, Tóth Imre <[EMAIL PROTECTED]> wrote:
> I did it in a brue force way:), so i am intersted in a smooth solution
> too.:)
>
> 2008/12/1 dr. Hannibal Lecter <[EMAIL PROTECTED]>
>>
>> I'd like to know this too.. I didn't get the time to look into it in
>> detail, but when I do and if I manage to find a solution I'll post it
>> here.
>>
>> On Nov 29, 11:35 am, gk <[EMAIL PROTECTED]> wrote:
>> > Hi there
>> >
>> > I'm trying to work out how to get all the access control objects an
>> > access request object can access - for example all the blog posts a
>> > user can edit. Can anybody point me in the right direction on how to
>> > do this? Thanks very much.


I used this myself, I don't think it's perfect, but suits my needs for now:


$this->Aco = ClassRegistry::init('Aco');

$this->Aco->bindModel(array(
'hasOne' => array(
'ArosAco',
'FilterAro' => array(
'className' => 'Aro',
'foreignKey' => false,
'conditions' => array(
'FilterAro.id = ArosAco.aro_id',
)
)
)
));

$selected = $this->Aco->find('all', array(
'recursive' => 0,
'fields' => array('Aco.id','Aco.alias'),
'conditions' => array(
'FilterAro.model' => $this->model,
'FilterAro.foreign_key' => $this->id
)
));

$this->acos = array();
foreach ($selected as $aco) $this->acos[ $aco['Aco']['id'] ] =
$aco['Aco']['alias'];


-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: Getting started with themes and static files

2008-11-29 Thread Arthur Pemberton

On Fri, Nov 28, 2008 at 12:04 AM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> If your looking for an easy content management system that you can
> easily extend upon you might wanna look at wildflower which is a cms
> built in cakephp
>
> wf.klevo.sk
>
> Good luck

Thanks, I really wasn''t looking for such a complete solution.

I have since found:
http://www.multimediadeveloper.net/paulherron/articles/view/managing_simple_pages_in_cakephp

It's just an implementation for what I already had in mind, and with a
few mods for CakePHP 1.2, I have got it working fairly nicely.

There is one big inefficiency still though, I build a (potentially)
massive regexp to pass to the router, is there a way to "catch" missed
Routes? Without interfering with MissingController?

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Chain off of Router

2008-11-27 Thread Arthur Pemberton

Is it possible chain of the Router to catch all routes that it can't resolve?

I know that it normally hands of to the Missing Controller if it can't
find a route.

I would like to insert a controller between these two, check against
my DB for a page, create the page if it is available, if not pass on
the request to the missing controller.

Thank you.

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: Getting started with themes and static files

2008-11-26 Thread Arthur Pemberton

On Wed, Nov 26, 2008 at 7:20 PM, Dan Bair <[EMAIL PROTECTED]> wrote:
>
> If you're going to be having a lot of static pages, it may be worth
> your while to use Cake's Folder and File objects. You can loop through
> the .ctp files assign the routes dynamically.
>
> Here's a quick snippet that will go through all of the .ctp files in
> the pages directory. This will be in app/config/routes.php
>
> App::import( 'Core', 'Folder' );
>$path = APP . 'views' . DS . 'pages' . DS;
>$files = new Folder( $path );
>$p = $files->find( '(.+)\.ctp' );
>foreach( $p as $file ){
>if( file_exists( $path . $file ) ){
>$tmp = str_replace( $path, '', substr( $file, 0, 
> (strlen
> ($file)-4) ) );
>Router::connect('/' . $tmp, array('controller' => 
> 'pages', 'action'
> => 'display', $tmp ));
>}
>}

This worked very well.

Thank you.

> Do note that this won't recursively get all of the files. You'll need
> to use the Folder::findRecursive method if you'll be using additional
> directories for your static pages.

All my static html should not go deeper than the root.

One additional question:

How troublesome would it be to have the 'pages' controller also check
the web root for .html files?

ie:

example.com/pagename -> WWW_ROOT.DS.$pagename.'.html' ?


-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Re: Getting started with themes and static files

2008-11-26 Thread Arthur Pemberton

On Wed, Nov 26, 2008 at 4:18 PM, James K <[EMAIL PROTECTED]> wrote:
>
> For static pages, just add them to views/pages/
>
> Name them with a .ctp extension
>
> You should be able to reach those pages by simply going to
> yourdomain.com/pages/staticpagename and it'll wrap that content in the
> default layout.


Is the process different to have them at the root of the website?
(Where I most if not all my static pages would need to be)


-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

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



Getting started with themes and static files

2008-11-26 Thread Arthur Pemberton

I'm just looking into CakePHP for a small website I need to build
(mostly static pages, but some logic with persistent data).

The screencasts and tutorials I have looked through so far provide
good starting information, but not much on making use of CakePHPs
themeing engine, and how it deals with static HTML files. Ideally, my
HTML files would also pass through the theming engine.

Just looking for links to reference/howto material.

Thank you.

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