Question about building a forum

2009-04-18 Thread Kyle Decot
I want to build a forum for my website but I have a question about the URL structure. I want it to be something like: example.com/forum/top-category/sub-category-1/sub-category-2/.. (etc).../thread-name/ How would I do this in the routes file? Any thoughts? --~--~-~--~~~-

Re: How to tell if a model exists

2009-04-18 Thread John Andersen
Hi Mattalex You can either use the php function class_exists, which checks if the class has been defined. And in case it has not been defined, check for the file in the MODELS directory. Enjoy, John On Apr 19, 7:37 am, mattalexx wrote: > Is there any way to know if a model exists if you hav

How to tell if a model exists

2009-04-18 Thread mattalexx
Is there any way to know if a model exists if you have the name of it in a string? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To uns

RE: AND in query

2009-04-18 Thread Dave Maharaj :: WidePixels.com
Perfect... Thanks once again! Dave -Original Message- From: brian [mailto:bally.z...@gmail.com] Sent: April-19-09 12:23 AM To: cake-php@googlegroups.com Subject: Re: AND in query Both are a part of your conditions, so they both should be in that array. $q = $this->Bookmark->find(

Re: AND in query

2009-04-18 Thread brian
Both are a part of your conditions, so they both should be in that array. $q = $this->Bookmark->find( 'first', array( 'conditions' => array( 'Bookmark.user_id' => $userID, 'Bookmark.post_id' => $postID

AND in query

2009-04-18 Thread Dave Maharaj :: WidePixels.com
Can someone point out how to do an AND query? In a regular query it would be SELECT Bookmark.id FROM Bookmarks WHERE Bookmark.user_id = $userID AND Bookmark.post_id = $postID Just cant seem to figure it out... i just need to see if there is a result and pass it to the layout $q = $this->Bookm

Re: find('list'): Filtering by a related table's field

2009-04-18 Thread mattalexx
Okay, thanks. By the way, there is nothing about recursion on that page. On Apr 17, 4:22 pm, AD7six wrote: > On Apr 17, 11:49 pm, mattalexx wrote: > > > 'all joins the other table and doesn't give me an error. 'list' on the > > other hand, does not join the table and therefore 'array > > ('Pro

all about Cakephp

2009-04-18 Thread Bakery
First all of you, How are you? I am fine . Thanks Now on Point. I am new means fresher in cakephp. My question is how can I show the middle content dynamically on default page.? Any body have answer Please reply me. Thanks --~--~-~--~~~---~--~~ You received t

Re: get action in beforeValidate?

2009-04-18 Thread brian
Yes, that's what I meant. After poking around in the source for awhile I agree that it doesn't look possible. On Sat, Apr 18, 2009 at 3:55 PM, Miles J wrote: > > By current action, do you mean the controllers action thats calling > the validation? > > Ive looked and tried before, theres no way t

Re: Form and validation

2009-04-18 Thread Miles J
You could also rewrite your action like so: function edit($id = null){ if (!empty($this->data)) { if ($this->User->save($this->data)) { $this->Session->setFlash( 'Success.', 'message_succes' ); } e

Re: User Validation is acting weird

2009-04-18 Thread Miles J
Bahaha, yeah I hate when little things like that slip your mind ;) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from th

Re: Issue with HABTM, LIMIT and the created SQL statements

2009-04-18 Thread John Andersen
Thanks a lot Brian, The second link certainly helped me on the way to a solution! Also thanks for pointing out my naming error :) That will be fixed! Enjoy, John On Apr 18, 7:50 pm, brian wrote: > I'm not sure I follow all that but I think these may be some use: > > http://teknoid.wordpress

Re: get action in beforeValidate?

2009-04-18 Thread Miles J
By current action, do you mean the controllers action thats calling the validation? Ive looked and tried before, theres no way to do it unless you hack it up yourself. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: get action in beforeValidate?

2009-04-18 Thread brian
OK, I just came across a link to the "on" info in the cookbook (that table of contents needs an overhaul) but it looks like it only works with "single rules per field". Bummer. And GreyCells gives the lowdown on the options array here: http://teknoid.wordpress.com/2008/09/22/setmerge-and-dynamic

get action in beforeValidate?

2009-04-18 Thread brian
I've been hunting around for the best way to have action-based validation. I know there's an "on" key that may be used but I can't find anything online about how to use it properly. Anyone know where it's documented? I came across this thread, linked from the FAQ: http://groups.google.com/group/

Re: HttpSocket keeps hitting my server

2009-04-18 Thread mscdex
On Apr 17, 7:49 pm, Andrew Koebbe wrote: > So I'm trying to use httpsocket to grab some data on an external > server, but when I put the uri (let's say 'google.com/search'), I keep > get a response from my own server saying that the page has permanently > moved to "mydomain.com/search". Sounds l

Re: Form and validation

2009-04-18 Thread rod
Try this: "psd" => array( "minLength" => array( "rule" => array("minLength", 5), "allowEmpty" => false, "message" => "Your message." ) On Apr 18, 11:42 am, Almaju wrote: > Hi, > I really don't understand what are the problems with

Re: Model::find('value')

2009-04-18 Thread Jon Bennett
Hi Brian, > YourModel->field( >        'field_name', >        array('id' => $id) > ) > doh! good shout! -- jon bennett w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Model::find('value')

2009-04-18 Thread brian
YourModel->field( 'field_name', array('id' => $id) ) On Fri, Apr 17, 2009 at 5:32 PM, mattalexx wrote: > > Is there any way to recreate something like this? > > $result = mysql_query('SELECT single_field FROM table WHERE id = 1 > LIMIT 1'); > $single_field_value_of_record_1 =

Re: Issue with HABTM, LIMIT and the created SQL statements

2009-04-18 Thread brian
I'm not sure I follow all that but I think these may be some use: http://teknoid.wordpress.com/2008/07/17/forcing-an-sql-join-in-cakephp/ http://bakery.cakephp.org/articles/view/quick-tip-doing-ad-hoc-joins-in-model-find Also, your join table should be named "articles_collections". On Sat, Apr

Re: Search and Paginate hasMany relationship

2009-04-18 Thread Chez17
Thanks for the response, I won't have a chance to test this until monday. I tried to understand the containable behavior but it just doesn't seem to be working for me. I'll keep at it. Thanks. On Apr 17, 9:44 pm, yodi wrote: > Oopss, i'm forgot Registration, here : > > function paginateSearch($i

Re: Using UUID's

2009-04-18 Thread jmcneese
hey dave, the long and short of it is: yes, it does impact performance, but for most people it is negligible. it has it's pros and cons just like anything, but if you ever are going to scale your app across multiple servers/clusters/cloud, then uuid is the way to go, due to it's "unique" nature.

Form and validation

2009-04-18 Thread Almaju
Hi, I really don't understand what are the problems with my code, see : function edit($id = null){ if(isset($this->data)){ $this->User->set($this->data); if(!$this->User->validates()){ $this->Session->

AJAX form submission

2009-04-18 Thread hugocaracol
I'm creating an ajax form but it's not working and I can't figure out why. The view to the ajax form is: $ajax->form('/authors/add','post',array('url' => '/authors/add', 'update'=>'DivAddAuthor')); $form->input('name'); $ajax->submit('Add', array('url' => '/authors/add', 'update'=>'DivAddAuthor'

Re: Model::find('value')

2009-04-18 Thread Jon Bennett
>> That returns a record, not one string, right? > > if you need a string, write a model method to return it: except that function will NEVER work cause of a typo! try: function findFieldValue($field, $conditions=array()) { if (isset($field) && !empty($conditions)) {

Re: Model::find('value')

2009-04-18 Thread Jon Bennett
> That returns a record, not one string, right? if you need a string, write a model method to return it: // Function in a model or AppModel if required application wide function findFieldValue($field, $conditions=array()) { if (isset($field) && !empty($condistions)) {

Re: input name data[_method]

2009-04-18 Thread Telegu
yes to save my data correctly On Apr 18, 11:55 am, Miles J wrote: > Yes but why is your data structured that way? SaveAll()? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, se

Re: User Validation is acting weird

2009-04-18 Thread christianstrang
OMG I just realised that the checkPasswords Function is not supposed to be in the controller but in the model. Problem solved, I'm ashamed... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to

Re: User Validation is acting weird

2009-04-18 Thread christianstrang
It seems that the checkPasswords function isn't the problem at all. If I do this: function checkPasswords($data) { return true; } I still get the "Entered passwords does not match" error. But what could case that? Are my password validation rules wrong formatted? 'password' => array( 'not

Re: User Validation is acting weird

2009-04-18 Thread christianstrang
Thx for the tipp, but if I place it in the checkPasswords, I don't get to see the values: function checkPasswords($data) { debug($data, true); if($data['password'] == $this->data['User']['password2hashed']) return true; else return false; } in the core I have: Configure

Re: optgroups and belongsto relations

2009-04-18 Thread fain182
i know scaffolding, but i want something more specific about optgroup.. no one has used optgroup in this way? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake

Re: User Validation is acting weird

2009-04-18 Thread Miles J
Put a debug($this->data) within the checkPasswords(). Thatll let you know if the 2 password fields are being hashed and match. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, se

Re: input name data[_method]

2009-04-18 Thread Miles J
Yes but why is your data structured that way? SaveAll()? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group,

Re: Import Contact address from various email providers to my appication.

2009-04-18 Thread Miles J
This is what I use: http://openinviter.com/ Turn it into a vendor and just follow their instructions. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@goo

Import Contact address from various email providers to my appication.

2009-04-18 Thread sandhya
I want to import contact addresses from various email providers to my appication. M working in cakephp 1.1.19.6305 I hav found dat i need to include contact grabber.. bt i hav no clue how to proceed further.. M stuck.. Plz... if any 1 cud help me out.. --~--~-~--~~~---

Re: input name data[_method]

2009-04-18 Thread Telegu
example $ì=0; $j=5; $form->input($i.'.Model1.Model2.'.$j.'.model_id') output ; this work but if $form->input($i.'.Model1.Model2.'.$j.'.Model3.model_id') output ; this don't work understand? On Apr 17, 10:04 pm, Miles J wrote: > Still confused on what your asking. Can we see your form code, an

Session->valid bug?

2009-04-18 Thread joshua
Hi all, It always lost session if one page redirect to another in my application. I find the fail reason until today. I had added some codes in my app_controller to check if the session is valid or not. Like this, //code if (!$this->Session->valid()) { $this->Session->renew(); } //end And it see

Re: User Validation is acting weird

2009-04-18 Thread christianstrang
Ok, fixed the unique problem with just using "isunique" in the validation, works like a charm. So, now the password check :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send

Issue with HABTM, LIMIT and the created SQL statements

2009-04-18 Thread John Andersen
Dear all, Having three tables in a standard HABTM configuration: Model "Article" HABTM model "Collection" Model "Collection" HABTM model "Article" Giving the tables "articles" -> "article_collections" -> "collections". My goal is to retrieve 4 of the articles which are related to the collectio

Re: Model::find('value')

2009-04-18 Thread fain182
> That returns a record, not one string, right? you can use the parameter 'list' with limit = 1: $single_field_value_of_record_1 = $this->find('list', array( 'conditions'=>array( 'table.single_field'=> 1), 'fields'=>array('single_field'), 'limit'=>1 )); this should give you an array of size 1.