Re: Media View / Download: How to count finished downloads?

2010-01-03 Thread biesbjerg
Hey, I modified the MediaView to be a Component, and added some stuff - you can find the component here: http://bin.cakephp.org/view/599576961 1. Add to components array in the controller. 2. Parameters are the same, only you should use $this->Download- >download($params); instead of $this->set($

Re: How to implement Comet in CakePHP ?

2010-01-03 Thread td-nathan
I also need to implement a chat room system, are there any good tutorials for integrating these Jabber systems with CakePHP? Ideally something that covers the server-side installation and then how to build an accessible front-end for users using CakePHP or an existing plugin? On Jan 2, 11:26 am,

Re: jQuery & ajax pagination in 1.3

2010-01-03 Thread Aris
For some reason if you call the $js->writeBuffer() with the onDomReady set to false it works. give it a shot: $js->writeBuffer(array('onDomReady'=>false)); This worked for me Aris On Dec 17 2009, 3:42 pm, Joe Theory wrote: > Jquery is the only engine that seems to have issues Mark.  Thanks for >

Re: Secret URLs

2010-01-03 Thread j0n4s.h4rtm...@googlemail.com
Well using UUIDs would result into /users/view/LONG-UU-ID-HERE Which would not resolve Cross Site Request Forgery. Use SecurityComponent and use form buttons that use method = post. That way "destructive" links get caught if no form security token was found. I do it like this: http://github.com/i

saveAll options help

2010-01-03 Thread Dave
I am trying to do a single transaction save for 2 related models and cant seem to get the fieldList params correct. $options = array($fieldList = array()); $this->User->saveAll($this-data, true, $options); But what is the fieldlist for 2 models? Structure wise I mean. Is each Model an array o

Re: Login after registration not working

2010-01-03 Thread EwBoonTwo
(Kind of) SOLUTION I've kept tinkering and noticed that the log in query was trying to use the unhashed password. So, I changed the register method from this: ... // log the user in to his new account $this->data['User']['password'] = $this->data['User']['password1']; ... to this: ... // log the

HABTM Question

2010-01-03 Thread Dave
I am back to working with additional fields in a HABTM and going to try the method as described in the cookbook. "Child hasMany Membership Membership belongsTo Child, Club Club hasMany Membership." In my setup I have User, Skill, Year, Skillset and UsersSkill but not sure of setting up the rela

Re: Problem with app_controller.php

2010-01-03 Thread szusty
It's work :D Thenks for help ;] Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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

Re: Problem with app_controller.php

2010-01-03 Thread John Andersen
Thanks :) I suggest you turn on debug (in config/core.php) and change your admin_index code as: [code] ... debug('Invoking $this->searchConditions'); $conditions = $this->searchConditions($this->params); ... [/code] Then open admin_index in your browser and tell us the result - d

Re: Problem with app_controller.php

2010-01-03 Thread szusty
Hi :) This code: [code] $this->Redirect->urlToNamed(); [/code] is changing tags on url adres. This is a example from tutorial which i now doing and ther everything is ok but in my code not. I don't know why becouse i do everything identically ;/ Thenks for help, and sorry for my lame english ;

Re: SQL Error Help

2010-01-03 Thread John Andersen
When you defined the tables, did you create a referental constraint between the profiles and users tables? Or maybe try to look in to the MySQL database "information_schema" in the table "REFERENTIAL_CONSTRAINTS" for your constraint "designers_ibfk_1" and see what the definition there tell you. T

SQL Error Help

