paginator on multipled HABTM relations ?

2008-06-04 Thread Knud Soerensen

paginator on a sigle HABTM relation can be seen on
http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/

But Imagine that users can subscribe to categories
so: Product HABTM Category HABTM User
If we would like to paginate through the products in the users
categories how can this be done ???

The sql would be like
“select products.* from products,categories_products as
cp,users_categories as uc WHERE products.id=cp.product_id AND
cp.category_id=uc.category_id AND uc.user_id=$User[id]”

But how would one define the model ???



--~--~-~--~~~---~--~~
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: is this a bug ?

2008-05-23 Thread Knud Soerensen

Adam Royle wrote:
> I think this is fixed in more recent versions.
>
> Adam
>   
>
>
>
I am using


1.2.0.6311 beta.



> On May 24, 2:39 am, Knud Soerensen <[EMAIL PROTECTED]> wrote:
>   
>> I have a local cake site running onhttp://10.0.0.161/
>>
>> if I accesshttp://10.0.0.161/everything is fine
>>
>> if I accesshttp://10.0.0.161/users/login?testeverything is fine
>>
>> but if I access  http://10.0.0.161/?test
>>
>> cake says
>>
>> *Warning* (2) : strpos() [function.strpos 
>> <http://php.net/function.strpos>]: Empty delimiter 
>> [*CORE/cake1.2/dispatcher.php*, line *607*]
>>
>> Missing Controller
>>
>> *Error: * /TestController/ could not be found.
>>
>> *Error: * Create the class /TestController/ below in file:
>> crowdnews/controllers/test_controller.php
>>
>> How do i get cake to ignore everything after ? when 
>> accessinghttp://10.0.0.161/ ??
>> 
> >
>
>   


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



is this a bug ?

2008-05-23 Thread Knud Soerensen

I have a local cake site running on http://10.0.0.161/

if I access http://10.0.0.161/ everything is fine

if I access http://10.0.0.161/users/login?test everything is fine

but if I access  http://10.0.0.161/?test

cake says

*Warning* (2) : strpos() [function.strpos 
]: Empty delimiter 
[*CORE/cake1.2/dispatcher.php*, line *607*]


Missing Controller

*Error: * /TestController/ could not be found.

*Error: * Create the class /TestController/ below in file:
crowdnews/controllers/test_controller.php

How do i get cake to ignore everything after ? when accessing
http://10.0.0.161/  ??




--~--~-~--~~~---~--~~
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: Problem calling user controler from app controler.

2008-05-20 Thread Knud Soerensen

Filip Camerman wrote:
> Hi,
> The bit of code you pasted does give the impression that you have some
> things mixed up. For an example of simple user login, read
> http://book.cakephp.org/view/327/simple-user-authentication .
>
>   
The problem with the example is that it is to simple !

First I don't like the idea that the user gets redirected to
a login page, if he is not login.

I wan't every page to display a login bar if the user is not logged in.

Also I can't use the auth component because I use openid so
 my user model don't have a password field.

I seams to me that i would have to write my own auth component
to archive what I want or is the another way ??
> >
>
>   


--~--~-~--~~~---~--~~
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: Problem calling user controler from app controler.

2008-05-20 Thread Knud Soerensen

Ketan Patel wrote:
> Looks like you don't know what you are trying to do here. Read the
> manual. As you don't have a clue what a model and controller is. In
> your code, you are importing the User model and then calling the
> action of the users controller. On top of that, this is not the way to
> do whatever you are trying to do.
>   
I trying to let the user login from every page.

So, would you suggest that i move the user model into the app model ?


> On May 19, 6:16 pm, Knud Soerensen <[EMAIL PROTECTED]> wrote:
>   
>> In app_controler.php i have
>>
>> class appControler extends Controler
>> {
>>
>> function beforeFilter()
>> {
>> App::Import('Model','User');
>> $this->User=&new User();
>> $this->User->login();
>>
>> }
>> }
>>
>> But I get 2 simmilar looking warnings:
>> warning (2): pg_query() [function.pg-query] Query failed: ERROR: syntax
>> error at or near "login"
>> LINE 1: login
>>
>> and
>>
>> warning (512): SQL Error: ERROR: syntax error at or near "login"
>> LINE 1:  login
>>
>> What am i doing wrong ??
>> 
> >
>
>   


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



Problem calling user controler from app controler.

2008-05-19 Thread Knud Soerensen

In app_controler.php i have

class appControler extends Controler
{

function beforeFilter()
{
App::Import('Model','User');
$this->User=&new User();
$this->User->login();
}

}

But I get 2 simmilar looking warnings:
warning (2): pg_query() [function.pg-query] Query failed: ERROR: syntax
error at or near "login"
LINE 1: login

and

warning (512): SQL Error: ERROR: syntax error at or near "login"
LINE 1:  login


What am i doing wrong ??






--~--~-~--~~~---~--~~
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: 1.2 Documentation has made amazing progress

2008-05-09 Thread Knud Soerensen

Yes. The cookbook have added a lot of pages.
But there  is still 4 issues which should be addressed.


1) It is just too slow. Waiting 45s for a page to load is not good.
Someone need to take a look why this is happing.

