Re: Cross Application Sesssion

2006-08-20 Thread AD7six

Hi Mandy,

Plugins will 'suffer' the same problem as a seperate app, I wrote a
short blog on the topic and how to work around it. It's possible that
the same approach would work for multiple apps, haven´t tried that.

http://www.noswad.me.uk/blogs/view/28

Cheers,

AD7six
PS. I´d welcome comments regarding any problems this may cause.


--~--~-~--~~~---~--~~
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: Pagination for hasMany assocation

2006-08-20 Thread AD7six

Hi All,

nate wrote:
> var $paginate = array('limit' => 20, 'order' => ...); // Anything you
> can pass to Model::findAll can be set here
Is it going to be possible to specify which relationships are included
in the main model query in 1.2, or to specify constraints for
subsequent queries (I´m guessing it is)? If not, as is the present
case constraints for hasMany and HABTM relationship tables won´t be
possible to include - unless something else has changed..?

Tease me, tease me :).

You can work around it, but it´s a bit messy - Query the sub table,
resort the array apply any kind of filtering and then get the array
items that correspond to your pagination values. I have some example
code for this somewhere..

Cheers,

AD7six


--~--~-~--~~~---~--~~
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: User Bar Logic

2006-08-20 Thread AD7six


Simplerules wrote:
> No matter what I do it won't work here is the code:
>
>//Get User Data;
>$Profile = $this->Session->read('User');
>
>if(isset($Profile['Username']))
>{
>  $this->set('logged_in', TRUE);
>  $this->set('username', $Profile['Username']);
>} else {
>  $this->set('logged_in', FALSE);
>   }
> }
>
> and no matter where I put it I get:
>From the code, why not do
$Username = $this->Session->read('User.Username');
if($Username) {
 ...

Where /are/ you putting it, and are you getting this error on every
page request or just a few (like just your static pages, or just your
error messages etc.)?

Cheers,

AD7six


--~--~-~--~~~---~--~~
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: Cross Application Sesssion

2006-08-20 Thread Mandy Singh
i m thinking of reading the chapter on plugins and see if i can move rdBloggery under /app/plugins though...
 
On 8/21/06, Mandy Singh <[EMAIL PROTECTED]> wrote:


:)
 
nate - i had already tried that.
 
basically, i use the same db as used by rdBloggery.
 
but my application runs in /app/ and the blog in /rdBloggery/
 
even when i was storing sessions in the db, i was not able to auto log the person into rdBloggery if he already logged on in my application in /app/.
 
when i work off the computer at home it works, when i do this from office computer it doesn't.
 
i m going mad!! :)
 
thanks,
Mandy. 

On 8/19/06, nate <[EMAIL PROTECTED]> wrote:
 
Mandy, that's because I wasn't on IRC ;-)in app/config/core.php, there is a setting called CAKE_SESSION_SAVE, 
set that to 'database', and load the SQL fromapp/config/sql/sessions.sql into your database.  Then, if you includethe same database in both applications, you should be able to sharesession data.


--~--~-~--~~~---~--~~
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: Cross Application Sesssion

2006-08-20 Thread Mandy Singh
:)
 
nate - i had already tried that.
 
basically, i use the same db as used by rdBloggery.
 
but my application runs in /app/ and the blog in /rdBloggery/
 
even when i was storing sessions in the db, i was not able to auto log the person into rdBloggery if he already logged on in my application in /app/.
 
when i work off the computer at home it works, when i do this from office computer it doesn't.
 
i m going mad!! :)
 
thanks,
Mandy. 
On 8/19/06, nate <[EMAIL PROTECTED]> wrote:
Mandy, that's because I wasn't on IRC ;-)in app/config/core.php, there is a setting called CAKE_SESSION_SAVE,
set that to 'database', and load the SQL fromapp/config/sql/sessions.sql into your database.  Then, if you includethe same database in both applications, you should be able to sharesession data.

--~--~-~--~~~---~--~~
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: Alternating Row Colors

