Re: Change created/modified to unix time

2012-07-22 Thread lowpass
On Sun, Jul 22, 2012 at 3:36 PM, Alex  wrote:
>
> The searches are within the database yes, the problem is that "not much of a
> performance hit" isn't ideal when carrying out a large number of searches.

I've just had a look around online. Various test results may surprise you.

http://dbscience.blogspot.ca/2008/08/can-timestamp-be-slower-than-datetime.html
http://www.dbtuna.com/article.php?id=36
http://gpshumano.blogs.dri.pt/2009/07/06/mysql-datetime-vs-timestamp-vs-int-performance-and-benchmarking-with-myisam/

I suggest you conduct your own tests before trying to modify Cake's internals.

> Converting it after performing the search wouldn't help the performance of
> the search unfortunately.

That suggestion was for the case where many date comparisons were
being done in your application code, not the DB queries.

> Sorry by usually I'm referring to US/UK, I have a slight bias :)

Sure, but my point is that those other formats are not at all a good
choice for programming.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Change created/modified to unix time

2012-07-22 Thread euromark
for standards it doesnt matter which country you come from - praise the 
lord.
on a db level this usually only is the one: YY-MM- (for the reasons 
mentioned above)

you are worried about a theoretical - slightly - slower performance with 
the current way of doing things?
write a test case to prove it - with a lot of loops you might actually see 
a difference. But I doubt it will be meaningful.
you will most certainly find out that the performance gain - 
if measurable at all - stands in no comparison to other things in the whole 
framework dispatching process.
meaning: if the whole process needs 1.5 seconds (request till display) and 
you search in the DB takes 0.2 than 0.15 wouldnt make much of a difference.

wrong bottleneck to work on at the moment - just my 5 cents
caching and other more practical things will make more of a difference in 
the long run.



Am Sonntag, 22. Juli 2012 21:36:39 UTC+2 schrieb Alex:
>
> Where are you doing these searches? If in the database I don't think 
>> there would be much of a performance hit. 
>>
>
> The searches are within the database yes, the problem is that "not much of 
> a performance hit" isn't ideal when carrying out a large number of searches.
>  
>
>>
>> You could do a conversion in AppModel::afterFind and add a new key, 
>> 'timestamp' to the data for each record. Or you could even have the 
>> database include it in the results for you, for that matter. 
>>
>
> Converting it after performing the search wouldn't help the performance of 
> the search unfortunately.
>  
>
>>
>> > I realise there may be the excuse that formatting would be required as 
>> unix 
>> > timestamps are unreadable, but this is also the case with the current 
>> setup 
>> > as how many people use -MM-DD HH:MM:SS when displaying dates? it's 
>> > usually DD-MM- or MM-DD-. 
>>
>> No it's not usually those formats. -MM-DD is an ISO standard for 
>> good reason. It sorts naturally, for one thing. Another obvious reason 
>> is right there in your comment: "DD-MM- or MM-DD-" Yes? Which 
>> is it then? They're ambiguous, so should be avoided. 
>>
>
> Sorry by usually I'm referring to US/UK, I have a slight bias :)
>  
>
>>
>> Now, if only some countries would also adopt the metric system. ;-) 
>>
>> > What does everyone else think? 
>> > 
>> > Is there a way to convert the current created/modified fields to UNIX 
>> > timestamps with current CakePHP? 
>>
>> I'll leave it for someone else to say. I know that I have seen where 
>> that is set but cannot remember now. 
>>
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Change created/modified to unix time

2012-07-22 Thread Alex

>
> Where are you doing these searches? If in the database I don't think 
> there would be much of a performance hit. 
>

The searches are within the database yes, the problem is that "not much of 
a performance hit" isn't ideal when carrying out a large number of searches.
 

>
> You could do a conversion in AppModel::afterFind and add a new key, 
> 'timestamp' to the data for each record. Or you could even have the 
> database include it in the results for you, for that matter. 
>