2) Also I wish the structure was more cookbook like
with recipes which is small examples for doing different things.

3) When I am in coding-mode I like to disconnect from the distractions
on the internet,  so a way to download the full manual is needed.

The most practical way for me would be an apt source, which where update
with a daily snapshot. But a pdf would also be usable.

4) A search  function, or at leased add google site search.

keymaster wrote:
> I think it's time to change the initial knee-jerk reaction when
> speaking about cake's documentation.
>
> If I remember correctly, only 3-4 months ago there was something like
> 190 pages. Most of the new 1.2 features were either totally
> undocumented, or sparse at best.
>
> I just had a look today using a pdf created version of the 1.2
> cookbook. It currently weighs in at over 330 pages!
>
> We clearly have to recognize that the progress on these 1.2 docs over
> the last couple of months, has been nothing short of amazing.
>
> The 1.2 documentation is now, literally, light years better than it
> was just a few months ago.
>
> A couple of more months at this pace, with community members
> continuing to use the doc, post suggestions, amendments, fleshing out
> the stuff not yet documented, etc. and I believe we will have totally
> obliterated any lingering perception of the documentation being an
> "issue".
>
> Much appreciation to John Anderson, AD7-Six et al., for the great
> work. Let's all pitch in and submit something to the cookbook to help
> them.
> >
>
>   


--~--~-~--~~~---~--~~
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: Custom Login for Auth Component?

2008-04-29 Thread Knud Soerensen

BrendonKoz wrote:
> I'd really like to take advantage of CakePHP v1.2's Auth and ACL
> features, but our user authentication is not stored in a database that
> I have access to, it is only accessible via a SSL webservice call.
> This means that users will not initially have any related model data
> in the User model, and they will *never* have a related password.  I'd
> like to still use an action of login for the User model.  From what I
> can tell, the only ways I can do this are a bit hackish...which would
> be the best (or is there better)?
>
>   
I am working on site using openid and here it is the same problem.

Maybe the auth module should be rewritten to cover this situation before
1.2 is released.


Knud

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



forum plugin

2008-04-05 Thread Knud Soerensen

Do there exist a forum plugin for cakephp ??

I need a forum plugin which is easy to modify.
Does anyone know if there is on written with cakephp ??


--~--~-~--~~~---~--~~
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 says Query failed: ERROR: invalid input syntax for integer: ""

2008-03-29 Thread Knud Soerensen

hi 

I am a cakephp newbie writing my first cake controller.
I am using cakephp 1.2.0.6311 and postgresql.

I get the error

 
*Warning* (2) : pg_query() [function.pg-query 
]: Query failed: ERROR:  invalid input syntax 
for integer: "" [*CORE/cake1.2/libs/model/datasources/dbo/dbo_postgres.php*, 
line *123*]

Code  | Context 

$sql=   "INSERT INTO "time_zones" ("id","time_zone") VALUES 
('','Europe/Copenhagen')"


*Warning*: implode() [function.implode
]: Invalid arguments passed in
*/usr/share/php/cake1.2/libs/debugger.php* on line *497*

pg_query - [internal], line ??
DboPostgres::_execute() - 
CORE/cake1.2/libs/model/datasources/dbo/dbo_postgres.php, line 123
DboSource::execute() - CORE/cake1.2/libs/model/datasources/dbo_source.php, line 
155
DboSource::create() - CORE/cake1.2/libs/model/datasources/dbo_source.php, line 
499
Model::save() - CORE/cake1.2/libs/model/model.php, line 1220
UsersController::login() - APP/controllers/users_controller.php, line 58
Dispatcher::_invoke() - CORE/cake1.2/dispatcher.php, line 268
Dispatcher::dispatch() - CORE/cake1.2/dispatcher.php, line 240
[main] - APP/webroot/index.php, line 84

*Query:* INSERT INTO "time_zones" ("id","time_zone") VALUES
('','Europe/Copenhagen')

The problem is that id is defined as a postgresql serial type
which automatically generate a new id on insert.

 So, how does I stop cakephp from trying to insert '' into the id field ??



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