Wednesday, December 1, 2010

Re: How to manipulate cakephp's sessions table with sql

Have you had any luck? I'm trying to do the same, and I'n not able to
delete row even with $this->Online->query()...

On Nov 25, 3:08 pm, Ish <ish1...@gmail.com> wrote:
> Hi Folks,
>
> I am using storing user sessions in database table sessions , and
> trying to manipulate (edit or delete) the sessions table from admin
> panel controls.
>
> // controllers/OnlinesController.php
> // e.g. $id = 'bk86c9argtdlqv7t12g8a0ugf6'
> $this->Online->delete($id); // doesn't work
> //
> // $this->Online->find('all'); // read operations work fine
>
> It's not letting me do that, anybody know's why ?
>
> In my core.php configurations, I have
>
> // config/core.php
> Configure::write('Session.save', 'database');
> Configure::write('Session.model', 'Session');
> Configure::write('Session.table', 'sessions');
> Configure::write('Session.database', 'default');
> Configure::write('Session.cookie', 'CAKEPHP');
> Configure::write('Session.timeout', '144');
> Configure::write('Session.start', true);
> Configure::write('Session.checkAgent', true);
> Configure::write('Security.level', 'medium');
>
> I have separate model Online to handle operations to sessions table.
>
> // models/online.php
> var $useTable = 'sessions';
>
> Any help is greatly appreciated
> - Thanks

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.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: ratings, like and dislike buttons...

Create new table:

| id | fociki_blog_id | like | dislike | user_id | created |

and add some logic to your code

On 1 pro, 16:38, John Andersen <j.andersen...@gmail.com> wrote:
> What are your requirements with regard to:
> - tracking which user used the Like and the Dislike buttons?
> - tracking when the Like or Dislike event took place?
> - statistics on the Like and Dislike event over time (total, within
> last 3 months, last week, location, etc)?
>
> I would register the Like and Dislike event in a separate table,
> possibly together with the foreign key to the user who did it.
> Something like:
>
> fociki_blogs -> hasMany -> like_indications <- belongsTo <- users
> users -> hasMany -> like_indications <- belongsTo <- fociki_blogs
>
> The rest is up to you :) Enjoy,
>    John
>
> On 1 Dec., 15:49, "chris...@yahoo.com" <chris...@yahoo.com> wrote:
>
> > hii All,... please help,... I need to create like and dislike buttons
> > for users to use in my social network BLOG section, something like in
> > a facebook. Please advise,... should I take it to a new table or add
> > fields in existing one,... this is what I have so far...
>
> > CREATE TABLE `fociki_blogs` (
> >   `id` int(11) unsigned NOT NULL auto_increment,
> >   `user_id` int(11),
> >   `category_id` int(11),
> >   `title` varchar(255) NOT NULL default '',
> >   `topic` text NOT NULL,
> >   `last_comment` datetime default NULL,
> >   `comments` int(11) NOT NULL default '0',
> >   `privacy` int(1) unsigned NOT NULL default '0',
> >   `created` datetime NOT NULL default '0000-00-00 00:00:00',
> >   PRIMARY KEY  (`id`)
> > ) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
>
> > THANKS !
>
>

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.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Problem with Math Captcha component @ 1.3.6

I detected a problem, I had a white space in the code ..

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.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: dynamically changing the type in form helper

Correction...I shouldn't need to change it to {$type} so I will leave
it as is. Please let me know how else I can get this corrected.

Thanks again. Erik

On Dec 1, 1:02 pm, mochaman <mochama...@gmail.com> wrote:
> Yes, that was my first thought as I read that when going through it
> which is why I didn't make the change at first.  However, after
> looking at the core code, it seemed like something was missing in my
> version (not sure why or how, but it was not there).  You are
> correct...that is what I put using the word 'text' instead of {$type}
> -- originally, there was no $input line for the case 'text'.  If I am
> not suppose to change it, then how should I go about getting it
> corrected?  At a minimum, I will change mine to use {$type} instead of
> the word 'text'.
>
> Thanks.  Erik
>
> On Dec 1, 3:54 am, John Andersen <j.andersen...@gmail.com> wrote:
>
>
>
>
>
>
>
> > You should not change anything in the CakePHP core files!
> > What you have added is already there!
>
> > [core code]
> > case 'text':
> > case 'password':
> > case 'file':
> >         $input = $this->{$type}($fieldName, $options);
> > break;
> > [/core code]
>
> > is the same as your change:
>
> > [your code]
> > case 'text':
> >         $input = $this->text($fieldName, $options);
> > break;
> > case 'password':
> > case 'file':
> >         $input = $this->{$type}($fieldName, $options);
> > break;
> > [/your code]
>
> > Is the above what you have done?
>
> > Enjoy,
> >    John
>
> > On 1 Dec., 09:55, mochaman <mochama...@gmail.com> wrote:> Thanks for the reply...I was able to resolve it.
>
> > > I am using cakephp 1.3.5.  Looks like form.php was missing some code
> > > since I resolved it by adding the case for 'text' of $input=$this-
>
> > > >text($fieldName,$options); break; to the form.php file.
>
> > > Thanks again.  Erik
>
> > [snip]

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.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: dynamically changing the type in form helper