Converting it after performing the search wouldn't help the performance of 
the search unfortunately.
 

>
> > I realise there may be the excuse that formatting would be required as 
> unix 
> > timestamps are unreadable, but this is also the case with the current 
> setup 
> > as how many people use -MM-DD HH:MM:SS when displaying dates? it's 
> > usually DD-MM- or MM-DD-. 
>
> No it's not usually those formats. -MM-DD is an ISO standard for 
> good reason. It sorts naturally, for one thing. Another obvious reason 
> is right there in your comment: "DD-MM- or MM-DD-" Yes? Which 
> is it then? They're ambiguous, so should be avoided. 
>

Sorry by usually I'm referring to US/UK, I have a slight bias :)
 

>
> Now, if only some countries would also adopt the metric system. ;-) 
>
> > What does everyone else think? 
> > 
> > Is there a way to convert the current created/modified fields to UNIX 
> > timestamps with current CakePHP? 
>
> I'll leave it for someone else to say. I know that I have seen where 
> that is set but cannot remember now. 
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How to pass id through a form to another controller and view form

2012-07-22 Thread AD7six


On Sunday, 22 July 2012 14:19:23 UTC+2, Guti Grewal wrote:
>
> Thanks for the reply but thats not what Im looking for really. 


I think what your answer indicates is that you didn't read the section 
Tarique linked to.

AD

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: how does comunicate Model View Controller

2012-07-22 Thread lowpass
The controller object has a member object called User. $this is the
controller and $this->whatever represents a member object.

http://php.net/manual/en/language.oop5.php

On Sun, Jul 22, 2012 at 1:44 PM, and  wrote:
> Hi all,
> i am reading a tutorial found on ibm developerswork.I have found this line:
> $this->User->save(.);
> $this is the UserController.Why there is User?User is the name of the
> Model.Can someone explain me better what it means?
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Change created/modified to unix time

2012-07-22 Thread lowpass
On Sat, Jul 21, 2012 at 6:26 PM, Alex  wrote:
> Hi,
>
> I currently make use of the created and modified fields throughout my
> application but being datetime fields, performing searches/comparisons isn't
> as fast as they could be if unix timestamps were used.

Where are you doing these searches? If in the database I don't think
there would be much of a performance hit.

You could do a conversion in AppModel::afterFind and add a new key,
'timestamp' to the data for each record. Or you could even have the
database include it in the results for you, for that matter.

> I realise there may be the excuse that formatting would be required as unix
> timestamps are unreadable, but this is also the case with the current setup
> as how many people use -MM-DD HH:MM:SS when displaying dates? it's
> usually DD-MM- or MM-DD-.

No it's not usually those formats. -MM-DD is an ISO standard for
good reason. It sorts naturally, for one thing. Another obvious reason
is right there in your comment: "DD-MM- or MM-DD-" Yes? Which
is it then? They're ambiguous, so should be avoided.

Now, if only some countries would also adopt the metric system. ;-)

> What does everyone else think?
>
> Is there a way to convert the current created/modified fields to UNIX
> timestamps with current CakePHP?

I'll leave it for someone else to say. I know that I have seen where
that is set but cannot remember now.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How to pass id through a form to another controller and view form

2012-07-22 Thread lowpass
On Sun, Jul 22, 2012 at 8:19 AM, Guti Grewal  wrote:
>
> What I want to do is get the galleryid to be inserted into the images table,
> through a form, which you can see above once a gallery is added it redirects
> to images/add, I want to get the last inserted id into the form in the
> images/add form so that I am able to call on the related ones

$this->redirect(
array(
'controller' => 'images',
'action' => 'add',
'gallery_id' => $this->Gallery->getInsertID()
)
);


Route::connect(
'/images/add/:gallery_id',
array(
'controller' => 'images',
'action' => 'add'
),
array(
'gallery_id' => '[0-9]+'
'pass' => 'gallery_id'
)
);

