Re: HABTM with 3 tables

2006-08-04 Thread [EMAIL PROTECTED]

Hey henthoca,

Thanks for your posts, I pretty much understand your explanations and
I'll let you know how I get on.

Ryno

henthoca wrote:

> Whoops, I forgot to mention that each other model should have a hasMany
> relation with the JoinModel, and the JoinModel should belongTo each of
> the other three models.  I think I might have implied that, but better
> to explicitly come out and say it.
>
> I think this method would ideally allow for an n-way join table, not
> limited to 2 like the HABTM relations are.
>
> henthoca wrote:
> > I had ran into this situation a while back, trying to figure out how to
> > do a three-way join table.  I believe gwoo helped me figure out that it
> > was best to create an extra model that belonged to the other three
> > models, instead of trying to do crazy HABTM join querys.
> >
> > My three models were Resources (rooms), Users and Groups (permissions).
> >  Each user has a certain set of permissions per resource. Eg, User A is
> > an Teacher for Room A and a Student for Room B.  Then I made an extra
> > model ( I named mine GroupsResourcesUser ) to store just the primary
> > id's of each of the other three tables, and set all of those as the
> > primary key in my new table.
> >
> > This method lets you pick one side and see which other sides it has,
> > like pick a User and see for which Projects the User has each Role, or
> > pick a Project to see which Users have each Role for that Project, or
> > pick a Role to see which Users have that Role for each Project.
> >
> > For example, finding the Project-Role combinations for a particular
> > (maybe logged in) user, I'd set $this->User->recursive = 3; and just
> > use $this->User->findById($id); to get the data.  It'll be in the form,
> > $data['JoinModelName']['TargetModel1'] etc, so you should be able to
> > capture the relationships that way.
> >
> > It seems to work well enough for me. LMK if I need to explain it better
> > though.


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



Re: Providing arguments to element from view

2006-08-04 Thread half_brick

Ok got it going, seems you can call request action from a view just
fine.
Thanks very much for your help Samuel.
Cheers,
Toby


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



Re: Providing arguments to element from view

2006-08-04 Thread half_brick

Ok, but it is it possible to cal request action from the view?
Because I want to call a view/element and insert it into the page
multiple times but with different aguments (userid) each time.


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



Re: Comment in Simple User Authentication example is wrong

2006-08-04 Thread John Zimmerman [gmail]
https://trac.cakephp.org/ticket/1268On 8/4/06, John Zimmerman [gmail] <
[EMAIL PROTECTED]> wrote:Sorry.  Didn't catch the first part of the post.  I will submit the bug right now.
What was the hangup with submitting a ticket on trac?On 8/4/06, John Zimmerman [gmail]
 <[EMAIL PROTECTED]> wrote:

Do you mind submitting a ticket on http://trac.cakephp.org
?That way it gets on their todo lists.
On 8/3/06, ebourqui
 <[EMAIL PROTECTED]> wrote:


Not really a question, but a statement, since I couldn't submit a bugat 
trac.cakephp.org
;The comment in the Simple User Authentication section of the CakePHPmanual (as of 8/3/2006) is wrong. It says:
// Note: hopefully your password in the DB is hashed,// so your comparison might look more like:// md5($somone['User']['password']) == ...it should read:// Note: hopefully your password in the DB is hashed,
// so your comparison might look more like:// ... == md5($this->data['User']['password']))because $someone is the data pulled from the database, which wouldalready be hashed, whereas $this->data['User']['password'] is the data
from the form, which has not been hashed yet.





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


Re: Comment in Simple User Authentication example is wrong

2006-08-04 Thread John Zimmerman [gmail]
Sorry.  Didn't catch the first part of the post.  I will submit the bug right now.What was the hangup with submitting a ticket on trac?On 8/4/06, John Zimmerman [gmail]
 <[EMAIL PROTECTED]> wrote:
Do you mind submitting a ticket on http://trac.cakephp.org?That way it gets on their todo lists.
On 8/3/06, ebourqui
 <[EMAIL PROTECTED]> wrote:

Not really a question, but a statement, since I couldn't submit a bugat trac.cakephp.org
;The comment in the Simple User Authentication section of the CakePHPmanual (as of 8/3/2006) is wrong. It says:
// Note: hopefully your password in the DB is hashed,// so your comparison might look more like:// md5($somone['User']['password']) == ...it should read:// Note: hopefully your password in the DB is hashed,
// so your comparison might look more like:// ... == md5($this->data['User']['password']))because $someone is the data pulled from the database, which wouldalready be hashed, whereas $this->data['User']['password'] is the data
from the form, which has not been hashed yet.



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


Re: Wrong $html->checkbox() value

2006-08-04 Thread Grant Cox

The intended behaviour for the Html::checkbox is for you to provide the
model data, and optionally the checked value, and for the helper to
decide whether the checkbox is checked or not (rather than you manually
setting it so).  If you want to force the checkbox to be checked, it
would be preferable to set the model data as such.