2010-01-03 Thread Dave
I am getting this error when creating a new User Error: 1452: Cannot add or update a child row: a foreign key constraint fails (`dev_table/profiles`, CONSTRAINT `designers_ibfk_1` FOREIGN KEY (`id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION) Query: INSERT INTO `profiles` (`t

Login after registration not working

2010-01-03 Thread OohBunToo
Hey all, I'm trying to set up a user registration system that uses the Auth component. I've set up both the registration and login parts of my site, and separately each work as expected (i.e. a user can register and is saved to the database, and a user can log in separately once registered). But,

CakePHP isUnique fail?

2010-01-03 Thread dispy
Good day, the isUnique-Flag doesn't work for me - based on a wrong query. Here my validation rules for User: /** * Validate the incoming data */ var $validate = array( 'name' => array( 'fieldUnique' => array( 'rule' => 'checkUnique', 'message' => 'Dieser Nutzerna

Problem with Currency Cents

2010-01-03 Thread gmchun
Hai, How to change currency display?For example,my code was display 20C but i would like to display as $0.20. I was read following solution but no luck. http://cakephp.lighthouseapp.com/projects/42648/tickets/34-added-functionality-to-number-helper I was using 1.2RC3 and also how to upgrade from 1

Re: redirect from within a view

2010-01-03 Thread John Andersen
Yes, just remember to invoke the parent::beforeFilter method of the parent controller :) Enjoy, John On Jan 3, 7:10 pm, Lorenzo Bettini wrote: > You mean in the pages controller?  Is it overridable? > > > > John Andersen wrote: > > As is specified in your router connect statement, it uses the

Re: Media View / Download: How to count finished downloads?

2010-01-03 Thread euromark
you can ONLY check if somebody starts to download not if he stops it or finishes it for counting just add the model method call before you pass those vars to the media view $this->Model->touch(); $this->set($params); with touch() being your count method! (in your controller action) On 3 Jan.,

Re: Secret URLs

2010-01-03 Thread euromark
just use UUIDs that "feature" comes with it automatically On 3 Jan., 08:41, Walther wrote: > Not really possible afaik. > > But, security through obscurity is not the solution. You should rather > spend the time writing code that will make sure that the user/referer > has permissions to perform t

Re: explicit bindModel not working

2010-01-03 Thread Lorenzo Bettini
Actually also doing before the find $this->Paper->recursive = 0; solved the problem... probably because it defaults to -1 and in that case the find does not work? thanks Lorenzo John Andersen wrote: > Add the recursive parameter to the find, as: > > [code] > $result = $this->Paper->fi

Re: redirect from within a view

2010-01-03 Thread Lorenzo Bettini
You mean in the pages controller? Is it overridable? John Andersen wrote: > As is specified in your router connect statement, it uses the pages > controller in order to display the admin view. > If you are not using the pages controller to display other pages/ > views, then add your check in the

Media View / Download: How to count finished downloads?

2010-01-03 Thread DigitalDude
Hey, in my app I have some type of file uploading, and also downloading. I'm using Cake's Media View, so I can send the file to the user after authenticating that he/she is allowed to get that file. So I was wondering, is there any chance to COUNT these downloads? All I have in my action is a vie

Re: explicit bindModel not working

2010-01-03 Thread John Andersen
Add the recursive parameter to the find, as: [code] $result = $this->Paper->find('all', array( 'fields' => array('Paper.*'), ''conditions' => array('AuthorsPaper.id' => 1), "recursive" => 1 )

explicit bindModel not working

2010-01-03 Thread Lorenzo Bettini
Hi I have Paper HABTM Author (I also have the model AuthorsPaper) and I'd like to do an explicit join using $this->Paper->bindModel(array('hasOne' => array('AuthorsPaper'))); however, when performing a find no explicit join is performed, in fact, if I try $result = $this->Paper->find('all',

Re: redirect from within a view

2010-01-03 Thread John Andersen
As is specified in your router connect statement, it uses the pages controller in order to display the admin view. If you are not using the pages controller to display other pages/ views, then add your check in the beforeFilter method (or create it) in the controller. Enjoy, John On Jan 3, 4:32

Re: redirect from within a view

2010-01-03 Thread Lorenzo Bettini
I have this setting in the route Router::connect('/admin/', array('controller' => 'pages', 'action' => 'display', 'admin')); so that it directly displays the admin.ctp, and I thought it doesn't pass by a controller of mine, am I wrong? cheers Lorenzo John Andersen wrote: > There is a

Re: xgettext: waring: file`' extension `' is unknown; will try C poedit

2010-01-03 Thread JoeyCake
Did you find a solution for this? On Dec 10 2009, 9:14 am, Jay wrote: > Hi, > > when I tried to create po file. > > Im getting the following error message > > xgettext: waring: file`' extension `' is unknown; will try C > > updation failed. > > I have given path > controllers > views/posts > . >

Upgrading from 1.2.2 to 1.2.5

2010-01-03 Thread Temujin_12
I'm not seeing a concise changelog anywhere. And, no: `git rev-list --no-merges --oneline 1.2 ^master | awk '{print "Commit: ["$1"]\n"; $1=""; print "-"$0"\n"}'` ...doesn't count as a changelog. I'm looking to build off of a code base I built on CakePHP 1.2.2 but want to take the opportunity to

Re: $this->Session->setFlash();

2010-01-03 Thread j0n4s.h4rtm...@googlemail.com
I use this to make it lots shorter: $this->Session->setFlash(___('Success Message'), 'flashes/success'); In app/views/layouts/flashes I have P.s. in app/config/boostrap.php I have function ___($string) { return __($string, true); } Check out the new CakePHP Questions site http://cakeq

Re: redirect from within a view

2010-01-03 Thread John Andersen
There is a controller associated with the route, probably it is called index! Your view is invoked by the controller, so which controller are you using for the admin? Please someone else correct me, if I am wrong about this! As far as I know, you can't invoke a view, just by having a route - it ha

Re: Problem with app_controller.php

2010-01-03 Thread John Andersen
Thanks :) In your post controller, what is this code doing? [code] $this->Redirect->urlToNamed(); [/code] Have you tried using debug just before the statement that is not being invoked, so that you may know that the code there actually is being reached? Enjoy, John On Jan 3, 12:39 pm, szust

Re: redirect from within a view

2010-01-03 Thread mike karthauser
On 3 Jan 2010, at 10:40, Lorenzo Bettini wrote: > well that was a view linked directly by the router, e.g., > > /admin > > thus there's no controller action associated to that... if you add if(isset($this->params['admin'])){ // do something

Re: redirect from within a view

2010-01-03 Thread Lorenzo Bettini
well that was a view linked directly by the router, e.g., /admin thus there's no controller action associated to that... Lorenzo John Andersen wrote: > Make the check in the controller and do the redirect from there! > Enjoy, >John > > On Jan 2, 7:01 pm, Lorenzo Bettini wrote: >> Hi >> >>

Re: Problem with app_controller.php

2010-01-03 Thread szusty
This is a code on app_controller file: '1', 'drafts' => '2'); if(isset($params['named']['q'])){ $conditions['MATCH(Post.title, Post.body) AGAINST(? IN BOOLEAN MODE)'] = $params['named']['q']; } if(isset($params['named']['status']) && isset($statuses[$params ['n