2006-08-20 Thread John Zimmerman [gmail]
dangit, dangit, dangit..I need to research the helpers more.Thanks for the snippet, I will go back and recode the appropriate sections of my code.On 8/20/06, 
sicapitan <[EMAIL PROTECTED]> wrote:
AD7 is right, tablecells does this automatically, and you can set theclaternating colours$html->tableCells($tr, array('style'=>'background:#E4E4E4'),array('style'=>'background:transparent'));

--~--~-~--~~~---~--~~
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: User Bar Logic

2006-08-20 Thread John Zimmerman [gmail]
Is 'Username' really capitalized as the table name in your schema?Cake conventions would make this lowercase.So if you made it lower case in the db schema, but then try to refer to it as sentence/camel case the variable Username would not actually exist because it is really 'username'.
On 8/20/06, Simplerules <[EMAIL PROTECTED]> wrote:
No matter what I do it won't work here is the code:   //Get User Data;   $Profile = "">   if(isset($Profile['Username']))   { $this->set('logged_in', TRUE);
 $this->set('username', $Profile['Username']);   } else { $this->set('logged_in', FALSE);  }}and no matter where I put it I get:Notice: Undefined variable: logged_in in
\app\views\layouts\default.thtml on line 24

--~--~-~--~~~---~--~~
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: bindModel conditions causing problems

2006-08-20 Thread fr33dom

Is this a bug or am I being a daft twit?

I tried to have a look in the dbo code to see why it was wrapping the
id with ' twice but couldn't seem to find it. i'm a bit loathe to
modify the core application code anyway as i'm looking forward to the
next release.

cheers,
freedom


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



Return field from second joined table

2006-08-20 Thread ShepherdWeb

Color and Product are hasAndBelongsToMany to each other

Product belongsTo Category

Category hasMany Product

I'm using this code to show products by color:


$this->Product->Color->id = $color_id;
$data = $this->Product->Color->read();
$this->set('products', $data['Product']);

this returns this array:

Array
(
[0] => Array
(
[id] => 51
[title] =>  Pink Polka dot Headband
[description] => This is our best selling headband!  We
start with a stretch cotton headband that is oh so comfy, then top it
off with an adorable light pink and white polka dot grosgrain bow. This
bow has a pink and white knotted center.  This headband is a classic
and one your little girl will wear for years! Fits ages 4 months - 4
years.
[inventory] => 2
[price] => 4.99
[category_id] => 1
[sale_date] => -00-00
[sale_price] => 0
)

[1] => Array
(
[id] => 52
[title] => Double Ruffle Satin Bow
[description] => How could you live without this one?
Bowhead Babies favorite bow of all, the double ruffle satin bow.  This
bow is perfect for dresses and casual play clothes.  It has a matching
satin knotted center and covered scissor clip back.  This bow measures
3" and is great for newborn to toddler girls.  It looks great in a lace
headband or in pigtails! Look at our 5 piece set deal!
[inventory] => 5
[price] => 3.99
[category_id] => 1
[sale_date] => -00-00
[sale_price] => 0
)

)

I would like to be able to return category.title to the view also.  How
do I do 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: Alternating Row Colors

2006-08-20 Thread sicapitan

AD7 is right, tablecells does this automatically, and you can set the
claternating colours

$html->tableCells($tr, array('style'=>'background:#E4E4E4'),
array('style'=>'background:transparent'));


--~--~-~--~~~---~--~~
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: User Bar Logic

2006-08-20 Thread Simplerules

No matter what I do it won't work here is the code:

   //Get User Data;
   $Profile = $this->Session->read('User');

   if(isset($Profile['Username']))
   {
 $this->set('logged_in', TRUE);
 $this->set('username', $Profile['Username']);
   } else {
 $this->set('logged_in', FALSE);
  }
}

and no matter where I put it I get:
Notice: Undefined variable: logged_in in
\app\views\layouts\default.thtml on line 24


--~--~-~--~~~---~--~~
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: User Bar Logic

2006-08-20 Thread Simplerules

No matter what I do it won't work here is the code:

   //Get User Data;
   $Profile = $this->Session->read('User');

   if(isset($Profile['Username']))
   {
 $this->set('logged_in', TRUE);
 $this->set('username', $Profile['Username']);
   } else {
 $this->set('logged_in', FALSE);
  }
}

