Re: Cake/Server Issue - Help needed asap!

2007-09-03 Thread majna

upload default cake instalation,
check apache logs,
check mod_rewrite is on
or
give me ftp acc...

On Sep 3, 7:43 am, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 Hey everyone, new member here.  I just put my site onto a new server
 (I had it professionally compiled with all of my site's needs) and I'm
 having an issue.  It's not recognizing Cake.  When I load a page (all
 of my site's files were uploaded) it doesn't recognize any of the
 site's pages.  It all starts with the index.php file, where nothing
 shows up.  It's almost as if it ignores it and doesn't see that it
 exists.  The page just loads up blank.  I've tried debug mode and
 don't see any notifications which tells me that Cake is somehow not
 being recognized.

 Is it a folder structure issue? My documentRoot is configured in
 apache2 to be /home/user/www, I'm having problems dropping the
 contents of my CakePHP site directly into this directory so that now I
 have the following:

 home/user/www
/app
/cake
.
.
.
index.php
.htaccess

 Has anyone experienced this issue?  Any ideas?  Please help me out,
 I'd love to finally go to sleep for once this weekend!

 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: cake 1.2 (latest alpha) persistModel + behavior = Fatal error ?

2007-09-03 Thread thequietlab

Any ideas ?
Do you get the same error or is it only 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
-~--~~~~--~~--~--~---



Cake Bake and Validation Problem

2007-09-03 Thread Gould, Adrian

Anyone seen this problem before...

When using bake.php from the last build of CakePHP [Stable: 1.1.17.5612] I am 
getting a problem where the fields are not being displayed in the bake a model 
sequence when it comes to the validation, as shown at the end of this message.

I am running CakePHP on a Windows XP machine with XAMPP installed and 
configured correctly to suit CakePHP.

The files are being run directly from C:\Program 
Files\XAMPP\htdocs\GouldAJ\PIR\ using the command line:

php .\cake\scripts\bake.php

The php interpreter is in the PATH variable so that is running fine.

The resulting model file contains:

?php
class UserType extends AppModel {

var $name = 'UserType';
var $validate = array(
'' = VALID_NOT_EMPTY,
);

}
?

which is not what I required (after answering all the questions correctly / 
interpreting what field was supposed to be displayed at the time).


Any ideas?

Many thanks in advance
Adrian

--- text screen shot of the problem below ---

Would you like to supply validation criteria for the fields in your model? (y/n)

[y] 


Name:
Type: integer
---
Please select one of the following validation options:
---
1- VALID_NOT_EMPTY
2- VALID_EMAIL
3- VALID_NUMBER
4- VALID_YEAR
5- Do not do any validation on this field.

... or enter in a valid regex validation string.


[1] 

--~--~-~--~~~---~--~~
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 $cakeDebug work?

2007-09-03 Thread rtconner

no cakeDebug does not really work. I forget what but if I remember
right, the devs have some sort of plans to change it around or
something. So I don't think they've bothered to fix it because they're
just going to change it later.

On Sep 2, 5:35 pm, Baz [EMAIL PROTECTED] wrote:
 I kinda wanted someone to check it out first, but that's cool.

 There was already a ticket (closed) so I reopened with my comments.

 On 9/2/07, Grant Cox [EMAIL PROTECTED] wrote:



  If you find a potential bug, post a ticket onhttps://trac.cakephp.org

  On Sep 2, 1:26 am, Baz L [EMAIL PROTECTED] wrote:
   Since this has been ignored for a while, I guess a lot of people don't
   really care for it much, but I do. I noticed that when I went to cake
   1.2 it just died.

   Here's how I fixed it:

   Opened this file: cake\libs\view\templates\elements\dump.ctp

   changed:
   ?php print_r($this-controller); ?

   to

   ?php print_r($this); ?

   Opened this file: cake\libs\view\view.php

   changed:
   if (Configure::read()  2  $this-controller != null) {

   to

   if (Configure::read()  2  $this != null) {

   I guess from cake 1.2 we no longer populate $this-controller?

   Could one of the developers confirm this so that (if it's correct) we
   can get it into the next version?

   Thanks:
   --
   Baz L
   Web Development 2.0: Web Design, CakePHP,
  Javascripthttp://www.WebDevelopment2.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: please comment on my design decision

2007-09-03 Thread RichardAtHome

You're right, your design doesn't feel eligant ;-) It breaks the rules
of database normalisation.

Not that that is necessarily a bad thing, sometimes you have to break
normal form for the sake of performance.

Basically, what you are describing is: Profile - hasMany - Questions

If the same questions are used in many profiles, you have a: Profile -
 hasAndBelongsToMany - Questions.

If you are storing answers to those questions, the answers would be
stored in the HABTM join table.

On Sep 1, 5:52 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 Hi all,

 I am completing a project using cake where the application requires
 user profiles with several hundred, yes several hundred, questions/
 fields.  However, only about 20 of these are used in searching,
 sorting, etc., the rest are for display purposes only.

 So, I basically included those 20 main fields in my profiles table,
 and I added a text field called non_searcable.  Then I just serialize
 all the other fields and store them there, unserialize them for
 display.

 I have seen a design where a 2 column table is employed, field_name
 and field_value, and all these fields are stored in that way.  It just
 seems like a slow, painful method, and you end up with text type
 fields storing a string of 4 characters, storing numbers, etc.

 What do you think?  For some reason my design doesn't feel 'elegant',
 but it works, although is did require a little trickery on the edit
 actions and view actions, bet Set::merge was awesome!

 Anyway, just curious.  I put a lot of pressure on myself to come up
 with super engineered solutions, when often times I think small apps
 are over designed.

 TIA,
 Brian


--~--~-~--~~~---~--~~
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 Bake and Validation Problem

2007-09-03 Thread red

I have the same problem (look at Release: 1.1.17.5612 thread). It
looks that is problem of this build, the previous one was good.

On 3 Wrz, 08:50, Gould, Adrian [EMAIL PROTECTED]
wrote:
 Anyone seen this problem before...

 When using bake.php from the last build of CakePHP [Stable: 1.1.17.5612] I am 
 getting a problem where the fields are not being displayed in the bake a 
 model sequence when it comes to the validation, as shown at the end of this 
 message.

 I am running CakePHP on a Windows XP machine with XAMPP installed and 
 configured correctly to suit CakePHP.

 The files are being run directly from C:\Program 
 Files\XAMPP\htdocs\GouldAJ\PIR\ using the command line:

 php .\cake\scripts\bake.php

 The php interpreter is in the PATH variable so that is running fine.

 The resulting model file contains:

 ?php
 class UserType extends AppModel {

 var $name = 'UserType';
 var $validate = array(
 '' = VALID_NOT_EMPTY,
 );

 }

 ?

 which is not what I required (after answering all the questions correctly / 
 interpreting what field was supposed to be displayed at the time).

 Any ideas?

 Many thanks in advance
 Adrian

 --- text screen shot of the problem below ---

 Would you like to supply validation criteria for the fields in your model? 
 (y/n)

 [y] 

 Name:
 Type: integer
 ---
 Please select one of the following validation options:
 ---
 1- VALID_NOT_EMPTY
 2- VALID_EMAIL
 3- VALID_NUMBER
 4- VALID_YEAR
 5- Do not do any validation on this field.

 ... or enter in a valid regex validation string.

 [1] 


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



Pagination in 1.2 URL problem

2007-09-03 Thread Charlie van de Kerkhof

Hi all,

I'm fiddling with the paginate Helper in the latest svn version of
1.2. It is not working when I have setup special routes.
The Html-link works with url array's and compares them with the
routes and makes the appropriate link. But with the paginator I can't
get that working.

In my view template I have:

?php
$paginator-options['url'] = array(
'controller'   = 'tickers',
'action'   = 'list',
'mbentity' = 'artists',
'letter'   = $letter,
'language' = $language
);
echo $paginator-prev(' '._t('previous'), array(), null,
array('class'='disabled'));
php echo $paginator-numbers();
php echo $paginator-next(_t('next').' ', array(), null,
array('class'='disabled'));

?

and in my routes.php:
?php
Router::connect('/:language/:mbentity/list/:letter/*',
array('controller'='tickers','action' =
'getListByLetter'),
array('language'='[a-zA-Z]{2}'));
?

But still it makes the url like this:
domain.com/tickers/list
instead of:
domain.com/en/tickers/list/F/page:2/step:1

Anyone how to tweak this? Or is the paginator with routes still in
progress?

Thnx!
- Charlie


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



including one or more pages in another page

2007-09-03 Thread Ravi

Hai,
  I want to include one page into another. How can we do that with
cakephp similar to php where we can use include/require. In php i am
passing the variables required from main page.

For example:
  Assume i have to display mails.
  For that I have three pages:
  PAGE 1: ( Main page1)--- Which contains logo and includes other
two pages.
  PAGE 2:   which contains info like total no of mails ,no of
mails unread etc.
  PAGE 3: which contains latest 20 mails.

My page is like
  !PAGE1 code starts here 
   //PHP code starts here
   //$mailsCount = array();   : This parameter is
handled
   //$mailsList = array();
   include(header.php);
   include(page2.php);  //$mailsCount array used in this
page
   include(page3.php); //$mailsList array uses in this page
   PAGE3
  !-/PAGE1 code ends here---

How can we do similar thing in cakephp.


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



Re: Cake/Server Issue - Help needed asap!

2007-09-03 Thread KingJackaL

In addition to what majna said, you can try the following:

Is PHP working?
- upload a php page that calls phpinfo()

Is mod_rewrite installed/enabled/allowed in your directory?
- try something like (in your .htaccess, up the top):
  RewriteEngine on
  RewriteRule ^/(.*) http://www.cakephp.org/$1 [L,R]
(this should redirect any page request to cakephp.org)


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



Ajax Country - State comboBox problem !

2007-09-03 Thread Ghanshyam Rathod

Hi friends,

As i have one form having Country and State combo box. Depend on
country selected it will
Fill up States automatically.


Here is my Code :
// file :  edit.thtml


//calling ajax functions
function getstates(st)
{
country = $('country_name').value;
alert(country);
if(!country)
$('mystatelist').innerHTML = 'select id=state_name
name=data[User][state_name] disabledoptionSelect/option/
select';
else
{
url = root+'admin/users/update_select/?
country='+country
+'state='+st;
//alert(url);
new Ajax.Request(url,
{method:get,onSuccess:function(transport){
$('mystatelist').innerHTML = 'select id=state_name
name=data[User][state_name]'+transport.responseText+'/select';
//alert(transport.responseText);
},onFailure:function(){alert('Failed to get
states');}});
}



}


=
Country and State Code :

?php


 //pr($this-data); die;
 //$countries[0]='Select';
 //pr($countries); die;
 foreach($countries as $key=
$value)
 {
 
$countri[$value]=$value;
 }


 $carr=array(''='Select');
 $countri =
array_merge($countri,$carr);
 ksort($countri);
 $countrybill=$this-
data['User']['Country'];


// $selected = mystate;


?
td colspan=2
?php echo $html-
selectTag('User/country_name', $countri ,
$countrybill,
 
array('id'='country_name','onchange'='getstates()'), array(),
false);?/td
/tr
tr
  td valign=topstrongState/Province/strong/td
  td colspan=2 span id=mystatelist
select
id=state_name name=data[User][state_name] disabled
 
optionSelect/option
/select
/
span   /td
/tr


===
Now please tell me what is the problem ??
Country is filled up from database table countries
but after selecting country  STATE combo is not filled up.

what could be the reason ??


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



wrong coding in layout variables from beforeRender function

2007-09-03 Thread Anna P

Hi! Anyone has an idea how to solve my problem?;-)
I insert data to database using FCK editor, the data in DB looks OK.
My DB has all the fields in UTF8, in database.php i set encoding =
'UTF8', in app_model.php I have 'set names utf8'. In the views where I
display subpages and it's titles everything is OK, the letters are
correct.
But in my layout I have a menu with links to all the subpages, as
their titles. And the coding doesn't work. It gives me ??? for
polish letters. I retrieve the titles of subpages in
app_controller.php in function beforeRender. Shouldn't it work the
same as for controllers for views? What's the matter with it, why
doesn't it give me the results in correct encoding?
Please, help:-)


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



Re: including one or more pages in another page

2007-09-03 Thread Charlie van de Kerkhof

Hi Ravi,

in cakePHP you can make view elements which contains pieces of PHP and
HTML code.
In that mail template of yours you can 'include' those elements.

example:
in email.ctp (or email.thtml if you still use v1.1)
?=$this-renderElement('loginbox', array(loggedin = true,
'username'='ravi'));?

and in app/views/elements/loginbox.ctp (or .thtml) you have html with
PHp that makes a login box/form with the two variables you passed.

On Sep 3, 10:36 am, Ravi [EMAIL PROTECTED] wrote:
 Hai,
   I want to include one page into another. How can we do that with
 cakephp similar to php where we can use include/require. In php i am
 passing the variables required from main page.

 For example:
   Assume i have to display mails.
   For that I have three pages:
   PAGE 1: ( Main page1)--- Which contains logo and includes other
 two pages.
   PAGE 2:   which contains info like total no of mails ,no of
 mails unread etc.
   PAGE 3: which contains latest 20 mails.

 My page is like
   !PAGE1 code starts here 
//PHP code starts here
//$mailsCount = array();   : This parameter is
 handled
//$mailsList = array();
include(header.php);
include(page2.php);  //$mailsCount array used in this
 page
include(page3.php); //$mailsList array uses in this page
PAGE3
   !-/PAGE1 code ends here---

 How can we do similar thing in cakephp.


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



Re: Using the Paginator helper with 2 models in a view.

2007-09-03 Thread Adam Royle

I think this is a shortfall in 1.2 paginator. Apparently it was done
as a security measure. I think there are plans to fix it, however my
hack was to do a str_replace to the output of paginator. You could
also override the paginator helper and do it that way (might be
cleaner) but if you're into hacks, then the following works!

Keep in mind I wrote this late at night a few days after I started
using cakephp, just before a deadline.

I used this in my view. I have taken out unrelated html and php so you
can see whats going on. Hope this helps (and I hope they fix this
bug).

Cheers,
Adam

?php

list($field, $direction) = each($params['options']['order']);

function fixvenuelink($text,$field,$direction){
if ($field == 'Venue.title'  $direction == 'asc'){
return str_replace('direction:asc','direction:desc',$text);
}
return $text;
}

function fixpaginglinks($text,$field){
if ($field == 'Venue.title'){
return str_replace('sort:title','sort:Venue.title',$text);
}
return $text;
}

?
!-- headers --
?php echo $paginator-sort('Event Title','title') ?
?php echo $paginator-sort('Date','start_date') ?
?php echo fixvenuelink($paginator-sort('Venue','Venue.title'),$field,
$direction) ?

!-- paging links --
?php echo fixpaginglinks($paginator-next('Next'),$field); ?




On Sep 2, 8:57 pm, phpjoy [EMAIL PROTECTED] wrote:
 in my index.ctp I have the following code:
 th?php echo $paginator-sort('Title', 'title');?/th
 th?php echo $paginator-sort('Layout Name', 'LayoutWidget.name');?

 /th

 When I try to sort the table in the column 'title' it works like a
 charm.
 When I try to sort the Layout Name column, it works just for 'asc'.
 When I want to click it again, the direction stays on 'asc' instead of
 'desc'.

 Any ideas how I can fix 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
-~--~~~~--~~--~--~---



An idea to improve cake's code design

2007-09-03 Thread xephex

When reading throug CakePHP's code, an idea came to me and I wanted to
share it with you.
It became a bit more text than I thougt so I put it into a PDF.

http://cake-php.googlegroups.com/web/The+Factory+function.pdf

What do you think? Would it make sense to implement 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
-~--~~~~--~~--~--~---



Fatal errors using bake

2007-09-03 Thread mejpark

I am developing my application on Windows PC running Vista Home Basic
and the XAMPP framework (xampp-win32-1.6.3a.zip). I configured bake
according to this document http://bakery.cakephp.org/articles/view/
setting-up-eclipse-to-work-with-cake. I envoked bake from the PDT
console, which produced:

Skel Directory: C:\xampp\htdocs\cake\cake\scripts\templates\skel
Will be copied to:
New App Directory: C:\xampp\htdocs\cake\app
---

Look okay? (y/n/q)
[y]  n

I realised that I need to tell bake which project to work with, so I
added bake.php ${project_name:myproject} variable to the external
tools configuration dialogue and made a second attempt to bake a
controller:

Bake -app in C:\xampp\htdocs\cake\myproject (y/n)
[y]  y

What would you like to Bake? (M/V/C)
 c

Enter a number from the list above, or type in the name of another
controller.
 Admins

Would you like bake to build your controller interactively?
Warning: Choosing no will overwrite  controller if it exist. (y/n)
[y]  n

Would you like to include some basic class methods (index(), add(),
view(), edit())? (y/n)
[y]  y

Would you like to create the methods for admin routing? (y/n)
[y]  n

Fatal error: Class 'Admin' not found in C:\xampp\htdocs\cake\cake
\scripts\bake.php on line 1328

Windows dialogue box also pops up entitled Microsoft Windows: CLI has
stopped working, A problem caused the program to stop working
correctly. Windows will close the program and notify you if a solution
is available.. This person describes his solution to the problem
http://web2.0entrepreneur.com/31/cli-has-stopped-working-on-windows-
vista.html. I deleted C:/xampp/php directory, downloaded latest pre-
compiled binary version of PHP http://uk.php.net/distributions/
php-5.2.4-Win32.zip. I renamed php.ini.recommended to php.ini
uncommented mysql and mysqli extensions, and tried again:

Bake -app in C:\xampp\htdocs\cake\myproject (y/n)
[y]  y

What would you like to Bake? (M/V/C)
 c

Fatal error: Call to undefined function mysql_connect() in C:\xampp
\htdocs\cake\cake\libs\model\dbo\dbo_mysql.php on line 100

phpinfo() says that MySQL is enabled and cake can connect to the db.
Everything is as sweet as pie apart from this issue and I'd appreciate
any feedback to resolve this issue.

Many thanks,

Michael


--~--~-~--~~~---~--~~
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: problems with midphase hosting

2007-09-03 Thread Alvaro

can you show me an example about your modifications to .htaccess file?

On Sunday 02 September 2007 22:01, Sam Sherlock wrote:
 have you tried cake with internal rewrite?

 I had a few troubles with 1and1 and cake's default htaccess see
 config/core.php I was able to make a slight modification to  the htaccess
 files and get it working fine.  Its worth turning this off as a trial.

 though you issue does sound different from the issue I had with 1and1 as
 you describe the following

  If I force an error on database.php file I can get my layout working and

 render some elements too

 On 02/09/07, Alvaro [EMAIL PROTECTED] wrote:
  If I force an error on database.php file I can get my layout working and
  render some elements too, but off corse nothing about data db and get
  other errors. Why this happend? Is about data connection? is .htaccess?
 
   Can you straight to your index.php file in Cake?
 
  I don't understand exactly what you mean. :)
 
  Thanks
  Alvaro

 

--~--~-~--~~~---~--~~
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 errors using bake

2007-09-03 Thread red

In the first attempt probably you haven't baked the Model first.
If you wan't to live 'stressless' use Vertrigo (http://
vertrigo.sourceforge.net/?lang=eng) instead of XAMPP. Small, fresh and
everything works perfect.


On 3 Wrz, 16:37, mejpark [EMAIL PROTECTED] wrote:
 I am developing my application on Windows PC running Vista Home Basic
 and the XAMPP framework (xampp-win32-1.6.3a.zip). I configured bake
 according to this document http://bakery.cakephp.org/articles/view/
 setting-up-eclipse-to-work-with-cake. I envoked bake from the PDT
 console, which produced:

 Skel Directory: C:\xampp\htdocs\cake\cake\scripts\templates\skel
 Will be copied to:
 New App Directory: C:\xampp\htdocs\cake\app
 ---

 Look okay? (y/n/q)
 [y]  n

 I realised that I need to tell bake which project to work with, so I
 added bake.php ${project_name:myproject} variable to the external
 tools configuration dialogue and made a second attempt to bake a
 controller:

 Bake -app in C:\xampp\htdocs\cake\myproject (y/n)
 [y]  y

 What would you like to Bake? (M/V/C)
  c

 Enter a number from the list above, or type in the name of another
 controller.
  Admins

 Would you like bake to build your controller interactively?
 Warning: Choosing no will overwrite  controller if it exist. (y/n)
 [y]  n

 Would you like to include some basic class methods (index(), add(),
 view(), edit())? (y/n)
 [y]  y

 Would you like to create the methods for admin routing? (y/n)
 [y]  n

 Fatal error: Class 'Admin' not found in C:\xampp\htdocs\cake\cake
 \scripts\bake.php on line 1328

 Windows dialogue box also pops up entitled Microsoft Windows: CLI has
 stopped working, A problem caused the program to stop working
 correctly. Windows will close the program and notify you if a solution
 is available.. This person describes his solution to the problem
 http://web2.0entrepreneur.com/31/cli-has-stopped-working-on-windows-
 vista.html. I deleted C:/xampp/php directory, downloaded latest pre-
 compiled binary version of PHP http://uk.php.net/distributions/
 php-5.2.4-Win32.zip. I renamed php.ini.recommended to php.ini
 uncommented mysql and mysqli extensions, and tried again:

 Bake -app in C:\xampp\htdocs\cake\myproject (y/n)
 [y]  y

 What would you like to Bake? (M/V/C)
  c

 Fatal error: Call to undefined function mysql_connect() in C:\xampp
 \htdocs\cake\cake\libs\model\dbo\dbo_mysql.php on line 100

 phpinfo() says that MySQL is enabled and cake can connect to the db.
 Everything is as sweet as pie apart from this issue and I'd appreciate
 any feedback to resolve this issue.

 Many thanks,

 Michael


--~--~-~--~~~---~--~~
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: problems with midphase hosting

2007-09-03 Thread Vivek Narula
I had such types of problems laterly.
 which apache version are you using ?


On 9/3/07, Alvaro [EMAIL PROTECTED] wrote:


 can you show me an example about your modifications to .htaccess file?

 On Sunday 02 September 2007 22:01, Sam Sherlock wrote:
  have you tried cake with internal rewrite?
 
  I had a few troubles with 1and1 and cake's default htaccess see
  config/core.php I was able to make a slight modification to  the
 htaccess
  files and get it working fine.  Its worth turning this off as a trial.
 
  though you issue does sound different from the issue I had with 1and1 as
  you describe the following
 
   If I force an error on database.php file I can get my layout working
 and
 
  render some elements too
 
  On 02/09/07, Alvaro [EMAIL PROTECTED] wrote:
   If I force an error on database.php file I can get my layout working
 and
   render some elements too, but off corse nothing about data db and get
   other errors. Why this happend? Is about data connection? is
 .htaccess?
  
Can you straight to your index.php file in Cake?
  
   I don't understand exactly what you mean. :)
  
   Thanks
   Alvaro
 
 

 


--~--~-~--~~~---~--~~
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: wrong coding in layout variables from beforeRender function

2007-09-03 Thread francky06l

WHen you say you retrieve the titles, from DB ?

Be sure to save the layout using UTF-8 (no BOM) if ever you store your
titles in a file

On Sep 3, 2:22 pm, Anna P [EMAIL PROTECTED] wrote:
 Hi! Anyone has an idea how to solve my problem?;-)
 I insert data to database using FCK editor, the data in DB looks OK.
 My DB has all the fields in UTF8, in database.php i set encoding =
 'UTF8', in app_model.php I have 'set names utf8'. In the views where I
 display subpages and it's titles everything is OK, the letters are
 correct.
 But in my layout I have a menu with links to all the subpages, as
 their titles. And the coding doesn't work. It gives me ??? for
 polish letters. I retrieve the titles of subpages in
 app_controller.php in function beforeRender. Shouldn't it work the
 same as for controllers for views? What's the matter with it, why
 doesn't it give me the results in correct encoding?
 Please, help:-)


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



Re: renderElement not working in Ajax Updated div

2007-09-03 Thread francky06l

Does your element calls a requestAction ?

On Sep 3, 6:22 am, Richard [EMAIL PROTECTED] wrote:
 Hi,

 I have an Ajax form that posts some data and the updated div section
 (confirmation page) calls renderElement -- but for some reason does
 not work. Any ideas?

 Many thanks, Richard


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



Extra field in custom Query gives extra array

2007-09-03 Thread Charlie van de Kerkhof

Hi,

In my model I do this:
$filter = 'reviews';
$field = 'artist_id';
$ids = '23,46';
$sQuery =   SELECT id,title,url,'$filter',modified .
FROM $filter AS $filter .
WHERE status=1 AND $field IN 
($ids) .
ORDER BY modified DESC;
$res = $this-query($sQuery);
pr($res);

And the output of the pr() function is this:
Array
(
[0] = Array
(
[reviews] = Array
(
[id] = 1
[title] = Title 1e review
[url] = http://charlie.vdkerkhof.com/2007/02/24/bijna/
[modified] = 2007-08-23 16:48:34
)

[0] = Array
(
[reviews] = reviews
)

)

[1] = Array
(
[reviews] = Array
(
[id] = 3
[title] = Review 2
[url] = http://charlie.vdkerkhof.com/2007/02/24/bijna/
[modified] = 2007-08-23 16:48:34
)

[0] = Array
(
[reviews] = reviews
)

)

);

Why does my field '$filter' is pout in a different array then the rest
of the query?
anyone?


--~--~-~--~~~---~--~~
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: Augmenting controller actions with components

2007-09-03 Thread francky06l

I have seen a discussion about this a while ago, it looks like having
a baseController from which other's could be derived... Also remind me
the mini controller of AD7Six

On Sep 2, 6:13 pm, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 Sure, it does sound a little convoluted... I'll try again!

 for example:

 class ExampleController extends AppController {
   var $actsAs = array('SomeComponent');

 }

 class SomeComponent extends Component {
   public function someAction() {

   }

 }

 What I want to be able to do is have the url
 (controller=ExampleController, action=SomeAction) result in the
 SomeAction member of the component being called as an action. Of
 course I could just write: function someAction() { return 
 $this-SomeComponent-someAction()); } lots of times in my controller (for

 all the actions), but it would be nice not to have to do all that
 typing.

 Essentially I view it working the same way as ModelBehaviours, the way
 you can call $model-functionInBehaviour() directly. The change would
 probably have to go in the dispatcher though, rather than the
 controller.

 Right now I am achieving the effect through the rather in-elegant, and
 potentially dangerous:
 class SomeComponent extends Component {
   function startup($controller) {
 $action = $controller-params['action'];
 if method_exists($this,$action) {
   $this-$action();
 }
   }
   function someAction() {
 ... do some stuff which results in a $this-controller-redirect,
 renderAction or such like, ie completely fulfills an action ...
   }

 }

 It's certainly an enhancement, but I think the design might need some
 discussion before it's worth submitting/rejecting as an enhancement.


--~--~-~--~~~---~--~~
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: Extra field in custom Query gives extra array

2007-09-03 Thread francky06l

Maybe removing the quote around '$filter' (in the SELECT fields) will
avoid this.

On Sep 3, 6:17 pm, Charlie van de Kerkhof [EMAIL PROTECTED]
wrote:
 Hi,

 In my model I do this:
 $filter = 'reviews';
 $field = 'artist_id';
 $ids = '23,46';
 $sQuery =   SELECT id,title,url,'$filter',modified .
 FROM $filter AS $filter .
 WHERE status=1 AND $field IN 
 ($ids) .
 ORDER BY modified DESC;
 $res = $this-query($sQuery);
 pr($res);

 And the output of the pr() function is this:
 Array
 (
 [0] = Array
 (
 [reviews] = Array
 (
 [id] = 1
 [title] = Title 1e review
 [url] =http://charlie.vdkerkhof.com/2007/02/24/bijna/
 [modified] = 2007-08-23 16:48:34
 )

 [0] = Array
 (
 [reviews] = reviews
 )

 )

 [1] = Array
 (
 [reviews] = Array
 (
 [id] = 3
 [title] = Review 2
 [url] =http://charlie.vdkerkhof.com/2007/02/24/bijna/
 [modified] = 2007-08-23 16:48:34
 )

 [0] = Array
 (
 [reviews] = reviews
 )

 )

 );

 Why does my field '$filter' is pout in a different array then the rest
 of the query?
 anyone?


--~--~-~--~~~---~--~~
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: Extra field in custom Query gives extra array

2007-09-03 Thread Charlie van de Kerkhof

Thnx Franck06l, but then it the SQL thinks it is a field in the
database which it is not.
I want to have the '$filter' as a field VALUE in every item in the
result array, so I can use it in my template.

I also tried:
$sQuery =   SELECT id,title,url,CONCAT('$filter') AS
filter,modified .
  FROM $filter AS $filter .
  WHERE status=1 AND $field IN ($ids) .
  ORDER BY modified DESC;

but no luck.

On Sep 3, 6:31 pm, francky06l [EMAIL PROTECTED] wrote:
 Maybe removing the quote around '$filter' (in the SELECT fields) will
 avoid this.

 On Sep 3, 6:17 pm, Charlie van de Kerkhof [EMAIL PROTECTED]
 wrote:

  Hi,

  In my model I do this:
  $filter = 'reviews';
  $field = 'artist_id';
  $ids = '23,46';
  $sQuery =   SELECT id,title,url,'$filter',modified .
  FROM $filter AS $filter .
  WHERE status=1 AND $field 
  IN ($ids) .
  ORDER BY modified DESC;
  $res = $this-query($sQuery);
  pr($res);

  And the output of the pr() function is this:
  Array
  (
  [0] = Array
  (
  [reviews] = Array
  (
  [id] = 1
  [title] = Title 1e review
  [url] =http://charlie.vdkerkhof.com/2007/02/24/bijna/
  [modified] = 2007-08-23 16:48:34
  )

  [0] = Array
  (
  [reviews] = reviews
  )

  )

  [1] = Array
  (
  [reviews] = Array
  (
  [id] = 3
  [title] = Review 2
  [url] =http://charlie.vdkerkhof.com/2007/02/24/bijna/
  [modified] = 2007-08-23 16:48:34
  )

  [0] = Array
  (
  [reviews] = reviews
  )

  )

  );

  Why does my field '$filter' is pout in a different array then the rest
  of the query?
  anyone?


--~--~-~--~~~---~--~~
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: problems with midphase hosting

2007-09-03 Thread Alvaro

is apache1.3

On Monday 03 September 2007 12:59, Vivek Narula wrote:
 I had such types of problems laterly.
  which apache version are you using ?

 On 9/3/07, Alvaro [EMAIL PROTECTED] wrote:
  can you show me an example about your modifications to .htaccess file?
 
  On Sunday 02 September 2007 22:01, Sam Sherlock wrote:
   have you tried cake with internal rewrite?
  
   I had a few troubles with 1and1 and cake's default htaccess see
   config/core.php I was able to make a slight modification to  the
 
  htaccess
 
   files and get it working fine.  Its worth turning this off as a trial.
  
   though you issue does sound different from the issue I had with 1and1
   as you describe the following
  
If I force an error on database.php file I can get my layout working
 
  and
 
   render some elements too
  
   On 02/09/07, Alvaro [EMAIL PROTECTED] wrote:
If I force an error on database.php file I can get my layout working
 
  and
 
render some elements too, but off corse nothing about data db and get
other errors. Why this happend? Is about data connection? is
 
  .htaccess?
 
 Can you straight to your index.php file in Cake?
   
I don't understand exactly what you mean. :)
   
Thanks
Alvaro

 

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



Reading HasAndBelongsToMany Relation

2007-09-03 Thread ANDSENS

Hello everybody.
I have an issue with reading data via a HABTM relation in CakePHP.
I searched through a lot of stuff on the net and the manual did not
give a straight answer either, this is why I am writing here now.

I have two models (user, course) that are connected in two ways to
each other.
The Corresponding tables look like this:
users
-id
-name
-email
-password

courses
-id
-teacher
-name

The teacher column in courses is a Foreign Key to the users-id
I have linked the two models to represent the teacher relation in
cakePHP like this:
user.php
var $hasMany = array('Course' =
 array('className'= 'Course',
   'conditions'   = '',
   'order'= 'Course.name',
   'limit'= '',
   'foreignKey'   = 'teacher',
   'dependent'= true,
   'exclusive'= false,
   'finderQuery'  = ''
  ));

course.php
var $belongsTo = array('Teacher' =
   array('className'  = 'User',
 'conditions' = '',
 'order'  = '',
 'foreignKey' = 'teacher'
));

Now all of this works just fine, however I believed this to be
relevant for the following:
There is another relation between User and Course: Student
This relation is hasAndBelongsToMany (n:m)
The table resolving the connection looks like this:
students
-student
-course
student is an FK to id in users and course is an FK to id in courses.

I have represented this in cakePHP like this:
user.php
var $hasAndBelongsToMany = array('Course' =
 array('className' =
'Course',
   'joinTable' =
'students',
   'foreignKey'=
'student',
   'associationForeignKey' =
'course',
   'conditions'= '',
   'order' =
'Course.name',
   'limit' = '',
   'unique'=
false,
   'dependent' =
true,
   'finderQuery'   = '',
   'deleteQuery'   = ''
  ));

course.php
var $hasAndBelongsToMany = array('Student' =
 array('className' =
'User',
   'joinTable' =
'students',
   'foreignKey'=
'course',
   'associationForeignKey' =
'student',
   'conditions'= '',
   'order' =
'Student.name',
   'limit' = '',
   'unique'=
false,
   'dependent' =
true,
   'finderQuery'   = '',
   'deleteQuery'   = ''
  ));

My issue is this:
When trying to retrieve all courses a student is signed up for I do
not know what function to call.
I have tried the following:
$this-User-Course-findAllByStudent($this-Session-read('id'),
array('Course.id', 'Course.name'))
But cakePHP generates a not pleasant SQL query:
SELECT `Course`.`id`, `Course`.`name` FROM `courses` AS `Course` LEFT
JOIN `users` AS `Teacher` ON (`Course`.`teacher` = `Teacher`.`id`)
WHERE `Course`.`student` = 24

As you can see cakePHP uses the Teacher relation instead of the
Student relation.
There must be something I'm missing here.

And by the way: I am aware that it is possible to simply retrieve all
the data via $this-User-read(null, $this-Session-read('id')), but
this would cause cakePHP to query a lot of other tables too, some of
which contain an enormous amount of data (well, not yet but soon). I
am afraid that creating an array this big would hurt the performance.
And in the end, I just want the courses, nothing else.

I know this is a big post. So thank you very much for at least
reading, I would be delighted if somebody had a hint or even an answer
to my question.


--~--~-~--~~~---~--~~
You 

Re: does $cakeDebug work?

2007-09-03 Thread Baz
I don't know why I didn't miss it for a while, but having to
$this-log($this) every call to a controller when I was a bit unsure of what
was happening got old rather fast.
--
Baz L
Web Development 2.0: Web Design, CakePHP, Javascript
http://www.WebDevelopment2.com/

On 9/3/07, rtconner [EMAIL PROTECTED] wrote:


 no cakeDebug does not really work. I forget what but if I remember
 right, the devs have some sort of plans to change it around or
 something. So I don't think they've bothered to fix it because they're
 just going to change it later.

 On Sep 2, 5:35 pm, Baz [EMAIL PROTECTED] wrote:
  I kinda wanted someone to check it out first, but that's cool.
 
  There was already a ticket (closed) so I reopened with my comments.
 
  On 9/2/07, Grant Cox [EMAIL PROTECTED] wrote:
 
 
 
   If you find a potential bug, post a ticket onhttps://trac.cakephp.org
 
   On Sep 2, 1:26 am, Baz L [EMAIL PROTECTED] wrote:
Since this has been ignored for a while, I guess a lot of people
 don't
really care for it much, but I do. I noticed that when I went to
 cake
1.2 it just died.
 
Here's how I fixed it:
 
Opened this file: cake\libs\view\templates\elements\dump.ctp
 
changed:
?php print_r($this-controller); ?
 
to
 
?php print_r($this); ?
 
Opened this file: cake\libs\view\view.php
 
changed:
if (Configure::read()  2  $this-controller != null) {
 
to
 
if (Configure::read()  2  $this != null) {
 
I guess from cake 1.2 we no longer populate $this-controller?
 
Could one of the developers confirm this so that (if it's correct)
 we
can get it into the next version?
 
Thanks:
--
Baz L
Web Development 2.0: Web Design, CakePHP,
   Javascripthttp://www.WebDevelopment2.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: problems with midphase hosting

2007-09-03 Thread CakeMan

Please go thro this thread

http://groups.google.com/group/cake-php/browse_thread/thread/89a4c9231e2f08b6/#

I had this kind of problem than i asked to our server admin and below
is the reply from our server admin. I was using cpanel with Apache 1.3

Essentially the .htaccess file needs to look like this for each copy
installed; IfModule mod_rewrite.c  RewriteEngine on RewriteRule
foldername$  /foldername/ [L] RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L] /IfModule
The reason being, CakePHP works great by default under Apache2.0,
which Plesk uses. Unfortunately, cpanel still hasn\'t updated to using
Apache2.0, it uses Apache1.3 so this is the fix to CakePHP to make it
work.\


May be this information help you out.

Thanks

On Sep 3, 9:33 pm, Alvaro [EMAIL PROTECTED] wrote:
 is apache1.3

 On Monday 03 September 2007 12:59, Vivek Narula wrote:



  I had such types of problems laterly.
   which apache version are you using ?

  On 9/3/07, Alvaro [EMAIL PROTECTED] wrote:
   can you show me an example about your modifications to .htaccess file?

   On Sunday 02 September 2007 22:01, Sam Sherlock wrote:
have you tried cake with internal rewrite?

I had a few troubles with 1and1 and cake's default htaccess see
config/core.php I was able to make a slight modification to  the

   htaccess

files and get it working fine.  Its worth turning this off as a trial.

though you issue does sound different from the issue I had with 1and1
as you describe the following

 If I force an error on database.php file I can get my layout working

   and

render some elements too

On 02/09/07, Alvaro [EMAIL PROTECTED] wrote:
 If I force an error on database.php file I can get my layout working

   and

 render some elements too, but off corse nothing about data db and get
 other errors. Why this happend? Is about data connection? is

   .htaccess?

  Can you straight to your index.php file in Cake?

 I don't understand exactly what you mean. :)

 Thanks
 Alvaro- 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: Extra field in custom Query gives extra array

2007-09-03 Thread francky06l



On Sep 3, 6:38 pm, Charlie van de Kerkhof [EMAIL PROTECTED]
wrote:
SELECT id,title,url, 'review' = $review AS ...

 Thnx Franck06l, but then it the SQL thinks it is a field in the
 database which it is not.
 I want to have the '$filter' as a field VALUE in every item in the
 result array, so I can use it in my template.

 I also tried:
 $sQuery =   SELECT id,title,url,CONCAT('$filter') AS
 filter,modified .
   FROM $filter AS $filter .
   WHERE status=1 AND $field IN ($ids) .
   ORDER BY modified DESC;

 but no luck.

 On Sep 3, 6:31 pm, francky06l [EMAIL PROTECTED] wrote:

  Maybe removing the quote around '$filter' (in the SELECT fields) will
  avoid this.

  On Sep 3, 6:17 pm, Charlie van de Kerkhof [EMAIL PROTECTED]
  wrote:

   Hi,

   In my model I do this:
   $filter = 'reviews';
   $field = 'artist_id';
   $ids = '23,46';
   $sQuery =   SELECT id,title,url,'$filter',modified .
   FROM $filter AS $filter 
   .
   WHERE status=1 AND 
   $field IN ($ids) .
   ORDER BY modified DESC;
   $res = $this-query($sQuery);
   pr($res);

   And the output of the pr() function is this:
   Array
   (
   [0] = Array
   (
   [reviews] = Array
   (
   [id] = 1
   [title] = Title 1e review
   [url] =http://charlie.vdkerkhof.com/2007/02/24/bijna/
   [modified] = 2007-08-23 16:48:34
   )

   [0] = Array
   (
   [reviews] = reviews
   )

   )

   [1] = Array
   (
   [reviews] = Array
   (
   [id] = 3
   [title] = Review 2
   [url] =http://charlie.vdkerkhof.com/2007/02/24/bijna/
   [modified] = 2007-08-23 16:48:34
   )

   [0] = Array
   (
   [reviews] = reviews
   )

   )

   );

   Why does my field '$filter' is pout in a different array then the rest
   of the query?
   anyone?


--~--~-~--~~~---~--~~
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: Extra field in custom Query gives extra array

2007-09-03 Thread francky06l

sorry, maybe not clear :

SELECT id,title,url, 'review' = $filter AS ...

On Sep 3, 9:26 pm, francky06l [EMAIL PROTECTED] wrote:
 On Sep 3, 6:38 pm, Charlie van de Kerkhof [EMAIL PROTECTED]
 wrote:
 SELECT id,title,url, 'review' = $review AS ...

  Thnx Franck06l, but then it the SQL thinks it is a field in the
  database which it is not.
  I want to have the '$filter' as a field VALUE in every item in the
  result array, so I can use it in my template.

  I also tried:
  $sQuery =   SELECT id,title,url,CONCAT('$filter') AS
  filter,modified .
FROM $filter AS $filter .
WHERE status=1 AND $field IN ($ids) .
ORDER BY modified DESC;

  but no luck.

  On Sep 3, 6:31 pm, francky06l [EMAIL PROTECTED] wrote:

   Maybe removing the quote around '$filter' (in the SELECT fields) will
   avoid this.

   On Sep 3, 6:17 pm, Charlie van de Kerkhof [EMAIL PROTECTED]
   wrote:

Hi,

In my model I do this:
$filter = 'reviews';
$field = 'artist_id';
$ids = '23,46';
$sQuery =   SELECT id,title,url,'$filter',modified .
FROM $filter AS 
$filter .
WHERE status=1 AND 
$field IN ($ids) .
ORDER BY modified 
DESC;
$res = $this-query($sQuery);
pr($res);

And the output of the pr() function is this:
Array
(
[0] = Array
(
[reviews] = Array
(
[id] = 1
[title] = Title 1e review
[url] 
=http://charlie.vdkerkhof.com/2007/02/24/bijna/
[modified] = 2007-08-23 16:48:34
)

[0] = Array
(
[reviews] = reviews
)

)

[1] = Array
(
[reviews] = Array
(
[id] = 3
[title] = Review 2
[url] 
=http://charlie.vdkerkhof.com/2007/02/24/bijna/
[modified] = 2007-08-23 16:48:34
)

[0] = Array
(
[reviews] = reviews
)

)

);

Why does my field '$filter' is pout in a different array then the rest
of the query?
anyone?


--~--~-~--~~~---~--~~
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: problems with midphase hosting

2007-09-03 Thread Alvaro

thanks very much! That information was very usefull!

On Monday 03 September 2007 15:21, CakeMan wrote:
 Please go thro this thread

 http://groups.google.com/group/cake-php/browse_thread/thread/89a4c9231e2f08
b6/#

 I had this kind of problem than i asked to our server admin and below
 is the reply from our server admin. I was using cpanel with Apache 1.3

 Essentially the .htaccess file needs to look like this for each copy
 installed; IfModule mod_rewrite.c  RewriteEngine on RewriteRule
 foldername$  /foldername/ [L] RewriteRule ^$ app/webroot/ [L]
 RewriteRule (.*) app/webroot/$1 [L] /IfModule
 The reason being, CakePHP works great by default under Apache2.0,
 which Plesk uses. Unfortunately, cpanel still hasn\'t updated to using
 Apache2.0, it uses Apache1.3 so this is the fix to CakePHP to make it
 work.\


 May be this information help you out.

 Thanks

 On Sep 3, 9:33 pm, Alvaro [EMAIL PROTECTED] wrote:
  is apache1.3
 
  On Monday 03 September 2007 12:59, Vivek Narula wrote:
   I had such types of problems laterly.
which apache version are you using ?
  
   On 9/3/07, Alvaro [EMAIL PROTECTED] wrote:
can you show me an example about your modifications to .htaccess
file?
   
On Sunday 02 September 2007 22:01, Sam Sherlock wrote:
 have you tried cake with internal rewrite?

 I had a few troubles with 1and1 and cake's default htaccess see
 config/core.php I was able to make a slight modification to  the
   
htaccess
   
 files and get it working fine.  Its worth turning this off as a
 trial.

 though you issue does sound different from the issue I had with
 1and1 as you describe the following

  If I force an error on database.php file I can get my layout
  working
   
and
   
 render some elements too

 On 02/09/07, Alvaro [EMAIL PROTECTED] wrote:
  If I force an error on database.php file I can get my layout
  working
   
and
   
  render some elements too, but off corse nothing about data db and
  get other errors. Why this happend? Is about data connection? is
   
.htaccess?
   
   Can you straight to your index.php file in Cake?
 
  I don't understand exactly what you mean. :)
 
  Thanks
  Alvaro- 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: problems with midphase hosting

2007-09-03 Thread Felix Geisendörfer

 I was using cpanel with Apache 1.3
I happen to run the same setup on my VPS right now and do not have any 
of those problems. So I'm not sure what is going on there.

-- Felix
--
My Blog: http://www.thinkingphp.org
My Business: http://www.fg-webdesign.de


Alvaro wrote:
 thanks very much! That information was very usefull!

 On Monday 03 September 2007 15:21, CakeMan wrote:
   
 Please go thro this thread

 http://groups.google.com/group/cake-php/browse_thread/thread/89a4c9231e2f08
 b6/#

 I had this kind of problem than i asked to our server admin and below
 is the reply from our server admin. I was using cpanel with Apache 1.3

 Essentially the .htaccess file needs to look like this for each copy
 installed; IfModule mod_rewrite.c  RewriteEngine on RewriteRule
 foldername$  /foldername/ [L] RewriteRule ^$ app/webroot/ [L]
 RewriteRule (.*) app/webroot/$1 [L] /IfModule
 The reason being, CakePHP works great by default under Apache2.0,
 which Plesk uses. Unfortunately, cpanel still hasn\'t updated to using
 Apache2.0, it uses Apache1.3 so this is the fix to CakePHP to make it
 work.\


 May be this information help you out.

 Thanks

 On Sep 3, 9:33 pm, Alvaro [EMAIL PROTECTED] wrote:
 
 is apache1.3

 On Monday 03 September 2007 12:59, Vivek Narula wrote:
   
 I had such types of problems laterly.
  which apache version are you using ?

 On 9/3/07, Alvaro [EMAIL PROTECTED] wrote:
 
 can you show me an example about your modifications to .htaccess
 file?

 On Sunday 02 September 2007 22:01, Sam Sherlock wrote:
   
 have you tried cake with internal rewrite?

 I had a few troubles with 1and1 and cake's default htaccess see
 config/core.php I was able to make a slight modification to  the
 
 htaccess

   
 files and get it working fine.  Its worth turning this off as a
 trial.

 though you issue does sound different from the issue I had with
 1and1 as you describe the following

 
 If I force an error on database.php file I can get my layout
 working
   
 and

   
 render some elements too

 On 02/09/07, Alvaro [EMAIL PROTECTED] wrote:
 
 If I force an error on database.php file I can get my layout
 working
   
 and

   
 render some elements too, but off corse nothing about data db and
 get other errors. Why this happend? Is about data connection? is
   
 .htaccess?

   
 Can you straight to your index.php file in Cake?
 
 I don't understand exactly what you mean. :)

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



Question about saving info in two tables from 1 model

2007-09-03 Thread nerohc

Hi everyone. I'm new in this group and with cake too. I have this
problem: I have a Users table, which contains login, pass, etc. and 2
tables with user's details. I use one or other table acording to the
user's group. For example if i register as a simple user, my details
would be saved in 'simple_details'. If my group is advanced users,
then my details would be saved in 'advanced_details'. My first thought
was to make a function that selects which table should use. However i
think that cake could have some way to do this. If there is any way,
please let me know. This is not a trouble really, is just curiousity.

Thank you


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



unbind and Pagination

2007-09-03 Thread cronet

Hi,

i have a question concerning the pagination and unbinding
associations.
My Model has a bunch of hasMany and habtm Associations which i want to
unbind, because for this request I need only the hasOne UserProfile
Model which is already defined in the User Model.


I do this:

   $this-User-unbindModel( array('hasMany' =
array('BandRequest', 'CellRequest', 'GigRequest', 'ImageUpload',
'MusicUpload', 'MusicianRequest', 'UsedRequest', 'Sender',
'Recipient'),
  
'hasAndBelongsToMany'  = array('Band')
)
  );
$this-User-recursive = 2;
$lists = $this-User-findAll();
$this-set('lists', $this-paginate($lists));


It fails with an SQL error (Column: 'id' in where clause is
ambiguous) ...

Is there a possibility to get this working ?


Regards,
Alexander


--~--~-~--~~~---~--~~
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: unbind and Pagination

2007-09-03 Thread Howard Glynn

You need to be quite generous with model name prefixes
in the original model specification to resolve the ambiguity, I read
this somewhere
on the list as I had the same problem.

So in your list of default fields to return in both the original
models file and the bind specification, try adding User.id,
Sender.id etc in various places and you'll probably sort things out.
You need to watch the debug output quite carefully to see where the
changes take effect and steer you to the right place.

H


On 9/3/07, cronet [EMAIL PROTECTED] wrote:

 Hi,

 i have a question concerning the pagination and unbinding
 associations.
 My Model has a bunch of hasMany and habtm Associations which i want to
 unbind, because for this request I need only the hasOne UserProfile
 Model which is already defined in the User Model.


 I do this:

$this-User-unbindModel( array('hasMany' =
 array('BandRequest', 'CellRequest', 'GigRequest', 'ImageUpload',
 'MusicUpload', 'MusicianRequest', 'UsedRequest', 'Sender',
 'Recipient'),
   
 'hasAndBelongsToMany'  = array('Band')
 )
   );
 $this-User-recursive = 2;
 $lists = $this-User-findAll();
 $this-set('lists', $this-paginate($lists));


 It fails with an SQL error (Column: 'id' in where clause is
 ambiguous) ...

 Is there a possibility to get this working ?


 Regards,
 Alexander


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



Bake generated admin section, basic password protect?

2007-09-03 Thread GunitMail

So I generated my admin section with bake, but its not password
protected.

Is there a dead basic/quick way to do a 1 user password protect on
these pages?

Thanks very much in advance


--~--~-~--~~~---~--~~
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: Bake generated admin section, basic password protect?

2007-09-03 Thread Geoff Ford

.htacess is the quickest

http://www.google.com.au/search?q=.htaccess+password+protectie=utf-8oe=utf-8aq=trls=org.mozilla:en-GB:officialclient=firefox-a

Geoff
--
http://lemoncake.wordpress.com

On Sep 4, 8:08 am, GunitMail [EMAIL PROTECTED] wrote:
 So I generated my admin section with bake, but its not password
 protected.

 Is there a dead basic/quick way to do a 1 user password protect on
 these pages?

 Thanks very much in advance


--~--~-~--~~~---~--~~
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: Question about saving info in two tables from 1 model

2007-09-03 Thread Geoff Ford

I would use a factory object to load a seperate model based on the
user type.

See this thread for a simliar problem.
http://groups.google.com/group/cake-php/browse_thread/thread/a2a140878b3094f1/05142a4f5055947c?lnk=gstq=sonic+i+love+a+goodrnum=2#05142a4f5055947c

Geoff
--
http://lemoncake.wordpress.com

On Sep 4, 6:08 am, nerohc [EMAIL PROTECTED] wrote:
 Hi everyone. I'm new in this group and with cake too. I have this
 problem: I have a Users table, which contains login, pass, etc. and 2
 tables with user's details. I use one or other table acording to the
 user's group. For example if i register as a simple user, my details
 would be saved in 'simple_details'. If my group is advanced users,
 then my details would be saved in 'advanced_details'. My first thought
 was to make a function that selects which table should use. However i
 think that cake could have some way to do this. If there is any way,
 please let me know. This is not a trouble really, is just curiousity.

 Thank you


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



observeField problem

2007-09-03 Thread [EMAIL PROTECTED]

Hello guys,

I'm working with an ajax observeField in a select tag, this is my view
code:

?php echo $html-selectTag('Laboratory/Section', $sections) ?
?php echo $ajax-observeField('LaboratorySection',
array('url'='loadResults/' . $data['Appointment']['id'], 'frecuency'
= 1, 'update' = 'results', 'loading' =
Element.hide('results');Element.show('loadingResults'), 'complete'
= Element.hide('loadingResults');Effect.Appear('results'))) ?

$data and $sections are set in controller's function.

div style=display: none; id=loadingResults?php echo $html-
image(spinner.gif, array('align' = 'left'))?Loading results,
please wait .../div
div id=results!-- Results are supposed to load here //--/div

So, the problem is that it is not loading the results, I've checked
the html code generated and it's good:

script type=text/javascriptnew
Form.Element.Observer('LaboratorySection', 2, function(element, value)
{new Ajax.Updater('results','/intranet/appointments/loadResults/
16410', {asynchronous:true, evalScripts:true,
onLoading:function(request)
{Element.hide('results');Element.show('loadingResults')},
onComplete:function(request)
{Element.hide('loadingResults');Effect.Appear('results')},
parameters:Form.Element.serialize('LaboratorySection'), requestHeaders:
['X-Update', 'results']})})/script

if I visit directly the url generated by observeField method in
Ajax.Updater, for instance: http:///intranet/appointments/loadResults/16410
the results are loaded correctly, but using the ajax observeField I
get an empty view and some queries executed but not the ones I'm
trying to in loadResults controller's method.

Any idea of what might be happening?, I have some other ajax
observeField in the view and they work properly, so I don't understand
what I'm missing.

Thanks for your time and help!


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



Re: problems with midphase hosting

2007-09-03 Thread Vivek Narula
VPS ???

and what are the other configurations i mean like PHP (php.ini) and what are
the Apache modules have installed. which version of cake you are using ?

Thanks


On 9/4/07, Felix Geisendörfer [EMAIL PROTECTED] wrote:

  I was using cpanel with Apache 1.3

 I happen to run the same setup on my VPS right now and do not have any of
 those problems. So I'm not sure what is going on there.

 -- Felix
 --
 My Blog: http://www.thinkingphp.org
 My Business: http://www.fg-webdesign.de


 Alvaro wrote:

 thanks very much! That information was very usefull!

 On Monday 03 September 2007 15:21, CakeMan wrote:


 Please go thro this thread
 http://groups.google.com/group/cake-php/browse_thread/thread/89a4c9231e2f08
 b6/#

 I had this kind of problem than i asked to our server admin and below
 is the reply from our server admin. I was using cpanel with Apache 1.3

 Essentially the .htaccess file needs to look like this for each copy
 installed; IfModule mod_rewrite.c  RewriteEngine on RewriteRule
 foldername$  /foldername/ [L] RewriteRule ^$ app/webroot/ [L]
 RewriteRule (.*) app/webroot/$1 [L] /IfModule
 The reason being, CakePHP works great by default under Apache2.0,
 which Plesk uses. Unfortunately, cpanel still hasn\'t updated to 
 usingApache2.0, it uses Apache1.3 so this is the fix to CakePHP to make it
 work.\


 May be this information help you out.

 Thanks

 On Sep 3, 9:33 pm, Alvaro [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:


 is apache1.3

 On Monday 03 September 2007 12:59, Vivek Narula wrote:


 I had such types of problems laterly.
  which apache version are you using ?

 On 9/3/07, Alvaro [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:


 can you show me an example about your modifications to .htaccess
 file?

 On Sunday 02 September 2007 22:01, Sam Sherlock wrote:


 have you tried cake with internal rewrite?

 I had a few troubles with 1and1 and cake's default htaccess see
 config/core.php I was able to make a slight modification to  the


 htaccess



 files and get it working fine.  Its worth turning this off as a
 trial.

 though you issue does sound different from the issue I had with
 1and1 as you describe the following



 If I force an error on database.php file I can get my layout
 working


 and



 render some elements too

 On 02/09/07, Alvaro [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:


 If I force an error on database.php file I can get my layout
 working


 and



  render some elements too, but off corse nothing about data db and
 get other errors. Why this happend? Is about data connection? is


 .htaccess?



  Can you straight to your index.php file in Cake?


 I don't understand exactly what you mean. :)

 Thanks
 Alvaro- 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: renderElement not working in Ajax Updated div

2007-09-03 Thread Richard

Hi,

No I am not using requestAction. Here is the code:
Any help would be gratefully appreciated.

// FORM
?php e($ajax-div('contact_form')); ?

form method=post action=?php e($html-url('/properties/
contact_us'));? onsubmit=return false;

table cellpadding=10 cellspacing=0

tr
   td align=rightName: /td
   td
 ?php e($html-input('Enquire/name'));?
   /td
/tr

tr
   td align=rightEmail: /td
   td
 ?php e($html-input('Enquire/email'));?
   /td
/tr

tr
   td align=rightPhone (including country code): /td
   td
 ?php e($html-input('Enquire/phone'));
  ?
   /td
/tr

tr
   td align=rightMessage: /td
   td

 ?php echo
  $html-textarea('Enquire/message', array('cols'='60',
'rows'='10'));
  ?
   /td
/tr
tr
   td/td
   td

   /td
/tr
/table

?php echo $ajax-submit('Submit', array('url' = '/properties/
contact_us', 'update' = 'contact_form'));?

/form

?php e($ajax-divEnd('contact_form')); ?

// CONTROLLER SCRIPT
$this-redirect('/confirmations/contact_us/'.$this-data['Enquire']
['name'].'/'.$this-data['Enquire']['email']);



// CONFIRMATION PAGE
e('trtdh1Thank you for your email. You will be contacted
shortly./h1/td/tr');

$this-renderElement('newsletter_prompt'); // -- this code is not
included into page




On Sep 3, 8:14 pm, francky06l [EMAIL PROTECTED] wrote:
 Does your element calls a requestAction ?

 On Sep 3, 6:22 am, Richard [EMAIL PROTECTED] wrote:

  Hi,

  I have an Ajax form that posts some data and the updated div section
  (confirmation page) calls renderElement -- but for some reason does
  not work. Any ideas?

  Many thanks, Richard


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



Index Function

2007-09-03 Thread SpyderDriver

Hello, I am new to Cake and I keep running into little catches that I
cant figure out. How do I create a default action for a controller?  I
thought it was to create an index function in that controller file but
that didn't seem to work. I was walking through a tutorial that
created a users control with a register action and a knownusers
action. What happens when someone decides to use domain.com/users/ as
a url. Right now it throws an error. What is needed to show a page for
that directory?


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