public function add($gallery_id = null)
{
$this->set(compact('gallery_id'));
...
}

$this->Form->hidden('Image.gallery_id', array('value' => $gallery_id));

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


how does comunicate Model View Controller

2012-07-22 Thread and
Hi all,
i am reading a tutorial found on ibm developerswork.I have found this line:
$this->User->save(.);
$this is the UserController.Why there is User?User is the name of the 
Model.Can someone explain me better what it means?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Change created/modified to unix time

2012-07-22 Thread Alex
Hi,

I currently make use of the created and modified fields throughout my 
application but being datetime fields, performing searches/comparisons 
isn't as fast as they could be if unix timestamps were used.

I realise there may be the excuse that formatting would be required as unix 
timestamps are unreadable, but this is also the case with the current setup 
as how many people use -MM-DD HH:MM:SS when displaying dates? it's 
usually DD-MM- or MM-DD-.

What does everyone else think?

Is there a way to convert the current created/modified fields to UNIX 
timestamps with current CakePHP?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cake PHP User Management Plugin Eagle

2012-07-22 Thread Steve
I have read your reply but I believe giving a bad name to a product without 
testing or even proper knowledge gives bad business to a good product which 
is not moralistic. I shall give answer to you one by one. 

This site was not made for Design. Its for Plugin. There is nothing in 
design. Everything is in Code. We have made this Plugin to ease the work of 
those guys using Cake PHP who wants User Management on their end. Regarding 
the Testing part, you can click on this link: 
http://www.eagle.getyourplugin.com/login and type username: admin and 
password: 123456. You can see the password. 

And we are not asking a huge money. This Plugin has 56 features which makes 
it a $197 original price but we are giving it at $30 only under an offer 
price.

You must read 56 Features of Cake PHP Eagle Plugin which are:

   1. Clean code with formatting 
   2. Login 
   3. Registration 
   4. Cookie login/ Remember me functionality 
   5. Add/Edit/Delete User By Admin 
   6. Add/Edit/Delete Group By Admin 
   7. Change Password 
   8. Forgot Password 
   9. Change User Password by Admin 
   10. List of all Users 
   11. List of all Groups 
   12. Manage site Permissions using Ajax updation, Permission caching 
   functionality for fast checking 
   13. User's Email Verification 
   14. User Profile View 
   15. User activation by Admin 
   16. Routing long urls to small urls 
   17. Login with Facebook, Twitter, Linkedin, Four Square, Gmail, Yahoo. 
   18. Plugin takes the image from facebook, linkedin, twitter and updates 
   as profile image 
   19. If a user sign in with facebook etc for the first time then plugin 
   automatically register him/her, If a user is already registered with same 
   email then plugin will associate old account with facebook etc. So there 
   will be no duplicacy. 
   20. All Configurations are database driven. 
   21. View Online users and guest 
   22. Admin can sign out any user at any time and Admin also can inactive 
   that user so that user cannot sign in again 
   23. Deleting cakephp cache in a single click on production 
   24. Captcha support in registration form 
   25. CSRF/XSS protection 
   26. Nice pagination for list 
   27. SSL support for selected pages or whole site 
   28. Profile view with nice design 
   29. password are salted with hash 
   30. Cross browser CSS optimized code 
   31. Strict form validations 
   32. Allow/Disallow deletion of user account 
   33. If admin deletes user account then user will automatically sign 
   out(if signed in) 
   34. Image resize helper: using this you can resize image or can crop 
   with desired size 
   35. Cake CSS removed now umstyle.css contains plugin css. You can use 
   cake generic css with this plugin if you want.
   36. Ajax Form Validations
   37. Ajax Form Validations with File/Image (Hope you will like it)
   38. Ajax Pagination
   39. Ajax Sorting on all List pages
   40. Ajax Search/Filter Options on List Pages
   41. Ajax Suggestion/Autocomplete on Search/Filter text boxes
   42. User Activation/Deactivation by Ajax
   43. User Deletion by Ajax
   44. User Email Verification by Ajax
   45. Image Validation with allow Empty (Hope you will like it)
   46. Preserve pagination number after user View/Edit/Change User Password
   47. Assign user to multiple groups By Admin
   48. $var is available in all views. It contains logged in user 
   information you can print it in any view file to see what's inside it.
   49. You can use Username after domain name for profile or any page, like 
   facebook . Strong 
   username validation added. Now user cannot take username like your 
   controller name, your custom route name for ex 'login' etc.
   50. Browser Cache control. Some time you made any change in CSS or JS 
   file and your users do not see changes due to browser cache.
   51. Remember me cookie name is now configurable. This will help for your 
   multiple projects with same plugin code. And also helpful for disable 
   user's browser cookie if needed.
   52. Ajax login redirect. If user session is timed out and needs to login 
   again. Now it works on ajax call too.
   53. Clear button is added on search form for clearing all filter 
   conditions.
   54. Now all social login window will open in new pop up window. Before 
   It was not in twitter and foursquare. Popup window is now auto re-sizable.
   55. Image resize helper modified. Now it can resize all images inside 
   webroot. Before It was restricted to img folder.
   56. Blackhole error message now handled. Black hole request is due to 
   Cakephp security component. If some one tries to use form tampering then 
   cakephp security component throws Black hole exception. Now it is handled 
   by callback function.




