Re: New SecurityComponent & Blackhole

2007-05-27 Thread jonern

Thats great Joshua =)
Please write a small working form example where the SecurityComponent
is used, ie:
$this->Security->requirePost('delete');

where $this->Security->blackHoleCallback also is included...

It just won't work for me...

Thanks!

On May 27, 7:28 pm, Joshua Benner <[EMAIL PROTECTED]> wrote:
> Using 1.2.0alpha5146 and not experiencing any problems with forms using
> FormsHelper.
>
> jonern wrote:
> > I use the form helper consistently and still end up blackholed every
> > time I submit a form.
> > Using cake_1.2.0.5146alpha.
>
> > All my forms where working fine in 1.1 with the htmlHelper, but when I
> > upgraded to 1.2 and started using the formHelper - the black hole gets
> > me every time...
> > Perhaps a bug somewhere...
>
> > Using Mariano Iglesias's method solved my problems temporarily though:
> >http://bakery.cakephp.org/articles/view/multiple-rules-of-validation-...
>
> > gwoo told me the new 1.2 is checking forms by default...


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: New SecurityComponent & Blackhole

2007-05-27 Thread jonern

I use the form helper consistently and still end up blackholed every
time I submit a form.
Using cake_1.2.0.5146alpha.

All my forms where working fine in 1.1 with the htmlHelper, but when I
upgraded to 1.2 and started using the formHelper - the black hole gets
me every time...
Perhaps a bug somewhere...

Using Mariano Iglesias's method solved my problems temporarily though:
http://bakery.cakephp.org/articles/view/multiple-rules-of-validation-per-field-in-cakephp-1-2

gwoo told me the new 1.2 is checking forms by default...


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP php5?

2007-05-26 Thread jonern

Making a framework compatible to PHP5 only would not be very
impressive. Making a framework compatible to PHP4,5,6 (and still be
quick and reliable) - that's a whole other story, The CakePHP Story =)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake php 1.2 pagination with custom query

2007-05-26 Thread jonern

//sets custom parameters:post.category = 1:
$conditions = array('Post.category' => 1);
//gets the category from search:
$category = $this->params['pass']['category'];

$paginationParameters = array();
$paginationParameters['controller'] = 'posts';
$paginationParameters['action'] = $this->action;
$paginationParameters['category'] = $category;

$this->paginate['Post'] = array(
'limit' => 1,
'order' => array ('Post.id' => 'desc'),
'url' => array ('url' => $paginationParameters)
);

$records = $this->paginate('Post', $conditions);

Here we create a paginate function with custom parameters and
paginationParameters!
This is working fine in my app...

Check out the example from Mariano Iglesias for more details:
http://groups.google.com/group/cake-php/browse_thread/thread/f990a45967935665/d45ee41f79f69031?lnk=gst&q=pagination+categories&rnum=1#d45ee41f79f69031

A big thanks to Nate, Mariano Iglesias, AD7six, Chris Hartjes and
PhpNut for all the great answers here in google-groups!
You have helped me a lot in my Cake baking process, and you make the
Cake grow even bigger =) Thanks!

On May 26, 4:21 pm, dardosordi <[EMAIL PROTECTED]> wrote:
> is there any way i can use $this->paginate() with a custom query?
>
> I'm doing a double join and filtering the results and need to paginate
> my results. Hope somebody could help me with this. Ask me if you need
> more details about my models, etc.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Is 1.2.0.5146alpha Usable?

2007-05-24 Thread jonern

...for the SQL errors you should set debug to 3 and check the sql
queries.
You will probably find the error if you are familiar with queries =)

The 1.2.0.5146alpha is working fine, and it's a great tool when you
get the hang of it!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: I starting new which version to go with?

2007-05-24 Thread jonern

