virtual subdomain & .htaccess

2007-05-18 Thread tekcorap

Hi all,
I have a project and user name value must be subdomain. (e.g.
alice.domain.com) and subdomain is must be /user/index/subdomainvalue/
action...
for this I use virtual subdomain by .htaccess.

   RewriteEngine on



RewriteCond %{HTTP_HOST} !^(www\.)?example\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.example\.com$ [NC]
RewriteCond %{DOCUMENT_ROOT}/%2%{REQUEST_URI}/ -d
RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} !^(www\.)?example\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.example\.com$ [NC]
RewriteRule ^(.*)$ /user/index/%2 [QSA,L]

and add cakephp's htaccess

RewriteRule^$ app/webroot/[L]
RewriteRule(.*) app/webroot/$1 [L]

 work, but only get subdomain value. Css and other images is not get.

alice.example.com/posts => I get 'alice' value but not posts
parameter. And any css
How can I do get post var, and view my page view properly. (because
css and image path not work )

Sorry my English is very poor :(


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



trying to understand caching philosophy in cakephp

2007-05-18 Thread bingo

hi bakers,

I am trying to better understand caching philosophy in cakephp. I have
specific questions

1. Is caching specific to particular session or its general to whole
website. If not, how do you cache result of same action for different
users i.e. actions give different result for different users

2. how cache are saved i.e. how the data is represented in tmp folder.
Somehow my cache are working but nothing is created in my tmp/cache/
views folder. I am not sure where cache files are placed.

3. Can you cache renderedElement for different users. I have a list of
articles in users library and they are persistently displayed on left
hand side of the page. To avoid querying database everytime, I am
caching the result. But every user will have different articles in his
library, so a whole site wide cache wont work and I need to cache data
for every user.How can I do this?

Please help in better understanding of cakephp.

Regards,
bingo


--~--~-~--~~~---~--~~
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: clear cache for element

2007-05-18 Thread bingo

okie..after some search I found this article

http://bakery.cakephp.org/articles/view/optimizing-your-cakephp-elements-and-views-with-caching

So it seems I can use
@unlink(CACHE.'views'.DS.'element__getposts');

to clear the renderedElement

However, the problem is my app/tmp/view foler is empty ...does it mean
that my cache is not working ??

bingo

On May 18, 7:11 pm, bingo <[EMAIL PROTECTED]> wrote:
> hi bakers,
>
> I have a persistent data on left hand side of a page. I followed
> (http://bakery.cakephp.org/articles/view/persistent-data)
> this tutorial to create persistent data display
>
> To avoid querying database everytime page referesh, I am caching the
> data. To cache the rendered element I am using
> echo $this->renderElement('div_list', array('list' =>
> $quickAccess['BlogsUser'], 'cache' => "+1 hour"));
>
> This all works great..but now there is a situation where I want to
> clear the cache of the element. But I am not able to find anything
> that tells how to force clear cache for an element.
>
> Regards,
> bingo


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



clear cache for element

2007-05-18 Thread bingo

hi bakers,

I have a persistent data on left hand side of a page. I followed
( http://bakery.cakephp.org/articles/view/persistent-data )
this tutorial to create persistent data display

To avoid querying database everytime page referesh, I am caching the
data. To cache the rendered element I am using
echo $this->renderElement('div_list', array('list' =>
$quickAccess['BlogsUser'], 'cache' => "+1 hour"));

This all works great..but now there is a situation where I want to
clear the cache of the element. But I am not able to find anything
that tells how to force clear cache for an element.

Regards,
bingo


--~--~-~--~~~---~--~~
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: How do I change the path to locale?

2007-05-18 Thread jitka

There is enhancement ticket with low priority for it:
https://trac.cakephp.org/ticket/2237

Development version is development version...


--~--~-~--~~~---~--~~
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 & mini dialogs

2007-05-18 Thread Samuel DeVore
here is one I have used that builds on prototype and scripta stuff

http://ajaxian.com/archives/tooltipjs-creating-simple-tooltips

there are a ton look in google for tooltip netflix

On 5/18/07, Chris Hartjes <[EMAIL PROTECTED]> wrote:
>
>
> More of a javascript issue than a Cake one.  Google is your friend for
> this.  Take a look at 'mousovers javascript'.
>
> Hope that helps.
>
>
>
> On 5/18/07, Christoph <[EMAIL PROTECTED]> wrote:
> >
> > If you've ever been to and used Netflix, you know that the feature
> > some really cool functionality (at least, IMO).  When you hover your
> > mouse over a movie title, a little dialog pops up and displays
> > information about that movie.  And if you add it to your queue,
> > another dialog pops up and the rest of the page behind it is all
> > greyed out.
> >
> > I'm wondering if anyone has functionality similar to this (or knows of
> > a tutorial I can take a look at) in the context of CakePHP?  How do
> > you set up the models and views for functionality like this?
> >
> > thnx,
> > Christoph
> >
> >
> > >
> >
>
>
> --
> Chris Hartjes
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheBallpark - http://www.littlehart.net/attheballpark
> @TheKeyboard - http://www.littlehart.net/atthekeyboard
>
> >
>


-- 
(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: URL problems

2007-05-18 Thread soytuny

How are you setting the action of the form?

You might try

 wrote:
> Hi,
>
> I installed CAKEPHP yesterday. The installation went OK and I can
> connect to a database. I also tried to follow the manual provided by
> IBM. The first example explained a registration form, but I can't get
> it to work. I don't have a problem with accessing the application by
> typinghttp://localhost/cake/users/register.
> The registration form appears and I can start fill in the form. But
> whenever I fill in the form and try to submit, the program tries to
> access localhost/users/register and a message "file not found"
> appears.
>
> My OS is windows XP prof
> I installed WAMP
> the mod_rewrite module is enabled
> directory is as follows
> 
> Options FollowSymLinks
> AllowOverride all
> Order deny,allow
> allow from all
> Satisfy all
> 
>
> Did I missed something or does anyone know how to do a proper
> installation on Windows XP.
>
> Many thanks,
> Chris


--~--~-~--~~~---~--~~
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 & mini dialogs

2007-05-18 Thread Chris Hartjes

More of a javascript issue than a Cake one.  Google is your friend for
this.  Take a look at 'mousovers javascript'.

Hope that helps.



On 5/18/07, Christoph <[EMAIL PROTECTED]> wrote:
>
> If you've ever been to and used Netflix, you know that the feature
> some really cool functionality (at least, IMO).  When you hover your
> mouse over a movie title, a little dialog pops up and displays
> information about that movie.  And if you add it to your queue,
> another dialog pops up and the rest of the page behind it is all
> greyed out.
>
> I'm wondering if anyone has functionality similar to this (or knows of
> a tutorial I can take a look at) in the context of CakePHP?  How do
> you set up the models and views for functionality like this?
>
> thnx,
> Christoph
>
>
> >
>


-- 
Chris Hartjes

My motto for 2007:  "Just build it, damnit!"

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

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



How do I change the path to locale?

2007-05-18 Thread [EMAIL PROTECTED]

How do I specify a different path to the locale folder (where my eng/
LC_MESSAGES/default.po) for my translations?


--~--~-~--~~~---~--~~
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: Joins across databases with useTable ??

2007-05-18 Thread gwoo

All associations except HABTM can work across database. You need
useDbConfig. There are a few threads on this group that explain it.


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



Vendor: should it extend AppModel?

2007-05-18 Thread cake_icing

Just a quick question as the subject indicates: when I create a vendor
class, should I extend AppModel? I need input in both technical and
logical.

I suppose logically it should not extend AppModel because it should be
outside the application... hence a vendor. But I want to hear from you
guys...

and I am not sure technical wise if I can extend AppModel. 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
-~--~~~~--~~--~--~---



URL problems

2007-05-18 Thread chrisdaems

Hi,

I installed CAKEPHP yesterday. The installation went OK and I can
connect to a database. I also tried to follow the manual provided by
IBM. The first example explained a registration form, but I can't get
it to work. I don't have a problem with accessing the application by
typing http://localhost/cake/users/register.
The registration form appears and I can start fill in the form. But
whenever I fill in the form and try to submit, the program tries to
access localhost/users/register and a message "file not found"
appears.

My OS is windows XP prof
I installed WAMP
the mod_rewrite module is enabled
directory is as follows

Options FollowSymLinks
AllowOverride all
Order deny,allow
allow from all
Satisfy all


Did I missed something or does anyone know how to do a proper
installation on Windows XP.

Many thanks,
Chris


--~--~-~--~~~---~--~~
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: Why do I have to define this?

2007-05-18 Thread Hellbot

$telephone = $this->NameOfModel->read('tel',$id);

my favorite :)


2007/5/18, Walker Hamilton <[EMAIL PROTECTED]>:
>
> I love this one: $this->NameOfModel->id = $id;
> $telephone = $this->NameOfModel->field('tel');
>
>
> didn't know about it until you mentioned it.I guess I still don't
> completely understand the stateful-ness of the Model instances...
>
> On May 18, 11:57 am, AD7six <[EMAIL PROTECTED]> wrote:
> > On May 18, 6:22 pm, Enchy <[EMAIL PROTECTED]> wrote:
> > Why use a framework if you are not going to use the framework ;)?
> >