On Sunday, July 15, 2012 8:21:27 PM UTC+5:30, Steve wrote:
>
>
> hi guys, we have launched an amazing Plugin "Eagle" for Cake PHP. It is 
> user management Plugin which has 56

Re: Cake PHP User Management Plugin Eagle

2012-07-22 Thread Steve
Thanks for reply.

This Eagle Plugin was made for a user who is facing problem with 
Login/Registration and other issues. It has 56 features. Please don't 
concentrate on design, everything is code. And testing is available and 
working. To test click here: http://www.eagle.getyourplugin.com/login and 
type username: admin and password: 123456

Hope it works. This is a very user friendly plugin being used by a lot of 
people.

Regards,
Steve.

On Sunday, July 15, 2012 8:21:27 PM UTC+5:30, Steve wrote:
>
>
> hi guys, we have launched an amazing Plugin "Eagle" for Cake PHP. It is 
> user management Plugin which has 56 features. It also gives you Login with 
> FB, Twitter, LinkedIn, Foursquare, Google and Yahoo. You can read all its 
> features here: http://developers.getyourplugin.com/features.html and you 
> can check the Plugin here: http://www.eagle.getyourplugin.com , you can 
> test the Plugin on this link: http://www.eagle.getyourplugin.com/login , 
> default username and password is 123456, check it and tell us the feedback.
>
> Regards,
> Steve
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How to pass id through a form to another controller and view form

2012-07-22 Thread Guti Grewal
Thanks for the reply but thats not what Im looking for really. 
Perhaps you don't understand what I'm trying to achieve. I want to add a 
gallery, so I have three fields in this table as follows: 

Gallery Table
ID | Gallery_name | Caption

I then have an images table which is related to the gallery table this is 
the structure :

Images Table

ID | gallery_id | gallery_name | caption 

What I want to do is get the galleryid to be inserted into the images 
table, through a form, which you can see above once a gallery is added it 
redirects to images/add, I want to get the last inserted id into the form 
in the images/add form so that I am able to call on the related ones 

Any help would be appreciated greatly 

Thanks

