Re: Checkbox

2007-06-01 Thread cake_learner

controller code:

 $this->set('languages', $this->Language->generateList(
null, null, null, "{n}.Language.language_name",
"{n}.Language.language_id")
);

view code:

Languages checkboxMultiple('Client/languages',
$languages);?> 

checkboxes are displayed correctly.

I want the data to be inserted into database with comma inbetween so,
in the controller i have written the code,

$langArr=$this->data['Client']['languages'];
$imp=implode(',',$langArr);
echo $imp;

output:
,English, French

1 There is a coma before the word English.

2  var $helpers = array('Html', 'Form' , 'Habtm');

what is 'Form' ?






On Jun 1, 8:39 pm, Joshua McFarren <[EMAIL PROTECTED]> wrote:
> Deja vu
>
> Make sure you define the helpers you need in the controllers that use
> that layout. ie:
>
> class FoobarsController extends AppController {
>
> var $name = 'Foobars';
> var $helpers = array('Html', 'Form' , 'Habtm');
>
> If that doesn't solve it what version of cake are you using?
>
> On Jun 1, 11:31 am, cake_learner <[EMAIL PROTECTED]> wrote:
>
>
>
> > I am getting error: Class 'HtmlHelper' not found
>
> > On Jun 1, 7:06 pm, Joshua McFarren <[EMAIL PROTECTED]> wrote:
>
> > > Check out this helper:
>
> > >http://bakery.cakephp.org/articles/view/create-multiple-checkboxes-in...- 
> > >Hide quoted text -
>
> - Show quoted text -


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



Re: Image gallery - add multiple entries for a model

2007-06-01 Thread Nasko

@all:
Thanks guys, I'll let you know how I tackled 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?hl=en
-~--~~~~--~~--~--~---



Re: Image gallery - add multiple entries for a model

2007-06-01 Thread Nasko



On Jun 1, 7:07 pm, Joshua McFarren <[EMAIL PROTECTED]> wrote:
> Don't mean to hijack the thread but could you post some links to the
> gallery tutorials you found? This would be really helpful to me and
> probably others.

Sure:
http://web.archive.org/web/20060427223358/http://wiki.cakephp.org/tutorials:image_gallery_2

Not exactly a gallery tutorial, but an excellent all-purpose file
upload component:
http://bakery.cakephp.org/articles/view/swfupload-and-multipurpose-uploader
http://www.pagebakers.nl/2006/12/19/swfupload-part-ii/


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



Dreamweaver CS 3

2007-06-01 Thread davis

Hello,

I tried a few tutorials on how to get thtml files to be recognized and
editable by dreamweaver, but those were for mx 2004 & 8, and the did
not work for cs 3.

If anyone has information regarding how to do that, I would be most
appreciative.  I might just have been looking at the wrong tutorials.

dave


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



How to display a session timeout message to the user

2007-06-01 Thread uk_maul

Hi

I see that my Cake session security default is set to MEDIUM - which
logs out a user after 20 minutes of inactivity. I want to display an
error message to the user saying that "You have been logged out due to
session timeout, please login again". Please let me know how I can do
this in CakePHP.

Regards


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



[job] Seeking Toronto based Cake baker

2007-06-01 Thread cake.developer

We are looking for a seasoned Cakephp web developer(s) based in the
GTA to join an ongoing Cake project.

You professional expertise should include:

- Expert programming experience in:
  PHP (5.0), MySql, CakePhp (experience or ability to learn
Cakephp)
  Ajax, JavaScript, CSS, XHTML, HTML, Linux
- Experience launching and maintaining enterprise level applications
- Strong database systems design and development skills
- Computer Science or Computer Engineering, or equivalent experience
- 3-4 years programming experience
- Experience with front-end design, onsite SEO (bonus)

Skill set:
- Excellent communication skills
- Bright, motivated, very dependable and professional
- Attention to detail
- Experience working with large projects through the entire life cycle
of a web-based service from concept, implementation, testing to
maintenance

Thank you for your 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?hl=en
-~--~~~~--~~--~--~---



Re: Seeking PHP Developer to bake Alpha Recipe into Nice Cake

2007-06-01 Thread objectfetish


It's not an escort business. It's a paid gig.

On Jun 1, 9:15 am, Joshua McFarren <[EMAIL PROTECTED]> wrote:
> Does the developer get some free "services" from your escort business?


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



Re: General gripes and questions

2007-06-01 Thread Dr. Tarique Sani

On 6/2/07, JDS <[EMAIL PROTECTED]> wrote:

> excellent PHP.net documentation... In any case, I am willing to help
> clean it up if someone is willing to point me in the direction of how.

sigh!

>  * What is the flash() method, where is it documented, how do I use
> it, and how am I supposed to know anything about it? This method is
> basically undocumented (like many many other CakePHP methods and
> classes)

http://api.cakephp.org/


HTH

Tarique
-- 
My motto for everyone else -  "Just shut up, damnit!!"
=
PHP for E-Biz: http://sanisoft.com
=

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



Re: Looking for opinions/suggestions/feedback - search engine for a non-public site

2007-06-01 Thread [EMAIL PROTECTED]

Hey Gonzalo,

Couple of ideas for you...
1st - I have no idea if this is viable, but it seems to me that the
cake cache might be a good way to index and search your content. I
would start by looking at the API. You would probably want to upgrade
to 1.2 if you go this route.

2nd - Instead of wget, why not user requestAction method?



On Jun 2, 12:24 am, "Gonzalo Servat" <[EMAIL PROTECTED]> wrote:
> Hi Bakers,
>
> Some of you may recall an email I sent to the list a month or so ago on how
> to integrate a search engine into a CakePHP app. Someone suggested I use the
> Lucene stuff from the Zend framework and that seemed like a good solution.
> It used a shell script (written by an author whose name I can't recall,
> sorry!) to wget recursively the site in order to index the content.
> I'm only getting around to actually doing the search engine now and before
> starting I realized the entire site is non-public, meaning all pages are
> behind a login/auth (cookie/session based) page which makes it hard for wget
> to get in. I've tried googling around to find out how other people do it but
> wasn't very successful. Can this be overcome? (non-hackishly, if possible)
>
> Another idea I had, given this hurdle, is to create a search() function in
> every model that should be searchable. When a search is made, I would look
> for a "search" function in all available models and where it is defined,
> call it with the search string as the argument. The search function in each
> model would then do the necessary database querying of the fields that
> should be searchable and return the matches.
>
> Does this seem like a crazy idea? I don't have THAT many models,
> fortunately, and I guess the search functionality would be pretty identical
> in all the models, except for the names of the searchable fields, so I would
> have a generic search function that I would adapt to each model. Haven't
> tested this at all so I'm just throwing the concept up in the air and hoping
> to get some feedback, specially from those who have had experience doing a
> similar thing.
>
> Thanks in advance!
>
> Regards,
> Gonzalo.


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



Looking for opinions/suggestions/feedback - search engine for a non-public site

2007-06-01 Thread Gonzalo Servat
Hi Bakers,

Some of you may recall an email I sent to the list a month or so ago on how
to integrate a search engine into a CakePHP app. Someone suggested I use the
Lucene stuff from the Zend framework and that seemed like a good solution.
It used a shell script (written by an author whose name I can't recall,
sorry!) to wget recursively the site in order to index the content.
I'm only getting around to actually doing the search engine now and before
starting I realized the entire site is non-public, meaning all pages are
behind a login/auth (cookie/session based) page which makes it hard for wget
to get in. I've tried googling around to find out how other people do it but
wasn't very successful. Can this be overcome? (non-hackishly, if possible)

Another idea I had, given this hurdle, is to create a search() function in
every model that should be searchable. When a search is made, I would look
for a "search" function in all available models and where it is defined,
call it with the search string as the argument. The search function in each
model would then do the necessary database querying of the fields that
should be searchable and return the matches.

Does this seem like a crazy idea? I don't have THAT many models,
fortunately, and I guess the search functionality would be pretty identical
in all the models, except for the names of the searchable fields, so I would
have a generic search function that I would adapt to each model. Haven't
tested this at all so I'm just throwing the concept up in the air and hoping
to get some feedback, specially from those who have had experience doing a
similar thing.

Thanks in advance!

Regards,
Gonzalo.

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



Re: i18n translation in db tables - how to do this like Symfony?

2007-06-01 Thread jitka

Well, it seems like deadline of your project doesn't allow wait for
cake's solution for reading records with fallback to default locale ;)
Ok, I can live with it. So I'll not comment your own solution at all -
I assume that you know that things may change in development version
and you're prepared to watch https://trac.cakephp.org/changeset/

But now when I know that you're cake newbie, I would like to make few
points (from fast review of your NewsArticlesController), which are
probably a bit 'off topic':

1. I don't see line with parent::beforeFilter(); in beforeFilter()
method
2. you're messing together terms 'language' and 'locale' - those are
different things (see next point)
3. you're using different locales, then cake, see L10n::$__l10nMap
(locale => language)
4. if you want your application (not only db translation, but also
i18n functions for reading of gettext files) use some locale (and not
use autodetection from browser), Configure::write('Config.language',
'fr') (or same key in session) is enough - TranslateBehavior will use
locale for this language automatically
5. $this->set('title_for_layout', ...); could be replaced with $this-
>pageTitle = ...;
6. variables 'siteVars' and title for page are used only for rendered
output (and as I can see they doesn't vary with called action) so
initialization of them imo belongs to beforeRender() callback

And btw: I don't like ?language=xx in url (if you do, don't read rest
of this paragraph), I prefer keep selected language in session
(probably combined with cookie, and with invisible links for search
engines), or in url like example.com/en/controller/action (nothing
special, just few lines in routes.php).

Just my 2 cents.


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



Re: SMTP with EmailComponent

2007-06-01 Thread Samuel DeVore
or http://www.ask.com/web?q=cakephp+email+smtp

if you don't like google

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



Re: SMTP with EmailComponent

2007-06-01 Thread Samuel DeVore
or...

http://bakery.cakephp.org/tags/view/smtp



On 6/1/07, Samuel DeVore <[EMAIL PROTECTED]> wrote:
>
> http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q=phpmailer+cakephp
>
>
> On 6/1/07, Ketan Patel <[EMAIL PROTECTED]> wrote:
> >
> >
> > I am looking in the EmailComponent but could not find anything for
> > SMTP authentication? How can I send SMTP emails using this component
> > in CakePHP 1.2.xx version.
> >
> > Or what would you suggest to use instead if the EmailComponent cannot
> > send SMTP emails.
> > Thanks
> >
> >
> > > >
> >
>
>
> --
> (the old fart) the advice is free, the lack of crankiness will cost you
>
> - its a fine line between a real question and an idiot
>
> http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/




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

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

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

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



Re: SMTP with EmailComponent

2007-06-01 Thread Samuel DeVore
http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q=phpmailer+cakephp

On 6/1/07, Ketan Patel <[EMAIL PROTECTED]> wrote:
>
>
> I am looking in the EmailComponent but could not find anything for
> SMTP authentication? How can I send SMTP emails using this component
> in CakePHP 1.2.xx version.
>
> Or what would you suggest to use instead if the EmailComponent cannot
> send SMTP emails.
> Thanks
>
>
> >
>


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

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

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

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



SMTP with EmailComponent

2007-06-01 Thread Ketan Patel

I am looking in the EmailComponent but could not find anything for
SMTP authentication? How can I send SMTP emails using this component
in CakePHP 1.2.xx version.

Or what would you suggest to use instead if the EmailComponent cannot
send SMTP emails.
Thanks


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



getLastInsertId and 'connection pooling'

2007-06-01 Thread cakePHP

Hi,

Does CakePHP pool database connections (using mysql) or does it
establish a connection per user thread? If it is the latter, is there
a limit on the number of concurrent connections to the database?

I ask as I want to use getLastInsert() function, which nobody here
seems to have any issues with.

In database.php, there is the option to use mysql_connect or
mysql_pconnect. Does the latter mean it is a persistent connection
(pooling?) and if so, would getLastInsert() still give the correct id?
Is there a link?

Thanks.

Vasu


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



Re: redirection problem - ibm tutorial

2007-06-01 Thread rtanz

ok please be patient with me, where can i find the htaccess file/s and
what should i do with the RewriteBase thing?

where do i insert that piece of code for 2.? my directory structure is
localhost/cake/ibm thanks

On Jun 1, 10:10 am, Szabolcs Sulik <[EMAIL PROTECTED]> wrote:
> hi
>
> if you put cake into a subdir do one of the follows:
> 1. use RewriteBase in .htaccess files
> 2. create VirtualHost: e.g. YOUR_WEBROOT_DIR/cake/ibm can be
> ibmcake.local
>
> 
> DocumentRoot YOUR_WEBROOT_DIR/cake/ibm
> ServerName ibmcake.local
> 
>
> bests
> szabolcs
>
> On May 31, 5:08 pm, rtanz <[EMAIL PROTECTED]> wrote:
>
> > hi i am a new cakephp user trying to follow the ibm tutorial but i
> > have a problem when i try to register a new user at
>
> >http://localhost/cake/ibm/users/register
>
> > when i press register i am redirected tohttp://localhost/users/register
> > and this returns a 404 not found error. it seems to me that that is
> > not the place where the script should be redirecting too, how can i
> > fix this? my register view has the following line 
>
> > thanks


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



Re: ajax tutorial problems

2007-06-01 Thread rtanz

i have that in my application but still im getting those errors, im
stumped :S

Geoff Ford wrote:

> Actually that should have been $helpers = array('Javascript') not
> $components
>
> On Jun 1, 1:22 pm, rtanz <[EMAIL PROTECTED]> wrote:
> > Hi i am trying to complete the ajax todo list tutorial 
> > athttp://grahambird.co.uk/cake/tutorials/ajax.php
> >
> > However i am getting this error after editing the default.thtml file
> > in layouts folder:
> >
> > Notice: Undefined variable: javascript in W:\www\cake\cake\libs\view
> > \templates\layouts\default.thtml on line 35
> >
> > Fatal error: Call to a member function link() on a non-object in W:\www
> > \cake\cake\libs\view\templates\layouts\default.thtml on line 35
> >
> > I inserted the following code into the head section as required:
> >
> > charsetTag('UTF-8') ?>
> > link('prototype') ?> //line35
> > link('scriptaculous.js?load=effects') ?>
> >
> > any idea why i have this problem? thanks


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



Re: Routes and Paginator

2007-06-01 Thread byBartus

Hi, maybe this can help, but i'm not sure if it's the right way.

Router::connect('/artikel/:action/:page/*', array('controller' =>
'article', 'action' => 'index'));




On May 31, 8:37 am, BenjaminB <[EMAIL PROTECTED]> wrote:
> Hi,
> its YARQ, so i try to keep it short.
> the paginator gives me links like this:
>
> /articles/index/page:8
>
> i have a route for the articles like this:
>
> $Route->connect( 'Artikel/', array( 'controller' => 'articles',
> 'action' => 'index' ) );
>
> this route works if someone requests "/Artikel/", but not if one tries
> to reach "/Artikel/page:5"
>
> if i change my route from "/Artikel/" to "/Artikel/*", im able to call
> "/Artikel/page:4" manually, but the
> paginator (which uses htmlhelper->link() which itself uses
> Route::url()) generates "/Artikel/" for every page url, completely
> omitting the page part. i dont have any clue, what the proper route
> could be, but what im trying to achieve is like this:
>
> /Artikel/ -> /articles/index
> /Artikel/Seite:8 -> /articles/index/page:8 (or even better /Artikel/
> Seite/8
> /Artikel/Zeige/* -> /articles/show/*
>
> so what could be the proper routes for that (i have the first and the
> last acutally working, but no chance to get the other one to work).
>
> thx in advance
> regards Benjamin


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



Re: i18n translation in db tables - how to do this like Symfony?

2007-06-01 Thread Langdon Stevenson

I have been wondering how Cake 1.2 will handle this.  I built a similar 
system (though not so elegent) for one of my projects in 1.1.x

It's nice to see that I wasn't completely off target with the design.

Regards,
Langdon


jitka wrote:
>> Do I understand it right that the table i18n & i18n_content stores
>> translations for each table that uses it?
> 
> Yes.
> 
>> If that's right the structure for news would be:
>>
>> Table: news
>> id: int(8)
>> title: varchar(255)
>> content: text
>> ...other fields
> 
> No. Structure for table 'news' will be
> id: int(8)
> ...other fields
> 
> because all translated fields (title and content in your case) are
> only virtual, managed by TranslateBehavior in i18n tables.
> 
> 
> > 

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



Re: i18n translation in db tables - how to do this like Symfony?

2007-06-01 Thread oleonav

Worked out a solution for;

>  The following issues need to be resolved for my project;
> - The ability to fetch default data when the data is not available in
> the database in the requested language. For example a news article is
> not available in French so the English version would be fetched by the
> model given English is the default language of the site.
> - Some sort of indicator stating the requested language is not
> available so a version in the default language is given.

My news_articles controller looks like this at this point:
---
function beforeFilter(){
//set supported languages
$languages = array('en_US','fr_FR');

//set language preference if present in the url 
(?language=xx_XX)
if(isset($this->params['url']['language'])){
if 
(in_array($this->params['url']['language'],$languages)){
$this->NewsArticle->locale = 
$this->params['url']['language'];
}
else{
$this->NewsArticle->locale = 'en_US';
}
}
else{
$this->NewsArticle->locale = 'en_US';
}
}


function index(){
//get articles array in the requested language
$trans_art = $this->NewsArticle->findAll();

//get articles array in the default language
$this->NewsArticle->locale = 'en_US';
$def_art = $this->NewsArticle->findAll();

//build array of translated articles - array key is the id of 
the
article
foreach($trans_art as $artT){
$trans_art_list[$artT['NewsArticle']['id']] = 
$artT['NewsArticle'];
}

//replace articles not found in the requested language by 
articles
in the default language
//also set isLocale status - yes if the translation is there, 
no if
not
foreach($def_art as $art){

if(array_key_exists($art['NewsArticle']['id'],$trans_art_list)){

$trans_art_list[$art['NewsArticle']['id']]['isLocale'] = 'yes';
$artList[]['NewsArticle'] = 
$trans_art_list[$art['NewsArticle']
['id']];
}
else{
$art['NewsArticle']['isLocale'] = 'no';
$artList[]['NewsArticle'] = $art['NewsArticle'];
}
}

//set the combined array to the view
$this->set('news_articles', $artList);

$this->set('siteVars', $this->Conf->get('site.*'));
$this->set('title_for_layout', $this->Conf->get('site.name'));
}
-

Short description:
- The beforeFilter get's the requested language or the default if not
given or invalid
- The index controller first get's every article in the default
language
- The index controller than get's every article in the requested
language (this array could be smaller)
- The index controller builds an array based in the default language.
- The index controller replaces records in the articles array for
every article where a translation is available
- Every article has a status variable indicating if the translation
was available or not (isLocale yes / no)

Next step would be to transfer this functionality to the model. In the
above example this functionality will be build into every controller
function. Something for the days to come...


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



Re: Fatal error: Call to a member function on a non-object

2007-06-01 Thread Christopher E. Franklin, Sr.

You cannot access the model or controller functions from the view, you
must do so before the view is rendered and pass whatever information
you can to the view.  In the view, you can then access the information
in a loop because the data passed will be in array form.

Therefore, in your controller you can do this:

$this->users = $this->Regusers->findAll();
$this->set('someUsersHere', $this->users);

Then in view, you access the variable by the name that you put in
single quotes. $someUsersHere
Now $someUsersHere is an array that the your view(ctp file) can access
to display the data.

foreach($someUsersHere as $users)
{
 //exec code here
}

or

foreach($someUsersHere as $key => $value)
{
 //exec code here
}

Also, I noticed your model class declaration reguser doesn't have a
capital 'R'... make sure that it does.

On Jun 1, 2:01 pm, cakephpnewbie <[EMAIL PROTECTED]> wrote:
> Hi All,
> I am new to cakePHP. I am trying to create a view which displays the
> data from the table 'regusers'.
>
> 
> The model - reguser.php
> 
>  class reguser extends AppModel
> {
>   var $name = 'Reguser';}
>
> ?>
>
> -
> The controller - regusers_controller.php
> -
>  class RegusersController extends AppController
> {
> var $name = 'Regusers';
>
> function report()
> {
> $this->pageTitle = "USER REGISTRATION REPORT";
> }
>
> }
>
> ?>
>
> --
> The view - report.ctp
> --
> 
> 
> USER REGISTRATION REPORT
> 
>
> 
> USER REGISTRATION REPORT
> 
>
> 
> ECHO "";
>
> //FORMATTING QUERY OUTPUT
> ECHO "";
> ECHO "USER IDUSERNAME TD>EMAILDATE OF REGISTRATION";
> $COLOR = 1;
>
> //ITERATE OVER RECORD SET AND PRINT EACH FIELD
> foreach ($this->Reguser->findAll() as $reguser)
> {
> IF ($COLOR == 1)
> {
>   ECHO "";
>   $COLOR = 0;
> }
> ELSE
> {
>   ECHO "";
>   $COLOR = 1;
> }
> ECHO "" .$reguser['id'] ."";
> ECHO "" .$reguser['uname']  ."";
> ECHO "" .$reguser['uemail'] ."";
> ECHO "" .$reguser['date']   ."";
> ECHO "";}
>
> ECHO "";
> ECHO "";
>
> ?>
>
> 
> 
>
> I have changed the database.php file to map to my table regusers.
> The problem is when i type the addresshttp://localhost/regusers/report
> in the browser window, I get the error:
> Fatal error: Call to a member function on a non-object in C:\AppServ
> \www\cakephp\app\views\regusers\report.ctp on line 20
> Line 20 is foreach ($this->Reguser->findAll() as $reguser)
> Can someone please help me understand what this error message
> indicates?
> Thanks in advance!!
>
> Regards,
> phpnewbie


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



Re: SQL Server connection

2007-06-01 Thread Christopher E. Franklin, Sr.

Is the port correct?  Is the username/password correct? Can the linux/
windows box see each other via ping?  Is the port being firewalled by
windows built in firewall?  I see an incorrect login in there too.

On Jun 1, 3:36 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hello guys,
>
> I'm trying to connect to a MS SQL Server using cake but I'm not able
> to, i get this messages:
>
> Warning: mssql_pconnect() [function.mssql-pconnect]: Write to SQL
> Server failed. (severity 9) in /var/www/apache2-default/infolab/cake/
> libs/model/dbo/dbo_mssql.php on line 138
>
> Warning: mssql_pconnect() [function.mssql-pconnect]: Login incorrect.
> (severity 9) in /var/www/apache2-default/infolab/cake/libs/model/dbo/
> dbo_mssql.php on line 138
>
> Warning: mssql_pconnect() [function.mssql-pconnect]: Unable to connect
> to server: 192.168.0.145:1433 in /var/www/apache2-default/infolab/cake/
> libs/model/dbo/dbo_mssql.php on line 138
>
> Warning: mssql_select_db(): supplied argument is not a valid MS SQL-
> Link resource in /var/www/apache2-default/infolab/cake/libs/model/dbo/
> dbo_mssql.php on line 140
>
> This is my database.php file:
>
> var $default = array('driver' => 'mssql',
> 'connect' => 
> 'mssql_pconnect',
> 'host' => 
> '192.168.0.145',
> 'login' => 
> 'sa',
> 'password' => 
> '',
> 'database' => 
> 'intranet',
> 'prefix' => 
> '');
>
> I have a Linux/PHP server and WinXP/SQL Server 2000 as DBMS
>
> Thanks for any help you can supply


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



SQL Server connection

2007-06-01 Thread [EMAIL PROTECTED]

Hello guys,

I'm trying to connect to a MS SQL Server using cake but I'm not able
to, i get this messages:

Warning: mssql_pconnect() [function.mssql-pconnect]: Write to SQL
Server failed. (severity 9) in /var/www/apache2-default/infolab/cake/
libs/model/dbo/dbo_mssql.php on line 138

Warning: mssql_pconnect() [function.mssql-pconnect]: Login incorrect.
(severity 9) in /var/www/apache2-default/infolab/cake/libs/model/dbo/
dbo_mssql.php on line 138

Warning: mssql_pconnect() [function.mssql-pconnect]: Unable to connect
to server: 192.168.0.145:1433 in /var/www/apache2-default/infolab/cake/
libs/model/dbo/dbo_mssql.php on line 138

Warning: mssql_select_db(): supplied argument is not a valid MS SQL-
Link resource in /var/www/apache2-default/infolab/cake/libs/model/dbo/
dbo_mssql.php on line 140

This is my database.php file:

var $default = array('driver' => 'mssql',
'connect' => 
'mssql_pconnect',
'host' => 
'192.168.0.145',
'login' => 'sa',
'password' => 
'',
'database' => 
'intranet',
'prefix' => '');

I have a Linux/PHP server and WinXP/SQL Server 2000 as DBMS

Thanks for any help you can supply


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



Fatal error: Call to a member function on a non-object

2007-06-01 Thread cakephpnewbie

Hi All,
I am new to cakePHP. I am trying to create a view which displays the
data from the table 'regusers'.


The model - reguser.php



-
The controller - regusers_controller.php
-
pageTitle = "USER REGISTRATION REPORT";
}

}
?>

--
The view - report.ctp
--


USER REGISTRATION REPORT



USER REGISTRATION REPORT


";

//FORMATTING QUERY OUTPUT
ECHO "";
ECHO "USER IDUSERNAMEEMAILDATE OF REGISTRATION";
$COLOR = 1;

//ITERATE OVER RECORD SET AND PRINT EACH FIELD
foreach ($this->Reguser->findAll() as $reguser)
{
IF ($COLOR == 1)
{
  ECHO "";
  $COLOR = 0;
}
ELSE
{
  ECHO "";
  $COLOR = 1;
}
ECHO "" .$reguser['id'] ."";
ECHO "" .$reguser['uname']  ."";
ECHO "" .$reguser['uemail'] ."";
ECHO "" .$reguser['date']   ."";
ECHO "";
}
ECHO "";
ECHO "";

?>




I have changed the database.php file to map to my table regusers.
The problem is when i type the address http://localhost/regusers/report
in the browser window, I get the error:
Fatal error: Call to a member function on a non-object in C:\AppServ
\www\cakephp\app\views\regusers\report.ctp on line 20
Line 20 is foreach ($this->Reguser->findAll() as $reguser)
Can someone please help me understand what this error message
indicates?
Thanks in advance!!

Regards,
phpnewbie


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



RE: cake 1.1.14.4797 - $html->input displays quotation marks as "

2007-06-01 Thread Mariano Iglesias

Update the CakePHP version. When you hit an issue that is probable a bug
ALWAYS update to latest release before posting. Chances are that it has been
previously solved.

-MI

---

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

BAKE ON!

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


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de flipcode
Enviado el: Viernes, 01 de Junio de 2007 05:07 p.m.
Para: Cake PHP
Asunto: cake 1.1.14.4797 - $html->input displays quotation marks as "

i use $html->input, i input data with quotation marks, in mysql
everything is fine, however once i display the data all quotation
marks are displayed as "


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



General gripes and questions

2007-06-01 Thread JDS

Biggest gripe with CakePHP: poor documentation.  Please note that I am
*not* a PHP newbie, and I do know the essentials that I need to know
to be able to use CakePHP.  But I guess I am just used to the
excellent PHP.net documentation... In any case, I am willing to help
clean it up if someone is willing to point me in the direction of how.

Okay, here are some general questions and comments and possibly
criticisms that I'd like addressed.

 * What is the flash() method, where is it documented, how do I use
it, and how am I supposed to know anything about it? This method is
basically undocumented (like many many other CakePHP methods and
classes)

 * Where is it mentioned how Controllers get access to the models? The
docs do not clearly describe this at all.  It is only obliquely
mentioned in subsequent sections and not in any clear and concise
manner. An example would be nice.

 * More examples in the documentation would be nice. For example, the
section in the manual on the "save()" method, for the Models, as
mentioned with the HTML Helper. This section could stand to have a
"For example" block just like the previous block does. For example,
here it is, as I have rewritten it:

  Saving Your Data

  To save data to your model, you need to supply it with the data
you wish to save. The data handed to the save() method should be in
the following form:

  Array
  (
  [ModelName] => Array
  (
  [fieldname1] => 'value'
  [fieldname2] => 'value'
  )
  )

  In order to get your data posted to the controller in this
manner, it's easiest just to use the HTML Helper to do this, because
it creates form elements that are named in the way Cake expects.

  For Example

  echo $html->input('Model/fieldname');

  You don't need to use the HTML helper, however: just make sure
your form elements have names that look like data[Modelname]
[fieldname]. But using $html->input('Model/fieldname') is easier.

 * Is there a typo in the manual? URL: http://manual.cakephp.org/chapter/models,
in all the places that say "Now, when we execute find() or findAll()
calls using the ... model, we should see our...". The example shown
always uses the "read()" method.

I have more questions but they are HABTM specific and I will start
another more specific thread for those.

Thanks all!

Love, Jeff


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



cake 1.1.14.4797 - $html->input displays quotation marks as "

2007-06-01 Thread flipcode

i use $html->input, i input data with quotation marks, in mysql
everything is fine, however once i display the data all quotation
marks are displayed as "

the $html->textarea does not show this behaviour, all quotation marks
are displayed correctly within a textarea.

what am i missing?

any thoughts on that?


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



Re: Behaviors

2007-06-01 Thread Joshua McFarren

You probably already know this but FYI to others behaviors dont work
in cake 1.1.x only 1.2.x.

> I'm considering writing a behavior to achieve some reusable model
> functionality for a 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?hl=en
-~--~~~~--~~--~--~---



Re: Behaviors

2007-06-01 Thread AD7six



On Jun 1, 8:30 pm, Joshua Benner <[EMAIL PROTECTED]> wrote:
> I'm considering writing a behavior to achieve some reusable model
> functionality for a project. I'm still in the process of reading
> through a mixture of source code, group posts, and items in the
> bakery, but I figured I'd ask for a point in the right direction:
>
> Are there any articles or such about writing a new behavior and some
> suggestions about proper usage?

The bakery source as well as some articles could be of use. Also the
tree behavior demo/test plugin I wrote might be useful:
http://cakeforge.org/projects/noswad. The description for the tree
plugin: http://www.noswad.me.uk/MiBlog/Trees

hth,

AD
PS. note that you have to move the behavior files to your app model
behavior folder for cake to find 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?hl=en
-~--~~~~--~~--~--~---



Behaviors

2007-06-01 Thread Joshua Benner

I'm considering writing a behavior to achieve some reusable model
functionality for a project. I'm still in the process of reading
through a mixture of source code, group posts, and items in the
bakery, but I figured I'd ask for a point in the right direction:

Are there any articles or such about writing a new behavior and some
suggestions about proper usage?


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



Re: Upload a File with CakePHP 1.2.0.5137alpha

2007-06-01 Thread 浪漫様

This is my way to upload a photo, create a thumbnail and show it using
an IFRAME as if it was an AJAX event


The view with the Upload Form and an Iframe to display the thumbnail -
> edit.thtml



  
File:
file('picFile'); ?>
submit('Upload'); ?>

  



The part of the controller to Upload the photo and create a thumbnail
of it

function thumbnail($file,$dir,$ancho=100,$alto=100,$gif_support=false,
$filename)
{
  if(!file_exists($file))
  {
printf("THUMBNAIL::File Error\n");
return false;
  }
  if(!is_dir($dir))
  {
printf("THUMBNAIL::Dir Error\n");
return false;
  }
  $mini = $dir.$filename;
  $origen = imageCreateFromJPEG($file);
  $imgAncho = imageSx($origen);
  $imgAlto = imageSy($origen);
  $imagen = imageCreateTrueColor($ancho,$alto);
  ImageCopyResampled($imagen,$origen,0,0,0,0,$ancho,$alto,$imgAncho,
$imgAlto);
  imageJPEG($imagen,$mini);
  return true;
}

function uploadphoto()
{
  $this->set('icono','no');
  $this->set('error','no');
  if (is_uploaded_file($this->params['form']['picFile']['tmp_name']))
  {
$uploadDir = '/var/www///httpdocs/app/webroot/img/
photos/'; // Your server's route
srand((double)microtime()*100);
$random = rand(1000,); // To make a random filename
$temporalname = $random.'.jpg';
$uploadFile = $uploadDir.$temporalname;
if ($this->params['form']['picFile']['type'] == 'image/pjpeg' ||
$this->params['form']['picFile']['type'] == 'image/jpeg')
{
   if (move_uploaded_file($this->params['form']['picFile']
['tmp_name'],$uploadFile))
  {
if(chmod($uploadFile, 0755))
{
  $this->thumbnail($uploadFile,$uploadDir,96,96,false,
$temporalname);
  $this->set('icono',$temporalname);
  $this->Session->Write('nuevaimagen',$temporalname);
}
  }
}
else
{
  $this->set('error','si');
}
  }
}


The View that display the thumbnail in the IFRAME or error if it
wasn't a JPG file


  
  image(photos/'.$icono,
array('border'=>'0','align'=>'absmiddle')); } ?>



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



Re: Upload a File with CakePHP 1.2.0.5137alpha

2007-06-01 Thread Fran Iglesias


El 01/06/2007, a las 15:31, dardosordi escribió:

> Hope it helps.
> It's all there, just read the code.

I've just found the problem.

As said, model->data is empty until Save. I was trying to access some  
data from the upload before it was available to the model. Solution:  
move all logic related to model->data to the beforeSave method (or  
where it belongs).

My logic involves some "autorouting" of the files depending on mime- 
type, and a "mode" option to store references to the file ior the  
content of the file itself n the model . File Upload model is also in  
the To Do list for my project.

Thank you.

--
Fran Iglesias
[EMAIL PROTECTED]




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



Re: i18n translation in db tables - how to do this like Symfony?

2007-06-01 Thread oleonav

Thanks jitka,

In the aspect of using Cake to develop sites I'm a beginner. So in
that respect I don't know every method of every class in the api. I
did not have time for that.

>> You get the complete tree with all available translations.
>Sure. What you expected?

Sorry for that, as stated before I'm a beginner. I was just writing my
findings to help maybe some other Cake beginners. It was not ment for
the experienced Cake developers.

Keep up the good work!


On Jun 1, 5:55 pm, jitka <[EMAIL PROTECTED]> wrote:
> > When the model is as this:
> > ---
> > var $actsAs = array('Translate' => array(
> >'title'=> 'Translations',
> >'content' => 'TranslationsContent'));
> > ---
>
> > And the findAll in the controller is changed to:
> > 
> > $this->set('news_articles', $this->NewsArticle->findAll('','','','','',
> > 2));
> > 
> > ---> recursive option is set to 2
>
> > You get the complete tree with all available translations.
>
> Sure. What you expected?
>
> There are ways, off course. You can define
> var $actsAs = array('Translate' => array('title', 'content'));
> so no hasMany association will be created for translated fields.
>
> Otherwise see api, please. I can not believe that you are using new
> feature of development version and you don't know about ONLY 2 methods
> of TranslateBehavior, which are (public && ! (callback ||
> redefinedParent))...
>
> Talking about bindTranslation() and unbindTranslation() methods ;)


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



Re: Select list behaviour

2007-06-01 Thread francky06l

Well I think because I was thinking the field you wanted to associate
with your id was "condition", but was is the real name of this field
into the database ?

On May 31, 4:19 pm, g5Maniac <[EMAIL PROTECTED]> wrote:
> No, you are not misunderstanding the problem, and thankyou for your
> response!
>
>  $this->set('conds',$this->Diagnosis->Condition->generateList(null,
> null, '{n}.Condition.id','{n}.Condition.condition'));
>
> entering that in my controller results in a sql syntax error
>
> Query: SELECT `Condition`.`id`, `Condition`.`condition`,
> `Condition`.`created_on`, `Condition`.`updated_on` FROM `conditions`
> AS `Condition` WHERE 1 = 1 LIMIT {n}.Condition.id
> Warning: SQL Error: 1064: You have an error in your SQL syntax; check
> the manual that corresponds to your MySQL server version for the right
> syntax to use near '{n}.Condition.id' at line 1
>
> I am guessing that the '{n}.Condition.id' is causing the problem and
> have tried editing that out. I still get no more that the list of id's
> in the select list in the view however
>
> On 31 May, 14:31, francky06l <[EMAIL PROTECTED]> wrote:
>
> > You explanation is not so clear, but I think you mean that the
> > generateList returns only the id and not the 'Condition' field ? If
> > so, generateList is by default making the array of the fields named
> > 'id' and 'name'.
> > As you might not have a 'name' field, you can set it into the model or
> > pass parameters to the generaList method such as :
>
> > generateList(null, null, '{n}.Condition.id',
> > '{n}.Condition.condition');
>
> > Hope this help and I am not misunderstanding the problem
>
> > On May 31, 12:10 pm, g5Maniac <[EMAIL PROTECTED]> wrote:
>
> > > Hi All,
>
> > > I am tyring to generate a select list in an edit view - all very basic
> > > stuff. I am however getting the wierdes result to my query.
>
> > > diagnosis_controller
> > > (edit)
> > >  $this->Diagnosis->id = $id;
> > >  $this->data = $this->Diagnosis->read();
> > >  $this->set('conds',$this->Diagnosis->Condition->generateList());
>
> > > edit view
> > > 
> > > 
> > >  > > $cond['Condition'] ?>
> > > 
> > > 
>
> > > This returns the id for each condition, but only 1 character of it!. I
> > > turned debug on and in the SQL I can see
> > > SELECT 'Condition'.'id' FROM 'conditions' as 'Condition' WHERE 1=1
>
> > > Now thats some bizzare SQL!
>
> > > Any Ideas?


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



Re: selectTag

2007-06-01 Thread gwoo

set $this->data['Product']['status_id']  in your controller


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



Re: Seeking PHP Developer to bake Alpha Recipe into Nice Cake

2007-06-01 Thread Joshua McFarren

Does the developer get some free "services" from your escort business?


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



Re: Seeking PHP Developer to bake Alpha Recipe into Nice Cake

2007-06-01 Thread rtconner

*golf clap for jitka*

To OP: http://withcake.com/



On Jun 1, 9:25 am, jitka <[EMAIL PROTECTED]> wrote:
> http://www.ahajokes.com/com030.html


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



Re: Image gallery - add multiple entries for a model

2007-06-01 Thread Samuel DeVore
http://tinyurl.com/3588y9

On 6/1/07, Joshua McFarren <[EMAIL PROTECTED]> wrote:
>
>
> Don't mean to hijack the thread but could you post some links to the
> gallery tutorials you found? This would be really helpful to me and
> probably others.
>
> > Before someone curses me - I did search the old wiki archives, the
> > bakery and this group's discussions and have already read several
> > gallery tutorials.
>
>
> >
>


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

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

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

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



Re: Image gallery - add multiple entries for a model

2007-06-01 Thread Joshua McFarren

Don't mean to hijack the thread but could you post some links to the
gallery tutorials you found? This would be really helpful to me and
probably others.

> Before someone curses me - I did search the old wiki archives, the
> bakery and this group's discussions and have already read several
> gallery tutorials.


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



Re: Image gallery - add multiple entries for a model

2007-06-01 Thread Samuel DeVore
If you are looping I would recommend using create()

foreach(data[Image] as image){
 $this->ImageSet->Image->create();
 $this->ImageSet->Image->save($image);
 }

On 6/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> It doesn't really matter whether you are working from the Image model
> or from the ImageSet model. If you are adding more than one record,
> simply loop through the data and add the records.
>
> See: "Saving Related Model Data" in
> http://manual.cakephp.org/chapter/models
>
> ImageSetController{
>function add(){
>   foreach(data[Image] as image){
>  $this->ImageSet->Image->save($image);
>   }
>}
> }
>
> On Jun 1, 10:17 am, Nasko <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > This is my second CakePHP-driven project, so I'm a newbie. I'm
> > building an image gallery, where images can be tagged.
> > Before someone curses me - I did search the old wiki archives, the
> > bakery and this group's discussions and have already read several
> > gallery tutorials. However, I have a feature that I cannot quite grasp
> > with respect to the CakePHP ways: instead of uploading one image at a
> > time  and invoking the 'add' action of my Image controller, I want to
> > use a flash widget which allows for multiple-file upload. The way I
> > see it, it would be best to use the 'add' action of the parent  model
> > - ImageSet to handle the multiple images uploaded.
> > My question is: how would I actually add all those images, using the
> > parent ImageSet controller?
> >
> > Thanks!
>
>
> >
>


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

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

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

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



Re: Upload a File with CakePHP 1.2.0.5137alpha

2007-06-01 Thread Tane Piper

And like magic - I've improved my version to include thumbnail
generation.  It uses Nate Constant's PHPThumb Generator Component
(http://bakery.cakephp.org/articles/view/phpthumb-component).

http://bin.cakephp.org/view/367489026

You can overide your thumbnail size in the arrayt, the default is
100x100.  The output is a file called thumb.(filename).(ext).

Tane

On 6/1/07, Tane Piper <[EMAIL PROTECTED]> wrote:
> I finally got it to work as well.  Here is my modification:
>
> http://bin.cakephp.org/view/367489026
>
> This one takes the upload file name, and corrects is for "bad"
> characters such as whitespace, & and + and replaces them with
> friendlier versions.
>
> Please feel free to play about, and make better (i'm going to look at
> adding the thumbnail stuff)
>
> Tane
>
> On 6/1/07, dardosordi <[EMAIL PROTECTED]> wrote:
> >
> > > By the way, I'm not sure about the placement of upload files as a
> > > behavior. I see it on the controller layer, but not so sure :-(.
> >
> > Yeah, I've thought it too, but then put it this way: uploading a file
> > is storing data, then is a model thing. And the behaviour was there
> > (Thanks a lot Chris Partridge! ) and works pretty well.
> >
> > This is how I tweaked it:
> >
> > Tweaked Behaviour: http://bin.cakephp.org/saved/19658
> >
> > Example:
> >
> > Model : http://bin.cakephp.org/saved/19659
> >
> > Controller: http://bin.cakephp.org/saved/19660
> >
> > View:  http://bin.cakephp.org/saved/19661
> >
> > Hope it helps.
> >
> > Also I use this amazing helper: 
> > http://bakery.cakephp.org/articles/view/image-resize-helper
> > and put some code in the behaviour to delete cached thumbs when the
> > record is deleted.
> >
> > It's all there, just read the code.
> >
> >
> >
> > > >
> >
>

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



Re: i18n translation in db tables - how to do this like Symfony?

2007-06-01 Thread jitka

> When the model is as this:
> ---
> var $actsAs = array('Translate' => array(
>   'title'=> 'Translations',
>   'content' => 'TranslationsContent'));
> ---
>
> And the findAll in the controller is changed to:
> 
> $this->set('news_articles', $this->NewsArticle->findAll('','','','','',
> 2));
> 
> ---> recursive option is set to 2
>
> You get the complete tree with all available translations.

Sure. What you expected?

There are ways, off course. You can define
var $actsAs = array('Translate' => array('title', 'content'));
so no hasMany association will be created for translated fields.

Otherwise see api, please. I can not believe that you are using new
feature of development version and you don't know about ONLY 2 methods
of TranslateBehavior, which are (public && ! (callback ||
redefinedParent))...

Talking about bindTranslation() and unbindTranslation() methods ;)


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



Re: Image gallery - add multiple entries for a model

2007-06-01 Thread [EMAIL PROTECTED]

It doesn't really matter whether you are working from the Image model
or from the ImageSet model. If you are adding more than one record,
simply loop through the data and add the records.

See: "Saving Related Model Data" in http://manual.cakephp.org/chapter/models

ImageSetController{
   function add(){
  foreach(data[Image] as image){
 $this->ImageSet->Image->save($image);
  }
   }
}

On Jun 1, 10:17 am, Nasko <[EMAIL PROTECTED]> wrote:
> Hello,
>
> This is my second CakePHP-driven project, so I'm a newbie. I'm
> building an image gallery, where images can be tagged.
> Before someone curses me - I did search the old wiki archives, the
> bakery and this group's discussions and have already read several
> gallery tutorials. However, I have a feature that I cannot quite grasp
> with respect to the CakePHP ways: instead of uploading one image at a
> time  and invoking the 'add' action of my Image controller, I want to
> use a flash widget which allows for multiple-file upload. The way I
> see it, it would be best to use the 'add' action of the parent  model
> - ImageSet to handle the multiple images uploaded.
> My question is: how would I actually add all those images, using the
> parent ImageSet controller?
>
> Thanks!


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



Re: i18n translation in db tables - how to do this like Symfony?

2007-06-01 Thread jitka

> 3. Create a demo article in news_articles
> 4. Add some demo data to i18n

You can use your model as usually:
$this->News->save(array('News'=>array('title'=>'blabla', 'content' =>
'foo_bar)));

> Changing $this->NewsArticle->locale to 'en' would fetch english
> content.
>
> It would probably be best to set this locale via a beforefilter in
> this controller or the appcontroller for real use.

If you will not initialize property $this->News->locale, cake will use
locale, which belongs to your preferred language in browser (or to
value in 'Config.language' key in session or Configure singleton).

If You will set $this->News->locale = false; then cake will not fetch
any translation.

> - The ability to fetch default data when the data is not available in
> the database in the requested language. For example a news article is
> not available in French so the English version would be fetched by the
> model given English is the default language of the site.

Work in progress. After next commit to TranslateBehavior you will be
able to set locale property of model to array.

> - Some sort of indicator stating the requested language is not
> available so a version in the default language is given.

That's why 'locale' key is in returned 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?hl=en
-~--~~~~--~~--~--~---



Re: Checkbox

2007-06-01 Thread Joshua McFarren

Deja vu

Make sure you define the helpers you need in the controllers that use
that layout. ie:

class FoobarsController extends AppController {

var $name = 'Foobars';
var $helpers = array('Html', 'Form' , 'Habtm');

If that doesn't solve it what version of cake are you using?



On Jun 1, 11:31 am, cake_learner <[EMAIL PROTECTED]> wrote:
> I am getting error: Class 'HtmlHelper' not found
>
> On Jun 1, 7:06 pm, Joshua McFarren <[EMAIL PROTECTED]> wrote:
>
> > Check out this helper:
>
> >http://bakery.cakephp.org/articles/view/create-multiple-checkboxes-in...


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



Re: Checkbox

2007-06-01 Thread cake_learner

I am getting error: Class 'HtmlHelper' not found

On Jun 1, 7:06 pm, Joshua McFarren <[EMAIL PROTECTED]> wrote:
> Check out this helper:
>
> http://bakery.cakephp.org/articles/view/create-multiple-checkboxes-in...


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



Re: i18n translation in db tables - how to do this like Symfony?

2007-06-01 Thread oleonav

Some info about:


 The following issues need to be resolved for my project;
- The ability to fetch default data when the data is not available in
the database in the requested language. For example a news article is
not available in French so the English version would be fetched by the
model given English is the default language of the site.

When the model is as this:
---
var $actsAs = array('Translate' => array(
'title'=> 'Translations',
'content' => 'TranslationsContent'));
---

And the findAll in the controller is changed to:

$this->set('news_articles', $this->NewsArticle->findAll('','','','','',
2));

---> recursive option is set to 2

You get the complete tree with all available translations. Problem is
that for each found record in the database news_articles a lot of
queries are made:

Formula:
count found records X count fields to be translated X count of
languages

So for example in a list view:
- Found 10 articles
- 3 fields in a news articles (title,introduction,content)
- 4 languages

This makes 10 X 3 X 4 = 120 !!!


This would not be a good solution to retrieve translations.

...


On Jun 1, 4:23 pm, oleonav <[EMAIL PROTECTED]> wrote:
> Thank you all, I have successfully implemented translations.
>
> The implementation to help other facing the same situation:
>
> 1. Create the i18n tables from the sql file /config/sql/i18n.sql
> 2. Create the news_articles table
>id (int8) prim key, auto incr.
> other fields like created_at, updates_at 
>
> 3. Create a demo article in news_articles
> id  created_at
> 1   2007-06-01 14:55:41
>
> 4. Add some demo data to i18n
> 
> id  content
> 1   Title in english
> 2   Titre en français
> 3   Content in english
> 4   Contenu en français
> 
>
> 5. Add some demo data to i18n_content
> 
> id  locale  i18n_content_id model   row_id  field
> 1   en  1   NewsArticle 1   title
> 2   fr  2   NewsArticle 1   title
> 3   en  3   NewsArticle 1   content
> 4   fr  4   NewsArticle 1   content
> -
>
> 6. Build the model for news_article (/models/news_article.php)
> 
> class NewsArticle extends AppModel{
> var $name = 'NewsArticle';
> var $actsAs = array('Translate' => array('title','content'));}
>
> 
> (title,content are the fields to translate. Add more for every field)
>
> 7. Basic news_articles controller with index action (/controllers/
> news_articles_controller.php)
> 
> class NewsArticlesController extends AppController{
> var $name = 'NewsArticles';
>
> function index(){
> //set the required language identifier here, 'en' or 'fr' in 
> this
> example
> $this->NewsArticle->locale = 'fr';
>
> $this->set('news_articles', $this->NewsArticle->findAll());
> }}
>
> ---
> Changing $this->NewsArticle->locale to 'en' would fetch english
> content.
>
> It would probably be best to set this locale via a beforefilter in
> this controller or the appcontroller for real use.
>
> 8. Basic view, nothing fancy (/views/news_articles/index.ctp):
> 
> 
> 
> ID:
> Title / Content:
> 
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
> 
>
> The following issues need to be resolved for my project;
> - The ability to fetch default data when the data is not available in
> the database in the requested language. For example a news article is
> not available in French so the English version would be fetched by the
> model given English is the default language of the site.
> - Some sort of indicator stating the requested language is not
> available so a version in the default language is given.
>
> Maybe this sort of functionality is already in Cake 1.2. If someone
> knows something about this issue then this would be very helpful also.
>
> Thanks,
>
> On Jun 1, 1:33 pm, jitka <[EMAIL PROTECTED]> wrote:
>
> > > Do I understand it right that the table i18n & i18n_content stores
> > > translations for each table that uses it?
>
> > Yes.
>
> > > If that's right the structure for news would be:
>
> > > Table: news
> > > id: int(8)
> > > title: varchar(255)
> > > content: text
> > > ...other fields
>
> > No. Structure for table 'news' will be
> > id: int(8)
> > ...other fields
>
> > because all translated fields (title and content in your case) are
> > only virtual, managed by TranslateBehavior in i18n tables.


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

Re: Seeking PHP Developer to bake Alpha Recipe into Nice Cake

2007-06-01 Thread jitka

http://www.ahajokes.com/com030.html


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



Re: selectTag

2007-06-01 Thread pete

thanks for your reply, not as a default value, i just couldnt find out
how it works to set a value as "selected"
thanks

On May 31, 7:52 pm, metasan <[EMAIL PROTECTED]> wrote:
> hi,
>
> 1. i think this error is due to this line :
>
> selectTag('status_id', $status, null, array(),
> null, false, false); ?>
>
> try to replace  fieldname with "Modelname/fieldname".
>
> 2. do you want to select delivered as a default value ?
>
> On Jun 1, 10:32 am,pete<[EMAIL PROTECTED]> wrote:
>
> > hi,
> > im trying to add the selectTag. the select field shows up but i get
> > the following warning:
>
> > Notice: Undefined offset: 1 in C:\Apache\xampp\htdocs\cake\cake\libs
> > \view\helpers\html.php on line 950
>
> >  selectTag('status_id', $status, null, array(),
> > null, false, false); ?>
>
> > 
> > Declined
> > Deleted
> > Delivered
> > Inquiring
> > Invoiced
> > Open
> > Qualifying
> > 
>
> > 1. has anyone an idea why i get the notice?
> > 2. how can i set Delivered as SELECTED ?
>
> > thank you
>
> >pete


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



Re: Upload a File with CakePHP 1.2.0.5137alpha

2007-06-01 Thread Tane Piper

I finally got it to work as well.  Here is my modification:

http://bin.cakephp.org/view/367489026

This one takes the upload file name, and corrects is for "bad"
characters such as whitespace, & and + and replaces them with
friendlier versions.

Please feel free to play about, and make better (i'm going to look at
adding the thumbnail stuff)

Tane

On 6/1/07, dardosordi <[EMAIL PROTECTED]> wrote:
>
> > By the way, I'm not sure about the placement of upload files as a
> > behavior. I see it on the controller layer, but not so sure :-(.
>
> Yeah, I've thought it too, but then put it this way: uploading a file
> is storing data, then is a model thing. And the behaviour was there
> (Thanks a lot Chris Partridge! ) and works pretty well.
>
> This is how I tweaked it:
>
> Tweaked Behaviour: http://bin.cakephp.org/saved/19658
>
> Example:
>
> Model : http://bin.cakephp.org/saved/19659
>
> Controller: http://bin.cakephp.org/saved/19660
>
> View:  http://bin.cakephp.org/saved/19661
>
> Hope it helps.
>
> Also I use this amazing helper: 
> http://bakery.cakephp.org/articles/view/image-resize-helper
> and put some code in the behaviour to delete cached thumbs when the
> record is deleted.
>
> It's all there, just read the code.
>
>
>
> >
>

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



Re: Suppressing the label in form->select

2007-06-01 Thread Mirko

At first I didn't get it.
$form-> input now handles everything, all you need to do is play
around with the options array passed to it.

Hooray for supersmart $form-> input ;)


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



Seeking PHP Developer to bake Alpha Recipe into Nice Cake

2007-06-01 Thread objectfetish

Sorry to serve SPAM for dessert, but I'm looking for a good coder who
likes interesting challenges a la cuisine.

Consider this a pudding cake, where you bake a cake, then break it
into pieces, and re-bake it with a pudding. It's like bread pudding,
only better. My wife made a chocolate spice bread pudding cake 10
years ago and we still talk about it.

Anyway, here's the abstract confection:

We've basically got a matchmaking site in a certain service provider
domain. It's not a find-a-dessert-date site, but it's a find-a-person
who can provide the service I'm looking for, with ratings, comments,
member to member emails, flagging, keywords, browse/search and in the
future, different membership levels.

The problem with the pie is that the OOP and the MVC are not well
blended with the mixture. Someone wasn't following the recipe. Hmm.
But the chef is still a very friendly guy who did quite a bit of nice
baking so far. However, the cake needs to rise, puff, steam and emit a
fantastic aroma.

I'd prefer to find someone in Eastern Europe because that will work
with my cooking classes this summer. The goal is to fix all the
imperfections in the short term and completely understand the site
while getting the alpha up and running and safely in beta (be great if
you were a sysadmin too) and then rewrite the whole recipe in a Cake
framework.

Have a nice breakfast, lunch and dinner.


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



Re: Pretty URL's

2007-06-01 Thread Nicolas Rimbeau

I guess yes... I don't get what's wrong, sorry.

On 6/1/07, Arndtinho <[EMAIL PROTECTED]> wrote:
>
> I ask the server admin at the hosting company - mod_rewrite is
> enabled.
> Normaly it should be working without any changes or not?
>
> Regards,
> Arndtinho
>
>
> On 31 Mai, 10:41, "Nicolas Rimbeau" <[EMAIL PROTECTED]> wrote:
> > I have the same result and it's working. What you want is urls without
> > any interrogation mark ?
> >
> > According to the ticket, "Cake does not work without mod_rewrite under
> > CGI", and you've just written "Apache/1.3.33 (Unix), Server API: CGI,
> > PHP Version 4.4.7". I am afraid you'll always need the '?' to make it
> > work with this configuration...
> >
> > On 5/31/07, Arndtinho <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > Thanks.
> > > I tried this configuration:
> >
> > > define ('BASE_URL', env('SCRIPT_NAME') . '?'); -> old: define
> > > ('BASE_URL', env('SCRIPT_NAME') );
> > > $uri = env('PHP_SELF') . env('QUERY_STRING'); -> old: $uri = setUri();
> >
> > > And this is the result now:http://www.mydomain.de/index.php?/main/index
> >
> > > I checked the server configuration with phpinfo(): Apache/1.3.33
> > > (Unix), Server API: CGI, PHP Version 4.4.7
> > > I'm clueless.
> >
> > > Regards,
> > > Arndtinho
> >
> > > On 30 Mai, 21:55, "Nicolas Rimbeau" <[EMAIL PROTECTED]> wrote:
> > > > On 5/31/07, Arndtinho <[EMAIL PROTECTED]> wrote:
> >
> > > > > Hello,
> >
> > > > > I have some problems with pretty url's. Following the domain name you
> > > > > can see "index.php" e.g.
> >
> > > > >http://www.mydomain.de/index.php/main/index
> >
> > > > > On my local machine (WinXP, Apache2, mod_rewrite is enabled) works the
> > > > > app without any problems. But on the webserver I get this problems. I
> > > > > don't have permissons to change the httpd.conf.
> >
> > > > > What I did:
> > > > > - uploaded the app on the server,
> > > > > - deleted the .htaccess files in
> >
> > > > > /appdir
> > > > > /appdir/app
> > > > > /appdir/app/webroot
> >
> > > > > - and uncommented the BASE_URL line. The result you can see above.
> >
> > > > > If I try to start the app with all the .htaccess files I getting an
> > > > > "500 server error".
> > > > > To draw a comparison I installed the same app (with all the .htaccess
> > > > > files and commented BASE_URL line) on an testing webserver at an other
> > > > > host. On this host the app is working fine.
> >
> > > > > What do you think is the reason for the problem above and how can I
> > > > > solve it?
> >
> > > > > Regards,
> > > > > Arndtinho
> >
> > > > I recently had the same problem... I think this can help you :
> >
> > > >https://trac.cakephp.org/ticket/812
> >
> > > > Regards,
> >
> > > > --
> > > > Nico
> > > > "Sanctis recorda, sanctis deus rex"
>
>
> >
>


-- 
Nico
"Sanctis recorda, sanctis deus rex"

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



Image gallery - add multiple entries for a model

2007-06-01 Thread Nasko

Hello,

This is my second CakePHP-driven project, so I'm a newbie. I'm
building an image gallery, where images can be tagged.
Before someone curses me - I did search the old wiki archives, the
bakery and this group's discussions and have already read several
gallery tutorials. However, I have a feature that I cannot quite grasp
with respect to the CakePHP ways: instead of uploading one image at a
time  and invoking the 'add' action of my Image controller, I want to
use a flash widget which allows for multiple-file upload. The way I
see it, it would be best to use the 'add' action of the parent  model
- ImageSet to handle the multiple images uploaded.
My question is: how would I actually add all those images, using the
parent ImageSet controller?

Thanks!


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



Re: i18n translation in db tables - how to do this like Symfony?

2007-06-01 Thread oleonav

Thank you all, I have successfully implemented translations.

The implementation to help other facing the same situation:

1. Create the i18n tables from the sql file /config/sql/i18n.sql
2. Create the news_articles table
   id (int8) prim key, auto incr.
    other fields like created_at, updates_at 

3. Create a demo article in news_articles
id  created_at
1   2007-06-01 14:55:41

4. Add some demo data to i18n

id  content
1   Title in english
2   Titre en français
3   Content in english
4   Contenu en français


5. Add some demo data to i18n_content

id  locale  i18n_content_id model   row_id  field
1   en  1   NewsArticle 1   title
2   fr  2   NewsArticle 1   title
3   en  3   NewsArticle 1   content
4   fr  4   NewsArticle 1   content
-

6. Build the model for news_article (/models/news_article.php)

class NewsArticle extends AppModel{
var $name = 'NewsArticle';
var $actsAs = array('Translate' => array('title','content'));
}

(title,content are the fields to translate. Add more for every field)

7. Basic news_articles controller with index action (/controllers/
news_articles_controller.php)

class NewsArticlesController extends AppController{
var $name = 'NewsArticles';

function index(){
//set the required language identifier here, 'en' or 'fr' in 
this
example
$this->NewsArticle->locale = 'fr';

$this->set('news_articles', $this->NewsArticle->findAll());
}
}
---
Changing $this->NewsArticle->locale to 'en' would fetch english
content.

It would probably be best to set this locale via a beforefilter in
this controller or the appcontroller for real use.

8. Basic view, nothing fancy (/views/news_articles/index.ctp):



ID:
Title / Content:

















The following issues need to be resolved for my project;
- The ability to fetch default data when the data is not available in
the database in the requested language. For example a news article is
not available in French so the English version would be fetched by the
model given English is the default language of the site.
- Some sort of indicator stating the requested language is not
available so a version in the default language is given.

Maybe this sort of functionality is already in Cake 1.2. If someone
knows something about this issue then this would be very helpful also.

Thanks,




On Jun 1, 1:33 pm, jitka <[EMAIL PROTECTED]> wrote:
> > Do I understand it right that the table i18n & i18n_content stores
> > translations for each table that uses it?
>
> Yes.
>
> > If that's right the structure for news would be:
>
> > Table: news
> > id: int(8)
> > title: varchar(255)
> > content: text
> > ...other fields
>
> No. Structure for table 'news' will be
> id: int(8)
> ...other fields
>
> because all translated fields (title and content in your case) are
> only virtual, managed by TranslateBehavior in i18n tables.


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



Re: Checkbox

2007-06-01 Thread Joshua McFarren

Check out this helper:

http://bakery.cakephp.org/articles/view/create-multiple-checkboxes-instead-of-a-multiple-select-in-your-views


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



Checkbox

2007-06-01 Thread cake_learner

I have a table named languages where language names are stored.  I
want to retrive those language names and give options to users in in
a
checkbox[] type.

I tried,
code in views:





 checkbox('Language/language',
$title = null,
$htmlAttributes = array($lang['Language']['language_id']), $return =
false); echo $lang['Language']['language_name'];?>



When i post,  i am getting value of only one checkbox


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



More production installation woes.

2007-06-01 Thread Beowolf

I've been working with a local cake install, and everything has been
fine.  All the folders are in a subfolder of DocumentRoot.

I had a few problems when uploading it to my isp.  The manual doesn't
seem to cover my circumstances, and most threads about it I could find
refer to the defunct wiki.

First off, I can't change documentroot.

There is already a site up at www.beowolf.org.uk, and this needs to
remain untouched.  I have an addon domain, www.foo.com, pointing to
www.beowolf.org.uk/foo, and this is where I want the app to be
located.

I finally found a thread that suggested the following layout:

--home/beowolf/public_html
---/cake
---/cake
---/docs
---/scripts
---/etc
---/foo
/config
/controllers
/models
/etc

This works.

But - there has to be a but - I'm getting /webroot prepended to any
urls.

If I go to www.foo.com/about, it is displayed correctly.  It links to
the page /contact - but the link is actually /webroot/contact.
clicking on it works, and the 'backlink' to /about is now /webroot/
about - and this also works.

Of course, I'd rather not have /webroot in the url.

I hope all this makes sense.

(These pages are all static, and served by the pages controller.)


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



Re: Suppressing the label in form->select

2007-06-01 Thread dardosordi

Think first why it should.

On May 31, 7:08 pm, Mirko <[EMAIL PROTECTED]> wrote:
> FormHelper::select() doesn't issue a label tag, just the select tag.
>
> Yes, and not even surrounding , but why???


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



Re: Upload a File with CakePHP 1.2.0.5137alpha

2007-06-01 Thread dardosordi

> By the way, I'm not sure about the placement of upload files as a
> behavior. I see it on the controller layer, but not so sure :-(.

Yeah, I've thought it too, but then put it this way: uploading a file
is storing data, then is a model thing. And the behaviour was there
(Thanks a lot Chris Partridge! ) and works pretty well.

This is how I tweaked it:

Tweaked Behaviour: http://bin.cakephp.org/saved/19658

Example:

Model : http://bin.cakephp.org/saved/19659

Controller: http://bin.cakephp.org/saved/19660

View:  http://bin.cakephp.org/saved/19661

Hope it helps.

Also I use this amazing helper: 
http://bakery.cakephp.org/articles/view/image-resize-helper
and put some code in the behaviour to delete cached thumbs when the
record is deleted.

It's all there, just read the code.



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



Re: Insert record with empty strings

2007-06-01 Thread Eugene Bolshakov

Thanks, but it seems that behavior (or beforeSave callback) won't help
cause cake simply strips out empty string values in DboSource::create
(after callback).

If for example there were some constant say

define(EMPTY_STRING, 'SOMETHINGREPRESENTINGEMPTYSTRING') and in
DboSource::create there was something like

if ($set === "''") {
   unset ($fieldInsert[$i]);
} elseif ($set === EMPTYSTRING) {
   $valueInsert[] = '';
} else {
   $valueInsert[] = $set;
}

Then I could write a behavior that would have beforeSave that would
replace empty strings for certain fields with that constant and it
would work, but that's a dirty hack I think.


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



Re: Using several models from one controller

2007-06-01 Thread [EMAIL PROTECTED]


You are right... oops.

Actually I am now using:

   $this->Status->recursive=0;
   $statusName = $this->Status->read( 'status', $sta );

Which is working perfectly

Erm... I think I read somewhere (possibly the manual) that one can
use
findAllBy as a method to quickly get to the information you
want!

Thanks, you made my day... I overlooked the obvious :-)

Paul


On 1 jun, 14:21, Joshua Benner <[EMAIL PROTECTED]> wrote:
> You're calling directly to the class, instead do this from the controller:
>
> $this->Status->findAll()
>
> ... and I'm not seeing findAllById() in the model API -- where did that
> come from?
>
> [EMAIL PROTECTED] wrote:
> > I use
> > $statusRow = Status::findAllById( $sta );
>
> > But then it gives me the error:
> > Call to undefined function: findallbyid()
>


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



Re: using uuid component to create id's into my model

2007-06-01 Thread grigri

I'd create a behavior. Of course models shouldn't access components,
so the logic from the component should be transferred to the behavior
itself. Something like this: http://pastebin.sk/en/1752/ (not tested,
just quickly written)

Cheers
grigri

On 30 May, 22:53, Langdon Stevenson <[EMAIL PROTECTED]> wrote:
> Interesting solution.  I have been generating UUIDs in PHP for one of my
> projects as my ISP only offers MySQL 4.x.
>
> Regards,
> Langdon
>
> Divagater wrote:
> > I use database triggers to handle writing UUID's for all of my id's.
> > This is not a PHP solution and may or may not be appropriate for
> > scalability across a wide range of databases. In MySQL a trigger to to
> > add a UUID as the id of a particular table would look like this:
>
> > CREATE TRIGGER `posts_id` BEFORE INSERT ON `posts` FOR EACH ROW SET
> > NEW.id = UUID();
>
> > Cheers,
> > Divagater


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



Re: Using several models from one controller

2007-06-01 Thread Joshua Benner

You're calling directly to the class, instead do this from the controller:

$this->Status->findAll()

... and I'm not seeing findAllById() in the model API -- where did that 
come from?

[EMAIL PROTECTED] wrote:
> Hi All,
>
> I know it is a FAQ, but I can't seem to get it to work.
>
> I have a Pet model and a Status model, both with associations that are
> working etc.
>
> In my PetsController I have the following line
> $uses = array( 'Pet', 'Status' );
>
> Then in one of the actions in that controller I want to get a row from
> the database using a given $sta, which is a sanitized entry from the
> url and has the correct content.
>
> I use
> $statusRow = Status::findAllById( $sta );
>
> But then it gives me the error:
> Call to undefined function: findallbyid()
>
> What am I doing wrong here?
>
> Thanks,
> Paul
>
>
> >
>   

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



Using several models from one controller

2007-06-01 Thread [EMAIL PROTECTED]

Hi All,

I know it is a FAQ, but I can't seem to get it to work.

I have a Pet model and a Status model, both with associations that are
working etc.

In my PetsController I have the following line
$uses = array( 'Pet', 'Status' );

Then in one of the actions in that controller I want to get a row from
the database using a given $sta, which is a sanitized entry from the
url and has the correct content.

I use
$statusRow = Status::findAllById( $sta );

But then it gives me the error:
Call to undefined function: findallbyid()

What am I doing wrong here?

Thanks,
Paul


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



Re: URL conventions - controller name consists of two words

2007-06-01 Thread AD7six



On 1 jun, 13:19, "Jon Bennett" <[EMAIL PROTECTED]> wrote:
> > Don't know what SEO purist would have to say though (although for example 
> > it doesn't seem
> > to affect one way or the other how you write your urls to Google).
>
> I've read/heard differently. I believe that hyphens (-) are better
> than underscores because search engines see underscored_words as
> oneword, whereas hypenated-words-are-seen as separate.
>
> what impact this has is much harder to qunatify though!

I've read/heard similar stuff too. If that were the case though I
would assume camel cased words would be even worse - since it would be
seen as a single long word, but (using some key words from a recent
blog).:

http://www.google.com/search?q=making+the+most+of+the+router
http://www.google.com/search?q=router+making+most (word order of
little importance)
http://uk.search.yahoo.com/search?p=making+the+most+of+the+router
http://uk.search.yahoo.com/search?p=router+making+most (word order of
little importance)

return almost the same results (my blog site is in page 1 of each of
those searches at the time of writing). I noticed that if you delete
one character from the end of any search term the results are vastly
different, so it seems to me that word boundaries are detected for
camel case words quite easily also.

IMO SEs are camel/dash/underscore/etc. aware and therefore it
shouldn't make any difference but as I'm not a SE developer: "purely
IMO" :).

Cheers,

AD


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



checkbox

2007-06-01 Thread cake_learner

I have a table named languages where language names are stored.  I
want to retrive those language names and give options to users in in a
checkbox[] type.

I tried,
code in views:



 checkbox('Language/language', $title = null,
$htmlAttributes = array($lang['Language']['language_id']), $return =
false); echo $lang['Language']['language_name'];?>


When i post,  i am getting value of only one checkbox


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



Re: Insert record with empty strings

2007-06-01 Thread grigri

You should read this bakery article: 
http://bakery.cakephp.org/articles/view/null-behavior

It's not exactly what you want, but should give you some pointers on
the best way to handle the situation.

On 1 Jun, 08:59, Eugene Bolshakov <[EMAIL PROTECTED]> wrote:
> When I want to save a record with some fields set to empty strings
> cake strips them out (from DboSource::create):
>
> >> if ($set === "''") {
> >>unset ($fieldInsert[$i]);
> >> } else {
> >>$valueInsert[] = $set;
> >>}
>
> And since I use MySQL 5 and the fields that I'm trying to save empty
> strings to are NOT NULL I get an error from MySQL (from mysql docs):
>
> As of MySQL 5.0.2, if a column definition includes no explicit DEFAULT
> value, MySQL determines the default value as follows:
>
> If the column can take NULL as a value, the column is defined with an
> explicit DEFAULT NULL clause. This is the same as before 5.0.2.
>
> If the column cannot take NULL as the value, MySQL defines the column
> with no explicit DEFAULT clause. For data entry, if an INSERT or
> REPLACE statement includes no value for the column, MySQL handles the
> column according to the SQL mode in effect at the time:
>
> * If strict SQL mode is not enabled, MySQL sets the column to the
> implicit default value for the column data type.
> * If strict mode is enabled, an error occurs for transactional
> tables and the statement is rolled back. For non-transactional tables,
> an error occurs, but if this happens for the second or subsequent row
> of a multiple-row statement, the preceding rows will have been
> inserted.
>
> Text/blob fields can't have a default value, so I don't see a way for
> me to solve this other than to alter cake DboSource::create code, but
> I'm really interested why does DboSource::create strips empty strings,
> what is the reason for this and what is the best solution here?
>
> Thanks.


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



Re: i18n translation in db tables - how to do this like Symfony?

2007-06-01 Thread jitka

Hi rrjanbiah, I saw in irc logs that you're looking for me, but
unfortunately we're in different timezones (GMT +1 here) and I have
regular fulltime job, so it is probably hard to meet there.

Example I gave to you *should* work. At least it works for me. Try it
with fresh (means empty) cake installation, please.


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



Re: Problem with CakePHP

2007-06-01 Thread Greg

oops.  i think that url should actually be "http://localhost:7070/cake/
index.php/notes", according to your post.


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



Re: Problem with CakePHP

2007-06-01 Thread Greg

note_controller.php should be notes_controller.php.  Also, if you are
using cake's pretty urls (you uncommented line 41 in app/config/
core.php), you access your controller with a url like "http://
localhost:7070/index.php/notes"


On Jun 1, 3:28 am, sonic <[EMAIL PROTECTED]> wrote:
> Hi all,
>
>   I'm a greenhorn at CakePHP. I use XAMPP for Apache,MySQL. I
> download and configure CakePHP as Manual ask me to do. CakePHP is
> properly work when I call "http://localhost:7070/cake/";. It show two
> messages " 1. Your database configuration file is present. and 2. Cake
> is able to connect to the database."
>   I face the problem when I test a tutorial "notes". I create
> index.thtml, add.thtml and view.thtml under "app\views\notes". Then I
> create note_controller.php under "app\controllers" and note.php under
> "app\model". As Tutorial says I call "http://localhost:7070/notes";,
> but I found that error " Object not found!".
>
>  Where do I need to change to run this "notes"? What
> configuration need to change?
>
> Please help me!
>
>Thanks in advance!
>
> sonic


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



Re: i18n translation in db tables - how to do this like Symfony?

2007-06-01 Thread jitka

> Do I understand it right that the table i18n & i18n_content stores
> translations for each table that uses it?

Yes.

> If that's right the structure for news would be:
>
> Table: news
> id: int(8)
> title: varchar(255)
> content: text
> ...other fields

No. Structure for table 'news' will be
id: int(8)
...other fields

because all translated fields (title and content in your case) are
only virtual, managed by TranslateBehavior in i18n tables.


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



Re: URL conventions - controller name consists of two words

2007-06-01 Thread Jon Bennett

> Don't know what SEO purist would have to say though (although for example it 
> doesn't seem
> to affect one way or the other how you write your urls to Google).

I've read/heard differently. I believe that hyphens (-) are better
than underscores because search engines see underscored_words as
oneword, whereas hypenated-words-are-seen as separate.

what impact this has is much harder to qunatify though!

jb


-- 


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

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



Re: URL conventions - controller name consists of two words

2007-06-01 Thread AD7six



On 31 mayo, 15:54, Preloader <[EMAIL PROTECTED]> wrote:
> Helly bakers,
>
> I hope this is not a strange/stupid question, but (i think) i didn't
> find the answer in the cake manual ("conventions").
>
> I have a controller for link categories.
>
> Classname: LinkCategoriesController
> Filename: link_categories_controller.php
>
> But what's the controller name? linkCategories, LinkCategories or
> link_categories?
>
> All the three work:
>
> 1)http://mydomain.com/linkCategories/view/1
> 2)http://mydomain.com/LinkCategories/view/1
> 3)http://mydomain.com/link_categories/view/1
>
> But what is correct?

cake expects you to use lowercase and underscored urls, so you could
say that 3 is correct in that it's consistent.

I prefer 2, but I think I'm in a minority :D. Don't know what SEO
purist would have to say though (although for example it doesn't seem
to affect one way or the other how you write your urls to Google).

Cheers,

AD


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



Problem with CakePHP

2007-06-01 Thread sonic

Hi all,

  I'm a greenhorn at CakePHP. I use XAMPP for Apache,MySQL. I
download and configure CakePHP as Manual ask me to do. CakePHP is
properly work when I call " http://localhost:7070/cake/ ". It show two
messages " 1. Your database configuration file is present. and 2. Cake
is able to connect to the database."
  I face the problem when I test a tutorial "notes". I create
index.thtml, add.thtml and view.thtml under "app\views\notes". Then I
create note_controller.php under "app\controllers" and note.php under
"app\model". As Tutorial says I call " http://localhost:7070/notes ",
but I found that error " Object not found!".

 Where do I need to change to run this "notes"? What
configuration need to change?

Please help me!

   Thanks in advance!

sonic


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



Re: Upload a File with CakePHP 1.2.0.5137alpha

2007-06-01 Thread Fran Iglesias


El 31/05/2007, a las 14:48, dardosordi escribió:

> save http://bin.cakephp.org/saved/17539 as app/models/behaviors/
> upload.php

Hi, I've tried a similar approach to write an upload behavior (my  
first behavior, yes, another newBaker) based on this example but it  
fails when adding new models, because model->data array contains  
nothing before save and the setup method tries to access it.

By the way, I'm not sure about the placement of upload files as a  
behavior. I see it on the controller layer, but not so sure :-(.

I would like to find some documentation about the inners of writing  
behaviors, not only api or sample code (useful, but a bit difficult  
for a starter). Some sort of empty template... Any ideas?

--
Fran Iglesias
[EMAIL PROTECTED]




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



Re: i18n translation in db tables - how to do this like Symfony?

2007-06-01 Thread R. Rajesh Jeba Anbiah

On Jun 1, 3:26 pm, oleonav <[EMAIL PROTECTED]> wrote:
  
> Do I understand it right that the table i18n & i18n_content stores
> translations for each table that uses it? So a news table and a pages
> table store their translations in the same i18n combo?
  

   FWIW, poLK has done some example in Translate behavior and she gave
the link to me, but I don't get it working. I have already added it in
; if
you can get it working or have any thoughts, kindly share.

--
  
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


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



Re: i18n translation in db tables - how to do this like Symfony?

2007-06-01 Thread oleonav

Hi jcsiegr...,

Thank's for your quick reply.

Do I understand it right that the table i18n & i18n_content stores
translations for each table that uses it? So a news table and a pages
table store their translations in the same i18n combo?

If that's right the structure for news would be:

Table: news
id: int(8)
title: varchar(255)
content: text
...other fields

Example record for news
id = 5
title = title for this article
content = some content...

Example record 1 in i18n:
id= autoincr. value...
locale= en_US
i18n_content_id= 10  (---> id from i18n_content record)
model= News
row_id= 5 (---> id from news table)
field= title

Example record 2 in i18n:
id= autoincr. value...
locale= fr_FR
i18n_content_id= 11  (---> id from i18n_content record)
model= News
row_id= 5 (---> id from news table)
field= title

Example record 1 (en_US) in i18n_content
id = 10 (---> as used in i18n example record 1 / i18n_content_id)
content = Title in english

Example record 2 (fr_FR) in i18n_content
id = 11 (---> as used in i18n example record 2 / i18n_content_id)
content = Titre en français

An so on...  for the content field in news there would be 2 records in
i18n and 2 records in i18n_content?

Ok, if I am right in the above example how should I adjust your code
example in the model for news, and would that be all ?

var $actsAs = array('Translate' => array(
 'title'=> 'Translations',
 'abstract' => 'TranslationsAbstract',
 'text' => 'TranslationsText',
 );

Thanks,


On Jun 1, 7:27 am, jcsiegrist <[EMAIL PROTECTED]> wrote:
> The new translation behavior of cake 1.2 will handle the translation
> in the db.
>
> To use init the I18n db tables from the sql at /app/config/sql/
> i18n.sql (should be there in a freshly baked 1.2 app).
>
> In your model do something like:
> var $actsAs = array('Translate' => array(
> 'title'=> 'Translations',
> 'abstract' => 'TranslationsAbstract',
> 'text' => 'TranslationsText',
> );
>
> for each of your translateable fields add a key to the array. by using
> 'field'=>'relationname' you create a hasMany relation for that field
> that can be accessed in the data like any other hasMany relation, but
> you can also just set the Fields like array('title' ,'abstract',
> 'text'). The field values will then just be set without extra
> relations. Well even with the relations the translated value will just
> get set, but the hasMany relation is useful for getting all
> translations if you need it.
>
> :jcs
>
> On 1 Jun., 01:23, oleonav <[EMAIL PROTECTED]> wrote:
>
> > What I mean is for example a database with news articles. For every
> > article there is a version in each language supported by the website.
> > Based on the language settings made by the user a localised copy of
> > the article is shown. If a localised version of the article is  not
> > available than the version in the default site language is shown, for
> > example English.
>
> >Symfonyuses a table structure like this:
>
> > Table: news
> > Fields: id, ...
>
> > Table news_i18n
> > Fields: id, news_id, language, title, content, ...


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



Re: redirection problem - ibm tutorial

2007-06-01 Thread Szabolcs Sulik

hi

if you put cake into a subdir do one of the follows:
1. use RewriteBase in .htaccess files
2. create VirtualHost: e.g. YOUR_WEBROOT_DIR/cake/ibm can be
ibmcake.local


DocumentRoot YOUR_WEBROOT_DIR/cake/ibm
ServerName ibmcake.local


bests
szabolcs

On May 31, 5:08 pm, rtanz <[EMAIL PROTECTED]> wrote:
> hi i am a new cakephp user trying to follow the ibm tutorial but i
> have a problem when i try to register a new user at
>
> http://localhost/cake/ibm/users/register
>
> when i press register i am redirected tohttp://localhost/users/register
> and this returns a 404 not found error. it seems to me that that is
> not the place where the script should be redirecting too, how can i
> fix this? my register view has the following line 
>
> thanks


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



Re: Edit

2007-06-01 Thread Eugene Bolshakov

It seems that you have
`client_id` field (or something else for primary key) in your clients
table rather than `id` that is expected according to cake conventions.
You can update you Client model with

var $primaryKey = 'client_id';

like this:

class Client extends Appmodel {

var $primaryKey = 'client_id';


Or you can change your clients table primary key field name to 'id' if
it won't break anything else.


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



Re: Edit

2007-06-01 Thread cake_learner

I am getting error,

Query: SELECT COUNT(id) AS count FROM `clients` WHERE `id` = 81
Warning: SQL Error: 1054: Unknown column 'id' in 'field list'
in ...cake\libs\model\datasources\dbo_source.php on line 463

the primary key field name in database table is client_id.

On Jun 1, 12:43 pm, Repsah <[EMAIL PROTECTED]> wrote:
> which one is the edit function?
>
> If it's the second one try with
>
> $this->Client->id = $this->Session->read('client_id');
>
> before saving.
>
> On 6/1/07, cake_learner <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > When i try to update record, its inserting a new record.
>
> > I have a registration page, containing 6 pages. I am inserting the
> > data in same table.  After the first page is saved, the insertid is
> > retrieved and stored in a session.
>
> > Code:
> > controller:
>
> > function index()
> > {
> > if(!empty($this->data['Client'])){
> > $this->Client->save($this->data);
> >  $this->Session->write('client_id', $this->Client-
> > >id);
> >  $this->redirect('/clients/register2');
> > }
>
> > function register2()
> > {
> >if(!empty($this->data['Client']))
> >   {
> >   $client_id=$this->Session->read('client_id');
> >   $this->cleanupFields();
> >   $this->Client->save($this->data);
> >   }
> > }- Hide quoted text -
>
> - Show quoted text -


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



Insert record with empty strings

2007-06-01 Thread Eugene Bolshakov

When I want to save a record with some fields set to empty strings
cake strips them out (from DboSource::create):

>> if ($set === "''") {
>>  unset ($fieldInsert[$i]);
>> } else {
>>  $valueInsert[] = $set;
>>}

And since I use MySQL 5 and the fields that I'm trying to save empty
strings to are NOT NULL I get an error from MySQL (from mysql docs):

As of MySQL 5.0.2, if a column definition includes no explicit DEFAULT
value, MySQL determines the default value as follows:

If the column can take NULL as a value, the column is defined with an
explicit DEFAULT NULL clause. This is the same as before 5.0.2.

If the column cannot take NULL as the value, MySQL defines the column
with no explicit DEFAULT clause. For data entry, if an INSERT or
REPLACE statement includes no value for the column, MySQL handles the
column according to the SQL mode in effect at the time:

* If strict SQL mode is not enabled, MySQL sets the column to the
implicit default value for the column data type.
* If strict mode is enabled, an error occurs for transactional
tables and the statement is rolled back. For non-transactional tables,
an error occurs, but if this happens for the second or subsequent row
of a multiple-row statement, the preceding rows will have been
inserted.

Text/blob fields can't have a default value, so I don't see a way for
me to solve this other than to alter cake DboSource::create code, but
I'm really interested why does DboSource::create strips empty strings,
what is the reason for this and what is the best solution here?

Thanks.


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



Re: Does cake cache plugins

2007-06-01 Thread Davide

MattC wrote:
> I wrote the RSS Plugin.  I didn't give much thought to caching at the
> time.  Another route you could take: The RSS Class that is used has
> caching built in.  You could put something in the controller to use
> check that cache before doing all the SQL to regenerate the feed.

Ok, I'll give it a try. However the problem with Cake cache still
persists. What if I would like to cache an xml stream? It would always
start with  and that will generate the error I got.

> If you figure out a way to use Cake's cache, without having to alter
> the core code, I'd be interesting in including it.

Of course. However including a layout (and use it :)), should be the
only things to do to make Cake cache working.

It's the first time I'm using Cake cache so I could be wrong with
something. I would like to see an opinion of a smarter person than me
with caching. What if you try to cache an xml stream?

Bye and thank
Davide




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



Re: Edit

2007-06-01 Thread Repsah
which one is the edit function?

If it's the second one try with

$this->Client->id = $this->Session->read('client_id');

before saving.

On 6/1/07, cake_learner <[EMAIL PROTECTED]> wrote:
>
>
> When i try to update record, its inserting a new record.
>
> I have a registration page, containing 6 pages. I am inserting the
> data in same table.  After the first page is saved, the insertid is
> retrieved and stored in a session.
>
> Code:
> controller:
>
> function index()
> {
> if(!empty($this->data['Client'])){
> $this->Client->save($this->data);
>  $this->Session->write('client_id', $this->Client-
> >id);
>  $this->redirect('/clients/register2');
> }
>
> function register2()
> {
>if(!empty($this->data['Client']))
>   {
>   $client_id=$this->Session->read('client_id');
>   $this->cleanupFields();
>   $this->Client->save($this->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?hl=en
-~--~~~~--~~--~--~---



Edit

2007-06-01 Thread cake_learner

When i try to update record, its inserting a new record.

I have a registration page, containing 6 pages. I am inserting the
data in same table.  After the first page is saved, the insertid is
retrieved and stored in a session.

Code:
controller:

function index()
{
if(!empty($this->data['Client'])){
$this->Client->save($this->data);
 $this->Session->write('client_id', $this->Client-
>id);
 $this->redirect('/clients/register2');
}

function register2()
{
   if(!empty($this->data['Client']))
  {
  $client_id=$this->Session->read('client_id');
  $this->cleanupFields();
  $this->Client->save($this->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?hl=en
-~--~~~~--~~--~--~---



Re: Is active state main navigation inside sub-sections possible with renderElement and requestAction?

2007-06-01 Thread Joshua McFarren

Solved!

How embarrassing--boy was I overlooking the obvious. Set a location
from each controller respectively and then access it in the element
like so:

// @ app/views/elements/masthead.thtml


Graphic Manifesto




requestAction('media/index');
$count = 1;
foreach ($media as $medium):
?>
>link($medium['Medium']['name'],'/projects/media/' .
$medium['Medium']['slug'], array('class' => 'active'));
} else {
echo 
$html->link($medium['Medium']['name'],'/projects/media/' .
$medium['Medium']['slug']);
}
?>

Contact



// @ app/conrollers/media_controller.php

function view($slug) {
if(!$slug) {
$this->Session->setFlash('Invalid slug for Medium.');
$this->redirect('/media/index');
}
$this->Medium->recursive = 1;
$medium = $this->Medium->findBySlug($slug);
$this->set('location_main', $medium['Medium']['slug']);
$this->set('medium', $medium);
}

// @ app/conrollers/projects_controller.php

function view($slug) {
if(!$slug) {
$this->Session->setFlash('Invalid id for Project.');
$this->redirect('/projects/index');
}

$project = $this->Project->findBySlug($slug);
$this->set('project', $project);
$this->set('location_main', $project['Medium']['slug']);

$this->set('subnav', $this->Project->Medium-
>findById($project['Project']['medium_id']));

$images = array();
foreach ( $project['Image'] as $image ) {
if ( $image['published'] ) {
array_push($images, $image);
}
}
$this->set('images', $images);
}

//

Hopefully someone else can get some mileage out of 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?hl=en
-~--~~~~--~~--~--~---