--~--~-~--~~~---~--~~
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: User and Friend model HasAndBelongsToMany relationship

2007-05-18 Thread Victor

AD and jyrgen: thanks for responding.

AD: I really appreciate that you answered each of my questions. Very
helpful! God Bless You!

You clarified things for me. I now see that I don't really need Friend
model. I just need a join table (let's just call it friends). I have
tried it. It works beautifully.

When view a user, I can see both Friend and Admirer. The only problem
is when I edit a user, I can only edit Admirers, the Friends are not
shown on screen even after I added line for inputing Friends.

input('Friend/Friend', array('options' =>
$friends, 'multiple' => 'multiple'));?>
input('Admirer/Admirer', array('options' =>
$admirers, 'multiple' => 'multiple'));?>

Here $form->input('Admirer/Admirer'... line were generated by Cake. It
did not generate the line for inputing Friend for some reason. Even
after I added the line for inputing Friend, it still does not show on
screen. Strange.

Other than that, your way of put two associations works beautifully. I
did not even know that you can put in two associations.

Again, thanks a lot.

Victor


On May 18, 1:50 am, AD7six <[EMAIL PROTECTED]> wrote:
> Hi Victor,
>
> Hope I can clarify a couple of things for you.
>
> On 17 mayo, 20:47, Victor <[EMAIL PROTECTED]> wrote:
>
>
>
> > I am trying to define the right model and relationship for User and
> > Friend. Here are my tables
>
> > CREATE TABLE users {
> > id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
> > name VARCHAR (20)
>
> > }
>
> > CREATE TABLE friends {
> > user_id INT UNSIGNED,
> > friend_id INT UNSIGNED
> > PRIMARY KEY(user_id, friend_id)
>
> > }
>
> > The next thing is to define relationship. I use bake command to create
> > relationship. User hasAndBelongsToMany Friend.
>
> > So my User model includes this:
>
> > var $hasAndBelongsToMany = array(
> > 'Friend' => array('className' => 'Friend',
> > 'joinTable' => 'friends',
> > 'foreignKey' => 'user_id',
> > 'associationForeignKey' => 
> > 'friend_id',
> > 'conditions' => '',
> > 'fields' => '',
> > 'order' => '',
> > 'limit' => '',
> > 'offset' => '',
> > 'unique' => '',
> > 'finderQuery' => '',
> > 'deleteQuery' => '',
> > 'insertQuery' => ''),
> > );
>
> > The question is that does the Friend model
>
> What friend model, a friend is another user right...? the table named
> "friends" is your join table, it is not in itself a model. In the
> above if you change 'className' => 'Friend', to 'className' => 'User',
> your class definitions would then appear to be correct.
>
> > need to include Friend
> > hasAndBelongsMany User relationship? If it does what should it look
> > like?
>
> > Should Friend model just simply have Friend belongs User relationship?
>
> You definitely should not have a friend model (unless there's
> something you aren't saying).
>
>
>
> > Is my friends table setup right? Is there better way?
>
> The tables look correct, it's just a typical join table definition.
>
>
>
> > Will this setup not allow cases where user A has B as friend but B
> > does not have A as friend?
>
> The way the above association works is 1 way. That is to say: your
> User model should have 2 habtm association definitions if you want to
> know who is a friend and who has the current user as a friend:
>
> var $hasAndBelongsToMany = array(
>  'Friend' => array('className' => 'User',
>  'joinTable' =>
> 'friends',
>  'foreignKey' =>
> 'user_id',
>
> 'associationForeignKey' => 'friend_id'),
>  'Admirer' => array('className' => 'User',
>  'joinTable' =>
> 'friends',
>  'foreignKey' =>
> 'friend_id',
>
> 'associationForeignKey' => 'user_id')
> );
>
> This would then allow you to say "User X has Y Friends. Z other users
> have X as a Friend". You can use bindModel/unbindModel to add/remove
> these relationships on the fly if necessary.
>
> You probably can rebake and get the above settings (and associated
> views etc.), and just for clarity: there is no problem at all in
> having a self joining association.
>
> hth,
>
> AD
> PS Did you look here before starting this thread 
> ;)http://groups.google.com/group/cake-php/search?group=cake-php&q=self+...


--~--~-~--~~~---

AJAX & mini dialogs

2007-05-18 Thread Christoph

If you've ever been to and used Netflix, you know that the feature
some really cool functionality (at least, IMO).  When you hover your
mouse over a movie title, a little dialog pops up and displays
information about that movie.  And if you add it to your queue,
another dialog pops up and the rest of the page behind it is all
greyed out.

I'm wondering if anyone has functionality similar to this (or knows of
a tutorial I can take a look at) in the context of CakePHP?  How do
you set up the models and views for functionality like this?

thnx,
Christoph


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



othAuth: Only showing content to certain levels

2007-05-18 Thread Tane Piper

I'm adding user levels to my content, as some I only want to show some
content to certain users.  I'm using othAuth, and this is how I
currently have my function:

function index()
{
if (!empty($this->othAuth->group('level')))
{
$level = $this->othAuth->group('level');
} else {
$level = 0;
}

// Overide paginate limit, may need to change
$this->cacheAction = '1 hour';
$this->passedArgs['limit'] = 1;
$this->set('posts', $this->paginate(null, 
array('Post.published'=>1,
'Post.access_level' => '<= ' . $level )));
}

The problem is that when I try and read the user's group level, I get
this error:

Fatal error: Can't use method return value in write context in
/home/digitalspaghetti/workspace/webrocket/controllers/posts_controller.php
on line 19

Can anyone suggest a way around it?  I'd rather do the check in the
controller (or the model) so that the data isn't pulled, rather than
reading the content and not displaying it with the helper.

Tane

--~--~-~--~~~---~--~~
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: Title in Subject (default)

2007-05-18 Thread Matthias Bauer

On 18.05.2007 15:17 Rodrigo Castilho Galvão Ferreira wrote:

> Please, it would be very good for having a heading for standard, for example:

Why? Just filter on the List-Id header:

List-Id: 

It's standardized, and way more robust.

-Matt

--~--~-~--~~~---~--~~
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: Why do I have to define this?

2007-05-18 Thread Matthias Bauer

On 18.05.2007 18:22 Enchy wrote:

> echo $telephone[0][suppliers][tel];
> 
> When I do this it moans that I have to define suppliers and tel

Because for one, you should be using strings, not barewords:

echo $telephone[0]['suppliers']['tel'];

And why do you bother with the whole framework thing if you're not going
to use it?

$this->Order->Suppliers->findById($id); // or something

-Matt

--~--~-~--~~~---~--~~
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: How do I use i18n and l10n in CakePHP 1.2?

2007-05-18 Thread [EMAIL PROTECTED]

To specify a different language do this...

$this->L10n = new L10n();
$this->L10n->get('eng');

On May 7, 10:53 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> It took me awhile to track thisd info down about using i18n in CakePHP
> 1.2 but here are my notes.
>
> Internationalization (i18n)
>
> * at top of controller: uses('L10n');
> * create /app/locale/eng/LC_MESSAGES/default.po (French is fre/
> fra)
>   ohttp://www.loc.gov/standards/iso639-2/php/code_list.php
> * create entries in default.po as such:
>
> msgid  "close_window"
> msgstr "Close"
>
> msgid  "where_pin"
> msgstr "Where is my PIN?"
>
> * call translations in view:  )
> ("close_window" is msgid from default.po)
>   o this is going to echo out the msgstr for the given msgid,
> else it wil display the msgid given
>   o use __("button_submit", true) to return the value as
> opposed to echoing it
>
> On May 5, 7:34 pm, Aaron  Shafovaloff <[EMAIL PROTECTED]> wrote:> I have 
> $_SESSION['Config']['language'] set to my desired language but
> > i18n::translate doesn't even seem to have access to $_SESSION?. I've
> > done a pr($_SESSION) at line 114 of i18n.php and it returns blank. If
> > I do a pr($_SESSION) in a view it works fine. Any ideas?
>
> > On May 5, 6:08 am, CraZyLeGs <[EMAIL PROTECTED]> wrote:> you probably mean 
> > $_SESSION['Config']['language']
>
> > > On May 4, 2:08 pm, misho <[EMAIL PROTECTED]> wrote:
>
> > > > Well Yes,
> > > > I do some checks on allowed languages, but I don't have a separate
> > > > controller to deal with this.
> > > > Just scan URL into function (in app_controller.php) and then redirect.
>
> > > > And thank you I do not know that Configure::write('Config.language',
> > > > 'en') and $_SESSION['Config.language'] are actually the same.
>
> > > > On May 4, 2:35 pm, jitka <[EMAIL PROTECTED]> wrote:
>
> > > > > - if You will store selected language in session, route url 
> > > > > '/language/
> > > > > *' to some controller->action and do 
> > > > > $this->Session->write('Config.language', $arg); in it (probably with 
> > > > > check if this
>
> > > > > lng is allowed) - then redirect to referer
>
> > > > > - if You will save Config.language in session, You don't have to use
> > > > > Configure class (session takes precedency)
>
> > > > > - /app/locale//LC_MESSAGES should be /app/locale//
> > > > > LC_MESSAGES - see L10n::$__l10nMap (locale != language)


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