On Wednesday, 18 July 2012 13:51:54 UTC+1, Guti Grewal wrote:
>
> Hi Im trying to create an image gallery with CakePHP 2.1, I'm having a 
> little bit of trouble with the complexity of the task. 
> I have two tables, Galleries and the other Images. My galleries controller 
> is like this...
>  class GalleriesController extends AppController {
> public $name = 'Galleries';
> function add() {
> if($this->request->is('post')) {
> if($this->Gallery->save($this->request->data)) {
> $this->Session->setFlash('Your gallery has been saved. You may upload 
> pictures to this gallery');
> $this->redirect(array('controller' => 'images','action' => 'add'));
> } else {
> $this->Session->setFlash('Unable to add your gallery.'); 
> ?>
>
> Once I get redirect to the images/add I want the form to have the id of 
> the gallery as well as the name of the gallery within this form. 
>
> How do I go about achieving this?? Anyone have any ideas?
>
> This is what I have for my view in images/add, however this is not working 
>
> 
> Form->create('Image', 
> array('controller'=>'Images','action'=>'add','type' => 'file', 
> 'class'=>'uploadfrm'));?>
> 
>   Upload a Picture for gallery
>  echo '';
> echo '';
> echo $this->Form->input('galleryid', array('between'=>'', 'class' => 
> 'input', 'value' => $this->Gallery->id));
> echo $this->Form->input('gallery_name', array('between'=>'', 
> 'class'=>'input', 'value' => $galleries['galleryname']));
> echo $this->Form->input('caption', array('between'=>'', 'rows'=> 
> '7', 'cols'=> '60', 'class'=>'input'));
> echo $this->Form->input('team_relating', array('between'=>'', 
> 'class'=>'input'));
> echo $this->Form->input('team_relating_two', array('between'=>'', 
> 'class'=>'input'));
> echo $this->Form->input('league', array(
> 'options' => array('premiership', 
> 'laliga','seriea','championsleague'),
> 'empty' => '(choose one)'
> )); 
> echo $this->Form->input('file', array('type' => 'file'));
>
> echo "";
> ?>
> Form->end(__('Upload Photo', true));?>
> 
> 
> This is also my controller for the Images
>
>  class ImagesController extends AppController {
> function add() {
> if($this->request->is('post')){ 
> $file = $this->request->data['Image']['file'];
> if($this->Image->save($this->data) && 
> move_uploaded_file($file['tmp_name'],APP.'webroot/files/galleries'.DS.$this->Image->id.'.jpeg'))
> {
> $this->Session->setFlash('The upload has been 
> saved', true);
> $this->redirect(array('controller'=>'Images', 'action' => 'add'));
> } else {
> $this->Session->setFlash('The upload could not be 
> saved, jpeg files can be processed only.', true);
> }}
> $galleries = $this->Image->Gallery->find('list');
> $this->set(compact('galleries'));
> }}
> ?>
> Would appreciate any help!!
>
> Thanks!
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


problem in ACL

2012-07-22 Thread Mamdoohi
hello all,
i used ACL in my project.
i have this tree for my users.
  Public
  - Registered
  - Admin
  - Manager
  - SuperUser

i want Registered can access to some (or all )  actions that Public can 
access
also Manager can access some (or all) actions that Admin and Public can 
access,

how can do this? redefine all Public (or Admin) actions to another users?


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: User management and authentication plugin for CakePHP 2

2012-07-22 Thread Piotr Beschel
So try to check prefered language for user $_SERVER['HTTP_ACCEPT_LANGUAGE'];

W dniu niedziela, 22 lipca 2012 07:33:49 UTC+2 użytkownik Albert 'Tigr' 
napisał:
>
> Hi!
>
> On Saturday, July 21, 2012 11:23:52 AM UTC+2, Piotr Beschel wrote:
>>
>> *If i'm right u can use echo __('some text') in your email views.*
>>
>>
> Yes, but that is inefficient. You'd have to split the text in small chunks 
> (length limits!) and translate them through the .po files. I'd rather have 
> texts in different languages and have the system pick up one. There is only 
> a couple of variables and the rest is, well, just text in a particular 
> language.
>
>  
>
>> My tip for you: Do not repeat yourself! Write a private function 
>> __blockRobots(){
>> end call it when you need it in other actions like:
>>
>>
> A long overdue action and not only there. I will. Thanks a lot!
>
> Albert
>  
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php