Scraping for "chocolate frosting" with Cake

2010-08-12 Thread Monkihed
I want to query three different search engines from my cake application and display the results. To achieve this I will use simple_html_dom for getting the data from the actual websites. My problem is how to properly set this up. If I understand things right the scraping process with simple_html_d

Re: Change the File Name for a Model

2010-08-12 Thread Sam
I looked it up- there are about 20 reserved words that you can't use in windows file/folder name... throwbacks from the old dos days: http://ionicflux.wordpress.com/2006/09/02/windows-reserved-words/ On Aug 12, 7:31 pm, cricket wrote: > On Thu, Aug 12, 2010 at 8:23 PM, Miles J wrote: > > Erm I m

Re: coding a loop in cake?

2010-08-12 Thread Sam
Also- I just had an idea... it is kind of janky but I think it will do what you want with a good speed increase. When you get your random number, check if it is already in the database by doing the following: $count = $this->find( 'count', array(

Re: Not serving css or js

2010-08-12 Thread Dr. Loboto
http://book.cakephp.org/view/918/Pretty-URLs-and-Lighttpd On Aug 12, 5:34 pm, Paul wrote: > Hi, I've recently started with Cake > > and I'm having trouble serving script files despite following the > docs:http://book.cakephp.org/view/1437/css > > I get the html fine but I'm not being served the j

Re: coding a loop in cake?

2010-08-12 Thread Sam
Can you tell us what you are using this random number for? This might be a situation where there is an alternative solution that we could help you out with if we knew why you needed the random numbers. Also- on the topic of uuid's, aren't they just a hexadecimal number? Couldn't you just convert th

Re: page creation time

2010-08-12 Thread cricket
On Thu, Aug 12, 2010 at 4:50 PM, Jose wrote: > Hi All > > I noticed when using debug=3, before the sqls and time, I get a > > for the page creation time. Having debug at 3 will make Cake spit out a ton of info and slow things down considerably. In fact, it's been removed from the 1.3 branch, AFA

Re: how can i tell cake to delete directories automatically after a specific time

2010-08-12 Thread Sam
Just curious... what's the advantage of uploading the file to a temporary directory? Technically, aren't files uploaded to a temporary directory anyways... if a file upload is cancelled it is automatically deleted. Are you doing some kind of piece-meal upload process that breaks up files or somethi

Re: Change the File Name for a Model

2010-08-12 Thread cricket
On Thu, Aug 12, 2010 at 8:23 PM, Miles J wrote: > Erm I mean $useTable. > > http://book.cakephp.org/view/1057/Model-Attributes#useTable-1059 Yes, that should work. Then, switch to Linux. :-) That's just utterly bizarre that Windows won't let you name something con (+ extension). I wonder which ba

Re: Change the File Name for a Model

2010-08-12 Thread Miles J
Erm I mean $useTable. http://book.cakephp.org/view/1057/Model-Attributes#useTable-1059 On Aug 12, 4:35 pm, Sam wrote: > How many places in the application already use the "Con" class name? > Is there any way to change the table name? If not you can use > "contact" for everything else(using $useT

Re: Change the File Name for a Model

2010-08-12 Thread Miles J
Create the model Contact. Just change the property $useDbTable = 'con'; On Aug 12, 4:35 pm, Sam wrote: > How many places in the application already use the "Con" class name? > Is there any way to change the table name? If not you can use > "contact" for everything else(using $useTable = 'Con') a

Re: Change the File Name for a Model

2010-08-12 Thread Sam
How many places in the application already use the "Con" class name? Is there any way to change the table name? If not you can use "contact" for everything else(using $useTable = 'Con') and just document the irregularity. On Aug 12, 5:33 pm, sanedevil wrote: > And i thot it would be something sim

Re: Change the File Name for a Model

2010-08-12 Thread sanedevil
And i thot it would be something simple. Damn it! thanks euromark! the table's already called Con and hence want to keep the name consistent throughout the app to avoid the typical issues that a softie faces :) You can imagine the nightmare when I start using two names in the app. I really hope th

Re: Change the File Name for a Model

2010-08-12 Thread euromark
WOW didnt know that.. crazy :) this would not be very straight forward. maybe with manual includes and stuff but why not naming it Contact and contact.php? On 13 Aug., 00:03, sanedevil wrote: > Table name: cons > Class name: Con > File name: Con.php > > However, windows doesn't allow you to cr

Change the File Name for a Model

2010-08-12 Thread sanedevil
Table name: cons Class name: Con File name: Con.php However, windows doesn't allow you to create a file named "Con". Is there a way that I can change the filename (e.g. Contact.php), but still keep the Classname as Con? Thanks! Check out the new CakePHP Questions site http://cakeqs.org and help

Re: check if a conversation with exactly those users exist

2010-08-12 Thread schaefer
nobody who can help? On 6 Aug., 22:41, schaefer wrote: > Conversation HM ConversationUser > > I want to check if there is already a conversation with lets say user > 1,2,4 > The problem is that I need 'ConversationUser.user_id'=>$users in the > conditions somehow > but HAVING COUNT(*) = '.count(

page creation time

2010-08-12 Thread Jose
Hi All I noticed when using debug=3, before the sqls and time, I get a for the page creation time. Is there a way I can echo that value in my footer so I can see it in the page? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You

How to involve two databases in a single sql query?

2010-08-12 Thread Roland Pish
Hi. I'm developing a project which needs to access two databases in a single sql query (or in a single Find call), so my question is if in cakephp is possible to perform a Find like: select * from `database1`.`table` where `database1`.`table`.`id` in (select id from `database2`.`table`) Thanks i

Re: saveAll does'nt work

2010-08-12 Thread BrendonKoz
Check my self-answer to my question, I believe it'll help: http://groups.google.com/group/cake-php/browse_thread/thread/a013e1f0ee6689ec On Jul 31, 11:41 am, "Gildonei Mendes A. (Junior)" wrote: > I'm also have some problems withsaveAll. This are the content of this > data and the relations of my

Re: Simple saveAll example... I believe saveAll is currently broken in the model.

2010-08-12 Thread BrendonKoz
Nevermind. I was using the wrong formatting in the view, causing the $this->data to also contain the wrong format. Even if you're only adding a single record, you still must have the following format in the view: echo $form->input('Comment.0.comment'); echo $form->input('Comment.0.author'); ...wh

Simple saveAll example... I believe saveAll is currently broken in the model.

2010-08-12 Thread BrendonKoz
Before I continue, I'd like to state that I am using the latest version of CakePHP v1.2 (not v1.3). I have not checked if the versions differ in their implementations for this specific method. Models: Post hasMany Comment Comment belongsTo Post Post hasAndBelongsToMany Tags In my tests, the contr

Re: Not serving css or js

2010-08-12 Thread Jeremy Burns | Class Outfit
Check that your .htaccess files are present and correct. Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 12 Aug 2010, at 11:34, Paul wrote: > Hi, I've recently started with Cake > > and I'm having trouble serving script files despite following the > docs: ht

Re: auth component issue

2010-08-12 Thread james livsey
yes that must be it. Its encrypting the encrypted password! cheers! On Thu, Aug 12, 2010 at 2:41 PM, Max Dörfler wrote: > Hi, > > that is beacuse when you create the user, the plaintext password gets > encrypted. When you now edit the user, the encrypted password gets loaded > and when you save y

Re: style cakephp apps with css

2010-08-12 Thread Mike Karthauser
On Wed, August 11, 2010 4:15 pm, amatorrahmane wrote: > Hi, > I'm a newbie in using cakephp and I'm having a hard time finding any > documentation that explains how to style my pages using css files. I > created these files before starting to use cakephp, and now I don't > know how to integrate th

Not serving css or js

2010-08-12 Thread Paul
Hi, I've recently started with Cake and I'm having trouble serving script files despite following the docs: http://book.cakephp.org/view/1437/css I get the html fine but I'm not being served the js and css files out of the respective webroot sub-directories. I'm using php 5.2 + Lighttpd on Windo

style cakephp apps with css

2010-08-12 Thread amatorrahmane
Hi, I'm a newbie in using cakephp and I'm having a hard time finding any documentation that explains how to style my pages using css files. I created these files before starting to use cakephp, and now I don't know how to integrate them. Is there any documentation or tutorials that shed some light

Re: how can i tell cake to delete directories automatically after a specific time

2010-08-12 Thread codivist
You will need to find out if your host allows you to do cron jobs first. Assuming you can... This is how I did it, but it doesn't mean its the correct way. I'm using Cakephp 1.3.0 inside your app/webroot folder, duplicate your "index.php" and name it something so you know its for cron jobs. at l

Re: auth component issue

2010-08-12 Thread Max Dörfler
Hi, that is beacuse when you create the user, the plaintext password gets encrypted. When you now edit the user, the encrypted password gets loaded and when you save your user, the encrypted password gets encrypted again. (so the already encrypted password is handled as if it's a plaintext pa

Re: Performance Problems using remote database

2010-08-12 Thread Thiago Elias
Hey Guys.. Thanks everyone for the answers.. I'll try them all here today, and I'll post the results soon as possible.. 2010/8/12 djogo > Hi Thiago, > > I would try to replicate the entire system (lampp + your app + > database) in other server and check whether the "slowness" is due to > the

auth component issue

2010-08-12 Thread james
Hi, I'm using the auth component and ive noticed that if i edit a users details from within the app it automatically changes the encrypted password. Any ideas as to why it would do this? thanks, James. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePH

Re: Performance Problems using remote database

2010-08-12 Thread djogo
Hi Thiago, I would try to replicate the entire system (lampp + your app + database) in other server and check whether the "slowness" is due to the server or not. You may also replicate a legacy PHP app, as you call it, to check if it works well too. This replicated server will allow you to test ot

Re: with tinymce activated i can't read content from textarea with jquery

2010-08-12 Thread Tomfox Wiranata
this is it tinyMCE.activeEditor.contentDocument.body.innerHTML lucky shot ^^ On 12 Aug., 11:09, Tomfox Wiranata wrote: > hi everyone, > > basically I can't read the text entered in a textare, when tinymce is > activated. without tinymce i read the text like this with jquery: > > var temp =  $('

with tinymce activated i can't read content from textarea with jquery

2010-08-12 Thread Tomfox Wiranata
hi everyone, basically I can't read the text entered in a textare, when tinymce is activated. without tinymce i read the text like this with jquery: var temp = $('#notes_title').val();// notes_title is the id from the textarea then i pass this text to my controller function "processtitle":

Re: Pagination Problem

2010-08-12 Thread arif hossen
Thank you very much On Thu, Aug 12, 2010 at 11:32 AM, Andras Kende wrote: > Try something like: > > $this->paginate = array( > 'conditions' => array(Project.id => $ProjectIdArray), > 'limit' => 20 > ); > > $projects = $this->paginate('Project'); > > // debugging in controller ;-) > // pr

Re: coding a loop in cake?

2010-08-12 Thread Tomfox Wiranata
thx to both of you. i know i always do things complicated... so if i do what you suggested, cricket: public function getNewNumber() { do { $new_number = rand(10,10); } while ($this->_testNewNumber($new_number)); return $new_number; }