Re: Data cleanup in Model

2007-03-26 Thread ianh
Hi, I agree that data cleaning and sanitization is best kept out of the controller and in the model. However, before I present my solution and for the sake of completeness, there are two functions, sanitize::paranoid and sanitize::cleanArray that work from the controller. I and others have found

where to put my functions ?

2007-03-26 Thread feelexit
in the posts_controller.php file, I have a function called funcation add() to add new posts. inside add function, i want to call another function checktags(), where do i write this function. I place it in the posts_controllers.php file, and get this error message. Fatal error: Call to

1.2 ready?

2007-03-26 Thread R. Rajesh Jeba Anbiah
I'm fairly new here (except that I did lurk in the early stage). I'd like to know if 1.2 is really ready? I don't seem to find good plugins/articles based on 1.2. TIA. -- ?php echo 'Just another PHP saint'; ? Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/

R: where to put my functions ?

2007-03-26 Thread m.sbragi
hello feelexit Are you calling your function like this? function checktags() { return 'Bravo!'; } function add() { $retVal = $this-checktags(); } -Messaggio originale- Da: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Per conto di feelexit Inviato: lunedì 26 marzo

Re: R: where to put my functions ?

2007-03-26 Thread feelexit
hi, M. thanx. I am using echo checktags(); this gives me error. after I change it to echo $this-checktags(); it works now.. thanx alot. On Mar 26, 6:02 pm, [EMAIL PROTECTED] wrote: hello feelexit Are you calling your function like this? function checktags() { return 'Bravo!';

Re: how to do Multi-Row Edit ?

2007-03-26 Thread francky06l
You can use a hack to format the tags using an indice ... such as ['model'][0]['Name'], ['model'][1]['Name] etc ... You can use : 'Model/'.$indice.'][fieldname' into the tag name to produce the above format .. On Mar 26, 5:37 am, cc96ai [EMAIL PROTECTED] wrote: I know how to do in PHP, but I

e - the textmate on windows

2007-03-26 Thread purepear
Just check it.. you'll love it. http://www.e-texteditor.com/ While i was waiting InType to gain some speed and development i found e-texteditor which saved my day :P --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: how to do Multi-Row Edit ?

2007-03-26 Thread Diona K
What a timely post! I'm doing the same thing...showing a table of data and allowing the user to edit it. By using this 'hack' will CakePHP handle the insert without any additional considerations? --~--~-~--~~~---~--~~ You received this message because you are

PHPmailer

2007-03-26 Thread Enchy
Hi I installed phpmailer Calling it like the tutorial says: vendor('phpmailer/class.phpmailer'); And then error: Call to undefined function: addaddress() in /usr/www/users/struts/cake/ app/controllers/hunters_controller.php on line 37 line 37: $this-Mailer-AddAddress('[EMAIL PROTECTED]');

Re: PHPmailer

2007-03-26 Thread Daniel Pape
Is $this-Mailer an instance of class.phpmailer?? 2007/3/26, Enchy [EMAIL PROTECTED]: Hi I installed phpmailer Calling it like the tutorial says: vendor('phpmailer/class.phpmailer'); And then error: Call to undefined function: addaddress() in /usr/www/users/struts/cake/

Re: PHPmailer

2007-03-26 Thread Brian Dailey
You won't need to use $this- when calling it from a controller. You'll probably need to do something like: $mailer = new Mailer; $mailer-AddAddress('[EMAIL PROTECTED]'); I suggest brushing up on PHP OOP techniques. The book PHP 5 Objects, Patterns, and Practice by Zandstra is a great way to

Re: how to do Multi-Row Edit ?

2007-03-26 Thread dima
You would have to use a custom model to overwrite some functionality (cake 1.x): E.g class MyHtml extends Html { ... function setFormTag($tagValue) { $parts = explode(/, $tagValue); $this-model = $parts[0]; $this-field= array_pop($parts); // We add a class

Links and Images with correct path from pure html

2007-03-26 Thread korcs
Hi Bakers, I am working on a refactoring project for an existing cms andI have decided to make it using cake. The CMS has an existing database with thousands of articles, stored basically as HTML code, where all the links and images appear as HTML tags like href..., or img...with relative

Re: Links and Images with correct path from pure html

2007-03-26 Thread dima
Korcs, Thanks for re-posting on the Group :) Could you provide some additional code? From what I can tell, you would need a custom helper like so: class CustomHelper { function parseAnchors($content) { // Replaces all anchors locations to an absolute value. return

Bakery Article

2007-03-26 Thread Erich C. Beyrent
I am trying to add a new article to the Bakery, but there are no categories. The article cannot be submitted without a category, so I'm stuck. Can the person/people who maintain the Bakery take a look at this? -Erich- --~--~-~--~~~---~--~~ You received this

one to one relationship (ADD)

2007-03-26 Thread christianandradet
hi, i am traing to insert data with a one to one relationship, i am working with this tables: CREATE TABLE 'people` ( `id` smallint(5) unsigned NOT NULL auto_increment, `lastname` varchar(40) NOT NULL, `firstname` varchar(40) NOT NULL, PRIMARY KEY (`id`) ) CREATE TABLE `judges` (

Re: how to do Multi-Row Edit ?

2007-03-26 Thread cc96ai
I cant generate this kind of format ['model'][0]['Name'], ['model'][1] ['Name] but I m trying to put the id into tag name $html-input(product/qty.$product['Product']['id']); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

one to one relationship (ADD)

2007-03-26 Thread christianandradet
hi, i am traing to insert data with a one to one relationship, i am working with this tables: CREATE TABLE 'people` ( `id` smallint(5) unsigned NOT NULL auto_increment, `lastname` varchar(40) NOT NULL, `firstname` varchar(40) NOT NULL, PRIMARY KEY (`id`) ) CREATE TABLE `judges` (

phpGACL

2007-03-26 Thread Michael Tuzi
I'd like to use this, but I can't figure out how to access MySQL, because the database is running on a non-standard port. With CakePHP, I can define the host as hostname:port, but this doesn't work with the plugin. It's using ADOdb, and I can't seem to define a port using any of the included

Strange problem with $javascript in renderElement

2007-03-26 Thread Siegfried Hirsch
Hello, I have a strange problem. Developing in Win2k with php5 eveything is working. But porting to Linux with php4, I get an error when calling $javascript-link(...); in a renderElement('header'); First I thought it could be the readerElement, which has problems, but putting the same code into

Re: Bakery Article

2007-03-26 Thread gwoo
Please submit bug reports to https://trac.cakephp.org/newticket. --~--~-~--~~~---~--~~ 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

problem with hasOne

2007-03-26 Thread salimk786
My problem is that every time i update my profile, it does an insert instead of an update sql command. Is my associations incorrect ? Thanks. class Member extends AppModel { var $name = 'Member'; var $hasOne = array('Profile' = array('className'

Re: Bakery Article

2007-03-26 Thread Erich C. Beyrent
Forbidden TICKET_CREATE privileges are required to perform this operation TracGuide — The Trac User and Administration Guide gwoo wrote: Please submit bug reports to https://trac.cakephp.org/newticket. --~--~-~--~~~---~--~~ You received this message

RE: Bakery Article

2007-03-26 Thread Mariano Iglesias
This is the problem we discussed gwoo. Should be fixed today. -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! blog:

Re: how to do Multi-Row Edit ?

2007-03-26 Thread [EMAIL PROTECTED]
Another method that was referenced in this group a while back was to use tags like ['model0']['Name'] ['model1']['Name'] Then in your controller, dynamically create a new model for each 'modelX' that you have and validate() it and then save() it. This way you also get the proper validation

Re: how to do Multi-Row Edit ?

2007-03-26 Thread digital spaghetti
Absolutly steve, get posting so we can get baking :). I haven't had to do this yet but I know it'll be coming soon. Tane On 3/26/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Another method that was referenced in this group a while back was to use tags like ['model0']['Name']

Re: sessions in cake db _gc

2007-03-26 Thread jyrgen
hello all, can anybody help please ? thanks, jyrgen --~--~-~--~~~---~--~~ 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,

Yet another Ajax-link question

2007-03-26 Thread Christopher E. Franklin, Sr.
I feel like an idiot for asking since there are so many posts in this group on Ajax-link questions but, I have already wasted 2 hours trying to find the answer. I was following a small tutorial to get Ajax working (the one with the stars =D ) and it didn't work. So, I tried to do a little test

Re: Yet another Ajax-link question

2007-03-26 Thread Christopher E. Franklin, Sr.
Oh yeah, this is the source in the page after it is rendered: div id=testola/div a href=/user/login/ id=link191330890 onclick= return false;Log In/a script type=text/javascript Event.observe('link191330890', 'click', function(event){ new Ajax.Updater('mainContent','/user/login/',

Re: Yet another Ajax-link question

2007-03-26 Thread Samuel DeVore
make sure that your defauly layout includes the prototype/ scriptalicious stuff, and that it is actually loding On 3/26/07, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: Oh yeah, this is the source in the page after it is rendered: div id=testola/div a href=/user/login/

Re: Data cleanup in Model

2007-03-26 Thread Michael Tuzi
@ianh I followed your instructions, but I am now getting an SQL error during validation! I don't understand how, why or where the query takes place, but the error I get shows that a query ('__sanitize') is being made to the db. I am using Zend's IDE that I purched a few years ago, but it isn't

Re: Admin Routing Techniques

2007-03-26 Thread fr3nch13
Ir Even better just bake it... if you can't bake it then: (i haven't played with 1.2 yet, but unless it was drastically changed from 1.1.x, this is how you i do it:) change: turn on admin routing, then: http://www.domain.com/admin/controller/action class ControllerController extends

Re: Yet another Ajax-link question

2007-03-26 Thread Samuel DeVore
can you post some more code in the bin http://bin.cakephp.org maybe there is a simple typo that some fresh eyes might see. Sam D On 3/26/07, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: I did. It is loading. When it doesn't I get the error about the undefined function Event

Re: how to do Multi-Row Edit ?

2007-03-26 Thread cc96ai
in your provided code, we might to update helper.php var $tags = array('link' = 'a href=%s %s%s/a', 'mailto' = 'a href=mailto:%s; %s%s/a', 'form' = 'form %s',

Re: A question on reusing ,parts'

2007-03-26 Thread nitsuj
Thanks for your help, I'll be looking into elements then. On Mar 25, 3:06 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: elements :) On Mar 25, 12:13 pm, nitsuj [EMAIL PROTECTED] wrote: Hi everyone, I've just started trying to use cake, I've followed a few tutorials and readpartsof the

Re: Yet another Ajax-link question

2007-03-26 Thread Christopher E. Franklin, Sr.
Well, I found a quick tutorial on cakebaker that I have tried and even that doesn't seem to work. It is a bare user plugin so I am just uploading it to this group as test_user_plugin.zip. The only thing you would need to change is the user_app_model.php public $useTable = false; Then you can

Re: Yet another Ajax-link question

2007-03-26 Thread Christopher E. Franklin, Sr.
Really wierd but, it's working now. When I included scriptaculous using $javascript-link(scriptaculous);, the script would include the needed file by itself add a whole url in the src tag (example: script src=http://localhost/js/builder.js; type=text/javascript). I commented out the part where

Re: how to do Multi-Row Edit ?

2007-03-26 Thread dima
CC96AI, You're right about modifying the tag templates. There would have to be more changes than the ones i mentioned above. However, it's a starting point :). As for it being a good idea, you can implement your own tags. Since you're subclassing HtmlHelper you can redefine the $tags class

Spam-protected, accessible forms?

2007-03-26 Thread Alex
Hi, Since my site was attacked by spammers, I was working on a solution, that generates some random input boxes inside my formula. when these (hidden by several methods) were filled by an automated spam-robot, the following action will not take place. the other inputs had to be randomly renamed.

Re: Email Component and UTF8 Subject

2007-03-26 Thread Alex
I opened a ticket for this topic: https://trac.cakephp.org/ticket/2298#preview --~--~-~--~~~---~--~~ 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

Re: Spam-protected, accessible forms?

2007-03-26 Thread Grant Cox
So all you want is for your helper to have the same interface as the Form/Html helper, but save the requested field names to the session and generate new random field names which are passed to the real Form/ Html helper? In that case, your helper can either have var $helpers =

modularity and MVC

2007-03-26 Thread DJ Spark
I'd like to know if using requestAction in the view breaks (too much) the MVC concept, or is it a good use? I've been doing due to the 'high' load of a website i'm working. An example: ?php echo $this-renderElement('listas/destaque-principal', array('listas' =

Re: Setting time zone

2007-03-26 Thread Grant Cox
What version of PHP, and what OS? As far as I am concerned, dealing with timezones on PHP4 and Windows is just too much trouble - the timezones need to be in a windows specific format ( http://bugs.php.net/bug.php?id=22418 ) rather than the common TZ format. If you have PHP5, just use

Re: Site wide variable.

2007-03-26 Thread BlenderStyle
To have a variable available in your views and elements try this in your controller (or AppController): function beforeRender() { $this-set('variable', 'whatever you want'); } In your views and elements you should be able to access $variable. On Mar 22, 9:36 pm, dizz [EMAIL PROTECTED] wrote:

RE: modularity and MVC

2007-03-26 Thread Mariano Iglesias
Not at all, calling requestAction() from elements/view is perfectly acceptable. Though you could also call it from the controller and set a var for the view to get, but again, I see no issue on the way you are doing it now (as a matter of fact much of The Bakery elements use this approach.)

Hierarchical Models and associations?

2007-03-26 Thread TekJansen
Is it possible to create a hierarchy of model classes? Cake doesn't seem too happy when I try. What I mean is that I have a table, let's say People. I've created two models which use this table, let's say Man and Woman. The reason they're different is that they have different validation rules,

getLastInsertID - multiple user are entering data??

2007-03-26 Thread bingo
Hi, I wanted to know how getLastInsertID works. I am especially concerned when two different users are posting two different articles at the exactly same time (although chances are extremely rare but is possible), then what getLastInsertID returns..does it works within a particular session or is

Re: getLastInsertID - multiple user are entering data??

2007-03-26 Thread Langdon Stevenson
Hi bingo Nate made the comment a little while ago (in response to my question along similar lines) that getLastIntertID will do what it is meant to. I don't remember the details, however a quick search of this group should turn up the thread. Given that no-one ever complains that

Re: getLastInsertID - multiple user are entering data??

2007-03-26 Thread [EMAIL PROTECTED]
As I understand, it works on the last query performed by that user, so you are always going to get the correct ID. I've never had any trouble with it with a heavily used CRM/CMS system. On Mar 27, 1:07 pm, bingo [EMAIL PROTECTED] wrote: Hi, I wanted to know how getLastInsertID works. I am

Re: Hierarchical Models and associations?

2007-03-26 Thread TekJansen
One small correction - below, when I said I hoped I could define the belongsTo relationship at some superclass level and have it inherited by subclasses, I meant, at least for my hypothetical example, the hasMany relationship. thanks. On Mar 26, 8:06 pm, TekJansen [EMAIL PROTECTED] wrote: I

Re: Spam-protected, accessible forms?

2007-03-26 Thread jitka
Hi Alex, I think You will want to review what AD7six has done - You can (at least) grab some idea how this can be done without modification of core helpers: http://www.noswad.me.uk/MiBlog/Spam Jitka --~--~-~--~~~---~--~~ You received this message because you

Re: Problem Redirecting to Servlet

2007-03-26 Thread g
Hi. Thanks to everybody who replied. I was able to fix the problem by using single quotes. Hehe. On Mar 12, 3:10 pm, Chris Lamb [EMAIL PROTECTED] wrote: Mariano Iglesias [EMAIL PROTECTED] wrote: This issue was solved some time ago: https://trac.cakephp.org/ticket/2060 I looked at the API

Re: Admin Routing Techniques

2007-03-26 Thread R. Rajesh Jeba Anbiah
On Mar 27, 12:17 am, fr3nch13 [EMAIL PROTECTED] wrote: Ir Even better just bake it... if you can't bake it then: (i haven't played with 1.2 yet, but unless it was drastically changed from 1.1.x, this is how you i do it:) change: turn on admin routing,

Re: WithCake.com relaunched

2007-03-26 Thread Dr. Tarique Sani
On 3/25/07, jonathan.snook [EMAIL PROTECTED] wrote: There's still two main features that I need to add: 1) RSS feeds for the job listing 2) a way for people to contact you through the site I'll see about getting those in sometime within the week. Tried it - Nice :) Tarique --

Re: Data cleanup in Model

2007-03-26 Thread ianh
Hi, Thanks for trying the code out - there are no SQL queries within the __sanitize function and the error as described sounds *really* counter- intuitive. What version of cake are you using out of interest? In terms of your controller block, nothing obviously wrong there, you may wish to