Re: halfcooked cake?

2007-05-18 Thread hydra12

I don't think it's problem with your view.  I deleted a view in one of
my projects, and I got an error saying that the view for my controller
couldn't be found.  What I get when I look at your web page is the
default cake setup.  It basically says: "OK, cake is installed.  Now
build something."
What is the name of your controller?  You have to put the controller
name into the URL. (http://coleg.homelinux.org/vColeg/controller name/
action).  Right now, it's showing the default cake page because it
doesn't know what controller to use.  For instance, if I had a
controller called UsersController, I'd put 
http://coleg.homelinux.org/vColeg/users/index,
or http://coleg.homelinux.org/vColeg/users/add.

Let me know what you find out.

hydra12

On May 18, 4:19 am, Changoso <[EMAIL PROTECTED]> wrote:
> the thing is I do have the controller set correctly.. i suppose
>
> what i cant seem to configure ollright is the views.
>
> tha baker is not making the add, edit or view.ctp in the view folder
>
> On May 17, 7:59 am, hydra12 <[EMAIL PROTECTED]> wrote:
>
> > What is the name of your controller?  Most cake projects work like
> > this:http://www.mysite.com/controller/action.  You don't have to do
> > it this way, but to change it you have to setup some routes, and it
> > doesn't sound like you have.  From what I can see on your site, you
> > either don't have any controllers defined, or your project is not the
> > document root of your web server.  You might need to give the project
> > name first:http://www.mysite.com/project/controller/action.  This
> > should only be necessary if you aren't using a standard cake install.
>
> > I hope that helps.
>
> > hydra12
>
> > On May 16, 3:02 am, Changoso <[EMAIL PROTECTED]> wrote:
>
> > > Hey guys!
>
> > > I have just baked my project, but it didnt make any add, edit or view
> > > archives, it only made the index.ctp.
>
> > > check, i dyndns so you can see it
>
> > > the address is:
>
> > >http://coleg.homelinux.org
>
> > > as you see if you go into
>
> > >http://coleg.homelinux.org/admins
>
> > > for example it will show you the empty db but I cant even add new
> > > admins
>
> > > i tried copying and editng a file i had from a project a friend did
> > > (the add.ctp) but i get an error
>
> > > you can try with tutors and you will get the same result, althugh that
> > > doesnt has the add.ctp so if you try to go to /add it will not find
> > > it.
>
> > > how can I fix this? or where could i get more help
>
> > > thx a lot


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



SWFupload for cake1.2

2007-05-18 Thread Siegfried Hirsch

After trying SWFupload with cake 1.2, I found, that
$this->params['form'] no longer is filled. So I recoded some parts of
the SWLupload component from James Revillini for cakePHP 1.2.

I was not able to post a comment to the original posting in the bakery
http://bakery.cakephp.org/articles/view/swfupload-and-multipurpose-uploader
so I thought
it would help somebody else if I post the new version here:


 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

/**
 * SwfUploadComponent - A CakePHP Component to use with SWFUpload
 * Thanks to Eelco Wiersma for the original explanation on handling
 * uploads from SWFUpload in CakePHP. Also, thanks to gwoo for guidance
 * and help refactoring for performance optimization and readability.
 * @author James Revillini http://james.revillini.com
 * @version 0.1.4
 */

/**
 * @package SwfUploadComponent
 * @subpackage controllers.components
 */