and no matter where I put it I get:
Notice: Undefined variable: logged_in in
\app\views\layouts\default.thtml on line 24


--~--~-~--~~~---~--~~
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: Pagination for hasMany assocation

2006-08-20 Thread Mikee Freedom

fantastic, thanks for the heads up.

On 21/08/06, Samuel DeVore <[EMAIL PROTECTED]> wrote:
>
> You, my good sir, are a tease  ;)
> On 8/20/06, nate <[EMAIL PROTECTED]> wrote:
> >
> > Pagination is being added to the core in Cake 1.2.  Using 1.2 you can
> > set up basic pagination on models or associated models by doing the
> > following in your controller:
> >
> > var $paginate = array('limit' => 20, 'order' => ...); // Anything you
> > can pass to Model::findAll can be set here
> >
> > That's to set the defaults, which can be overridden in POST or URL
> > parameters.  You can retrieve the records using the paginate( ) method
> > in your actions, as follows:
> >
> > $this->paginate('ImageVersion', $this->params); // Assuming
> > $this->params contains named arguments like 'page', etc.
> >
> > Sorry, there isn't any documentation on this yet, and the API isn't
> > even finalized.  I will be working on this, as well as a helper to
> > render pagination links in the coming week.
> >
> >
> > >
> >
>
> >
>

--~--~-~--~~~---~--~~
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: Pagination for hasMany assocation

2006-08-20 Thread Samuel DeVore

You, my good sir, are a tease  ;)
On 8/20/06, nate <[EMAIL PROTECTED]> wrote:
>
> Pagination is being added to the core in Cake 1.2.  Using 1.2 you can
> set up basic pagination on models or associated models by doing the
> following in your controller:
>
> var $paginate = array('limit' => 20, 'order' => ...); // Anything you
> can pass to Model::findAll can be set here
>
> That's to set the defaults, which can be overridden in POST or URL
> parameters.  You can retrieve the records using the paginate( ) method
> in your actions, as follows:
>
> $this->paginate('ImageVersion', $this->params); // Assuming
> $this->params contains named arguments like 'page', etc.
>
> Sorry, there isn't any documentation on this yet, and the API isn't
> even finalized.  I will be working on this, as well as a helper to
> render pagination links in the coming week.
>
>
> >
>

--~--~-~--~~~---~--~~
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: Pagination for hasMany assocation

2006-08-20 Thread nate

Pagination is being added to the core in Cake 1.2.  Using 1.2 you can
set up basic pagination on models or associated models by doing the
following in your controller:

var $paginate = array('limit' => 20, 'order' => ...); // Anything you
can pass to Model::findAll can be set here

That's to set the defaults, which can be overridden in POST or URL
parameters.  You can retrieve the records using the paginate( ) method
in your actions, as follows:

$this->paginate('ImageVersion', $this->params); // Assuming
$this->params contains named arguments like 'page', etc.

Sorry, there isn't any documentation on this yet, and the API isn't
even finalized.  I will be working on this, as well as a helper to
render pagination links in the coming week.


--~--~-~--~~~---~--~~
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: Pagination for hasMany assocation

2006-08-20 Thread fr33dom

Hey again,

Just checking to see if anyone had any thoughts on this issue. If it
has been discussed and answered before I do apologise, a reference to
that discussion / resource would be much appreciated.

Cheers,
Freedom


--~--~-~--~~~---~--~~
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: Debug working with IE but not Firefox

2006-08-20 Thread [EMAIL PROTECTED]

I had the same problem... the debug 2 wasn't working at all...
thanks mate for the tip


--~--~-~--~~~---~--~~
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: url and routing

2006-08-20 Thread [EMAIL PROTECTED]

> Dieter: Alright, as I already tried to communicate numerous times, I'm
> not criticizing you for trying to build a website with i18n url's, I
> criticized the available ways of achieving it - concluding in the
> opinion that it's not worth it for me. You do a web site for school, you
> might enjoy it, it's small (?), only 1 language, I can see it work out.