Yes, that was my first thought as I read that when going through it
which is why I didn't make the change at first. However, after
looking at the core code, it seemed like something was missing in my
version (not sure why or how, but it was not there). You are
correct...that is what I put using the word 'text' instead of {$type}
-- originally, there was no $input line for the case 'text'. If I am
not suppose to change it, then how should I go about getting it
corrected? At a minimum, I will change mine to use {$type} instead of
the word 'text'.

Thanks. Erik

On Dec 1, 3:54 am, John Andersen <j.andersen...@gmail.com> wrote:
> You should not change anything in the CakePHP core files!
> What you have added is already there!
>
> [core code]
> case 'text':
> case 'password':
> case 'file':
>         $input = $this->{$type}($fieldName, $options);
> break;
> [/core code]
>
> is the same as your change:
>
> [your code]
> case 'text':
>         $input = $this->text($fieldName, $options);
> break;
> case 'password':
> case 'file':
>         $input = $this->{$type}($fieldName, $options);
> break;
> [/your code]
>
> Is the above what you have done?
>
> Enjoy,
>    John
>
> On 1 Dec., 09:55, mochaman <mochama...@gmail.com> wrote:> Thanks for the reply...I was able to resolve it.
>
> > I am using cakephp 1.3.5.  Looks like form.php was missing some code
> > since I resolved it by adding the case for 'text' of $input=$this-
>
> > >text($fieldName,$options); break; to the form.php file.
>
> > Thanks again.  Erik
>
> [snip]

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.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: PHPCake: trouble with Controllers

Hi Jeremy,
I have the same problem of bobaso
But I don't understand How can I do to solve the problem.

How I can edit my model to do it?

Thank you

On Nov 17, 8:31 pm, Jeremy Burns | Class Outfit
<jeremybu...@classoutfit.com> wrote:
> The syntax you are using relates to models, not to controllers. So within the users_controller you can do:
>
> $result = $this->User->Profile->find(...);
>
> ...so long as the Profile model is related to the User model.
>
> If you want to do the same but from within the User model, you'd do this:
>
> $result = $this->Profile->find(...);
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 17 Nov 2010, at 10:20,bobasowrote:
>
>
>
>
>
>
>
> > I'm having some troubles with PHP while working with Controllers.
> > If i want to create and then use 2 controllers,when using this syntax
> > it doesn't work:
>
> > $this->Controller1->Controller2->find("all"...)
>
> > Instead this works:
>
> > $this->Controller1->find("all"...)
>
> > I was thinking that maybe i need to initialise first the Controller2
> > in this way:
>
> > var $users="Controller2"
>
> > and then maybe the first syntax may work,but i'm not sure.Any advice?
>
> > Thank you in advance for your help =)
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscribe@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en

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.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Matt Curry Asset Packer Help

Ok anyone get this working?

 

I have in my layout

<?php echo $html->css(array( 'styles' , 'typography' ), null,  array( 'inline' => false ) );?>      

<?php echo $javascript->link( array( 'jquery-1.4.2.min'), false ); ?> 

<?php echo $asset->scripts_for_layout();?>

 

So these get compressed all good up until this point.

 

 

Now in the views if I add a new css it breaks

 

I have in a view $javascript->link( array( 'jquery.form'), false ); and it adds it to the layout 'jquery-1.4.2.min' perfect just what I want.

 

But I can not add any new css styles.

 

Docs:

7. Similarly include your css with the inline option set to false:

      $html->css('style', null, null, false);

 

White page, my guess is that’s an older 1.2 css tag so I use $html->css('colorbox', null, null, false); and what happens now is I get 4 css / js links.

 

Css => the 2 original from the layout compressed

Js => the original form layout

Css => new css sheet from view

Js => new js from view.

 

I just want 2 files to end with, 1 css and 1 js.

 

Any help would be great thanks.

 

Dave