However, it makes sense to be flexible on this, so I would suggest you
submit an enhancement ticket about this on trac (
https://trac.cakephp.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
-~--~~~~--~~--~--~---



Re: Websites vs. Web Applications

2006-08-04 Thread Grant Cox

Completely OT, but the header image doesn't appear in Firefox on that
site.

Samuel DeVore wrote:
> http://www.glicksmanlaw.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
-~--~~~~--~~--~--~---



Re: Providing arguments to element from view

2006-08-04 Thread Samuel DeVore
In cake speak a component is a class used to contain common code for many controllers, I'm not sure this is what you are talking abouthttp://manual.cakephp.org/chapter/9
  - components Is is possible you are thinking of a need for $this->requestAction ('/controller/action/',$params)referenced in the section on controllers? 
http://manual.cakephp.org/chapter/7Sam DOn 8/4/06, half_brick <[EMAIL PROTECTED]> wrote:
Cheers,I actually got that working just after I posted.What would be even more useful, and what I probably should have asked
to start with is how do you provide parameters from the view through tothe component?At the moment I have access to the parameters at the view, but I'drather pass the user id down to the component, get the component to get
the relevant data on the user and then render the view.Is that different call than renderElement?

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


Re: Providing arguments to element from view

2006-08-04 Thread half_brick

Cheers,
I actually got that working just after I posted.
What would be even more useful, and what I probably should have asked
to start with is how do you provide parameters from the view through to
the component?
At the moment I have access to the parameters at the view, but I'd
rather pass the user id down to the component, get the component to get
the relevant data on the user and then render the view.
Is that different call than renderElement?


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



Re: Providing arguments to element from view

2006-08-04 Thread Samuel DeVore
According to the api  renderElement takes two parameters
you could try this$params['user_id'] = $user_id;echo $this->renderElement('user_box', $params);and in the element look for it(hint it will be $user_id ;)Sma D
On 8/4/06, half_brick <[EMAIL PROTECTED]> wrote:
Hi,I'm trying to pass some arguments into an element from a view.Basically, I'm rendering comments in a view and want to pass the useridof the comment to the element/component so that for every comment the
userinformation and avatar is shown.Currently im trying to pass in the userid in the renderElement call.But I can't seem to get it back out in the startup method of thecomponent.My code is as follows
in the view I call: echo $this->renderElement('user_box', $user_id, $params);and in the userbox I've tried so many different ways to get hold ofthat $user_id parameter.If someone could tell me how to get it, my problems would be solved.
Cheers
--~--~-~--~~~---~--~~
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  -~--~~~~--~~--~--~---


Providing arguments to element from view

2006-08-04 Thread half_brick

Hi,
I'm trying to pass some arguments into an element from a view.
Basically, I'm rendering comments in a view and want to pass the userid
of the comment to the element/component so that for every comment the
userinformation and avatar is shown.
Currently im trying to pass in the userid in the renderElement call.
But I can't seem to get it back out in the startup method of the
component.

My code is as follows

in the view I call:
 echo $this->renderElement('user_box', $user_id, $params);

and in the userbox I've tried so many different ways to get hold of
that $user_id parameter.
If someone could tell me how to get it, my problems would be solved.
Cheers


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



Re: newbie:othAuth: how to login from a page with a non Admin group?

2006-08-04 Thread gmwebs

Hi,

I am also having this problem... I can login with Admin and everything
works, but as soon as I try with a user I created, it just sits there
and does nothing after clicking login.

Any news on this?

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



ajax help. RequestHandler is making me crazy

2006-08-04 Thread salimk786

//post.thtml


formTag('/blogs/viewPost/' , 'get'); ?>
Title:
URL:

submit('Submit');
else
echo $ajax->submit('Submit', array('url' => 'viewPost',
'update'=>'ajax_update', 'loading' => "Element.show('".
$pagination->domId ."');", 'complete' =>
"Element.hide('".$pagination->domId ."');", 'method' =>'get'));
?>

domId = 'loading';?>
image('xppc/spinner.gif',array('align'=>'texttop'))?>



Title:
Description:
URL:link($data['Post']['url'], $data['Post']['url']);?>

style == 'ajax')
echo $ajax->link('Delete Post', 
'/blogs/deletePost/' .
$data['Post']['id'], array('update'=>'ajax_update', 'after' => 'new
Effect.Fade(\'done_' . $data['Post']['id'] . '\');'));
else
echo $html->link('Delete Post', 
'/blogs/deletePost/' .
$data['Post']['id']);
?>




//Controller: blogs


function deletePost($id=null)
{
//PostID ($id) is invalid.
if (empty($this->params['form']))
{
$this->Post->id= $id ;
$data = 
$this->Post->find($criteria="account_id='" . $account_id .
"' and Post.id = '" . $id . "'");
$this->set('data', $data);
$this->set('id', $id);
$this->render();
}
else
{
if 
(!empty($this->params['form']['cancel']))
{

$this->redirect('/blogs/viewPost/');
}
else
{
_deletePost($id);

$this->redirect('/blogs/viewPost/');
}
}
}
function _deletePost($id=null)
{
$this->Post->id= $id ;
$data = 
$this->Post->find($criteria="account_id='" . $account_id .
"' and Post.id = '" . $id . "'");
if (!empty($data))
{
$this->Post->del($id);
$this->Comment->query("delete from 
keywords where post_id = '" .
$id . "'");
return true;
}
else
{
return false;
}
}




//things i've tried:
if($this->RequestHandler->isAjax())
{
$this->autoRender=false;
}
//things i've tried:
if($this->RequestHandler->isAjax())
{
$this->layout="ajax";
}
// Can you show me where either one of those two go in the above code
or is there a different way to make this baby work ?

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



Re: Comment in Simple User Authentication example is wrong

2006-08-04 Thread John Zimmerman [gmail]
Do you mind submitting a ticket on http://trac.cakephp.org?That way it gets on their todo lists.On 8/3/06, ebourqui
 <[EMAIL PROTECTED]> wrote:
Not really a question, but a statement, since I couldn't submit a bugat trac.cakephp.org;The comment in the Simple User Authentication section of the CakePHPmanual (as of 8/3/2006) is wrong. It says:
// Note: hopefully your password in the DB is hashed,// so your comparison might look more like:// md5($somone['User']['password']) == ...it should read:// Note: hopefully your password in the DB is hashed,
// so your comparison might look more like:// ... == md5($this->data['User']['password']))because $someone is the data pulled from the database, which wouldalready be hashed, whereas $this->data['User']['password'] is the data
from the form, which has not been hashed yet.

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


Has anybody baked some trackback?

2006-08-04 Thread anarchitect

There seems to be no documentation of the use of trackback with Cake.
Has anybody some experience with it? Any hints/advice? Can anybody
suggest a library that works well with Cake? Thanks for any help.


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



Re: Pages Controller Subpages

2006-08-04 Thread John Zimmerman [gmail]
Gwoo answered my question on IRC.Here it is for anyone interested (was sort of obvious after he stated it).For static sub pages just create a subdirectory in your /app/views/pages directory.So if I wanted a page with url 
http://example.com/pages/about/companyThe path for that would be /app/views/pages/about/company.thtmlKind of a basic question but hope it helps someone else.
On 8/3/06, John Zimmerman [gmail] <[EMAIL PROTECTED]> wrote:
In the code for the pages controller there are variables there for subpages.Is anyone using static subpages with the pages controller?I browsed around for documentation about it, but came up empty.




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


weird autocomplete styling problem...

2006-08-04 Thread ax0rz

Hey. I've got an autocomplete form that works great... the problem is
that the div.auto_complete is overriding certain stylings. I'm able to
set the background color, border etc, but everytime the div is
populated, it changes the style to "position: absolute; left: 80px;
top: 22px; width: 146px; opacity: 0.99; display: none;" (copy-paste
from the DOM inspector). It's damn weird Can anyone explain why
this is happening, and how I can change its styling?? :P

