problem with html in text areas

2007-06-14 Thread Anton Morrison
Hi I am really going off my head here.

I have build an app and everything is working on my localhost but  
when i up load it and try and put any html tags inside a text area  
then submit the form it takes me back to the root of the site.

I dont know if its a security think i have set. I have another app i  
built on the same server and it works with html tags.

If anyone can give me any ideas what could be causing this it would  
be much appreciated as i said i have been trying to fix this for two  
days now

anton



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Crash problem with html in textareas

2007-06-12 Thread Anton Morrison
Has anyone ever had the problem of html inside text areas causing  
problems.

Basically when ever i put in any html inside a text area and submit  
the form it just gos to the route of the site.

Its really annoying as its working fine on my localhost.

I am using 1.2.0.4798alpha, checked it on FF and safari

any ideas?




Anton Morrison
[EMAIL PROTECTED]




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



Re: dynamically setting the $useTable

2007-05-23 Thread Anton Morrison
thanks

the reason is i have a content model and have two tables for english  
content and one for spanish content, then depending on what language  
the user is viewing in i thought i could swap the table over rather  
than have two controllers. This also makes adding a new language just  
adding a new table.

thanks again


On 23 May 2007, at 14:04, grigri wrote:

>
> Why do you need to do that?
>
> Anyway, assuming you have a reason, the best place to set it would be
> the constructor of the model:
>
> class SillyTest extends AppModel {
>   var $name = "SillyTest";
>   var $useTable = 'dummy';
>
>   function __construct() {
> if (mt_rand(0, 100) < 30) {
>   $this->useTable = 'other_table';
> }
>   }
>   parent::__construct();
> }
>
> Hope this helps!
>
> On May 23, 9:19 am, Anton Morrison <[EMAIL PROTECTED]> wrote:
>> Hi I am wondering if anyone can help me find a way to set the
>> $useTable dynamically.
>>
>> I want to set it depending on a Session variable.
>>
>> thanks
>
>
> >

Anton Morrison
[EMAIL PROTECTED]




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



Re: Session keeps regenerating

2007-05-23 Thread Anton Morrison
I had a problem getting things to work because i had the  
app_controller.php in the /app/controllers/ folders but it has to be  
in /app/


On 23 May 2007, at 09:29, Mike Digital Egg wrote:

>
> Hi,
>
> This is driving me mad and I hope that someone can spot the very
> simple mistake I am making. I am building a shopping cart and I want
> to generate a session id which then creates a shopping cart for that
> session.
>
> I have the following in app_controller.php which should create the
> Cart.session id once per session. But it isn't doing that, it
> regenerates the session id every page request. So it seems that
> either !$this->Session->check('Cart.session') is not working, I have
> tried all 3 storage methods (php,cake,database) but still no joy.
>
> app_controller.php
> [php]
> var $beforeFilter = array('_set_defaults');
>   var $uses = array('ShoppingCart');
>   var $helpers = array('Javascript', 'Html', 'Ajax' , 'Form');
>
>   function _set_defaults () {
>   if ( !$this->Session->check('Cart.session') ) {
>   $session = md5(uniqid(time()));
>   $this->Session->write('Cart.session',$session);
>   $this->_create_cart( $session );
>   }
>   }
> [/php]
> Am I doing something really stupid?
>
> Thanks
>
> Mike
>
>
> >

Anton Morrison
[EMAIL PROTECTED]




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



dynamically setting the $useTable

2007-05-23 Thread Anton Morrison

Hi I am wondering if anyone can help me find a way to set the  
$useTable dynamically.

I want to set it depending on a Session variable.

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



setting Session variable then using it in another controller

2007-05-22 Thread Anton Morrison

Hi I am trying to set the Session var with a language variable, then  
use it to tell another controller what table to use.

I have a page controller and i am calling the before filter function  
to set the default language

function beforeFilter(){
if($this->Session->check('language') || $this->Session->read 
('language') == ''){
$this->Session->write('language', 'english');
}
print $this->Session->read('language');
}

the page controller use the content model then i want to use the  
session variable i have just set to set the table like

Session->read('language');

}
?>

however this does not work, any idea how i can do this. Does the  
content model get included before the beforeFilter of my page model  
therefore the Session is not set?

thanks in advance for any help







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



Re: what relationship is this?

2007-05-03 Thread Anton Morrison

Thanks i do know how to set up relationships my question did prob  
seem quite basic.

The problem with your suggestion is say my customer comes along and  
now wants the site in french as well as spanish, catalan, italian and  
dutch. I would have to go and add all the fields into each table.  
Plus i was using a simple table as a example there will be maybe five  
fields in a table that will have a translation.

I have worked it out without using bind.

var $belongsTo = array(
'Template' => array('className' => 'Template',
'foreignKey' => 
'template_id',
'conditions' => 
'',
'fields' => 
'name',
'order' => '',
'counterCache' 
=> ''),
'Title' => array('className' => 'ContentEnglish',
  
'foreignKey' => 'title',
  
'conditions' => '',
  
'fields' => 'content',
  
'order' => '',
  
'counterCache' => ''),
'Content' => array('className' => 'ContentEnglish',
  
'foreignKey' => 'content',
  
'conditions' => '',
  
'fields' => 'content',
  
'order' => '',
  
'counterCache' => ''),
);

I am not sure about this way and i am yet to see what i have to do to  
get it to save. I will look into the bind, unbind functions.

thanks



On 3 May 2007, at 15:50, [EMAIL PROTECTED] wrote:

>
> You are asking is how to set up relationships. If you don't know how
> to create basic relationships, then you need to read cake manual, and
> then go through the blog tutorial. You can do both in about 3-4 hours.
> After that, try setting up your relationships; If you still have
> trouble at that point, come back here and ask for help.
>
> There are plenty of people willing to help here, but you need to know
> the basics first.
>
> On a different note: I think you would find it easier to keep all of
> you content in one table, rather than having one table for each
> language. Just add a field to identify the language.
>
> page.id
> page.name
> page.language
> page.header
> page.body
>
> Now when some one goes to the "home" page, you can simply query
> page.name=home AND page.language = users_language
>
> This way you don't need to bind and unbind models, and you don't need
> to create a new table every time you add a new language.
>
> good luck,
> cook
>
>
>
>
> On May 3, 9:14 am, Anton Morrison <[EMAIL PROTECTED]> wrote:
>> Hi
>>
>> I have a table with a page title and body. the title and body are
>> integers that link to a table with there content value (so i can have
>> different tables for different languages). Is there a relationship i
>> can set up to get the content values in one query?
>>
>> at the moment i get the integer values then go through the content
>> table and get the text values, but this means extra trips to the
>> database.
>>
>> thanks in advance.
>>
>> Anton Morrison
>> [EMAIL PROTECTED]
>
>
> >

Anton Morrison
[EMAIL PROTECTED]




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



what relationship is this?

2007-05-03 Thread Anton Morrison


Hi

I have a table with a page title and body. the title and body are  
integers that link to a table with there content value (so i can have  
different tables for different languages). Is there a relationship i  
can set up to get the content values in one query?

at the moment i get the integer values then go through the content  
table and get the text values, but this means extra trips to the  
database.

thanks in advance.

Anton Morrison
[EMAIL PROTECTED]




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



Re: multi language site

2007-04-30 Thread Anton Morrison

This is more about translating the core stuff. I want my client to  
update there own pages and translate them.

I was more asking if there was a way i could bind the fields from the  
content_english table with there corresponding fields in the page  
table. In rails you can use 'bind' is there anything like this in cake?


On 30 Apr 2007, at 16:54, R. Rajesh Jeba Anbiah wrote:

>
> Anton Morrison wrote:
>> Hi I am trying to build a micro content management system so have
>> more than one langage, with human translation.
>
>
> Possibly <http://groups.google.com/group/cake-php/msg/
> 13afbe9841b91314>
>
> --
>   
> Email: rrjanbiah-at-Y!com    Blog: http://rajeshanbiah.blogspot.com/
>
>
> >

Anton Morrison
[EMAIL PROTECTED]




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



Re: multi language site

2007-04-30 Thread Anton Morrison

I cant find the documentation either. Is this a automatic translation  
script?

I dont want that i want to set it up so humans enter all the content.


On 30 Apr 2007, at 16:13, Mariano Iglesias wrote:

>
> If you are using CakePHP 1.2 take a look at the Translation behavior:
>
> https://trac.cakephp.org/browser/branches/1.2.x.x/cake/libs/model/ 
> behaviors/
> translate.php
>
> poLK added a small documentation somewhere but can't remember where.
>
> -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 Anton Morrison
> Enviado el: Lunes, 30 de Abril de 2007 11:04 a.m.
> Para: cake-php@googlegroups.com
> Asunto: multi language site
>
> Hi I am trying to build a micro content management system so have
> more than one langage, with human translation.
>
>
> >

Anton Morrison
[EMAIL PROTECTED]




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



multi language site

2007-04-30 Thread Anton Morrison

Hi I am trying to build a micro content management system so have  
more than one langage, with human translation.

I want the amount of langages to be changeable so thought the best  
way to do this was have different 'content' tables for the different  
langages then have a foren key linking to each of the translations.

Here is my schema to help explane

Page
id : int primary key
title :int
body :int

content_english
id :int primary key
content : text

content_spanish
id int primaty key
content :text

So an excample page would be

page.id = 1
page.title = 99
page.body = 100

content_english.id = 99
content_english.content = 'hello world'

content_english.id = 100
content_english.content = 'body copy for hello world'

content_spanish.id=99
content_spanish.content = 'hola mundo'

...

So basically the content_english row ids match with the  
content_spanish and represent the translation.

Now if i was on the page with id one

I would have page_array with the id numbers fo rthe content and  
depending on which langague the user was on the site i would go to  
that database.

My question is this would i be able to set up the relationships in  
cake php to automatically get the content into the page array?

i am new to cake but i am finding it really good to use and thinking  
it could save me a lot of time if i could set this up.

thanks in advance




Anton Morrison
[EMAIL PROTECTED]




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



Re: Dynamic Links with DS constant?

2007-04-30 Thread Anton Morrison

I can never use the $html->link when i want to link on an image as it  
turns all the < into gth;

has anyone ever found a way?


On 29 Apr 2007, at 21:18, Samuel DeVore wrote:

>
> btw r() is a convenience function for str_replace
>
> manual.cakephp.org/chapter/constants
>
> On 4/29/07, Mariano Iglesias <[EMAIL PROTECTED]> wrote:
>>
>> echo $html->link('Link','/' . r(DS, '/', $filepath));
>>
>> -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 Lb-web
>> Enviado el: Domingo, 29 de Abril de 2007 04:06 a.m.
>> Para: Cake PHP
>> Asunto: Dynamic Links with DS constant?
>>
>> I'm an newbie to CakePHP and I'm having a problem with links
>> generated
>> by my DS constant.
>>
>>
>>>
>>
>
>
> -- 
> (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/
>
> >

Anton Morrison
[EMAIL PROTECTED]




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