i've never felt offended or critisized by any of your posts, i didn't
realise my posts would let you think otherwise.  i'm here to discuss
this "matter" because i want to hear opinions, experiences,... to learn
from them.  but the opinions i've seen this far are the "general" ones
(as you said in your last post) that keep multi-lingual and what-not
sites in mind.
that's why i explained my project a little more. (only 1 language,
little javascript, soap webservice etc), so that you (and the others)
could formulate your ideas again on my approach for this specific
project


--~--~-~--~~~---~--~~
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: url and routing

2006-08-20 Thread Felix Geisendörfer




Hi,

darx: Having the language code in the url makes total sense, is
perfectly RESTful, simple to do, and highly recommended from my site. I
did it before on fg-webdesign.de and it works well for that purpose
(it's a
small static site using texilte as markup).

Dieter: Alright, as I already tried to communicate numerous times, I'm
not criticizing you for trying to build a website with i18n url's, I
criticized the available ways of achieving it - concluding in the
opinion that it's not worth it for me. You do a web site for school,
you might enjoy it, it's small (?), only 1 language, I can see it work
out. But a lot (not all) of the  people think of it in the context of
somewhat bigger sites that they work on for a fixed prize (or hourly
payment), supporting 2 or more languages. And ROI(Return on Investment)
probably plays an important part in their way to create a page. So I
was talking to the mailing list in general, more then I was talking to
you specifically, you just happened to be the one who brought up the
topic ; ).

In general, I'm not opposed to i18n url's. I'd love to have them in
fact. So if somebody out there makes it so that it's really easy, I'll
start using them with high respect for to the clever guy that made it
possible.

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



[EMAIL PROTECTED] wrote:

  http://cakephp.org/pastes/show/5f136ad39fe38b274fd2090c2a24c5d7 this
will be easier to copy/paste from (mind you, at line 51 there is a
newline, but the backslash isn't shown)

Felix and mouth.
i haven't mentioned this before, but the app i'm building is a project
for school, and i thought it would be really cool if "the whole user
experience" (including urls) would be in dutch.  it would give a little
extra touch to my application.

 apart from the programming which is (obviously) in english, the
website on itself is only 1 language, dutch.  so i think that on itself
solves some things you mentioned.
also, i don't plan to use ajax, i will use (little) _javascript_s though
also, the translator is just a (transparant) layer that performs a
translation and then the whole system (with routing etc) is left
untouched.  as long i watch out that there are no words in english that
will be recognized as dutch and stranslated, anything in english should
go straight through.  I _will_ use a webservice (soap) though, fully in
english, but i don't think there will be problems with that (given the
remark above)




  


--~--~-~--~~~---~--~~
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: Trying CakePHP for the first time and get error

2006-08-20 Thread [EMAIL PROTECTED]

I used Winzip.


--~--~-~--~~~---~--~~
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: url and routing

2006-08-20 Thread [EMAIL PROTECTED]

http://cakephp.org/pastes/show/5f136ad39fe38b274fd2090c2a24c5d7 this
will be easier to copy/paste from (mind you, at line 51 there is a
newline, but the backslash isn't shown)

Felix and mouth.
i haven't mentioned this before, but the app i'm building is a project
for school, and i thought it would be really cool if "the whole user
experience" (including urls) would be in dutch.  it would give a little
extra touch to my application.

 apart from the programming which is (obviously) in english, the
website on itself is only 1 language, dutch.  so i think that on itself
solves some things you mentioned.
also, i don't plan to use ajax, i will use (little) javascripts though
also, the translator is just a (transparant) layer that performs a
translation and then the whole system (with routing etc) is left
untouched.  as long i watch out that there are no words in english that
will be recognized as dutch and stranslated, anything in english should
go straight through.  I _will_ use a webservice (soap) though, fully in
english, but i don't think there will be problems with that (given the
remark above)


--~--~-~--~~~---~--~~
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: url and routing

2006-08-20 Thread darx

> [EMAIL PROTECTED]
happy it's not just a problem of mine and if you can, please post you
code with split $from_url. I need some good examples from which to
learn ;)