class SwfUploadComponent extends Object {

/* component configuration */
var $name = 'SwfUploadComponent';
var $params = array();
var $errorCode = null;
var $errorMessage = null;

// file and path configuration
var $uploadpath;
var $webpath = '/files/';
var $overwrite = false;
var $filename;
var $modelName = '';
var $filedata = 'Filedata';
var $data;

/**
 * Contructor function
 * @param Object &$controller pointer to calling controller
 */
function startup(&$controller) {
// initialize members
$this->uploadpath = 'files' . DS;

//keep tabs on mr. controller's params
$this->params = $controller->params;
$this->data = $controller->data;
// get first model - for cake1.2
if (empty($modelName) && isset($controller->modelNames[0])) {
$this->modelName = $controller->modelNames[0];
}
}

/**
 * Uploads a file to location
 * @model string name of the model
 * @filedata string name of the inputfield for filedata
 * @return boolean true if upload was successful, false otherwise.
 */
function upload($model = '', $filedata = 'Filedata') {
if (!empty($model)) {
$this->modelName = $model;
}
if (!empty($filedata)) {
$this->filedata = $filedata;
}
$ok = false;
if ($this->validate()) {
$this->filename = 
$this->data[$this->modelName][$this->filedata]['name'];
$ok = $this->write();
}

if (!$ok) {
header("HTTP/1.0 500 Internal Server Error");   //this 
should tell
SWFUpload what's up
$this->setError();  //this should tell standard 
form what's up
}

return ($ok);
}

/**
 * finds a unique name for the file for the current directory
 * @param array an array of filenames which exist in the desired
upload directory
 * @return string a unique filename for the file
 */
function findUniqueFilename($existing_files = null) {
// append a digit to the end of the name
$filenumber = 0;
$filesuffix = '';
$fileparts = explode('.', $this->filename);
$fileext = '.' . array_pop($fileparts);
$filebase = implode('.', $fileparts);

if (is_array($existing_files)) {
do {
$newfile = $filebase . $filesuffix . $fileext;
$filenumber++;
$filesuffix = '(' . $filenumber . ')';
} while (in_array($newfile, $existing_files));
}

return $newfile;
}

/**
 * moves the file to the desired location from the temp directory
 * @return boolean true if the file was successfully moved from the
temporary directory to the desired destination on the filesystem
 */
function write() {
// In

Re: Why do I have to define this?

2007-05-18 Thread Walker Hamilton

I love this one: $this->NameOfModel->id = $id;
$telephone = $this->NameOfModel->field('tel');


didn't know about it until you mentioned it.I guess I still don't
completely understand the stateful-ness of the Model instances...

On May 18, 11:57 am, AD7six <[EMAIL PROTECTED]> wrote:
> On May 18, 6:22 pm, Enchy <[EMAIL PROTECTED]> wrote:
>
> > $this->set('telephone',$this->Order->findBySql("SELECT tel FROM
> > suppliers WHERE id='$id'"));
>
> > echo $telephone[0][suppliers][tel];
>
> > When I do this it moans that I have to define suppliers and tel
>
> Why not just do
>
> $this->NameOfModel->id = $id;
> $telephone = $this->NameOfModel->field('tel');
>
> OR
>
> $telephone = $this->NameOfModel->field('tel', array('NameOfModel.id'=>
> $id));
>
> OR
>
> $result = $this->NameOfModel->find(array(´ModelName.id'=>
> $id),array('tel'));
> $telephone = $result['NameOfModel']['tel'];
>
> OR
>
> $result = ->NameOfModel->findByID($id, array('tel')
>
> etc
>
> Why use a framework if you are not going to use the framework ;)?
>
> hth,
>
> 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
-~--~~~~--~~--~--~---



Re: Problems when moving cake code to production servers

2007-05-18 Thread Walker Hamilton

Yeah, go to your production servers and find /app/tmp/cache/persistent
and you'll see whypartially.

Really, you should be able to just clean the cache (models,
persistent, views) out and you'll be fine just dropping in new files.

On May 18, 11:43 am, merlin <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> We recently went live with our first cakephp app.
>
> Whenever a controller is updated (edit or add) and then deployed to
> the production server, cake acts like its not there:
>- DEBUG is set to 0 so we get the "The requested address users was
> not found on this server."
>
> At first I thought this might be some caching problem so I left it for
> over an hour, but it didn't help.
>
> What *did* help was changing DEBUG (in core.php) from 0 to 3. All the
> new/updated controller came to life. We can then change DEBUG from 3
> back to 0 and everything is still OK
> Note: editing the core.php file but not changing DEBUG doesn't fix the
> problem
>
> Some differences between our test and production servers that *may* be
> relevant:
>- DEBUG is set to 3 on dev
>- The production servers are actually 3 machines behind a load
> balancer.
>
> This has happened twice now - Obviously, we'd rather not have to do
> this every time we deploy changes - anyone have any idea what's
> happening ??


--~--~-~--~~~---~--~~
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: Why do I have to define this?

2007-05-18 Thread AD7six



On May 18, 6:22 pm, Enchy <[EMAIL PROTECTED]> wrote:
> $this->set('telephone',$this->Order->findBySql("SELECT tel FROM
> suppliers WHERE id='$id'"));
>
> echo $telephone[0][suppliers][tel];
>
> When I do this it moans that I have to define suppliers and tel

Why not just do

$this->NameOfModel->id = $id;
$telephone = $this->NameOfModel->field('tel');

OR

$telephone = $this->NameOfModel->field('tel', array('NameOfModel.id'=>
$id));

OR

$result = $this->NameOfModel->find(array(´ModelName.id'=>
$id),array('tel'));
$telephone = $result['NameOfModel']['tel'];

OR

$result = ->NameOfModel->findByID($id, array('tel')

etc

Why use a framework if you are not going to use the framework ;)?

hth,

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



Problems when moving cake code to production servers

2007-05-18 Thread merlin

Hi All,

We recently went live with our first cakephp app.

Whenever a controller is updated (edit or add) and then deployed to
the production server, cake acts like its not there:
   - DEBUG is set to 0 so we get the "The requested address users was
not found on this server."

At first I thought this might be some caching problem so I left it for
over an hour, but it didn't help.

What *did* help was changing DEBUG (in core.php) from 0 to 3. All the
new/updated controller came to life. We can then change DEBUG from 3
back to 0 and everything is still OK
Note: editing the core.php file but not changing DEBUG doesn't fix the
problem

Some differences between our test and production servers that *may* be
relevant:
   - DEBUG is set to 3 on dev
   - The production servers are actually 3 machines behind a load
balancer.

This has happened twice now - Obviously, we'd rather not have to do
this every time we deploy changes - anyone have any idea what's
happening ??


--~--~-~--~~~---~--~~
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: Why do I have to define this?

2007-05-18 Thread soytuny

Moaning scripts, eh?  The list can't hear it.  The error message would
help us diagnose.

Maybe your query returned no results.

And I think findBySql is old skool, cuz.

By that, I mean it's deprecated, use $this->Model->query() instead.



On May 18, 9:22 am, Enchy <[EMAIL PROTECTED]> wrote:
> $this->set('telephone',$this->Order->findBySql("SELECT tel FROM
> suppliers WHERE id='$id'"));
>
> echo $telephone[0][suppliers][tel];
>
> When I do this it moans that I have to define suppliers and tel


--~--~-~--~~~---~--~~
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: Obtain count from associations

2007-05-18 Thread buzznut

Looks like it was a problem with cake 1.2 that has been fixed. I was
using 1.2.0.4798alpha. I just updated to the nightly build /
1.2.x.x_17.05.2007 and it worked as expected.

On May 18, 7:49 am, buzznut <[EMAIL PROTECTED]> wrote:
> That is the thread that I have been working off to get this far.
> However, the query that I get generated has the Group By statements in
> the left join which causes the query to fail.
>
> On May 18, 7:38 am, Sliv <[EMAIL PROTECTED]> wrote:
>
> > You may want to check this 
> > thread:http://groups.google.ch/group/cake-php/browse_thread/thread/308ea2013...
>
> > On May 18, 9:06 am, buzznut <[EMAIL PROTECTED]> wrote:
>
> > > It looks like the GROUP BY in the left join statement is causing the
> > > problem. The following query works and returns the results I want, but
> > > doesn't use Cake magic to make it work.
>
> > > SELECT `Project`.`id`, count(`Task`.`project_id`) FROM `projects` AS
> > > `Project` LEFT JOIN `tasks` AS `Task` ON (`Project`.`company_id`= `3`
> > > AND `Task`.`project_id` = `Project`.`id`)
> > > WHERE `Project`.`company_id`= `3` GROUP BY `Task`.`project_id`


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



Why do I have to define this?

2007-05-18 Thread Enchy


$this->set('telephone',$this->Order->findBySql("SELECT tel FROM
suppliers WHERE id='$id'"));


echo $telephone[0][suppliers][tel];

When I do this it moans that I have to define suppliers and tel


--~--~-~--~~~---~--~~
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: Joins across databases with useTable ??

2007-05-18 Thread Walker Hamilton

yeah, he wouldn't do it that way because he's doing it over two DBs.

I think he'll run into problems with thatcake's not really set up
to let that happen easily.


--~--~-~--~~~---~--~~
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: Joins across databases with useTable ??

2007-05-18 Thread mehodgson

Is there any reason why you wouldn't use Cake's Built in model
relationships.  Defining a hasOne or hasMany relationship in the Model
should do the trick.

On May 17, 4:25 am, floepi <[EMAIL PROTECTED]> wrote:
> Hi,
>
> i would like to make a join over two databases.
>
> In plain mySQL that is easy like
>
> "... from a.user LEFT JOIN b.countries ..."
>
> where a and b are on the same host.
>
> I tried to do the same thing in cake by defining in the country model
>
> var $useTable = 'b.countries';
>
> but it always comes up with an error. Does anybody know how i can use
> the cakes database abstraction but still make cross database joins.
> Rewriting all the queries in the model like save is not really a nice
> option.
>
> Cheers
>
> Phil


--~--~-~--~~~---~--~~
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: Admin as a plugin

2007-05-18 Thread guitarclap

Thanks for your reply!
I agree with everything that you say.  To me, it's kinda non
conventional to mix the admin_* methods within non .. mostly because
you can't look at the controllers and discern which ones have those
methods until you open up the file.  This way through a plugin you
know what each controllers specifically does.  Also, with plugins
having their own AppController, you can easily set menus, etc ..

Also, this is a breeze for ACL because you can wildcard controllers
with Admin*:* (using felix g's SimpleAcl)



On May 18, 11:27 am, Greg <[EMAIL PROTECTED]> wrote:
> It also depends on how many people are working on your application.
> If, say, you have an admin programmer who only works on the admin
> section of your app, and a public side programmer who sticks to the
> non-admin areas, the project would be rather difficult to manage if
> you
> were to go about the admin_* route.  You would constantly have more
> than one person modifying a file at a time, which becomes a complete
> hassle when using svn or some other versioning system.
>
> So, as far as I know, your other options are to go with a plugin, or a
> completely separate app.  I am not sure about the overhead with
> plugins,
> I am really new to Cake still, so I need to do some more research on
> that.
> I am about to jump into the same situation you are, and I would like
> to
> use plugins, it just seems more logical from first look.
>
> ...and there's 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: using Subdomain to differentiate page-content

2007-05-18 Thread Walker Hamilton

Hi.I'm doing it for languages.


App Controller:

'English', 'ar'=>'Arabic',
'es'=>'Espanol', 'de'=>'Deutsch', 'lt'=>'Lithuanian',
'fr'=>'Francois');
var $components = array('Cookie', 'LanguageDetection');

var $cookieName = 'REMEMBERMEAPPARES';
var $cookieKey = 'dsfhjkc432saigh43';
var $cookieDomain;

function __construct() {
parent::__construct();
$host_r = explode('.', $_SERVER['SERVER_NAME']);
if(count($host_r)>2)
while(count($host_r)>2) array_shift($host_r);
$this->cookieDomain = '.'.implode('.', $host_r);
}

function beforeFilter()
{
//get the parts of the host string ( lang dot domain dot 
com/org/
edu )
$host_r = explode('.', $this->Session->host);
if($host_r[0]=='www')
array_shift($host_r);

if(count($host_r)==3)
{
$langtester = $host_r[0];
if(in_array($langtester, $this->langarr)) {
define('LANG',$langtester);
} else {
define('LANG','en');
}
} else if(count($host_r)==2) {
$thebrowserlang = 
$this->LanguageDetection->getLangArr();

if(in_array($this->Cookie->read('User.lang'), 
$this->langarr))
{

$this->redirect('http://'.$this->Cookie->read('User.lang').'.'.
$this->Session->host);
exit();
} else if(array_key_exists($thebrowserlang[1], 
$this->langarr)) {

$this->redirect('http://'.$thebrowserlang[1].'.'.$this->Session-
>host);
exit();
} else {

$this->redirect('http://'.LANG.'.'.$this->Session->host);
exit();
}
}

$this->set('all_languages', $this->langarr);
}

}

?>

In the models that relate to a city (or a language in my case):

function beforeFind($queryData) {
$queryData['Interface']['lang'] = $this->lang;
return $queryData;
}

Ask me a question about that if you need to. You should be able to
make it work essentially the same way.


--~--~-~--~~~---~--~~
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: Admin as a plugin

2007-05-18 Thread Greg

It also depends on how many people are working on your application.
If, say, you have an admin programmer who only works on the admin
section of your app, and a public side programmer who sticks to the
non-admin areas, the project would be rather difficult to manage if
you
were to go about the admin_* route.  You would constantly have more
than one person modifying a file at a time, which becomes a complete
hassle when using svn or some other versioning system.

So, as far as I know, your other options are to go with a plugin, or a
completely separate app.  I am not sure about the overhead with
plugins,
I am really new to Cake still, so I need to do some more research on
that.
I am about to jump into the same situation you are, and I would like
to
use plugins, it just seems more logical from first look.

...and there's 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: using Subdomain to differentiate page-content

2007-05-18 Thread MJ Ray

BoSc <[EMAIL PROTECTED]> wrote:
> What I would like is to use a subdomain to indicate which city to
> show: newyork.domain.com/city/show (to show city new york)

I think you should be able to read $_SERVER['HTTP_HOST'] from anywhere
inside Cake, even the config if you want.

Hope that helps,
-- 
MJ Ray <[EMAIL PROTECTED]>  www.ttllp.co.uk +44(0)8444 437 237
Webmaster since 1995, developer, statistician, writer, more.
Registered in England and Wales, partnership number OC303457
Reg. Office: 36 Orchard Cl., Kewstoke, Somerset, GB-BS22 9XY

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



Admin as a plugin

2007-05-18 Thread guitarclap

I was wondering what the cons were to making 'admin' an actual
plugin.  It seems to me that this might make the app much more
organized since regular and admin_* functions aren't mixed in the same
file.

What are your thoughts?  Is there more overhead doing it this way?


--~--~-~--~~~---~--~~
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 Subdomain to differentiate page-content

2007-05-18 Thread Gonzalo Servat
On 5/18/07, BoSc <[EMAIL PROTECTED]> wrote:
>
>
> A bit of a cryptical description, but here goes.
>
> Suppose I use a Cake app. to show the content of different cities,
> Normally I would use a city controller dat accepts some parameters
> like: domain.com/citys/show/newyork (to show city 1)
>
> What I would like is to use a subdomain to indicate which city to
> show:
>
> newyork.domain.com/city/show (to show city new york)
>
> I've already read some options of wildcard DNS and stuff like that.
> That is all clear to me, except the fact, how to transform the
> subdomain into a parameter for a certain page. Also it's important
> that the address bar always shows city.domain.com


Apache's rewrite stuff together with a regular expression and a wildcard DNS
entry (*.domain.com IN A www.domain.com or similar) should be able to fix
that. Sorry I can't give you an example (as I don't have one handy), but it
should be a matter of just grabbing the first portion of the domain and
sending it to the right controller, and so on.

When you manage to get it done, it would be interesting to see how you did
it.

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



using Subdomain to differentiate page-content

2007-05-18 Thread BoSc

A bit of a cryptical description, but here goes.

Suppose I use a Cake app. to show the content of different cities,
Normally I would use a city controller dat accepts some parameters
like: domain.com/citys/show/newyork (to show city 1)

What I would like is to use a subdomain to indicate which city to
show:

newyork.domain.com/city/show (to show city new york)

I've already read some options of wildcard DNS and stuff like that.
That is all clear to me, except the fact, how to transform the
subdomain into a parameter for a certain page. Also it's important
that the address bar always shows city.domain.com

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: Printing Variable in thtml

2007-05-18 Thread Silas da Silva

The proper way to do this seems to be

   echo $html->tagValue('Order/dateoforder');

tagValue() is in the API for HtmlHelper, but maybe hard to find if you
don't know what you're looking for.
This will work whether the dateoforder was just sent by a form or if
you set the data in your controller with
   $this->data['Order']['dateoforder'] = $some_date

If you use
   $this->set('data', $this->data);
then you won't be able to output the $data values with tagValue() or
any other HtmlHelper form functions, which defeats the whole purpose
of using $data. At least, It doesn't work for me that way.


--~--~-~--~~~---~--~~
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: Want to add sum to sql

2007-05-18 Thread Enchy

Ugh Sliv that is why Im asking what do I use instead of Findall in
helpers?
Where do I read up on what functions to use in a helper because the
cakephp functions are not working.

On May 18, 3:16 pm, Sliv <[EMAIL PROTECTED]> wrote:
> cakephp style coding would be to not grab data from your db using php
> mysql functions in a view helper...I'd recommend reading up on the
> manual and some basic tutorials about cake, mvc, etc.
>
> On May 18, 9:13 am, Enchy <[EMAIL PROTECTED]> wrote:
>
>
>
> > Thanks
>
> > i endend up creating a  really quick and dirty helper
>
> >  function _gettotal ($oid)
> > {
>
> > $total = '';
> > $sql = "SELECT price,quantity FROM Orderitems where oid='$oid'";
>
> > $rst= mysql_query($sql) or die("$sql".mysql_error());
>
> > while($row = mysql_fetch_array($rst))
> > {
>
> > $total += $row['quantity']*$row['price'];
>
> > }
>
> > //$total = $this->Orderitems->findBySql("SELECT SUM(price) as total
> > FROM Orderitems where oid='$oid' ");
>
> > return $total;
>
> > }
>
> > Can someone help me tidy it up with cakephp style coding please.
> > that uncommented line does not work.- 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: Integrating a forum with Cake (ie, Vanilla)

2007-05-18 Thread luke BAKING barker

sorry I did it too :/ -- for th eunified login I guess as well, maybe
vendors is best bet, but I guess it depends which authenticating
system you wil be using?

On May 18, 1:33 pm, luke BAKING barker <[EMAIL PROTECTED]> wrote:
> Your form seems to have a stutter :)
>
> I think the easy way might be in apache or similar to have a path
> specified that gets routed (maybe better in cake routes.php) that is
> like
>
> /path/to/webroot/Vanilla/
>
> and then it will get ignored by the cake and you can do what you want
> within it
>  I think
> try it !
>
> Luke
>
> On May 17, 11:05 pm, Mark Ferris <[EMAIL PROTECTED]> wrote:
>
> > Hi all -
>
> > I have a website fully developed and now want to include a forum.
> > I've looked around, and I've heard good things about Vanilla and I've
> > seen documentation showing how to integrate Vanilla into a (general)
> > PHP-based site.  (Unified logins between site and forum is really the
> > only thing I require.. I don't need a flashy all-the-bells-and-
> > whistles forum package.)
>
> > At any rate, I wanted to pick the collective brain as to the best way
> > to accomplish this.  I've read a few posts where people said they have
> > accomplished this but I haven't been able to find any documentation or
> > walkthroughs.
>
> > Should I attempt to set this up as a vendor?  Should I just set it up
> > outside of my Cake structure and perhaps use an IFRAME to show the
> > forum page(s)?  Some other way I haven't though of?  If you do point
> > me in the direction of setting it up as a vendor - I've not worked
> > with this before, so how would calling the vendor application
> > integrate with my page? (If you think of all the links/pages in a
> > forum, I'm just wondering how that would correspond to the Cake
> > convention of each method of a controller equating to a page/view.)
>
> > I'm a relative newbie to Cake, so apologies in advance if it seems I'm
> > not approaching the question properly.  I usually exhaust all
> > documentation I can find (I was able to build a relatively complex
> > site without ever having to ask a question), but in this case I've not
> > been able to find any documentation or previous experiences from
> > people who have integrated a forum package with their existing Cake
> > application.
>
> > Thanks 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: Printing Variable in thtml

2007-05-18 Thread Enchy

Thanks alot.

  

I had to ad a ['0']

On May 18, 2:53 pm, "Jon Bennett" <[EMAIL PROTECTED]> wrote:
> > I have looked in the htmlhelper api and cant find anything for this.
>
> > echo   $html->input('Order/dateoforder', array('size' => '53')
>
> > Htmlhelper just echos form elements I just want echo the value of
> > Order/dateoforder onscreen.
> > How do I do this, I looked in the API but cant find it.
>
> assuming you've set the data to the view in your controller like so:
>
> $this->set('data', $this->data);
>
> this will give you a variable $data in your view, so you can get to
> dateoforder like so:
>
> 
>
> on a side note, to help you with rapid prototyping with Scaffolding or
> using the Bake functionality, you might want to follow database naming
> conventions more, by using _ underscores in table names/field names,
> like so:
>
> date_of_order rather than dateoforder
>
> this would mean when using scaffolding, Cake will be able to make the
> field name into a human readable name, eg: Date of order, it can't do
> that without the underscores.
>
> hth
>
> jon
>
> --
>
> 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: Title in Subject (default)

2007-05-18 Thread Rodrigo Castilho Galvão Ferreira

...And in Subject Googlegroup, it does not exist? It would not be necessary?


-- 
Rodrigo Castilho Galvão Ferreira






On 5/18/07, Sam Sherlock <[EMAIL PROTECTED]> wrote:
> yes but you can just filter all mail sent to cake-php@googlegroups.com as
> 'cake'
>
>  On 18/05/07, Rodrigo Castilho Galvão Ferreira <[EMAIL PROTECTED]> wrote:
> >
> > Sorry, I did not specify where... Subject in Googlegroups CakePHP.
> >
> >
> > Examples:
> >
> > [jQuery] Lorem ipsum dolor
> >
> > [Rails-spinoffs] Suspendisse malesuada
> >
> > [css-d] Aliquam cursus enim
> >
> >
> >
> > For CakePHP Group:
> >
> > [CakePHP] MY TITLE
> >
> >
> >
> > Regards,
> >
> > --
> > Rodrigo Castilho Galvão Ferreira
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > On 5/18/07, Sliv <[EMAIL PROTECTED] > wrote:
> > >
> > > I'm not sure I understand you exactly, but you can put this in a
> > > controller to set a title for the view:
> > >
> > > $this->pageTitle = 'yourpagetitle');
> > >
> > > On May 18, 9:17 am, "Rodrigo Castilho Galvão Ferreira"
> > > <[EMAIL PROTECTED]> wrote:
> > > > Please, it would be very good for having a heading for standard, for
> example:
> > > >
> > > > [CakePHP] MY TITLE
> > > >
> > > > Admin, it could insert for standard?
> > > >
> > > > Thanks,
> > > >
> > > > --
> > > > Rodrigo Castilho Galvão Ferreira
> > >
> > >
> > > >
> > >
> >
> >
> > www.rodrigocastilho.com
> > www.rodrigocastilho.com.br
> > www.rodcast.com.br
> > www.rod.cast.nom.br
> >
> >
>
>
>  >
>

--~--~-~--~~~---~--~~
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: Obtain count from associations

2007-05-18 Thread buzznut

That is the thread that I have been working off to get this far.
However, the query that I get generated has the Group By statements in
the left join which causes the query to fail.

On May 18, 7:38 am, Sliv <[EMAIL PROTECTED]> wrote:
> You may want to check this 
> thread:http://groups.google.ch/group/cake-php/browse_thread/thread/308ea2013...
>
> On May 18, 9:06 am, buzznut <[EMAIL PROTECTED]> wrote:
>
> > It looks like the GROUP BY in the left join statement is causing the
> > problem. The following query works and returns the results I want, but
> > doesn't use Cake magic to make it work.
>
> > SELECT `Project`.`id`, count(`Task`.`project_id`) FROM `projects` AS
> > `Project` LEFT JOIN `tasks` AS `Task` ON (`Project`.`company_id`= `3`
> > AND `Task`.`project_id` = `Project`.`id`)
> > WHERE `Project`.`company_id`= `3` GROUP BY `Task`.`project_id`


--~--~-~--~~~---~--~~
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: Title in Subject (default)

2007-05-18 Thread Sam Sherlock
yes but you can just filter all mail sent to cake-php@googlegroups.com as
'cake'

On 18/05/07, Rodrigo Castilho Galvão Ferreira <[EMAIL PROTECTED]> wrote:
>
>
> Sorry, I did not specify where... Subject in Googlegroups CakePHP.
>
>
> Examples:
>
> [jQuery] Lorem ipsum dolor
>
> [Rails-spinoffs] Suspendisse malesuada
>
> [css-d] Aliquam cursus enim
>
>
>
> For CakePHP Group:
>
> [CakePHP] MY TITLE
>
>
>
> Regards,
>
> --
> Rodrigo Castilho Galvão Ferreira
>
>
>
>
>
>
>
>
>
> On 5/18/07, Sliv <[EMAIL PROTECTED]> wrote:
> >
> > I'm not sure I understand you exactly, but you can put this in a
> > controller to set a title for the view:
> >
> > $this->pageTitle = 'yourpagetitle');
> >
> > On May 18, 9:17 am, "Rodrigo Castilho Galvão Ferreira"
> > <[EMAIL PROTECTED]> wrote:
> > > Please, it would be very good for having a heading for standard, for
> example:
> > >
> > > [CakePHP] MY TITLE
> > >
> > > Admin, it could insert for standard?
> > >
> > > Thanks,
> > >
> > > --
> > > Rodrigo Castilho Galvão Ferreira
> >
> >
> > >
> >
>
>
> www.rodrigocastilho.com
> www.rodrigocastilho.com.br
> www.rodcast.com.br
> www.rod.cast.nom.br
>
> >
>

--~--~-~--~~~---~--~~
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: Title in Subject (default)

2007-05-18 Thread Mariano Iglesias

$this->set('title', 'yourpagetitle');

Is more appropiate.

-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 Sliv
Enviado el: Viernes, 18 de Mayo de 2007 10:35 a.m.
Para: Cake PHP
Asunto: Re: Title in Subject (default)

I'm not sure I understand you exactly, but you can put this in a
controller to set a title for the view:

$this->pageTitle = 'yourpagetitle');


--~--~-~--~~~---~--~~
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: Title in Subject (default)

2007-05-18 Thread Rodrigo Castilho Galvão Ferreira

Sorry, I did not specify where... Subject in Googlegroups CakePHP.


Examples:

[jQuery] Lorem ipsum dolor

[Rails-spinoffs] Suspendisse malesuada

[css-d] Aliquam cursus enim



For CakePHP Group:

[CakePHP] MY TITLE



Regards,

-- 
Rodrigo Castilho Galvão Ferreira









On 5/18/07, Sliv <[EMAIL PROTECTED]> wrote:
>
> I'm not sure I understand you exactly, but you can put this in a
> controller to set a title for the view:
>
> $this->pageTitle = 'yourpagetitle');
>
> On May 18, 9:17 am, "Rodrigo Castilho Galvão Ferreira"
> <[EMAIL PROTECTED]> wrote:
> > Please, it would be very good for having a heading for standard, for 
> > example:
> >
> > [CakePHP] MY TITLE
> >
> > Admin, it could insert for standard?
> >
> > Thanks,
> >
> > --
> > Rodrigo Castilho Galvão Ferreira
>
>
> >
>


www.rodrigocastilho.com
www.rodrigocastilho.com.br
www.rodcast.com.br
www.rod.cast.nom.br

--~--~-~--~~~---~--~~
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: Title in Subject (default)

2007-05-18 Thread Sliv

I'm not sure I understand you exactly, but you can put this in a
controller to set a title for the view:

$this->pageTitle = 'yourpagetitle');

On May 18, 9:17 am, "Rodrigo Castilho Galvão Ferreira"
<[EMAIL PROTECTED]> wrote:
> Please, it would be very good for having a heading for standard, for example:
>
> [CakePHP] MY TITLE
>
> Admin, it could insert for standard?
>
> Thanks,
>
> --
> Rodrigo Castilho Galvão Ferreira


--~--~-~--~~~---~--~~
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: Obtain count from associations

2007-05-18 Thread Sliv

You may want to check this thread:
http://groups.google.ch/group/cake-php/browse_thread/thread/308ea201394f235c/dcf614689114db68

On May 18, 9:06 am, buzznut <[EMAIL PROTECTED]> wrote:
> It looks like the GROUP BY in the left join statement is causing the
> problem. The following query works and returns the results I want, but
> doesn't use Cake magic to make it work.
>
> SELECT `Project`.`id`, count(`Task`.`project_id`) FROM `projects` AS
> `Project` LEFT JOIN `tasks` AS `Task` ON (`Project`.`company_id`= `3`
> AND `Task`.`project_id` = `Project`.`id`)
> WHERE `Project`.`company_id`= `3` GROUP BY `Task`.`project_id`


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



Title in Subject (default)

2007-05-18 Thread Rodrigo Castilho Galvão Ferreira

Please, it would be very good for having a heading for standard, for example:


[CakePHP] MY TITLE


Admin, it could insert for standard?



Thanks,

-- 
Rodrigo Castilho Galvão Ferreira

--~--~-~--~~~---~--~~
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: Obtain count from associations

2007-05-18 Thread buzznut

It looks like the GROUP BY in the left join statement is causing the
problem. The following query works and returns the results I want, but
doesn't use Cake magic to make it work.

SELECT `Project`.`id`, count(`Task`.`project_id`) FROM `projects` AS
`Project` LEFT JOIN `tasks` AS `Task` ON (`Project`.`company_id`= `3`
AND `Task`.`project_id` = `Project`.`id`)
WHERE `Project`.`company_id`= `3` GROUP BY `Task`.`project_id`


--~--~-~--~~~---~--~~
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: Usind Ajax->Submit

2007-05-18 Thread buzznut

Here is how I use it.

Quick Add (Task)
create('Task',array('onSubmit'=>'return false'));?>

input('Task/name');
echo $form->hidden('Task/project_id',array('value'=>
$project['Project']['id']));
echo $ajax->submit('Quick Add', array('url'=>'/tasks/quickadd/' .
$project['Project']['id'], 'update'=>'open_tasks'));
?>


And then in my tasks_controller, here is my quickadd action.

function quickadd($project_id) {
// adds new task to database
if (!empty($this->params['data'])) {
$this->data['Task']['creator_id'] = $this->Session-
>read('User.id');
$this->data['Task']['completed'] = '0';
$this->Task->create();
if ($this->Task->save($this->params['data'])) {
$this->set('project_id', $project_id);
$this->set('opentasks', $this-
>paginate(null,array('Task.project_id'=>
$project_id,'Task.completed'=>'!=1')));
$this->render('opentasks', 'ajax');
}
}
}

I am not doing all the error checking I need to yet, but it is
functional and works nicely!!


On May 18, 4:06 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> I've forgetten to say that the div "viewadmin" in another view (the
> index.html) where initially I've loaded modify.html and then I would
> load "controlName/actionName".
>
> On 18 Mag, 10:48, "[EMAIL PROTECTED]"
>
> <[EMAIL PROTECTED]> wrote:
> > I'm new in CakePHP
> > I have a question.
> > Can anyone make me an example of use of $ajax->submit?
>
> > My code is:
>
> > 
> > 
> > 
> > Input:input('input/input',
>
> > array('size'=> '60','value'=>0))?>
> > 
>
> >   > $options=array( 'update'=> 'viewadmin',
> > 'url'   => '/controlName/
> > actionName'  );
> > echo $ajax->submit('Save', $options);
> >?>
> > 
> > 
> > 
> > 
>
> > When I click on "Save" I don't get anything in the div "viewadmin".
> > Why?
>
> > Many 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: Want to add sum to sql

2007-05-18 Thread Sliv

He probably didn't get a reply because the only reply is rtfm...

On May 18, 9:17 am, Enchy <[EMAIL PROTECTED]> wrote:
> I actually do need this in my model cause I need to sort it by total
> in the column, so findall is of no use.
> I need this in my main sql query.  I have seen a guy ask this same
> question in 2006 and never got a reply.
>
> On May 18, 2:56 pm, Sliv <[EMAIL PROTECTED]> wrote:
>
> > How to use sql functions in 
> > conditionshttp://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-cond...
>
> > On May 18, 8:45 am, Enchy <[EMAIL PROTECTED]> wrote:
>
> > >   var $belongsTo = array( 'Orderitem' =>
> > >  array('className' => 'Orderitem',
> > >'conditions'=> '',
> > >'order' => 'item ASC',
> > >'limit' => '',
> > >'foreignKey'=> 'id',
> > >'dependent' => true,
> > >'exclusive' => false,
> > >'finderQuery'   => ' '
> > >  )
>
> > > );
>
> > > Hi I cant find this anywhere.  how do you add a custom query after
> > > SELECT statement.
> > > I just want to add SUM()price as totalprice
>
> > >   'finderQuery'   => 'SELECT item,price,quantity,SUM(price) as
> > > oidPrice FROM Orderitems '
> > > I tried this but it just executes it without the finder.   How do you
> > > include finder into this?- 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: Want to add sum to sql

2007-05-18 Thread Enchy

I actually do need this in my model cause I need to sort it by total
in the column, so findall is of no use.
I need this in my main sql query.  I have seen a guy ask this same
question in 2006 and never got a reply.

On May 18, 2:56 pm, Sliv <[EMAIL PROTECTED]> wrote:
> How to use sql functions in 
> conditionshttp://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-cond...
>
> On May 18, 8:45 am, Enchy <[EMAIL PROTECTED]> wrote:
>
>
>
> >   var $belongsTo = array( 'Orderitem' =>
> >  array('className' => 'Orderitem',
> >'conditions'=> '',
> >'order' => 'item ASC',
> >'limit' => '',
> >'foreignKey'=> 'id',
> >'dependent' => true,
> >'exclusive' => false,
> >'finderQuery'   => ' '
> >  )
>
> > );
>
> > Hi I cant find this anywhere.  how do you add a custom query after
> > SELECT statement.
> > I just want to add SUM()price as totalprice
>
> >   'finderQuery'   => 'SELECT item,price,quantity,SUM(price) as
> > oidPrice FROM Orderitems '
> > I tried this but it just executes it without the finder.   How do you
> > include finder into this?- 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: Want to add sum to sql

2007-05-18 Thread Sliv

cakephp style coding would be to not grab data from your db using php
mysql functions in a view helper...I'd recommend reading up on the
manual and some basic tutorials about cake, mvc, etc.

On May 18, 9:13 am, Enchy <[EMAIL PROTECTED]> wrote:
> Thanks
>
> i endend up creating a  really quick and dirty helper
>
>  function _gettotal ($oid)
> {
>
> $total = '';
> $sql = "SELECT price,quantity FROM Orderitems where oid='$oid'";
>
> $rst= mysql_query($sql) or die("$sql".mysql_error());
>
> while($row = mysql_fetch_array($rst))
> {
>
> $total += $row['quantity']*$row['price'];
>
> }
>
> //$total = $this->Orderitems->findBySql("SELECT SUM(price) as total
> FROM Orderitems where oid='$oid' ");
>
> return $total;
>
> }
>
> Can someone help me tidy it up with cakephp style coding please.
> that uncommented line does not work.


--~--~-~--~~~---~--~~
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: Want to add sum to sql

2007-05-18 Thread Enchy

Thanks

i endend up creating a  really quick and dirty helper

 function _gettotal ($oid)
{

$total = '';
$sql = "SELECT price,quantity FROM Orderitems where oid='$oid'";

$rst= mysql_query($sql) or die("$sql".mysql_error());

while($row = mysql_fetch_array($rst))
{

$total += $row['quantity']*$row['price'];

}

//$total = $this->Orderitems->findBySql("SELECT SUM(price) as total
FROM Orderitems where oid='$oid' ");

return $total;

}

Can someone help me tidy it up with cakephp style coding please.
that uncommented line does not work.


--~--~-~--~~~---~--~~
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: Printing Variable in thtml

2007-05-18 Thread Sliv

Read:
http://manual.cakephp.org/chapter/controllers
http://manual.cakephp.org/chapter/views

For example, depending on the controller/view, your example could be
as simple as: echo $order['dateoforder'] ...


On May 18, 6:03 am, Enchy <[EMAIL PROTECTED]> wrote:
> Hi
>
> I have looked in the htmlhelper api and cant find anything for this.
>
> echo   $html->input('Order/dateoforder', array('size' => '53')
>
> Htmlhelper just echos form elements I just want echo the value of
> Order/dateoforder onscreen.
> How do I do this, I looked in the API but cant find it.
>
> L


--~--~-~--~~~---~--~~
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: 1.2 error message from form::input

2007-05-18 Thread Mariano Iglesias

I know :)

-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 yangz
Enviado el: Viernes, 18 de Mayo de 2007 05:42 a.m.
Para: Cake PHP
Asunto: Re: 1.2 error message from form::input

Great, it works perfectly now.


--~--~-~--~~~---~--~~
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: Want to add sum to sql

2007-05-18 Thread Sliv

How to use sql functions in conditions
http://cakebaker.42dh.com/2007/05/04/how-to-use-sql-functions-in-conditions/

On May 18, 8:45 am, Enchy <[EMAIL PROTECTED]> wrote:
>   var $belongsTo = array( 'Orderitem' =>
>  array('className' => 'Orderitem',
>'conditions'=> '',
>'order' => 'item ASC',
>'limit' => '',
>'foreignKey'=> 'id',
>'dependent' => true,
>'exclusive' => false,
>'finderQuery'   => ' '
>  )
>
> );
>
> Hi I cant find this anywhere.  how do you add a custom query after
> SELECT statement.
> I just want to add SUM()price as totalprice
>
>   'finderQuery'   => 'SELECT item,price,quantity,SUM(price) as
> oidPrice FROM Orderitems '
> I tried this but it just executes it without the finder.   How do you
> include finder into 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: Integrating a forum with Cake (ie, Vanilla)

2007-05-18 Thread luke BAKING barker

Your form seems to have a stutter :)

I think the easy way might be in apache or similar to have a path
specified that gets routed (maybe better in cake routes.php) that is
like

/path/to/webroot/Vanilla/

and then it will get ignored by the cake and you can do what you want
within it
 I think
try it !

Luke

On May 17, 11:05 pm, Mark Ferris <[EMAIL PROTECTED]> wrote:
> Hi all -
>
> I have a website fully developed and now want to include a forum.
> I've looked around, and I've heard good things about Vanilla and I've
> seen documentation showing how to integrate Vanilla into a (general)
> PHP-based site.  (Unified logins between site and forum is really the
> only thing I require.. I don't need a flashy all-the-bells-and-
> whistles forum package.)
>
> At any rate, I wanted to pick the collective brain as to the best way
> to accomplish this.  I've read a few posts where people said they have
> accomplished this but I haven't been able to find any documentation or
> walkthroughs.
>
> Should I attempt to set this up as a vendor?  Should I just set it up
> outside of my Cake structure and perhaps use an IFRAME to show the
> forum page(s)?  Some other way I haven't though of?  If you do point
> me in the direction of setting it up as a vendor - I've not worked
> with this before, so how would calling the vendor application
> integrate with my page? (If you think of all the links/pages in a
> forum, I'm just wondering how that would correspond to the Cake
> convention of each method of a controller equating to a page/view.)
>
> I'm a relative newbie to Cake, so apologies in advance if it seems I'm
> not approaching the question properly.  I usually exhaust all
> documentation I can find (I was able to build a relatively complex
> site without ever having to ask a question), but in this case I've not
> been able to find any documentation or previous experiences from
> people who have integrated a forum package with their existing Cake
> application.
>
> Thanks 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: Printing Variable in thtml

2007-05-18 Thread Jon Bennett

> I have looked in the htmlhelper api and cant find anything for this.
>
> echo   $html->input('Order/dateoforder', array('size' => '53')
>
> Htmlhelper just echos form elements I just want echo the value of
> Order/dateoforder onscreen.
> How do I do this, I looked in the API but cant find it.

assuming you've set the data to the view in your controller like so:

$this->set('data', $this->data);

this will give you a variable $data in your view, so you can get to
dateoforder like so:



on a side note, to help you with rapid prototyping with Scaffolding or
using the Bake functionality, you might want to follow database naming
conventions more, by using _ underscores in table names/field names,
like so:

date_of_order rather than dateoforder

this would mean when using scaffolding, Cake will be able to make the
field name into a human readable name, eg: Date of order, it can't do
that without the underscores.

hth

jon

-- 


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



Want to add sum to sql

2007-05-18 Thread Enchy

  var $belongsTo = array( 'Orderitem' =>
 array('className' => 'Orderitem',
   'conditions'=> '',
   'order' => 'item ASC',
   'limit' => '',
   'foreignKey'=> 'id',
   'dependent' => true,
   'exclusive' => false,
   'finderQuery'   => ' '
 )


);

Hi I cant find this anywhere.  how do you add a custom query after
SELECT statement.
I just want to add SUM()price as totalprice

  'finderQuery'   => 'SELECT item,price,quantity,SUM(price) as
oidPrice FROM Orderitems '
I tried this but it just executes it without the finder.   How do you
include finder into 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
-~--~~~~--~~--~--~---



ACL (again) in 1.2

2007-05-18 Thread Dave J


I do realise that this topic comes up often and i have read and
searched the group for answers  and i'm at the point of trying to
decide the best way to implement ACL.

I'm just wondering if ACL in 1.2 works at all (doesn't matter if its
not documented yet, i understand that completely), but just asking if
the functionality is there - figuring out usage is another matter, but
that's ok.

any light on this issue would be very appreciated   even a
straight out "No! forget it" would do  :-)

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