Look at
http://rapidshare.de/files/28163747/weird-looking-autocomplete.gif.html
for a screenshot!


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



Re: Wrong $html->checkbox() value

2006-08-04 Thread Chowsapal

All I know is that it works great if you set the value to 1 and checked
to your database boolean value.  The hidden value doesn't seem to mess
with anything.  It's clearly intentional if you look at the code for
the checkbox.  It checks for certain HTML attributes and works with
them.


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



Re: Special characters from the model and str_replace()

2006-08-04 Thread anarchitect

Great. Thanks a lot.


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



Re: Re: Special characters from the model and str_replace()

2006-08-04 Thread Samuel DeVore

I uploaded the latest version to the cakeforge site

http://cakeforge.org/projects/tmbundle/

look in files,


Also you can get it from the macromates svn repository for bundles

see http://www.macromates.com/textmate/manual/bundles#getting_more_bundles

the cake bundle is

CAKE.bundle

surprisingly enough.  if you have a problem getting it send me an email


Sam D
On 8/4/06, anarchitect <[EMAIL PROTECTED]> wrote:
>
> I have read about your bundle, but i havent tested it, yet .. wasnt it
> requiring some software repository check out process ;)
>
> Do you have a link or someting? 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
-~--~~~~--~~--~--~---



Re: Two CakePHP Newbie Qs

2006-08-04 Thread Felix Geisendörfer




Wordpress scheme isn't bad. But you need to be aware of the fact that
you are using
a non-primary key as your unique identifier. In the comments to the
post mentioned
by nate, tomo pointed out the possibility of using an url like:
/posts/view/1/my-post-slug.
This way your url's will stay consistent even if the post slug changes,
but you still have the
buzz words for the SE's in the url.

Best Regards,
Felix Geisendörfer aka the_undefined
--
http://www.thinkingphp.org
http://www.fg-webdesign.de



anarchitect wrote:

  I have read this post also and i think the way Wordpress handles slugs
is quite alright and better than numbers - imho: Lock the slug
according to the first title. If the title will change the old slug
will still do its job, since the content of the page won't change that
dramatically.




  


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





Re: Special characters from the model and str_replace()

2006-08-04 Thread Chris Hartjes

Where can you get the CakePHP bundle?  I'm a TextMate user too...

On 8/4/06, Samuel DeVore <[EMAIL PROTECTED]> wrote:
> TextMate does rock, are you using the CakePHP bundle?  It's written by some
> old fart but it is pretty cool
>
> Sam D
>
> ps I am the old fart ;)
>
>
> On 8/4/06, anarchitect <[EMAIL PROTECTED]> wrote:
> >
> > I have read about that also, but my current editor - TextMate -
> > doesnt do that kind of thing ;)
> >
> > I was just not aware that Cake was trying to be friendly - creating
> > html entities on the fly - while this seems to cause problems in a
> > UTF-8 setting. After all it is not necessary.
> >
> >
> >
> >
> > > >
> >
>