> Felix, mouth
I agree with you guys. We don't need to translate URL: common user
doesn't care about it.
But i need to categorize url in some way to know if a user is
requesting an IT or an EN content.I mean: it's a knowledge i use post
looking at log files to have some statistics about the traffic on the
site.
Thats' why I need to prefix to my action the /lang/ pseudo path.
We need to filter our web log files to tell our customers how people is
behaving in their sites and it's easier if you can parse a log file
knowing exactly that an /IT/ token leads to an Italian content. :)

I use SESSION to track down language user preference, being able to
serve different views  with dynamic and stati content completely
translated (I work only on small/medium size sites).

Hope to see soon the improvement that'll be made to routing in cake.

BTW, I love this framework and the community that's around it.


--~--~-~--~~~---~--~~
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: url and routing

2006-08-20 Thread AD7six

Wow, an interesting debate :).

I too have been considering i18n URLs, and also concluded that it was
too much work. I have to agree with Felix, nobody except 'power' users
and developers looks at the url, so it's pretty much pointless anyway.

The routing part isn't really a problem, as you can take the url,
translate it back to english and then run your routes (that's how I was
considering doing it). That way it isn't necessary to generate a
massive route list.

The real problem is as already mentioned - links from the page also
need i18n and the overhead in doing so is at the very least annoying; I
was considering hooking in a service to take the english url (assuming
the code is in english) and return a translated url (probably not
enormously difficult, if you just explode the url and translate each
part).

Maybe I'll put an experiment in place in the future and see if it's
worth thinking about further, but at this time, I don't think so.

Cheers,

AD7six


--~--~-~--~~~---~--~~
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: url and routing

2006-08-20 Thread [EMAIL PROTECTED]

As promised, here is my solution.
fresh from the kitchen, so it needs some cooling down.
but it's eatable i think (at least it tastes good to me!)

in routes.php add this _BEFORE_ your routes

include_once("translate.php");
$from_url = translate($from_url);

then create translate.php in the same folder as routes.php and put this
in it:
(make sure there are no newlines or whitespace outside the php tags!)

1)$new[1] = 
translate($old[1],"action");

/* copy remaining entries, if any.  
array_merge() is not suitable
for this :( */
for ($i = 2; $i < sizeof($old); $i++)
{
$new[$i] = $old[$i];
}

/* construct the translated url.  this also 
adds a trailing "/"
even if it wasn't in the original */
$new_url="";
foreach($new as $n)
{
$new_url .= $n."/";
}
return $new_url;
}
else
{
$table = array('controller' => 
array('nieuws' => 'news',

'aanbiedingen' => 
'offers'

),

'action'=> array('bekijk' => 'view',

'verwijder' => 'delete',

'voegtoe' => 'add'

)

);
if(isset($table[$level]))
{
foreach ($table[$level] as $orig => 
$new)
{
if($var == $orig) $var = $new;
}
}
else
{
if(DEBUG) echo("translate table for 
level ".$level." not found:
".$var." left untranslated\n");
}
return $var;
}
}
}
?>


--~--~-~--~~~---~--~~
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: url and routing

2006-08-20 Thread nate

Uh guys?  Why not just use HTTP_ACCEPT_LANGUAGE?  That's what its there
for.


--~--~-~--~~~---~--~~
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: url and routing

2006-08-20 Thread Felix Geisendörfer




Hi Dieter,


  Uhm, afaik, every url must do a pass trough the routing system, so if