Re: Problems installing phpGACL-Plugin with Cake

2007-05-18 Thread bujanga

Search this group for:
"phpGACL could not be installed"

On 5/18/07, JuergenE <[EMAIL PROTECTED]> wrote:
>
> Hello group
>
> I have spent hours trying to install phpGACL-Plugin with CakePHP and I
> have spent hours to find a solution.
>
> I use CakePHP 1.1.14.4797, phpGACL Plugin 1.0.2b, phpGACL 3.3.7, PHP
> 5.1.4 on my local server and MySQL 4.1.20.
> I use the document http://dev.sypad.com/installing-phpgacl-plugin-cakephp
> for installation. I only get to the page that says "Check your
> settings" and shows my database-settings. When I click on "Proceed
> with Installation", the page reloads presenting an error-message on
> top ("phpGACL could not be installed"). Looking at the database-table,
> there are 4 tables, that the script created (prefix_acl,
> prefix_acl_sections, prefix_aco, prefix_phpgacl).
>
> Has anybody any hint for me how to get the plugin installed and
> working?
>
> Thanks
> JuergenE
>
>
> >
>

--~--~-~--~~~---~--~~
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: Usind Ajax->Submit

2007-05-18 Thread [EMAIL PROTECTED]

I've forgetten to say that the div "viewadmin" in another view (the
index.html) where initially I've loaded modify.html and then I would
load "controlName/actionName".