-- 
Chris Hartjes

"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

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



Re: Special characters from the model and str_replace()

2006-08-04 Thread anarchitect

I have read about your bundle, but i havent tested it, yet .. wasnt it
requiring some software repository check out process ;)

Do you have a link or someting? 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
-~--~~~~--~~--~--~---



Re: Special characters from the model and str_replace()

2006-08-04 Thread Samuel DeVore
TextMate does rock, are you using the CakePHP bundle?  It's written by some old fart but it is pretty coolSam Dps I am the old fart ;)On 8/4/06, 
anarchitect <[EMAIL PROTECTED]> wrote:
I have read about that also, but my current editor - TextMate -doesnt do that kind of thing ;)I was just not aware that Cake was trying to be friendly - creatinghtml entities on the fly - while this seems to cause problems in a
UTF-8 setting. After all it is not necessary.

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


Re: Special characters from the model and str_replace()

2006-08-04 Thread anarchitect

I have read about that also, but my current editor - TextMate -
doesnt do that kind of thing ;)

I was just not aware that Cake was trying to be friendly - creating
html entities on the fly - while this seems to cause problems in a
UTF-8 setting. After all it is not necessary.


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



Re: Special characters from the model and str_replace()

2006-08-04 Thread Samuel DeVore
So now I have to admint I haven't been reading this thread at all, and I have no experience with this particular problem.  But when I was helping someone track down some problems with jpGraph and cake.  we were having problems with encoding of the resulting image.  It turned out that a couple of the files had BOM settings that were differenet then what we were trying to output and it was getting cakephp/ php and apache all confused.  After stripping BOMs from all the files we had better luck
Sam DOn 8/4/06, anarchitect <[EMAIL PROTECTED]> wrote:
Now the phenomenon gets clearer, i am still in clueless state, though.Getting data in a regular fashion from models to the views via the$this->set('var', $this->Post->findAll(null,null,'Post.created
 DESC'));seems to work.But if i want to display stuff within a view from other models encodingseems to get treated differently. The two cases that i am stumblingabout right now are components/elements and associated models - in my
case a tag model via hasAndBelongsToMany. Umlaut-characters are shownscrewed up.Does anybody has any insight where the difference might lie? Thanksagain.
--~--~-~--~~~---~--~~
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  -~--~~~~--~~--~--~---


Re: Two CakePHP Newbie Qs

2006-08-04 Thread anarchitect

I have read this post also and i think the way Wordpress handles slugs
is quite alright and better than numbers - imho: Lock the slug
according to the first title. If the title will change the old slug
will still do its job, since the content of the page won't change that
dramatically.


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



Re: Special characters from the model and str_replace()

2006-08-04 Thread anarchitect

Okay. Finally, i got it. My speculation from the last post are way off.
The problems occurred when i used html->link() without disabling
html-encoding/escaping. Adding "false" as the 5th parameter everytime
solves all my special character problems. Thanks for you guys' patience.


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



Re: Special characters from the model and str_replace()

2006-08-04 Thread anarchitect

Now the phenomenon gets clearer, i am still in clueless state, though.

Getting data in a regular fashion from models to the views via the
$this->set('var', $this->Post->findAll(null,null,'Post.created DESC'));
seems to work.

But if i want to display stuff within a view from other models encoding
seems to get treated differently. The two cases that i am stumbling
about right now are components/elements and associated models - in my
case a tag model via hasAndBelongsToMany. Umlaut-characters are shown
screwed up.

Does anybody has any insight where the difference might lie? Thanks
again.


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



Re: SQL helpers for MAX(foo) and MIN(foo)

2006-08-04 Thread Chris Hartjes

On 8/4/06, nate <[EMAIL PROTECTED]> wrote:
>
> Sory, the second parameter in the above should be "MAX(s_date) AS
> s_date".  Either will work, but this makes the resulting array key a
> little more friendly.

Nate,

Thanks for the tip, the code looks better now. :)

-- 
Chris Hartjes

"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

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



Re: Two CakePHP Newbie Qs

2006-08-04 Thread nate

The thing to remember about title-based URL's is that (a) they could
theoretically conflict, and (b) your URL breaks when the title changes,
unless you feel like devising a needlessly intricate system for mapping
the old URLs to the new ones.

Felix Geisendörfer wrote a great post on the subject recently, which
you can see at
http://www.thinkingphp.org/2006/08/02/bye-bye-friendly-urls/


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



Re: Two CakePHP Newbie Qs

2006-08-04 Thread anarchitect

To question #1: Graham Bird has on his site a little tutorial that
introduces "slugs" or (clean titles for the url) to your cake app:

http://grahambird.co.uk/cake/tutorials/slugs.php

He doesnt cover how those are created though. I have put my slug()
function into the AppModel (cake/app/app_model.php) so that it is
available in every model. It transforms German umlaute into their
non-umlaut counterparts - maybe you'd like to add more rules.

function slug($string)
{
$slug = strtolower($string);
$umlaute = array("ä", "Ä", "ü", "Ü", "ö", "Ö", "ß");
$replace = array("ae", "ae", "ue", "ue", "oe", "oe", "ss");
$slug = str_replace($umlaute, $replace, $slug);
$slug = preg_replace("/\W/", "", $slug);
return $slug;
}


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



Re: Two CakePHP Newbie Qs

2006-08-04 Thread nate

(1) Check out this great tutorial:
http://www.grahambird.co.uk/cake/tutorials/slugs.php

(2) In app/webroot/index.php, there is a define called
CAKE_CORE_INCLUDE_PATH which you can modify to point to where your Cake
core is installed (i.e. /usr/local/web/cake).  This folder should
contain your /cake core directory, and your root /vendors directory.

As an added bonus, any JavaScript files in /vendors/js will be
accessible to all your applications just like if they were in
webroot/js; same with webroot/css, mapping to /vendors/css.


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



Re: SQL helpers for MAX(foo) and MIN(foo)

2006-08-04 Thread nate

Sory, the second parameter in the above should be "MAX(s_date) AS
s_date".  Either will work, but this makes the resulting array key a
little more friendly.


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



Re: SQL helpers for MAX(foo) and MIN(foo)

2006-08-04 Thread nate

Yup, there is.  First of all, let me point out that findBySql( ) has
been deprecated in favor of query( ).

In any case, you could rewrite the above using find( ) as follows:
$foo = $this->Stat->find(null, "MAX(s_date)");


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



Re: newbie:othAuth: how to login from a page with a non Admin group?

2006-08-04 Thread Siegfried Hirsch

If I remember right, this is a bug in the othAuth module.
We have debugged it and found, that all user other than
admin are not handled.

Sorry, I am in a hurry, but I can post our solution.

Siegfried

2006/8/4, michele <[EMAIL PROTECTED]>:
>
> Hello,
>
> I installed othAuth on my CakePhp app,  and I have configured two
> groups in my application: admin (group id=1) and member (group id=2).
>
> I have the following problem: in the login page I can only
> login with the Admin user, if i try to login with a member user
> I receive the message wrong user/password, even if the password
> is 123456 like the Admin.
>
> I read that i should set in the login page group id=2 so users from
> the groups 1 and 2 can login from this page, but i don't know
> how to do it.
>
> Has anyone a *.thtml example?
>
> Thanks,
>
> Michele
>
>
> >
>


-- 
Siegfried Hirsch
http://www.rss-blogger.de / http://seconds11.com
http://www.newsbee.de NewsBee 2.0 - customized RSS solutions
https://www.openbc.com/net/sxsw/ - Forum zum Thema Social Software

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



newbie:othAuth: how to login from a page with a non Admin group?

2006-08-04 Thread michele

Hello,

I installed othAuth on my CakePhp app,  and I have configured two
groups in my application: admin (group id=1) and member (group id=2).

I have the following problem: in the login page I can only
login with the Admin user, if i try to login with a member user
I receive the message wrong user/password, even if the password
is 123456 like the Admin.

I read that i should set in the login page group id=2 so users from
the groups 1 and 2 can login from this page, but i don't know
how to do it.

Has anyone a *.thtml example?

Thanks,

Michele


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



Re: Wrong $html->checkbox() value

2006-08-04 Thread davide
Chowsapal wrote:
> 
> Try $html->checkbox('Member/inlist', null, array('value' => 1,
> 'checked' => $members['Member']['inlist']))
> 
> The value => 1 just indicates what value you want to use for true.

The problem is that when I don't specify attributes, the checkbox
automatically render the value="1". Instead, when I specify even only
one attribute, the value attribute is not rendered anymore. I have to
specify by my hand.

I don't know if this is a bug, or if it's wanted that the helpers works
in this way.

However, If I specify the value everything is fine.

Bye
D.






signature.asc
Description: OpenPGP digital signature


SQL helpers for MAX(foo) and MIN(foo)

2006-08-04 Thread Chris Hartjes

I have an application where I need to get the maximum value out of a
table.  Right now I'm using the following:

$foo = $this->Stat->findBySql("SELECT MAX(s_date) AS s_date FROM stats");
$s_date = $foo[0][0]['s_date'];

Is there a better, more elegant way to do this?

-- 
Chris Hartjes

"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

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



Re: HABTM with 3 tables

2006-08-04 Thread henthoca

Whoops, I forgot to mention that each other model should have a hasMany
relation with the JoinModel, and the JoinModel should belongTo each of
the other three models.  I think I might have implied that, but better
to explicitly come out and say it.

I think this method would ideally allow for an n-way join table, not
limited to 2 like the HABTM relations are.

henthoca wrote:
> I had ran into this situation a while back, trying to figure out how to
> do a three-way join table.  I believe gwoo helped me figure out that it
> was best to create an extra model that belonged to the other three
> models, instead of trying to do crazy HABTM join querys.
>
> My three models were Resources (rooms), Users and Groups (permissions).
>  Each user has a certain set of permissions per resource. Eg, User A is
> an Teacher for Room A and a Student for Room B.  Then I made an extra
> model ( I named mine GroupsResourcesUser ) to store just the primary
> id's of each of the other three tables, and set all of those as the
> primary key in my new table.
>
> This method lets you pick one side and see which other sides it has,
> like pick a User and see for which Projects the User has each Role, or
> pick a Project to see which Users have each Role for that Project, or
> pick a Role to see which Users have that Role for each Project.
>
> For example, finding the Project-Role combinations for a particular
> (maybe logged in) user, I'd set $this->User->recursive = 3; and just
> use $this->User->findById($id); to get the data.  It'll be in the form,
> $data['JoinModelName']['TargetModel1'] etc, so you should be able to
> capture the relationships that way.
>
> It seems to work well enough for me. LMK if I need to explain it better
> though.


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



Re: Wrong $html->checkbox() value

2006-08-04 Thread Chowsapal

Try $html->checkbox('Member/inlist', null, array('value' => 1,
'checked' => $members['Member']['inlist']))

The value => 1 just indicates what value you want to use for 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
-~--~~~~--~~--~--~---



Re: HABTM with 3 tables

2006-08-04 Thread henthoca

I had ran into this situation a while back, trying to figure out how to
do a three-way join table.  I believe gwoo helped me figure out that it
was best to create an extra model that belonged to the other three
models, instead of trying to do crazy HABTM join querys.

My three models were Resources (rooms), Users and Groups (permissions).
 Each user has a certain set of permissions per resource. Eg, User A is
an Teacher for Room A and a Student for Room B.  Then I made an extra
model ( I named mine GroupsResourcesUser ) to store just the primary
id's of each of the other three tables, and set all of those as the
primary key in my new table.

This method lets you pick one side and see which other sides it has,
like pick a User and see for which Projects the User has each Role, or
pick a Project to see which Users have each Role for that Project, or
pick a Role to see which Users have that Role for each Project.

For example, finding the Project-Role combinations for a particular
(maybe logged in) user, I'd set $this->User->recursive = 3; and just
use $this->User->findById($id); to get the data.  It'll be in the form,
$data['JoinModelName']['TargetModel1'] etc, so you should be able to
capture the relationships that way.

It seems to work well enough for me. LMK if I need to explain it better
though.


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



Re: Special characters from the model and str_replace()

2006-08-04 Thread anarchitect

Wow that really is helpful. I also think we should put it into the
wiki.

The only thing: it doesn't seem to solve my problem: while the regular
views get utf-8 right now - with your method as well as others - the
component/element can't handle special characters.

If you guys dont mind, i will just paste the component and element,
maybe i have overlooked something.

controller = &$controller;
$Post = new Post;   // hmm?
$data = $Post->findAll(
null,
null,
'Post.modified DESC',
3
);
$this->controller->set('RecentPosts',$data);
}
}
?>