you put all your "mapping" , or "filtering" logic in there, you can
change it there, and only there, in case anything needs to changed
(please, correct me if i'm wrong)

Ok, I'll make a couple examples of the problems with url translations
in the context of a mid-sized internationalized (let's 3 languages)
site:

  Every $html->link(); will have to have imbedded logic to know
which
language to use, otherwise you need different versions for *every* view
which seems very un-DRY to me.
  All _javascript_ that uses url's alot (aka ajax) will have to know
about the
url routing logic
  A lot of characters from other languages get escaped in url's, so
you either
have to use workarounds (like oe for ö in German) or life with very
ugly urls
  Debugging Missing Controller / Missing Action errors becomes a
mess
because you never quite know if it's a bug in the routing system, a
problem
with your controller, or your url itself
  You make your site less RESTful. /posts/1 is very RESTful.
/posts/view/1 is kinda
RPC. /posts/view/my-great-post is a little nightmare in terms of REST,
since "my-great-post"
as an identifier might changes or looses uniqueness. But
/beitraege/ansehen/mein-toller-beitrag
is a big piece of #$!%, since somebody who doesn't speak german doesn't
know which controller
this relates to, which action it triggers, and even less what resource
you talk about. Don't go
there *ever* if you plan to create a webservice for your site, you'll
be in great pain.
  Orginzational overhead is big: For every controller/action you
create you need to do n translations
to make them work in a different language, given that you are not crazy
enough to use an approach
like mixed-language-url's if not all translations are available.

Now all of those problems are just off the cuff. Coding the thing will
show a lot more problems that you maybe couldn't even imagine before.
But given that my quick-list is pretty long already and some of the
issues are fairly severe, you should be able to see WHAT kind of mess
you are dealing with.


  and yes, imo the user benefits from an url in his own language.  not
every visitor understands english decently enough to understand _all_
urls (which can get complicated if you get difficult words as actions)

Sure he does, if he would actually *read* urls. Unless your target
audience is a bunch of web developers and geeks, you'll soon realize
that people don't even *look* at anything but the domain in a url, and
even that they don't really do (talking about phishing). Is it worth
hours and hours of your time to work on a cute little detail (that's
really all it is) compared to the amount of features you could add to
the web site in the same time? I know the answer for myself.

Just take my advice, I like pretty url's a lot. I tried to create
internationalized url's before and it always ended up being a big mess,
tons of work and almost killed the project. I'm not going there again,
ever (unless somebody comes up with a really easy way to do it, that
is).

But hey, if you still think it's worth it, do it. I'd like to hear
about your success with it and would be very impressed if you can make
it a worthwhile cause.

Best Regards,
Felix Geisendörfer

--~--~-~--~~~---~--~~
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: url and routing

2006-08-20 Thread mouth

> $Route->connect('/'.$language.'/:controller/:action', array('language'
> => $language));
has to be
$Route->connect('/'.$language.'/:controller/:action/*',
array('language' => $language));


--~--~-~--~~~---~--~~
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: url and routing

2006-08-20 Thread mouth

> Any ideas?

//file app/config/routes.php
$routes = array(
'/' => array('controller' => 'pages', 'action' => 'display', 'home'),
'/page/*'   => array('controller' => 'pages', 'action' => 
'display'),
'/language/*'   => array('controller' => 'pages', 'action' =>
'selectLanguage'),
'/login/*'  => array('controller' => 'users', 'action' => 
'login'),
);

//next line merge with Your own solution for determining of
selected/allowed/default language
$language = 'en_US';

foreach ($routes as $key => $value) {
$value['language'] => $language;
$Route->connect($key, $value);
$Route->connect('/'.$language.'/'.$key, $value);
}

$Route->connect('/'.$language.'/:controller/:action', array('language'
=> $language));


...and then take a look to $this->params['language'] in Your
controller. Last line is only example how to route default
/controller/action routes, so You will probably want to repeat this
line for 'bare' calls etc... ;-)


--~--~-~--~~~---~--~~
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: url and routing

2006-08-20 Thread mouth

kitten wrote:
> This works fine, except for saving $lang to session -- the session is not
> yet available at this point.

pr(get_declared_classes());

in routes.php shows me class CakeSession is declared already


--~--~-~--~~~---~--~~
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: url and routing

2006-08-20 Thread mouth

Felix Geisendörfer wrote:
> It's insane!

I have to agree with every word in Your post, Felix.

For all experimentators with variable $from_url in
app/config/routes.php - dont't forget some things:

--> caching mechanism is URL based, so if You will play with URI in
bootstrap.php and with $from_url in routes.php, I'm 'not sure' about
filenames of Your cached views

--> if You're using some 'shortcuts' like $Route->connect('/login',
array('controller'=>'users', 'action'=>'login')), You will probably
want to translate them also...

--> if You want complex solution, You will have to play with
app/config/inflections.php also...