On 18 Mag, 10:48, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> I'm new in CakePHP
> I have a question.
> Can anyone make me an example of use of $ajax->submit?
>
> My code is:
>
> 
> 
> 
> Input:input('input/input',
>
> array('size'=> '60','value'=>0))?>
> 
>
>   $options=array( 'update'=> 'viewadmin',
> 'url'   => '/controlName/
> actionName'  );
> echo $ajax->submit('Save', $options);
>?>
> 
> 
> 
> 
>
> When I click on "Save" I don't get anything in the div "viewadmin".
> Why?
>
> Many 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
-~--~~~~--~~--~--~---



Printing Variable in thtml

2007-05-18 Thread Enchy

Hi

I have looked in the htmlhelper api and cant find anything for this.

echo   $html->input('Order/dateoforder', array('size' => '53')

Htmlhelper just echos form elements I just want echo the value of
Order/dateoforder onscreen.
How do I do this, I looked in the API but cant find it.

L


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



Usind Ajax->Submit

2007-05-18 Thread [EMAIL PROTECTED]

I'm new in CakePHP
I have a question.
Can anyone make me an example of use of $ajax->submit?

My code is:




Input:input('input/input',
 
array('size'=> '60','value'=>0))?>


  'viewadmin',
'url'   => '/controlName/
actionName'  );
echo $ajax->submit('Save', $options);
   ?>








When I click on "Save" I don't get anything in the div "viewadmin".
Why?

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



Problems installing phpGACL-Plugin with Cake

2007-05-18 Thread JuergenE

Hello group

I have spent hours trying to install phpGACL-Plugin with CakePHP and I
have spent hours to find a solution.

I use CakePHP 1.1.14.4797, phpGACL Plugin 1.0.2b, phpGACL 3.3.7, PHP
5.1.4 on my local server and MySQL 4.1.20.
I use the document http://dev.sypad.com/installing-phpgacl-plugin-cakephp
for installation. I only get to the page that says "Check your
settings" and shows my database-settings. When I click on "Proceed
with Installation", the page reloads presenting an error-message on
top ("phpGACL could not be installed"). Looking at the database-table,
there are 4 tables, that the script created (prefix_acl,
prefix_acl_sections, prefix_aco, prefix_phpgacl).

Has anybody any hint for me how to get the plugin installed and
working?

Thanks
JuergenE


--~--~-~--~~~---~--~~
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: halfcooked cake?

2007-05-18 Thread Changoso

the thing is I do have the controller set correctly.. i suppose

what i cant seem to configure ollright is the views.

tha baker is not making the add, edit or view.ctp in the view folder



On May 17, 7:59 am, hydra12 <[EMAIL PROTECTED]> wrote:
> What is the name of your controller?  Most cake projects work like
> this:http://www.mysite.com/controller/action.  You don't have to do
> it this way, but to change it you have to setup some routes, and it
> doesn't sound like you have.  From what I can see on your site, you
> either don't have any controllers defined, or your project is not the
> document root of your web server.  You might need to give the project
> name first:http://www.mysite.com/project/controller/action.  This
> should only be necessary if you aren't using a standard cake install.
>
> I hope that helps.
>
> hydra12
>
> On May 16, 3:02 am, Changoso <[EMAIL PROTECTED]> wrote:
>
> > Hey guys!
>
> > I have just baked my project, but it didnt make any add, edit or view
> > archives, it only made the index.ctp.
>
> > check, i dyndns so you can see it
>
> > the address is:
>
> >http://coleg.homelinux.org
>
> > as you see if you go into
>
> >http://coleg.homelinux.org/admins
>
> > for example it will show you the empty db but I cant even add new
> > admins
>
> > i tried copying and editng a file i had from a project a friend did
> > (the add.ctp) but i get an error
>
> > you can try with tutors and you will get the same result, althugh that
> > doesnt has the add.ctp so if you try to go to /add it will not find
> > it.
>
> > how can I fix this? or where could i get more help
>
> > thx a lot


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



Re: 1.2 error message from form::input

2007-05-18 Thread yangz

Great, it works perfectly now.

On May 18, 9:07 am, "Mariano Iglesias" <[EMAIL PROTECTED]>
wrote:
> Update to latest SVN branch.
>
> -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 yangz
> Enviado el: Jueves, 17 de Mayo de 2007 09:20 p.m.
> Para: Cake PHP
> Asunto: Re: 1.2 error message from form::input
>
> Im using CakePHP 1.2.0.4798 alpha


--~--~-~--~~~---~--~~
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: learn cakephp and develop a system

2007-05-18 Thread Davide

rtanz wrote:
> ...
> an intermediate php user like me to learn how to use cake and develop
> ...

On my blog I've summed up some resources for learning CakePHP in a post[1].

HTH
Davide

1. http://edivad.wordpress.com/2007/04/06/learning-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
-~--~~~~--~~--~--~---