Latest Posts!



link($Post['Post']['title'],
"/posts/view/{$Post['Post']['slug']}")?>





timeAgoInWords($Post['Post']['created'])?>





Using the php header command in the element doesnt work either.

Thanks a bunch for all the help from all you guys and maybe further
clues in regard to this.


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



Re: Special characters from the model and str_replace()

2006-08-04 Thread [EMAIL PROTECTED]

I've had frustrating encoding problems in PHP before, some still
persisting on my site because  I could not fully resolve them. Your
post here is extremely helpful! I was not aware of all those setup
options.

The encoding problems in PHP have, of course, been widely excoriated.
>From your post it seems that adequate documentation could make a big
difference.

Could you try posting that on the PHP web site?

Thanks again.

meek wrote:
> These are the things I do to make sure I can work consistently with
> UTF-8.
>
> 1) Make sure that the MySQL server and your database and all tables
> within it are configured to store and output strings as UTF-8.
>
> 2) Make sure that the MySQL connection from CAKE is configured for
> UTF-8 encoding. I do this in an overriden constructor in
> app/app_model.php:
>
> function __construct()
> {
> parent::__construct();
> $this->execute("SET NAMES 'UTF8'");
>  }
>
> - I got this from an earlier discussion in this group I think. It made
> the real difference for me.
>
> 3) Set the encoding for all your views as UTF-8 using the PHP header
> command. At the moment I do this right at the top of my layouts - it
> needs to go in somewhere before anything else is rendered:
>
> 
>
>
> 4) Set the charset in HTML using the HTMLHelper although I don't think
> this is so important:
>
> charset('utf-8')?>
>
> 5) Make sure all your .php and .thtml files are UTF-8 encoded. Eclipse
> and JEdit both do this fine and consistently.
>
> - str_replace seems to work for me if I do all that (in PHP4) - I don't
> use the multibyte functions.


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