I would say go for the latest CakePHP 1.2.x.x version!
CakePHP 1.1.x.x surely has more examples and documentation, but when
1.2.x.x get's stable 1.1 will slowly get outdated. I'm currently
rewriting a fairly large application from 1.1 to 1.2, and it requires
a lot of changes before it's fully 1.2 compatible. A lot of 1.1
functions has been deprecated! My advice is go for 1.2.x.x, get used
to the new way of using model behaviors and all the features 1.2 has
to offer.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Is 1.2.0.5146alpha Usable?

2007-05-23 Thread jonern

I'm also using 5146 in production, and no problems so far.
Might be hard to find documentation for functions and recently added
features, but this affects all 1.2.xx builds...
With some help from Google and this group you will get it working!

So I would say go for it! =)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Count clicks

2007-05-23 Thread jonern

Here is my temp solution to the count clicks issue:

//Getting read-posts data from the session:
$rPosts = $this->Session->read('readPosts');
if(!empty($rPosts))
{
//if the post do not exist in $rposts, add it:
if(!in_array($id, $rPosts))
{
array_push($rPosts, $id);
$this->Session->write('readPosts', $rPosts);
$this->Post->populateCount($id);
//Populate count now adds to a tmp cache file before updating 
the
database once every hour.
}
else
{
//do nothing
}
}
//If $rPosts is empty, create a new variable:
else
{
$this->Post->populateCount($id); //Add count to tmp file
$rPosts = array($id);
$this->Session->write('readPosts', $rPosts);
}

Probably not the most efficient way of doing this, but it works and it
does not trouble the database to much.
The populateCount() function now writes clicks to a tmp cache file and
updates the database once every hour.
When getting the clicks it combines the clicks from the database and
the file, with a cache of 5 minutes, so
the database is not overloaded.

Hope this can inspire anyone to make this work even better =)

Bake on!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Paginator URLs

2007-05-23 Thread jonern

Hi fellow bakers!
I have been playing around with CakePHP since late 2006, and so far I
must say I love the taste of this Cake!

Just started baking 1.2.xx cakes, and I have some problems with the
paginator helper.
Anyone know how to change the urls from:
http://www.webpage.com/posts/index/page:1
http://www.webpage.com/posts/index/page:2

to

http://www.webpage.com/posts/index/1
http://www.webpage.com/posts/index/2

In advance, thanks!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Count clicks

2007-04-15 Thread jonern

Thanks for all the answers/suggestions =)

I will host my own statistics, since it's just clicks, hits, and
referrers that will be required to monitor.
I checked out Mink, Google Analytics and GetBasil but nothing is
better than to be able to control everything my self (controlfreak?..
nah ;)

Also read about MySQL's INSERT DELAYED method also, but it's to
unstable and can lead to table corruption. It seems to happen when an
ALTER TABLE command is issued against a table that is being written to
by a DELAYED thread.

Anyway, what about caching clicks in static cache-files, and then
update the database every hour or so by running a cron job with
Crontab? That way the database would not be overloaded with writings.

Think I will give it a shot and post my result here to get it "rated"
=)
Any suggestions or ideas are most welcome!

And to Chris Hartjes:
My motto for 2007:  "Just build it, damnit!" <- you can't go around
beeing lazy with that motto, hehe :)



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Count clicks

2007-04-12 Thread jonern

Hi CakePHP bakers!

Just read through the CakePHP manual and finished the blog-tutorial,
and everything works great.
Next step would be to add a counter to the posts. How many times a
post have been read...

Where should I put this code? The counter should only be updated
everytime a user clicks
the link, not everytime the post is shown (refresh etc).

So far I've made a populateCount function in the post model:
function populateCount($id)
{
   $this->query("UPDATE posts SET post_views +'1' WHERE id='$id'");
}

..and in the posts_controller.php file:
function display($id, $url)
{
   .
   $this->Post->populateCount($id);
   .
}

This works but the post_views is updated everytime the post is
refreshed or gets a direct request...

Silly newbie question with a simple solution?
In advance, thanks!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---