--> whole this thing is supposed to be builded around stable
browser-language detection, default language configuration option,
method for saving selected language (session and/or cookie and/or
something else for wap etc) AND - file/model based unified translation
system - to be honest I'm pretty sure this is 'more then possible' ;-)
in this time - with CakePHP actual trunk code, with classes I18n and
L10n from 1.2 branch, some patch to cake/basics.php file, with some
LanguageSelector component and model-based solution with usage of
bindModel() and unbindModel(), with custom validation methods... ;-)

BTW: More I know Cake's code, more I like it. And there are such a
sweet things on the road:
- Router will be enhanced in next few days...
- behaviours implementation is just knocking on the door...

SHORT VERSION OF THIS POST:
Wait for CakePHP 1.2


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



libmm.so.13: cannot open shared object file

2006-08-20 Thread jonee

i was running the acl script when i got this error-

php: error while loading shared libraries: libmm.so.13: cannot open
shared object file: No such file or directory

i am using a xampp installation on slackware.
anyone else had this too?


--~--~-~--~~~---~--~~
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: url and routing

2006-08-20 Thread [EMAIL PROTECTED]

Uhm, afaik, every url must do a pass trough the routing system, so if
you put all your "mapping" , or "filtering" logic in there, you can
change it there, and only there, in case anything needs to changed
(please, correct me if i'm wrong)

and yes, imo the user benefits from an url in his own language.  not
every visitor understands english decently enough to understand _all_
urls (which can get complicated if you get difficult words as actions)


--~--~-~--~~~---~--~~
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: url and routing

2006-08-20 Thread Felix Geisendörfer




Hi,

I find this topic quite interesting myself and as far as
internationalized urls go I came to one conclusion:

It's insane!

The amount of work you have to put into it, in order for it to work
throughout your entire system is incredible. Now you only want to do it
for 1 language and 1 specific project which makes it a lot easier. But
for anything beyond that I think it's just pure craziness. Think about
all the logic you need to run every time you use a link on the site
somewhere! Just think of all the errors you could introduce by adding
an *additional* layer to your (Uniform) Resource Identification system!
Made an error in the translation from one English controller name and
discover it after 3 month -> tons of broken urls (you can keep
legacy url support, but that's work)!

Another point is: Who benefits from it? The user? He cares less if it
says /posts/view/mein-toller-beitrag or (completly in German)
/beitraege/anschauen/mein-toller-beitrag. I mean really, no one, but us
web developers is as obsessed with the way urls should look like. 
Search engines? They don't care much as long as they get their little
title-in-url (mein-toller-beitrag), they care less about the
/posts/view/ part.

Now ok, to stop ranting (sorry for that), I think if you can pull it
off with a reasonable amount of work, go for it. But if you feel like
you spent as much time on it as you do on some major features of the
site itself, I'd ask if it's worth it. That's just my opinion.

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



[EMAIL PROTECTED] wrote:

  
darx wrote:
  
  
Hi bakers,
i know it's been asked before but none of the threads was so claryfing.

  
  
I know exactly what you mean :) I've gone through about 20 topics on
this group, of which most ones end up in pointing to the same solution
(which is ad7six locale package)

I also noted this pretty radical different point of view between the
locale package and what you and me try to achieve.
Whereas you and me want to have the urls in native language of the
user, the locale package focuses on using english-url's and then
showing content in the right language (at least, that's what i
understood of it when skimming ad7six' tutorial on the wiki)

So our problem (well at least mine, yours is similar but not entirely
the same i think) is that controllers and actions should be named in
english (programming in a language other then english is not a good
practice imo), while we want our url's in a language other then
english. (but "map" these urls to english ones, or at least call the
english controllers and actions)

The solution that i've come up with, is to take $from_url, split it in
parts, and then check each part if it should be mapped to something
else. (eg map indici to index, map newzi to news, etc), then i
reconstruct the $from_url again, which is the translated (where
nessecary) version of the original one, and the normal routing
functions go on from that.

I'm still tweaking my code, and will post it later on
 (ftr: it would be cool if the routes.php would have something like
components like controllers do, to modularize code also on other levels
then models, views and controllers. or is this possible already?)

Oh, and for the record, my site is in 1 language only (dutch) so i
don't have to worry about selecting languages in my controller (or
view), i just map the dutch url to an english one and all my views
shows the dutch content anyway




  


--~--~-~--~~~---~--~~
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: url and routing

2006-08-20 Thread [EMAIL PROTECTED]


darx wrote:
> Hi bakers,
> i know it's been asked before but none of the threads was so claryfing.

I know exactly what you mean :) I've gone through about 20 topics on
this group, of which most ones end up in pointing to the same solution
(which is ad7six locale package)