Re: controller:flash not redirecting?

2006-08-04 Thread ryanb006

If you have DEBUG turned on (1, 2, 3), you have to click the message to
continue. If DEBUG is 0, flash automatically redirects.

Ryan


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



Re: Two CakePHP Newbie Qs

2006-08-04 Thread Bert Van den Brande

For question 1, yes I think it's possible if you route all news/* to a
controller and action, for example NewsController and displayAction()
.

If I'm right, all parameters after news/ will be provided to the
display function as a parameter, making you function look like this :
NewsController::displayAction($sanitizedTitle)

Of course you will need to perform the lookup by sanitized title yourself

For 2, I think you'd best have a look at the advanced section of this
page : http://manual.cakephp.org/chapter/3

On 8/4/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> 1. While it is great Cake has static URLs out of the box, can I make
> Cake use static URLs of this form:
>
> http://www.site.com/news/my-news-article/
>
> ... as opposed to the default static URL of...
>
> http://www.site.com/news/1/
>
> ?
>
>
> 2. I am playing around with Cake in a development environment now, but
> when I start using Cake in my production environment can I setup Cake
> to run off one install and then have many webroot and app folders (one
> for each site) in different locations? This way I can have one Cake
> install and many different web sites using that same install, or do I
> have to install Cake for each web site?
>
>
> Thanks in advance for the help.
>
>
> >
>

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



Re: Deployment

2006-08-04 Thread MJ Ray

On 2006-08-04 12:52:58 +0100 [EMAIL PROTECTED] <[EMAIL PROTECTED]> 
wrote:

> Simply FTPing the local copy of the subversion repository to the
> production server gets to be a pain. [...]

Why?  If you use a FTP mirror tool that can do incremental updates 
(sitecopy or rsync over one of the fuse FTP filesystems...), it seems 
fairly painless to me and I think using rsync with a Makefile would 
make all of your wishlist fairly easy.

Of course, you should use SFTP or ftp over SSL or similar for security 
these days, but lots of web hosting providers don't support it.  
UKHosts and dreamhost do, as far as I can tell (so at least on their 
Linux servers).

Hope that helps,
-- 
MJ Ray <[EMAIL PROTECTED]>  www.ttllp.co.uk  +44 870 4321 9 10
Web, localisation, koha, databases, gnu/linux and statistics
Registered in England and Wales, partnership number OC303457

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



Wrong $html->checkbox() value

2006-08-04 Thread davide
I've noticed that if I specify an array of htmlAttributes for the
$html->checkbox, the "value" attribute is not rendered anymore. I have
to specify it by hand in the array. Otherwise, i I don't use the
htmlAttributes array, everything is rendered right. Here some usage example:

checkbox("Member/inlist",null,array("checked"=>"checked","value"=>"1"))?>

will render




*
checkbox("Member/inlist",null,array("checked"=>"checked"))?>

will render




*

checkbox("Member/inlist")?>

will render




Cake version: 1.1.6.3264
php version: 4.4.0
apache version: 2.0.54

I've searched in the track but I didn't find this problems? Do you have
this behaviour too? Do you think this is a right behaviour? Do I have to
open a ticket?

Thanks in advance
Davide

-- 
By the power of Greyskull...



signature.asc
Description: OpenPGP digital signature


HABTM with modfication date + realted data

2006-08-04 Thread [EMAIL PROTECTED]

Hi,

I want to save related data (create date, update date, comment) for
HBTM associated tables. Do I have to create my own SQL-Statement to get
this data or is there already something in cakephp that I could use
for?

the tables look like this
###