I also noted this pretty radical different point of view between the
locale package and what you and me try to achieve.
Whereas you and me want to have the urls in native language of the
user, the locale package focuses on using english-url's and then
showing content in the right language (at least, that's what i
understood of it when skimming ad7six' tutorial on the wiki)

So our problem (well at least mine, yours is similar but not entirely
the same i think) is that controllers and actions should be named in
english (programming in a language other then english is not a good
practice imo), while we want our url's in a language other then
english. (but "map" these urls to english ones, or at least call the
english controllers and actions)

The solution that i've come up with, is to take $from_url, split it in
parts, and then check each part if it should be mapped to something
else. (eg map indici to index, map newzi to news, etc), then i
reconstruct the $from_url again, which is the translated (where
nessecary) version of the original one, and the normal routing
functions go on from that.

I'm still tweaking my code, and will post it later on
 (ftr: it would be cool if the routes.php would have something like
components like controllers do, to modularize code also on other levels
then models, views and controllers. or is this possible already?)

Oh, and for the record, my site is in 1 language only (dutch) so i
don't have to worry about selecting languages in my controller (or
view), i just map the dutch url to an english one and all my views
shows the dutch content anyway


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



Invitation 4 U

2006-08-20 Thread DecentCuteGirl

Hi Dear  Members, 
  
THNX 4 using Yahoo Groups 
  
I have also started following new groups 

I invite you to join my following groups
  
IF YOU ARE LOOKING FOR JOBS, JOIN OUR FOLLOWING YAHOO GROUP A2ZHRINFOSERVICES, 
WE WILL POST JOBS IN YOUR EMAIL 
  
http://finance.groups.yahoo.com/group/a2zhrinfoservices/join 
http://groups.google.com/group/professionalsjobs4u/subscribe
  
IF YOU ARE LOOKING FOR BRIDE GROOMS, JOIN OUR FOLLOWING YAHOO GROUP 
net4matrimonialsdotcom, WILL WILL POST NEW PROFILES OF BRIDES/GROOMS WEEKLY 

http://groups.yahoo.com/group/net4matrimonialsdotcom/join 
http://groups.google.com/group/yourmatrimony/subscribe
  
Thnx in advance 
  

Download free Love Calculator Software (Lovemeter) from 
http://groups.yahoo.com/group/lovemeter/files worth 25$ FREE NOW!!!

ADVT:
=
Post Matrimony Message/Profile FREE only on http://www.net4matrimonials.com

Post jobs/resumes FREE only on http://www.net4professionals.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: Alternating Row Colors

2006-08-20 Thread AD7six

Hi All,

why not use the html helper for this, that's what the tableCells method
seems to be for..?

You can see an example here:
http://wiki.cakephp.org/tutorials:i18n#messages_dynamic_content

Note that if you have cake pre 3228, the count declaration in the html
helper is incorrect and should be: static $count=0;

HTH,

AD7six


--~--~-~--~~~---~--~~
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: User Bar Logic

2006-08-20 Thread AD7six

Hi All,

Let's look at it this way:

1) If a line of code like $this->set('Foo',$bar); is executed by any
controller, a variable named $Foo will be available in the view/layout
with the contents $bar.

2) If you define a method in your app_controller and in one of your
controllers you override the method, you can run the parent code by
calling parent::methodName();

Therefore, for example, if you create in app_controller:
function beforeRender() {
 $this->set('Foo',$bar);
}

and in any child controller than needs to use this method you code it
as:
function beforeRender() {
 ... specific logic...
 parent::beforeRender();
}

Then the variable $foo will always be present in your view/layout.

HTH,

AD7six
PS. Tested/Used


--~--~-~--~~~---~--~~
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: User Bar Logic

2006-08-20 Thread JensWiese

I had the same problem and build a component which is rendered in the
main template. works fine.

Jens


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