CREATE TABLE `companies` (
`id` int(11) NOT NULL auto_increment,
`name` text,
`searchname` text,
`orgform` text,
`street` text,
`zip` text,
`town` text,
`state` text,
`country` text,
PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

CREATE TABLE `members` (
`id` int(11) NOT NULL auto_incremen ,
`abbreviation` varchar(64) default NULL,
`name` varchar(128) default NULL,
PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

CREATE TABLE `companies_members` (
`company_id` int(11) NOT NULL default '0',
`member_id` int(11) NOT NULL default '0',
`joined_at` date default NULL,
`left_at` date default NULL,
PRIMARY KEY  (`company_id`,`member_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1


Does anybody know how I could solve this issue or could point me to a
page where I could get the appropriate info.

Thanks in advance
derkaan


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



Two CakePHP Newbie Qs

2006-08-04 Thread [EMAIL PROTECTED]

1. While it is great Cake has static URLs out of the box, can I make
Cake use static URLs of this form:

http://www.site.com/news/my-news-article/

... as opposed to the default static URL of...

http://www.site.com/news/1/

?


2. I am playing around with Cake in a development environment now, but
when I start using Cake in my production environment can I setup Cake
to run off one install and then have many webroot and app folders (one
for each site) in different locations? This way I can have one Cake
install and many different web sites using that same install, or do I
have to install Cake for each web site?


Thanks in advance for the help.


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



Deployment

2006-08-04 Thread [EMAIL PROTECTED]

Hi all - I was wondering if any Cake developers out there have any good
suggestions on how to deploy a Cake-based web app.  Here's the
development scenario:
 - multiple developers developing on their local machines
 - all files in a subversion repository
 - the app needs to be deployed to a client's hosted web server

Simply FTPing the local copy of the subversion repository to the
production server gets to be a pain.  Most hosted web servers don't
have a subversion client so we can't simply keep a working copy on the
production server.

Ideally, a deployment system (for our uses anyway) would have the
following capabilities:
 - sync the remote copy with the local copy (add/modify/delete files as
necessary)
 - only perform adds/modifies/deletes (don't simply copy all local
files to remote server)
 - ignore certain directories on the local machine (like .svn folders)
 - specify alternate versions of certain files to put on the remote
machine (like a different database.php file for local and remote
machines, files with different web services API keys for
http://localhost and http://www.site.com, specialized .htaccess files
for remote machine, etc)
 - specify permissions for certain files/folders on the remote machine
(make app/tmp writable recursively)
 - would also be nice to sync the remote database with the local one

What tools are other Cake developers using to handle deployment to a
production server?


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



Re: Special characters from the model and str_replace()

2006-08-04 Thread Bert Van den Brande

Hmm ok tnx, I'll retry the Eclipse problem tonight ...

On 8/4/06, meek <[EMAIL PROTECTED]> wrote:
>
> These are the things I do to make sure I can work consistently with
> UTF-8.
>
> 1) Make sure that the MySQL server and your database and all tables
> within it are configured to store and output strings as UTF-8.
>
> 2) Make sure that the MySQL connection from CAKE is configured for
> UTF-8 encoding. I do this in an overriden constructor in
> app/app_model.php:
>
> function __construct()
> {
> parent::__construct();
> $this->execute("SET NAMES 'UTF8'");
>  }
>
> - I got this from an earlier discussion in this group I think. It made
> the real difference for me.
>
> 3) Set the encoding for all your views as UTF-8 using the PHP header
> command. At the moment I do this right at the top of my layouts - it
> needs to go in somewhere before anything else is rendered:
>
> 
>
>
> 4) Set the charset in HTML using the HTMLHelper although I don't think
> this is so important:
>
> charset('utf-8')?>
>
> 5) Make sure all your .php and .thtml files are UTF-8 encoded. Eclipse
> and JEdit both do this fine and consistently.
>
> - str_replace seems to work for me if I do all that (in PHP4) - I don't
> use the multibyte functions.
>
>
> >
>

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



Re: $this->redirect('/') not working :(

2006-08-04 Thread olle

Come to think of it, you could remove the final ?> as well.

PHP can parse files that do not end in ?>. And without the final ?> you
can never output accidental whitespace.

Here is what the PHP manual says:

Note: The closing tag of a PHP block at the end of a file is optional,
and in some cases omitting it is helpful when using include() or
require(), so unwanted whitespace will not occur at the end of files,
and you will still be able to add headers to the response later. It is
also handy if you use output buffering, and would not like to see added
unwanted whitespace at the end of the parts generated by the included
files.

http://www.php.net/manual/en/language.basic-syntax.instruction-separation.php

Cheers,
   Olle


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



Re: Special characters from the model and str_replace()

2006-08-04 Thread meek

These are the things I do to make sure I can work consistently with
UTF-8.

1) Make sure that the MySQL server and your database and all tables
within it are configured to store and output strings as UTF-8.

2) Make sure that the MySQL connection from CAKE is configured for
UTF-8 encoding. I do this in an overriden constructor in
app/app_model.php:

function __construct()
{
parent::__construct();
$this->execute("SET NAMES 'UTF8'");
 }

- I got this from an earlier discussion in this group I think. It made
the real difference for me.

3) Set the encoding for all your views as UTF-8 using the PHP header
command. At the moment I do this right at the top of my layouts - it
needs to go in somewhere before anything else is rendered:




4) Set the charset in HTML using the HTMLHelper although I don't think
this is so important:

charset('utf-8')?>

5) Make sure all your .php and .thtml files are UTF-8 encoded. Eclipse
and JEdit both do this fine and consistently.

- str_replace seems to work for me if I do all that (in PHP4) - I don't
use the multibyte functions.


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



Re: Install Location / Path problem

2006-08-04 Thread Aldo

Thanks a lot!
That works.

Aldo


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



Re: Install Location / Path problem

2006-08-04 Thread Andreas Waidelich

edit config/core.php and uncomment the line
//  define ('BASE_URL',env('SCRIPT_NAME'));

Andreas

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



Re: Install Location / Path problem

2006-08-04 Thread Aldo

No, I would like to try it without.


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



Re: Install Location / Path problem

2006-08-04 Thread Felix Geisendörfer




Do you have mod_rewrite working?
--
http://www.thinkingphp.org
http://www.fg-webdesign.de



Aldo wrote:

  Hello

I try to install Cake PHP on my local machine.
In the htdocs directory of apache I have the following structure:

somedir1/cake

so i call: http://localhost/somedir1/cake

The cake start page shows up, even the database configuration file is
present.
The problem is, that the path to the stylesheets and images are not set
or wrong.

What should i change or set in my configuration?

Thanks for any help
Aldo




  


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





Install Location / Path problem

2006-08-04 Thread Aldo

Hello

I try to install Cake PHP on my local machine.
In the htdocs directory of apache I have the following structure:

somedir1/cake

so i call: http://localhost/somedir1/cake

The cake start page shows up, even the database configuration file is
present.
The problem is, that the path to the stylesheets and images are not set
or wrong.

What should i change or set in my configuration?

Thanks for any help
Aldo


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



missing table / forcing $db->listsource() to re-read tables from database

2006-08-04 Thread Dr. Tarique Sani <[EMAIL PROTECTED]>

We are trying to create an installer for plugins - something which will
create the needed tables by reading a file and then do
$this->requestAction(/new_plugin/install)

The first part of reading a file and creating tables goes fine but
despite the table being present in the db the subsequent call
$this->requestAction(/new_plugin/install) gives a missing table error

This is because the __source in the db object is not regenerated after
the addition of a new table.

Any way to get around this missing table error. I don't want to burden
the user with creating tables from SQL and nor do I want to make life
miserable for plugin creators by having $uses = '' in the model.

Thanks in advance

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