Re: set paginator last page as default?

2011-04-18 Thread Jeremy Burns | Class Outfit
Out of interest then, what happens when a user clicks the '2' page tab? I'm 
intrigued that you say you data can't be ordered - so is the actual data 
randomly ordered? Or ordered by 'created'? If not, who how or what decides the 
actual order of the data? Does it have an auto incrementing id column? If not, 
can you add one?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
(t) +44 (0) 208 123 3822
(m) +44 (0) 7973 481949
Skype: jeremy_burns
http://www.classoutfit.com

On 18 Apr 2011, at 21:38, lucas wrote:

> Thanks stats kim, i already know about that solution. It seems there
> is nothing built in at core level to achieve this.
> It´s not an elegant solution but it works fine and it´s practical.
> 
> For those who need something like this, before call the paginate
> method, put this line $this->paginate['page'] = 9; or a bigger
> number...
> 
> Thanks for all the responses.
> 
> 
> 
> On 18 abr, 17:23, stas kim 
> wrote:
>> What you can do is set page parameter in your controller to 'last'
>> or some huge number larger than projected page count.
>> And it will miraculously bring you to the last page. whatever that
>> last page's number is.
>> That is the way Controller::paginate works in 1.3
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> On Mon, Apr 18, 2011 at 3:42 PM, lucas  wrote:
>>> I can´t do that because the data can´t be ordered. I need it in that
>>> way...
>> 
>>> On 18 abr, 16:37, Tilen Majerle  wrote:
 yes...instead of order => "YourModel.field ASC" type "YourModel.field DESC"
 and you will have newest posts/whatever in top of pages
 --
 Lep pozdrav, Tilen Majerlehttp://majerle.eu
>> 
 2011/4/18 Jeremy Burns | Class Outfit 
>> 
> Sort the data in reverse order?
>> 
> Jeremy Burns
> Class Outfit
>> 
> jeremybu...@classoutfit.com
> http://www.classoutfit.com
>> 
> On 18 Apr 2011, at 20:32, lucas wrote:
>> 
>> Hi people, is it possible to set as default the last page of the
>> paginated data from the controller? Is there an option available to do
>> this?
>> 
>> thanks in advance!
>> 
>> --
>> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
> 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
> athttp://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 sitehttp://ask.cakephp.organdhelp
> 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
> athttp://groups.google.com/group/cake-php
>> 
>>> --
>>> Our newest site for the community: CakePHP Video 
>>> Tutorialshttp://tv.cakephp.org
>>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 
>>> athttp://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

-- 
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: $this->html->image() vulnerabilities

2011-04-18 Thread mark_story
You should be checking your inputs, and HtmlHelper::image() will help
escape your output.  The helper will encode any entities in the
attribute values.  You should still check that things that are
supposed to be images are in-fact images, and you should always be
careful with letting people add assets to your site.

-Mark

On Apr 16, 10:47 am, goluhaque  wrote:
> If somebody submits a link to a javascript script rather than a pic/image,
> will the function($this->html->image() ) block it automatically, or do we
> have to build our own checker for that?

-- 
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: Can someone explain this to me in English please

2011-04-18 Thread Jamie
You only need to set a prefix as explicitly false if the page with the
link has that prefix defined as true.

- Jamie

On Apr 18, 8:21 am, "Krissy Masters" 
wrote:
> One thing I was going to ask in regard to the admin routing.
> You have 3 different routes prefixed, admin, manager, editor and on the
> homepage like this example do you have to write admin => false, manager=>
> false, editor => false for every link? Or is there a short prefix => null
> type option?
>
>
>
> -Original Message-
> From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
>
> Of Sam Sherlock
> Sent: Monday, April 18, 2011 12:24 PM
> To: cake-php@googlegroups.com
> Subject: Re: Can someone explain this to me in English please
>
> the last line allows admin users to access all areas. Other roles are
> limited to thier respective prefixed routes
>
> add admin=>false  to your html->link calls
>
> On 18/04/2011, MeatSandwich  wrote:
> > Sorry for being a bit of a dumb-ass but I'm trying to learn and have
> > been looking at this for a couple of days but I'm still not completely
> > sure how it works. I'm following an offline tutorial about using
> > prefixes.
>
> > the tutorial says do this:
> > 1 - uncomment the admin routing prefix in core.php
> > 2 - add the following to users_controller.php:
> >    public function dashboard() {
> >            $role = $this->Auth->user('role');
> >            if (!empty($role)) {
> >                    $this->redirect(array($role=>true,
> 'action'=>'dashboard'));
> >            }
> >    }
>
> >    public function admin_dashboard() {
> >    }
>
> >    public function manager_dashboard() {
> >    }
>
> > 3 - create three views for the above
> > 4 - in app_controller add the authorize and session components with
> > appropriate settings, then add:
> >    public function isAuthorized() {
> >            $role = $this->Auth->user('role');
> >            $neededRole = null;
> >            $prefix = !empty($this->params['prefix']) ? $this-
> >>params['prefix'] : null;
> >            if (!empty($prefix) && in_array($prefix,
> > Configure::read('Routing.prefixes'))) {
> >                    $neededRole = $prefix;
> >            }
> >            return (empty($neededRole) || strcasecmp($role, 'admin') ==
> 0 ||
> > strcasecmp($role, $neededRole) == 0);
> >    }
>
> > 5 - in the default layout:
> >  >    $dashboardUrl = array('controller'=>'users', 'action'=>'dashboard');
> >    if (!empty($user['role'])) {
> >            $dashboardUrl[$user['role']] = true;
> >    }
> >    echo $this->Html->link('My Dashboard', $dashboardUrl);
> > ?>
>
> > Now the whole thing works and I can follow most of whats going on, but
> > I'm confused with the last line in the isAuthorized method. What
> > exactly does return (empty($neededRole) || strcasecmp($role, 'admin')
> > == 0 || strcasecmp($role, $neededRole) == 0); actually return?
>
> > Also, the above code works fine and when I log in as someone who is an
> > admin they can view the admin_dashboard ok, but there after it seems
> > any other link has an admin prefix. How do I stop that happening? I
> > don't want to have to create an admin_ method for everything including
> > the homepage!
>
> > thanks in advance - Cake rules!
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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
>
> --
>  - S
>
> +44 (0)7908 069 219
>
> --
> Our newest site for the community: CakePHP Video 
> Tutorialshttp://tv.cakephp.org
> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 
> athttp://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: Can someone explain this to me in English please

2011-04-18 Thread Ryan Schmidt

On Apr 18, 2011, at 10:21, Krissy Masters wrote:

> You have 3 different routes prefixed, admin, manager, editor and on the
> homepage like this example do you have to write admin => false, manager=>
> false, editor => false for every link?

My understanding is that that is correct, yes.

> Or is there a short prefix => null
> type option?


I'm not aware of it if there is.

For these reasons prefixes seem a bit inconvenient and I'm trying to limit 
myself to just a single prefix in the app I'm currently working on.



-- 
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 do you do it?

2011-04-18 Thread Angel Robert Marquez
: )
( :

ask the economist to do a comparison against the door knob, the wind shield
wiper and the lightbox.

the lightbox is definitely not the new black...

i agree with krissy ? masters. the first interview i just got up and walked
out on a guy that didn't know sh*t from shinola asked me how I would write a
lightbox from scratch. i was thinking in my head you should be worrying
about all the 50megabyte images on your sire before you start with that jazz
bro. why would i not use 1 of the billions of lb libs out there. i am all
for from scratch but in a realistic b*ll crushing hierarchic of corporate
pigs..you/they're getting the fancybox-latest with a custom button. wanted
it yesterday etc...

On Mon, Apr 18, 2011 at 5:59 PM, cricket  wrote:

> On Mon, Apr 18, 2011 at 8:22 PM, Angel Robert Marquez
>  wrote:
> > the clock is ticking...
>
> Change in plan. I've convinced The Economist to allow me to
> guest-editorial on the subject of the lightbox. I plan to excoriate
> the current state of demoralized apathy that Web 2.0 has become with
> its dependence on the lightbox to get anything done. I contacted The
> Register first but they told me the lightbox was so last year, then
> suggested I call The Onion instead (they were being mean).
>
> > it is interesting that a different shade of box light is rather scarce as
> > well.
>
> Conformity. It's dragging us all down.
>
> (I'm laughing with you, btw. I'd have included a :-) or a LOL but ...
> well, that seems so juvenile.)
>
> :-)
>
> --
> 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: Cache Confusion

2011-04-18 Thread cricket
On Mon, Apr 18, 2011 at 10:56 AM, Krissy Masters
 wrote:
> Still no answers to my questions. No one has any insight?
>
> If you cache the whole action ( $cacheAction) then is it to assume you don't
> need to cache the query data or the view since the whole action is cached as
> 1 object? Does 1 cache take precedent over another. The actual action in the
> controller is never hit (if already cached) so you would not need to cache
> the query data in that action?

Yes, that's right. Dispatcher checks if there's a cached file. If yes,
it loads up a View which in turn renders the cached version. No
controller required.

-- 
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: Cookbook is partially offline/broken

2011-04-18 Thread Ryan Schmidt

On Apr 18, 2011, at 17:28, Veraxus wrote:

> I think I sort of figured it out. Viewing the pages in Chrome or Opera gave 
> me a 500 error. But if opened the webpage in Firefox or Safari, it worked. 
> More strangely, if I then tried the same web page in one of the 
> aforementioned "problem" browsers again, it now worked. Any page currently 
> "broken" remains broken until I visit the page in Firefox first, then it 
> miraculously works in everything.

Yes, I experienced behavior like that too, back when the new version of the 
book site was first made available. I have no idea how that kind of brokenness 
is even possible.


-- 
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 do you do it?

2011-04-18 Thread cricket
On Mon, Apr 18, 2011 at 8:22 PM, Angel Robert Marquez
 wrote:
> the clock is ticking...

Change in plan. I've convinced The Economist to allow me to
guest-editorial on the subject of the lightbox. I plan to excoriate
the current state of demoralized apathy that Web 2.0 has become with
its dependence on the lightbox to get anything done. I contacted The
Register first but they told me the lightbox was so last year, then
suggested I call The Onion instead (they were being mean).

> it is interesting that a different shade of box light is rather scarce as
> well.

Conformity. It's dragging us all down.

(I'm laughing with you, btw. I'd have included a :-) or a LOL but ...
well, that seems so juvenile.)

:-)

-- 
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: Internal server error on my browser

2011-04-18 Thread Ryan Schmidt
Ok, so the .htaccess file in C:\wamp\www seems to be the cause. It basically 
says "for any request, prepend the directory "webroot". So when you request 
/bookstore, it prepends "webroot" and rewrites that to "/webroot/bookstore". To 
which it then prepends "webroot" and rewrites it to 
"/webroot/webroot/bookstore". And so on forever (or until Apache errors out due 
to internal redirect limit).

Why is this .htaccess file here? What is its intended purpose? Clearly you 
don't want the above behavior, so what behavior do you actually want?


On Apr 18, 2011, at 09:03, varai wrote:

> contents of HTACCESS file in c:\wamp\www
> 
>RewriteEngine on
>RewriteRule^$webroot/[L]
>RewriteRule(.*) webroot/$1[L]
> 

> contents of httpd.conf

> DocumentRoot "c:/wamp/www/"

> When i type http://localhost/bookstore in the browser address bar, I
> get the internal server error.
> 
> Apache error log (after setting LogLevel to debug):
> Mon Apr 18 21:22:09 2011] [error] [client 127.0.0.1] Request exceeded
> the limit of 10 internal redirects due to probable configuration
> error. Use 'LimitInternalRecursion' to increase the limit if
> necessary. Use 'LogLevel debug' to get a backtrace.
> [Mon Apr 18 21:22:09 2011] [debug] core.c(3046): [client 127.0.0.1] r-
>> uri = /webroot/webroot/webroot/webroot/webroot/webroot/webroot/
> webroot/webroot/webroot/bookstore/
> [Mon Apr 18 21:22:09 2011] [debug] core.c(3052): [client 127.0.0.1]
> redirected from r->uri = /webroot/webroot/webroot/webroot/webroot/
> webroot/webroot/webroot/webroot/bookstore/
> [Mon Apr 18 21:22:09 2011] [debug] core.c(3052): [client 127.0.0.1]
> redirected from r->uri = /webroot/webroot/webroot/webroot/webroot/
> webroot/webroot/webroot/bookstore/
> [Mon Apr 18 21:22:09 2011] [debug] core.c(3052): [client 127.0.0.1]
> redirected from r->uri = /webroot/webroot/webroot/webroot/webroot/
> webroot/webroot/bookstore/
> [Mon Apr 18 21:22:09 2011] [debug] core.c(3052): [client 127.0.0.1]
> redirected from r->uri = /webroot/webroot/webroot/webroot/webroot/
> webroot/bookstore/
> [Mon Apr 18 21:22:09 2011] [debug] core.c(3052): [client 127.0.0.1]
> redirected from r->uri = /webroot/webroot/webroot/webroot/webroot/
> bookstore/
> [Mon Apr 18 21:22:09 2011] [debug] core.c(3052): [client 127.0.0.1]
> redirected from r->uri = /webroot/webroot/webroot/webroot/bookstore/
> [Mon Apr 18 21:22:09 2011] [debug] core.c(3052): [client 127.0.0.1]
> redirected from r->uri = /webroot/webroot/webroot/bookstore/
> [Mon Apr 18 21:22:09 2011] [debug] core.c(3052): [client 127.0.0.1]
> redirected from r->uri = /webroot/webroot/bookstore/
> [Mon Apr 18 21:22:09 2011] [debug] core.c(3052): [client 127.0.0.1]
> redirected from r->uri = /webroot/bookstore/
> [Mon Apr 18 21:22:09 2011] [debug] core.c(3052): [client 127.0.0.1]
> redirected from r->uri = /bookstore/


-- 
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 do you do it?

2011-04-18 Thread Angel Robert Marquez
the clock is ticking...
..
.

it is interesting that a different shade of box light is rather scarce as
well.

On Mon, Apr 18, 2011 at 4:47 PM, cricket  wrote:

> On Mon, Apr 18, 2011 at 6:03 PM, Angel Robert Marquez
>  wrote:
> > cake should not allow the lightbox to be executed unless a check is made
> for
> > the amount of people using it at any one given time..?
>
> I read somewhere that Richard Stallman is dead set against the
> lightbox. Cake should follow his lead and announce a no-lightbox
> policy going forward in 2.0.
>
> I'll give Larry Masters exactly one hour to set the record straight
> before I post a vitriolic screed on /. denouncing CakePHP's posture on
> the lightbox.
>
> --
> 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: How do you do it?

2011-04-18 Thread cricket
On Mon, Apr 18, 2011 at 6:03 PM, Angel Robert Marquez
 wrote:
> cake should not allow the lightbox to be executed unless a check is made for
> the amount of people using it at any one given time..?

I read somewhere that Richard Stallman is dead set against the
lightbox. Cake should follow his lead and announce a no-lightbox
policy going forward in 2.0.

I'll give Larry Masters exactly one hour to set the record straight
before I post a vitriolic screed on /. denouncing CakePHP's posture on
the lightbox.

-- 
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: I want to allow a user to create his own page, the url of which would be his name

2011-04-18 Thread Sam Sherlock
using slugs (cakedc utils plugin sluggable or cake syrup)

http://bakery.cakephp.org/articles/mariano/2007/03/24/sluggable-behavior

 and in routes


App::import('Lib', 'routes/UserRoute');
Router::connect('/:slug', array(
'controller' => 'users',
'action' => 'view'),
array('routeClass' => 'UserRoute'));

you could specify the form the slug must be there too

see the section Passing parameters to action in the cake book
http://book.cakephp.org/view/945/Routes-Configuration#Passing-parameters-to-action-949

adapt the advice on Mark Story routing class
http://mark-story.com/posts/view/using-custom-route-classes-in-cakephp

hth - S




On 19 April 2011 00:02, MeatSandwich  wrote:

> I'm trying to create an app which allows a user to create an account
> and then create their own page.
>
> I'd like to use a combination of the users first and and last name as
> the url of their page, ie mywebsite.com/john_smith
>
> Obviously I'd need to create a controller with an apropriate action,
> but how do I go about making it have the url I want?
>
> By the way, I've read through the manual a bunch of times (all the
> stuff about routes esp) and read loads of tutorials and a couple of
> the books but there's nothing I've come across that explains this
> exactly.
>
> any help would be greatly appreciated.
>
> --
> 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: Link submission email

2011-04-18 Thread cricket
On Mon, Apr 18, 2011 at 4:14 AM, dvvbrook79
 wrote:
> Yeah ok sorry about that...heres my "submitlink.ctp" which is the
> email i get. I have left the bottom part of the "controller" as i know
> this is for admin purposesHOPE YOU CAN HELP,cause ive been looking
> and cant seem to find anything wrong, but saying that im still fairly
> new to cakeCheers for the assistance.
>
>
>  Submissions'); ?>
>
> 
>    
>        :
>        
>    
>    
>        :
>        
>    
>    
>        :
>        link($link['Link']['url'], $link['Link']
> ['url']); ?>
>    
>    
>        :
>        
>    
>            
>        :
>        
>    
> 
>
> "HERES MY view"
> create('Link', array('action' => 'submit')); ?>
>
>        echo $form->inputs(array (
>        'legend' => false,
>        'Link.link_category_id' => array (
>            'label' => __('Category', true)
>        ),
>        'Link.title',
>        'Link.url' => array(
>            'label' => __('URL', true)
>        ),
>
>        'Link.description',
>                'Link.reciprocallink'
>
>    ));
>    ?>

Have you checked the DB to see if 'reciprocallink' is empty? Try also
debugging the submitted data.

if (!empty($this->data))
{
  die(debug($this->data));

Actually, are you sure the DB column isn't named 'reciprocal_link'?


> "AND HERES MY controller"
>  class LinksController extends AppController {
>
>    var $name = 'Links';
>    var $uses = array('Link', 'LinkCategory', 'Page');

You don't need LinkCategory here because you can access it through Link:
$this->Link->LinkCategory->find(...)

Better yet, put this in the Link model:

public function getCategories($order = array())
{
if (empty($order))
{
$order = array('Linkcategory.title' => 'ASC');
}

return $this->LinkCategory->find(
'list',
array(
'order' => $order
)
);
}

controller:
public function submit()
{
if (!empty($this->data))
{
// ...
}

$this->set(
'categories',
$this->Link->getCategories()
);
}


You should fetch the categories after checking if $this->data is
empty. If the submission succeeds you redirect, so there's no need to
get the categories. If it fails, execution falls through, you get the
categories, and show the form again. But you should add an else to set
a flash message (but don't redirect) if save fails.


>$this->Email->from =
> __('DisneyVillaVacations.com', true) . ' <' .
> Configure::read('Admin.email') . '>';
>                $this->Email->to       =
> Configure::read('Admin.email');
>                $this->Email->subject  = __('DisneyVillaVacations.com
> - Link Submission', true);


$this->Email->from =
Configure::read('Email.from_name'). ' <' .
Configure::read('Admin.email') . '>';
$this->Email->to =
Configure::read('Admin.email');
$this->Email->subject = Configure::read('Email.subject');

bootstrap:
Configure::write('Email.from_name', 'DisneyVillaVacations.com');
Configure::write('Email.subject', 'DisneyVillaVacations.com');

-- 
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


I want to allow a user to create his own page, the url of which would be his name

2011-04-18 Thread MeatSandwich
I'm trying to create an app which allows a user to create an account
and then create their own page.

I'd like to use a combination of the users first and and last name as
the url of their page, ie mywebsite.com/john_smith

Obviously I'd need to create a controller with an apropriate action,
but how do I go about making it have the url I want?

By the way, I've read through the manual a bunch of times (all the
stuff about routes esp) and read loads of tutorials and a couple of
the books but there's nothing I've come across that explains this
exactly.

any help would be greatly appreciated.

-- 
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: Cookbook is partially offline/broken

2011-04-18 Thread Veraxus
I think I sort of figured it out. Viewing the pages in Chrome or Opera gave 
me a 500 error. But if opened the webpage in Firefox or Safari, it worked. 
More strangely, if I then tried the same web page in one of the 
aforementioned "problem" browsers *again*, it now worked. Any page currently 
"broken" remains broken until I visit the page in Firefox first, then it 
miraculously works in everything.

I guess I'll just use Firefox when I need to look at the cookbook, but this 
is by far one of the most bizarre things I've seen.

-- 
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 do you do it?

2011-04-18 Thread Angel Robert Marquez
On Mon, Apr 18, 2011 at 2:51 PM, Krissy Masters
wrote:

> The Beatles? Do they have their own light box? Perhaps we could make a
> light box with Beatles theme and every site on the web could use it! Wow
> that would be heaven!
>
Unfortunately I'm not big on sales and marketing initiatives even thought
those are the types of goals that keep my pockets fed. Sounds kinda greedy
and played out.

>
>
> Do we all have to like them?
>
of course not.


> Does it matter if I do or do not?
>
 no.

>
>
> Should every radio station play them?
>
no

> Perhaps a variety is nice, not sure if you are in a communist country where
> you do not have the freedom to choose and if your forced to listen to the
> Beatles all day then that’s just the way it is.
>
 You might be right.

But other than being not relevant to anything I was referring to I was
> simply asking for an opinion on options other than light box because yes I
> do think it is used “in excess” and simply placing everything inside of 1 is
> not the quick and dirty answer I was looking for.
>
I agree.

>
>
> But anyways in all seriousness if I offended you by saying my own opinion
> of what I think of the use of light box well I do apologize for hurting your
> feelings.
>
Well, it just seemed like you were using it to your advantage with your
presentational intent and everyone who uses one like you were running for
president or something. I don't want to feel awkward the next time someone
wants the lightbox.

cake should not allow the lightbox to be executed unless a check is made for
the amount of people using it at any one given time..?

>
>
> K
>
>
>
> *From:* cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] *On
> Behalf Of *Angel Robert Marquez
> *Sent:* Monday, April 18, 2011 7:08 PM
>
> *To:* cake-php@googlegroups.com
> *Subject:* Re: How do you do it?
>
>
>
> actually all i said is there is an obvious solution that is used by many
> making in your juvenile speak 'played out'.
>
>
>
> i'm all for innovating when needed; but, I am certainly against making
> something that was a good idea that has been overly produced by it's own
> accord being labeled something like played out. it's not the light
> boxes fault that so many people use it.
>
>
>
> do you not like the beatles either, krissy?
>
>
>
>
>
> On Mon, Apr 18, 2011 at 2:28 PM, Krissy Masters <
> naked.cake.ba...@gmail.com> wrote:
>
> Yes that’s exactly what I am saying! WTF! That’s no answer to the question
> WTF!
>
> But for those who love to go to the extreme WTF! WTF LOL ROTHL and all the
> other foolish juvenile text generation lingo you like to add.
>
>
>
> What I should say is that is clearly over used on because of its ease to
> use sure throw it in a lightbox is the EASY answer but there are people out
> there that do like to try new things and maybe try to come up with something
> new rather than just the obvious.
>
> Lets just put everything in a lightbox and never come up with anything new.
>
>
> Stop thinking and asking questions to alternative solutions since you seem
> to think a lightbox is the be all and end all flavor of the web can’t go
> wrong with it answer for every situation.
>
> Ok good stuff.
>
>
>
> This is the equivalent of saying ”since everyone is doing it I will too…why
> think for myself!”
>
>
>
> K
>
>
>
> *From:* cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] *On
> Behalf Of *Angel Robert Marquez
> *Sent:* Monday, April 18, 2011 6:38 PM
> *To:* cake-php@googlegroups.com
> *Subject:* Re: How do you do it?
>
>
>
> >>I had it in a lightbox which worked fine but everyone and their brother
> has a lightbox and its just so played out.
>
>
>
> This is the equivalent to saying 'toilet paper is played out'.
>
>
>
> wtf.
>
>
>
> On Mon, Apr 18, 2011 at 1:29 PM, Samuel Infante 
> wrote:
>
> I can think of three options:
>
> 1. Lightbox: very simple, a lot of people uses it for that reason and
> also it doesn't look bad.
> 2. Going back and forth: Annoying, as you stated.
> 3. Edit it right there: make the "ajax upload" of a pic and load it
> into a thumb size box (all in the same page) make the user to move the
> picture to get the thumb result and if you want to get fancy put a + -
> so they can zoom. I think this might be the thing you are looking for
> but I think it will be REALLY difficult to accomplish.
>
> Just my thoughts...
>
>
> --
> 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 

RE: How do you do it?

2011-04-18 Thread Krissy Masters
The Beatles? Do they have their own light box? Perhaps we could make a light
box with Beatles theme and every site on the web could use it! Wow that
would be heaven!

 

Do we all have to like them? Does it matter if I do or do not?

 

Should every radio station play them? Perhaps a variety is nice, not sure if
you are in a communist country where you do not have the freedom to choose
and if your forced to listen to the Beatles all day then that's just the way
it is. But other than being not relevant to anything I was referring to I
was simply asking for an opinion on options other than light box because yes
I do think it is used "in excess" and simply placing everything inside of 1
is not the quick and dirty answer I was looking for. 

 

But anyways in all seriousness if I offended you by saying my own opinion of
what I think of the use of light box well I do apologize for hurting your
feelings.

 

K

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Angel Robert Marquez
Sent: Monday, April 18, 2011 7:08 PM
To: cake-php@googlegroups.com
Subject: Re: How do you do it?

 

actually all i said is there is an obvious solution that is used by many
making in your juvenile speak 'played out'.

 

i'm all for innovating when needed; but, I am certainly against making
something that was a good idea that has been overly produced by it's own
accord being labeled something like played out. it's not the light boxes
fault that so many people use it. 

 

do you not like the beatles either, krissy?

 

 

On Mon, Apr 18, 2011 at 2:28 PM, Krissy Masters 
wrote:

Yes that's exactly what I am saying! WTF! That's no answer to the question
WTF!

But for those who love to go to the extreme WTF! WTF LOL ROTHL and all the
other foolish juvenile text generation lingo you like to add.

 

What I should say is that is clearly over used on because of its ease to use
sure throw it in a lightbox is the EASY answer but there are people out
there that do like to try new things and maybe try to come up with something
new rather than just the obvious. 

Lets just put everything in a lightbox and never come up with anything new. 

Stop thinking and asking questions to alternative solutions since you seem
to think a lightbox is the be all and end all flavor of the web can't go
wrong with it answer for every situation. 

Ok good stuff. 

 

This is the equivalent of saying "since everyone is doing it I will too.why
think for myself!"

 

K

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Angel Robert Marquez
Sent: Monday, April 18, 2011 6:38 PM
To: cake-php@googlegroups.com
Subject: Re: How do you do it?

 

>>I had it in a lightbox which worked fine but everyone and their brother
has a lightbox and its just so played out.

 

This is the equivalent to saying 'toilet paper is played out'.

 

wtf. 

 

On Mon, Apr 18, 2011 at 1:29 PM, Samuel Infante  wrote:

I can think of three options:

1. Lightbox: very simple, a lot of people uses it for that reason and
also it doesn't look bad.
2. Going back and forth: Annoying, as you stated.
3. Edit it right there: make the "ajax upload" of a pic and load it
into a thumb size box (all in the same page) make the user to move the
picture to get the thumb result and if you want to get fancy put a + -
so they can zoom. I think this might be the thing you are looking for
but I think it will be REALLY difficult to accomplish.

Just my thoughts...


--
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

-- 

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

Re: How do you do it?

2011-04-18 Thread Angel Robert Marquez
actually all i said is there is an obvious solution that is used by many
making in your juvenile speak 'played out'.

i'm all for innovating when needed; but, I am certainly against making
something that was a good idea that has been overly produced by it's own
accord being labeled something like played out. it's not the light
boxes fault that so many people use it.

do you not like the beatles either, krissy?


On Mon, Apr 18, 2011 at 2:28 PM, Krissy Masters
wrote:

> Yes that’s exactly what I am saying! WTF! That’s no answer to the question
> WTF!
>
> But for those who love to go to the extreme WTF! WTF LOL ROTHL and all the
> other foolish juvenile text generation lingo you like to add.
>
>
>
> What I should say is that is clearly over used on because of its ease to
> use sure throw it in a lightbox is the EASY answer but there are people out
> there that do like to try new things and maybe try to come up with something
> new rather than just the obvious.
>
> Lets just put everything in a lightbox and never come up with anything new.
>
>
> Stop thinking and asking questions to alternative solutions since you seem
> to think a lightbox is the be all and end all flavor of the web can’t go
> wrong with it answer for every situation.
>
> Ok good stuff.
>
>
>
> This is the equivalent of saying ”since everyone is doing it I will too…why
> think for myself!”
>
>
>
> K
>
>
>
> *From:* cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] *On
> Behalf Of *Angel Robert Marquez
> *Sent:* Monday, April 18, 2011 6:38 PM
> *To:* cake-php@googlegroups.com
> *Subject:* Re: How do you do it?
>
>
>
> >>I had it in a lightbox which worked fine but everyone and their brother
> has a lightbox and its just so played out.
>
>
>
> This is the equivalent to saying 'toilet paper is played out'.
>
>
>
> wtf.
>
>
>
> On Mon, Apr 18, 2011 at 1:29 PM, Samuel Infante 
> wrote:
>
> I can think of three options:
>
> 1. Lightbox: very simple, a lot of people uses it for that reason and
> also it doesn't look bad.
> 2. Going back and forth: Annoying, as you stated.
> 3. Edit it right there: make the "ajax upload" of a pic and load it
> into a thumb size box (all in the same page) make the user to move the
> picture to get the thumb result and if you want to get fancy put a + -
> so they can zoom. I think this might be the thing you are looking for
> but I think it will be REALLY difficult to accomplish.
>
> Just my thoughts...
>
>
> --
> 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
>
>  --
> 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: How do you do it?

2011-04-18 Thread Krissy Masters
Yes that's exactly what I am saying! WTF! That's no answer to the question
WTF!

But for those who love to go to the extreme WTF! WTF LOL ROTHL and all the
other foolish juvenile text generation lingo you like to add.

 

What I should say is that is clearly over used on because of its ease to use
sure throw it in a lightbox is the EASY answer but there are people out
there that do like to try new things and maybe try to come up with something
new rather than just the obvious. 

Lets just put everything in a lightbox and never come up with anything new. 

Stop thinking and asking questions to alternative solutions since you seem
to think a lightbox is the be all and end all flavor of the web can't go
wrong with it answer for every situation. 

Ok good stuff. 

 

This is the equivalent of saying "since everyone is doing it I will too.why
think for myself!"

 

K

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Angel Robert Marquez
Sent: Monday, April 18, 2011 6:38 PM
To: cake-php@googlegroups.com
Subject: Re: How do you do it?

 

>>I had it in a lightbox which worked fine but everyone and their brother
has a lightbox and its just so played out.

 

This is the equivalent to saying 'toilet paper is played out'.

 

wtf. 

 

On Mon, Apr 18, 2011 at 1:29 PM, Samuel Infante  wrote:

I can think of three options:

1. Lightbox: very simple, a lot of people uses it for that reason and
also it doesn't look bad.
2. Going back and forth: Annoying, as you stated.
3. Edit it right there: make the "ajax upload" of a pic and load it
into a thumb size box (all in the same page) make the user to move the
picture to get the thumb result and if you want to get fancy put a + -
so they can zoom. I think this might be the thing you are looking for
but I think it will be REALLY difficult to accomplish.

Just my thoughts...


--
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

-- 
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 do you do it?

2011-04-18 Thread Angel Robert Marquez
>>I had it in a lightbox which worked fine but everyone and their brother
has a lightbox and its just so played out.

This is the equivalent to saying 'toilet paper is played out'.

wtf.

On Mon, Apr 18, 2011 at 1:29 PM, Samuel Infante  wrote:

> I can think of three options:
>
> 1. Lightbox: very simple, a lot of people uses it for that reason and
> also it doesn't look bad.
> 2. Going back and forth: Annoying, as you stated.
> 3. Edit it right there: make the "ajax upload" of a pic and load it
> into a thumb size box (all in the same page) make the user to move the
> picture to get the thumb result and if you want to get fancy put a + -
> so they can zoom. I think this might be the thing you are looking for
> but I think it will be REALLY difficult to accomplish.
>
> Just my thoughts...
>
> --
> 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: set paginator last page as default?

2011-04-18 Thread stas kim
FYI

this is how cake tests the page
if ($page === 'last' || $page >= $pageCount) {
$options['page'] = $page = $pageCount;
} elseif (intval($page) < 1) {
$options['page'] = $page = 1;
}

so i would say 'last' is built in option

On Mon, Apr 18, 2011 at 4:38 PM, lucas  wrote:
> Thanks stats kim, i already know about that solution. It seems there
> is nothing built in at core level to achieve this.
> It´s not an elegant solution but it works fine and it´s practical.
>
> For those who need something like this, before call the paginate
> method, put this line $this->paginate['page'] = 9; or a bigger
> number...
>
> Thanks for all the responses.
>
>
>
> On 18 abr, 17:23, stas kim 
> wrote:
>> What you can do is set page parameter in your controller to 'last'
>> or some huge number larger than projected page count.
>> And it will miraculously bring you to the last page. whatever that
>> last page's number is.
>> That is the way Controller::paginate works in 1.3
>>
>>
>>
>>
>>
>>
>>
>> On Mon, Apr 18, 2011 at 3:42 PM, lucas  wrote:
>> > I can´t do that because the data can´t be ordered. I need it in that
>> > way...
>>
>> > On 18 abr, 16:37, Tilen Majerle  wrote:
>> >> yes...instead of order => "YourModel.field ASC" type "YourModel.field 
>> >> DESC"
>> >> and you will have newest posts/whatever in top of pages
>> >> --
>> >> Lep pozdrav, Tilen Majerlehttp://majerle.eu
>>
>> >> 2011/4/18 Jeremy Burns | Class Outfit 
>>
>> >> > Sort the data in reverse order?
>>
>> >> > Jeremy Burns
>> >> > Class Outfit
>>
>> >> > jeremybu...@classoutfit.com
>> >> >http://www.classoutfit.com
>>
>> >> > On 18 Apr 2011, at 20:32, lucas wrote:
>>
>> >> > > Hi people, is it possible to set as default the last page of the
>> >> > > paginated data from the controller? Is there an option available to do
>> >> > > this?
>>
>> >> > > thanks in advance!
>>
>> >> > > --
>> >> > > Our newest site for the community: CakePHP Video Tutorials
>> >> >http://tv.cakephp.org
>> >> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
>> >> > 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
>> >> > athttp://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 sitehttp://ask.cakephp.organdhelp
>> >> > 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
>> >> > athttp://groups.google.com/group/cake-php
>>
>> > --
>> > Our newest site for the community: CakePHP Video 
>> > Tutorialshttp://tv.cakephp.org
>> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 
>> > athttp://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
>

-- 
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: Does pagination with custom urls really sucks?

2011-04-18 Thread stas kim
i think you need to make your route greedy
OR add another route with page param, you will need to keep both routes
one for default location  and one for paged

On Mon, Apr 18, 2011 at 1:29 PM, huoxito  wrote:
> im not able to make route class and paginator helper work as i want too i
> guess.
> if i try to reach example.com/controller/slug1/slug2/page:2 cakephp tries to
> find an action called slug1. Its like as if it ignores completely the route
> i defined.
>
> --
> 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: set paginator last page as default?

2011-04-18 Thread lucas
Thanks stats kim, i already know about that solution. It seems there
is nothing built in at core level to achieve this.
It´s not an elegant solution but it works fine and it´s practical.

For those who need something like this, before call the paginate
method, put this line $this->paginate['page'] = 9; or a bigger
number...

Thanks for all the responses.



On 18 abr, 17:23, stas kim 
wrote:
> What you can do is set page parameter in your controller to 'last'
> or some huge number larger than projected page count.
> And it will miraculously bring you to the last page. whatever that
> last page's number is.
> That is the way Controller::paginate works in 1.3
>
>
>
>
>
>
>
> On Mon, Apr 18, 2011 at 3:42 PM, lucas  wrote:
> > I can´t do that because the data can´t be ordered. I need it in that
> > way...
>
> > On 18 abr, 16:37, Tilen Majerle  wrote:
> >> yes...instead of order => "YourModel.field ASC" type "YourModel.field DESC"
> >> and you will have newest posts/whatever in top of pages
> >> --
> >> Lep pozdrav, Tilen Majerlehttp://majerle.eu
>
> >> 2011/4/18 Jeremy Burns | Class Outfit 
>
> >> > Sort the data in reverse order?
>
> >> > Jeremy Burns
> >> > Class Outfit
>
> >> > jeremybu...@classoutfit.com
> >> >http://www.classoutfit.com
>
> >> > On 18 Apr 2011, at 20:32, lucas wrote:
>
> >> > > Hi people, is it possible to set as default the last page of the
> >> > > paginated data from the controller? Is there an option available to do
> >> > > this?
>
> >> > > thanks in advance!
>
> >> > > --
> >> > > Our newest site for the community: CakePHP Video Tutorials
> >> >http://tv.cakephp.org
> >> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
> >> > 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
> >> > athttp://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 sitehttp://ask.cakephp.organdhelp
> >> > 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
> >> > athttp://groups.google.com/group/cake-php
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 
> > athttp://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: Validation errors only working in Add form, but not in Edit form.

2011-04-18 Thread stas kim
a) use http://bin.cakephp.org or other bin of preference to show your code
b) Model::save() validation parameter defaults to true, no need to force it
c) number of reasons why you don't see messages
you may not print it in the view - compare your add and edit views
or your validation rules 'on' options set to 'create'


On Mon, Apr 18, 2011 at 1:57 PM, Krissy Masters
 wrote:
> if ($this->Post->save($this->data)) { you not forcing validation check
>
> add true
>
> if ($this->Post->save($this->data, true)) {
>
> K
>
> -Original Message-
> From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
> Of jackgoh
> Sent: Monday, April 18, 2011 3:23 PM
> To: CakePHP
> Subject: Validation errors only working in Add form, but not in Edit form.
>
> Hi,
>
>
> The validation message is working in Add Form, but not in the Edit
> Form, can anyone help me?
> Part of my code in the controller:
>
>        function edit($id = null) {
>                $this->Post->id = $id;
>                $sectors = $this->Post->Sector->find('list', array(
>
> 'fields' => array('id','combined_name'),
>
> 'conditions' => array('status' => 'A')
>
> )
>                );
>                $this->set(compact('sectors'));
>
>                if (empty($this->data)) {
>                        $this->data = $this->Post->read();
>                } else {
>                        if ($this->Post->save($this->data)) {
>                                $this->Session->setFlash('Your record has
> been updated.');
>                                $this->redirect(array('action' => 'index'));
>                        } else {
>                                $this->Session-
>>setFlash('Error.');
>                        }
>                }
>        }
>
> Thanks!
>
> Best regards.
>
> --
> 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
>

-- 
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 do you do it?

2011-04-18 Thread Samuel Infante
I can think of three options:

1. Lightbox: very simple, a lot of people uses it for that reason and
also it doesn't look bad.
2. Going back and forth: Annoying, as you stated.
3. Edit it right there: make the "ajax upload" of a pic and load it
into a thumb size box (all in the same page) make the user to move the
picture to get the thumb result and if you want to get fancy put a + -
so they can zoom. I think this might be the thing you are looking for
but I think it will be REALLY difficult to accomplish.

Just my thoughts...

-- 
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 do you do it?

2011-04-18 Thread Eric Anderson
I've always thought about that same issue. I think there's some good
JQuery  / Ajax image upload and cropping plugins.

On a basic level, I'd probably allow an upload then refresh the same
page after the successful upload. On reload, the page would be in the
"editing" state, so instead of just showing the photo they just
loaded, it's shown within the cropping editor with a "save changes"
button below. Upon clicking that, the co-ordinates are sent to the
controller action again and the page is reloaded again, this time with
the final cropped / edited photo in place.

I'd likely try to streamline this with Ajax image uploading though.

Take a look at Malsup's Ajax image upload plugin for JQuery.
http://jquery.malsup.com/form/#file-upload

On Apr 18, 12:22 pm, "Krissy Masters" 
wrote:
> This is not a code how to question, just general functionality how to
> question.
>
> I have a gallery, upload images and a cropper to select thumbs for the
> images all set up and functionality working.
>
> But I want to know how do you edit your thumbs? Click thumb edit > new page
> with the editor save selection redirect back to gallery set of images?
>
> If just found back and forth very annoying so im trying to come up with an
> easier 1 page type ajax setup but everything just seems to have its
> limitations.
>
> I had it in a lightbox which worked fine but everyone and their brother has
> a lightbox and its just so played out.
>
> Any ideas brainstorm thought would help a stuck baker!
>
> Thanks,
>
> K

-- 
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: set paginator last page as default?

2011-04-18 Thread stas kim
What you can do is set page parameter in your controller to 'last'
or some huge number larger than projected page count.
And it will miraculously bring you to the last page. whatever that
last page's number is.
That is the way Controller::paginate works in 1.3




On Mon, Apr 18, 2011 at 3:42 PM, lucas  wrote:
> I can´t do that because the data can´t be ordered. I need it in that
> way...
>
>
> On 18 abr, 16:37, Tilen Majerle  wrote:
>> yes...instead of order => "YourModel.field ASC" type "YourModel.field DESC"
>> and you will have newest posts/whatever in top of pages
>> --
>> Lep pozdrav, Tilen Majerlehttp://majerle.eu
>>
>> 2011/4/18 Jeremy Burns | Class Outfit 
>>
>>
>>
>>
>>
>>
>>
>> > Sort the data in reverse order?
>>
>> > Jeremy Burns
>> > Class Outfit
>>
>> > jeremybu...@classoutfit.com
>> >http://www.classoutfit.com
>>
>> > On 18 Apr 2011, at 20:32, lucas wrote:
>>
>> > > Hi people, is it possible to set as default the last page of the
>> > > paginated data from the controller? Is there an option available to do
>> > > this?
>>
>> > > thanks in advance!
>>
>> > > --
>> > > Our newest site for the community: CakePHP Video Tutorials
>> >http://tv.cakephp.org
>> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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
>> > athttp://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 sitehttp://ask.cakephp.organd 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
>> > athttp://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
>

-- 
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: Anyone having issues searching the Bakery?

2011-04-18 Thread Samuel Infante
I was talking about this in the IRC channel and well the bot suggested
to do site:bakery.cakephp.org to search :D

-- 
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: set paginator last page as default?

2011-04-18 Thread lucas
I can´t do that because the data can´t be ordered. I need it in that
way...


On 18 abr, 16:37, Tilen Majerle  wrote:
> yes...instead of order => "YourModel.field ASC" type "YourModel.field DESC"
> and you will have newest posts/whatever in top of pages
> --
> Lep pozdrav, Tilen Majerlehttp://majerle.eu
>
> 2011/4/18 Jeremy Burns | Class Outfit 
>
>
>
>
>
>
>
> > Sort the data in reverse order?
>
> > Jeremy Burns
> > Class Outfit
>
> > jeremybu...@classoutfit.com
> >http://www.classoutfit.com
>
> > On 18 Apr 2011, at 20:32, lucas wrote:
>
> > > Hi people, is it possible to set as default the last page of the
> > > paginated data from the controller? Is there an option available to do
> > > this?
>
> > > thanks in advance!
>
> > > --
> > > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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
> > athttp://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 sitehttp://ask.cakephp.organd 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
> > athttp://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: set paginator last page as default?

2011-04-18 Thread Tilen Majerle
yes...instead of order => "YourModel.field ASC" type "YourModel.field DESC"
and you will have newest posts/whatever in top of pages
--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2011/4/18 Jeremy Burns | Class Outfit 

> Sort the data in reverse order?
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.com
> http://www.classoutfit.com
>
> On 18 Apr 2011, at 20:32, lucas wrote:
>
> > Hi people, is it possible to set as default the last page of the
> > paginated data from the controller? Is there an option available to do
> > this?
> >
> > thanks in advance!
> >
> > --
> > 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
>

-- 
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: set paginator last page as default?

2011-04-18 Thread Tilen Majerle
why would you like to do this?...

one option is to order data in reverse direction
--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2011/4/18 lucas 

> Hi people, is it possible to set as default the last page of the
> paginated data from the controller? Is there an option available to do
> this?
>
> thanks in advance!
>
> --
> 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: set paginator last page as default?

2011-04-18 Thread Jeremy Burns | Class Outfit
Sort the data in reverse order?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 18 Apr 2011, at 20:32, lucas wrote:

> Hi people, is it possible to set as default the last page of the
> paginated data from the controller? Is there an option available to do
> this?
> 
> thanks in advance!
> 
> -- 
> 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


set paginator last page as default?

2011-04-18 Thread lucas
Hi people, is it possible to set as default the last page of the
paginated data from the controller? Is there an option available to do
this?

thanks in advance!

-- 
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: Cookbook is partially offline/broken

2011-04-18 Thread Sam Sherlock
seems fine to me


On 18 April 2011 19:06, Veraxus  wrote:

> Still seeing 500 errors all over the place, making the cookbook nearly
> useless as a reference tool.
>
> --
> 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: Cookbook is partially offline/broken

2011-04-18 Thread Veraxus
Still seeing 500 errors all over the place, making the cookbook nearly 
useless as a reference tool.

-- 
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: Validation errors only working in Add form, but not in Edit form.

2011-04-18 Thread Krissy Masters
if ($this->Post->save($this->data)) { you not forcing validation check

add true

if ($this->Post->save($this->data, true)) {

K

-Original Message-
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of jackgoh
Sent: Monday, April 18, 2011 3:23 PM
To: CakePHP
Subject: Validation errors only working in Add form, but not in Edit form.

Hi,


The validation message is working in Add Form, but not in the Edit
Form, can anyone help me?
Part of my code in the controller:

function edit($id = null) {
$this->Post->id = $id;
$sectors = $this->Post->Sector->find('list', array(

'fields' => array('id','combined_name'),

'conditions' => array('status' => 'A')

)
);
$this->set(compact('sectors'));

if (empty($this->data)) {
$this->data = $this->Post->read();
} else {
if ($this->Post->save($this->data)) {
$this->Session->setFlash('Your record has
been updated.');
$this->redirect(array('action' => 'index'));
} else {
$this->Session-
>setFlash('Error.');
}
}
}

Thanks!

Best regards.

-- 
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


Validation errors only working in Add form, but not in Edit form.

2011-04-18 Thread jackgoh
Hi,


The validation message is working in Add Form, but not in the Edit
Form, can anyone help me?
Part of my code in the controller:

function edit($id = null) {
$this->Post->id = $id;
$sectors = $this->Post->Sector->find('list', array(

'fields' => array('id','combined_name'),

'conditions' => array('status' => 'A')

)
);
$this->set(compact('sectors'));

if (empty($this->data)) {
$this->data = $this->Post->read();
} else {
if ($this->Post->save($this->data)) {
$this->Session->setFlash('Your record has been 
updated.');
$this->redirect(array('action' => 'index'));
} else {
$this->Session-
>setFlash('Error.');
}
}
}

Thanks!

Best regards.

-- 
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: Can someone explain this to me in English please

2011-04-18 Thread Sam Sherlock
As I understand it if you are on an admin route and don't set admin to false
in link call then the link will be admin prefixed.

so when your on some other route you'd specifically set the respective
prefix to false (the others would be assumed false)
and this could be overridden so a link in admin dashboard could be displayed
to link to manager or editor prefixed URL.

Am I wrong in thinking this?

 - S




On 18 April 2011 16:21, Krissy Masters  wrote:

> One thing I was going to ask in regard to the admin routing.
> You have 3 different routes prefixed, admin, manager, editor and on the
> homepage like this example do you have to write admin => false, manager=>
> false, editor => false for every link? Or is there a short prefix => null
> type option?
>
> -Original Message-
> From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On
> Behalf
> Of Sam Sherlock
> Sent: Monday, April 18, 2011 12:24 PM
> To: cake-php@googlegroups.com
> Subject: Re: Can someone explain this to me in English please
>
> the last line allows admin users to access all areas. Other roles are
> limited to thier respective prefixed routes
>
> add admin=>false  to your html->link calls
>
> On 18/04/2011, MeatSandwich  wrote:
> > Sorry for being a bit of a dumb-ass but I'm trying to learn and have
> > been looking at this for a couple of days but I'm still not completely
> > sure how it works. I'm following an offline tutorial about using
> > prefixes.
> >
> > the tutorial says do this:
> > 1 - uncomment the admin routing prefix in core.php
> > 2 - add the following to users_controller.php:
> >   public function dashboard() {
> >   $role = $this->Auth->user('role');
> >   if (!empty($role)) {
> >   $this->redirect(array($role=>true,
> 'action'=>'dashboard'));
> >   }
> >   }
> >
> >   public function admin_dashboard() {
> >   }
> >
> >   public function manager_dashboard() {
> >   }
> >
> > 3 - create three views for the above
> > 4 - in app_controller add the authorize and session components with
> > appropriate settings, then add:
> >   public function isAuthorized() {
> >   $role = $this->Auth->user('role');
> >   $neededRole = null;
> >   $prefix = !empty($this->params['prefix']) ? $this-
> >>params['prefix'] : null;
> >   if (!empty($prefix) && in_array($prefix,
> > Configure::read('Routing.prefixes'))) {
> >   $neededRole = $prefix;
> >   }
> >   return (empty($neededRole) || strcasecmp($role, 'admin') ==
> 0 ||
> > strcasecmp($role, $neededRole) == 0);
> >   }
> >
> > 5 - in the default layout:
> >  >   $dashboardUrl = array('controller'=>'users',
> 'action'=>'dashboard');
> >   if (!empty($user['role'])) {
> >   $dashboardUrl[$user['role']] = true;
> >   }
> >   echo $this->Html->link('My Dashboard', $dashboardUrl);
> > ?>
> >
> >
> > Now the whole thing works and I can follow most of whats going on, but
> > I'm confused with the last line in the isAuthorized method. What
> > exactly does return (empty($neededRole) || strcasecmp($role, 'admin')
> > == 0 || strcasecmp($role, $neededRole) == 0); actually return?
> >
> > Also, the above code works fine and when I log in as someone who is an
> > admin they can view the admin_dashboard ok, but there after it seems
> > any other link has an admin prefix. How do I stop that happening? I
> > don't want to have to create an admin_ method for everything including
> > the homepage!
> >
> > thanks in advance - Cake rules!
> >
> > --
> > 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
> >
>
>
> --
>  - S
>
> +44 (0)7908 069 219
>
> --
> 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
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask

Re: Does pagination with custom urls really sucks?

2011-04-18 Thread huoxito
im not able to make route class and paginator helper work as i want too i 
guess.

if i try to reach example.com/controller/slug1/slug2/page:2 cakephp tries to 
find an action called slug1. Its like as if it ignores completely the route 
i defined.

-- 
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


Does pagination with custom urls really sucks?

2011-04-18 Thread huoxito
Im trying to use pagination in a view like these:

example.com/controller/slug1/slug2

so theres no action in the url

but when i try to paginate it the best i could get was: 

example.com/controller/action/slug1/slug2/page:2

Could anyone help to exclude that 'action' part of the url, please?

I've set a rule like this:

Route::connect('/:controller/:slug1/:slug2', array('action' => 
'someaction'), array('pass' => array('slug1', 'slug2')));
I also use the options on paginator to add the slugs paramters but i cant 
exclude the 'action' from the url.

...

-- 
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: Can someone explain this to me in English please

2011-04-18 Thread Krissy Masters
One thing I was going to ask in regard to the admin routing. 
You have 3 different routes prefixed, admin, manager, editor and on the
homepage like this example do you have to write admin => false, manager=>
false, editor => false for every link? Or is there a short prefix => null
type option?

-Original Message-
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Sam Sherlock
Sent: Monday, April 18, 2011 12:24 PM
To: cake-php@googlegroups.com
Subject: Re: Can someone explain this to me in English please

the last line allows admin users to access all areas. Other roles are
limited to thier respective prefixed routes

add admin=>false  to your html->link calls

On 18/04/2011, MeatSandwich  wrote:
> Sorry for being a bit of a dumb-ass but I'm trying to learn and have
> been looking at this for a couple of days but I'm still not completely
> sure how it works. I'm following an offline tutorial about using
> prefixes.
>
> the tutorial says do this:
> 1 - uncomment the admin routing prefix in core.php
> 2 - add the following to users_controller.php:
>   public function dashboard() {
>   $role = $this->Auth->user('role');
>   if (!empty($role)) {
>   $this->redirect(array($role=>true,
'action'=>'dashboard'));
>   }
>   }
>
>   public function admin_dashboard() {
>   }
>
>   public function manager_dashboard() {
>   }
>
> 3 - create three views for the above
> 4 - in app_controller add the authorize and session components with
> appropriate settings, then add:
>   public function isAuthorized() {
>   $role = $this->Auth->user('role');
>   $neededRole = null;
>   $prefix = !empty($this->params['prefix']) ? $this-
>>params['prefix'] : null;
>   if (!empty($prefix) && in_array($prefix,
> Configure::read('Routing.prefixes'))) {
>   $neededRole = $prefix;
>   }
>   return (empty($neededRole) || strcasecmp($role, 'admin') ==
0 ||
> strcasecmp($role, $neededRole) == 0);
>   }
>
> 5 - in the default layout:
>$dashboardUrl = array('controller'=>'users', 'action'=>'dashboard');
>   if (!empty($user['role'])) {
>   $dashboardUrl[$user['role']] = true;
>   }
>   echo $this->Html->link('My Dashboard', $dashboardUrl);
> ?>
>
>
> Now the whole thing works and I can follow most of whats going on, but
> I'm confused with the last line in the isAuthorized method. What
> exactly does return (empty($neededRole) || strcasecmp($role, 'admin')
> == 0 || strcasecmp($role, $neededRole) == 0); actually return?
>
> Also, the above code works fine and when I log in as someone who is an
> admin they can view the admin_dashboard ok, but there after it seems
> any other link has an admin prefix. How do I stop that happening? I
> don't want to have to create an admin_ method for everything including
> the homepage!
>
> thanks in advance - Cake rules!
>
> --
> 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
>


-- 
 - S

+44 (0)7908 069 219

-- 
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: Cache Confusion

2011-04-18 Thread Krissy Masters
Still no answers to my questions. No one has any insight?

If you cache the whole action ( $cacheAction) then is it to assume you don't
need to cache the query data or the view since the whole action is cached as
1 object? Does 1 cache take precedent over another. The actual action in the
controller is never hit (if already cached) so you would not need to cache
the query data in that action?

Function view ($id) {

//Read cache if empty get the data needed and cache the query data

$cache_data = Cache::read($cache_name);
if (empty($cache_data))
{
$dataModel = $this->Model->find('first');
Cache::write($cache_name, $dataModel, array('config' => 'File',
'duration' => 7200)); //if the action is cached do you need to cache this
data at all?
}
else
{
$dataModel = $cache_data;
}




}

Thanks to anyone who might have some insight!

K

-Original Message-
From: Krissy Masters [mailto:naked.cake.ba...@gmail.com] 
Sent: Thursday, April 07, 2011 9:47 PM
To: 'cake-php@googlegroups.com'
Subject: Cache Confusion

Cache action, query and view/element. So how do you know which to use, when?

Basic example we use Post action => view,  id => 123

We cache the query data from the database so every time that Post is viewed
we simply read the cached data, fine easy enough delete that data cache on
update so we always pull new data.

***But***

If the action is cached do we need to cache the query data also? The view
holds the data so if the view is cached as the final product does cake still
try to get the database query. I guess think of a cascade effect if the
action is cached for x amount of time does that override the view and query
cache since that action and the query inside the action would not even be
run since the total "action" and everything inside is cached whatever is
inside the action should be skipped all together no?

$cacheAction as it sounds would cache everything the action does, all its
thinking, data requests and result if your caching the whole action then you
don't need to cache anything else?

Cacheing you query is just the data from the db in a file / memory wherever
you save it

View just the rendered output with the query data in it

$cacheAction = view/123 => 1 month whatever for a rough example


function view ($id) {

//after initial first time viewing of this page everything inside here would
be completely skipped?
If your caching the total actions end result why would you cache the query
data? Would it not be cached inside the action already?

}

I guess with the available options it can be a bit confusing and knowing
when to use with what and when.

Any insight to clear this up would be great.

Thanks all,

K

-- 
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: Can someone explain this to me in English please

2011-04-18 Thread Sam Sherlock
the last line allows admin users to access all areas. Other roles are
limited to thier respective prefixed routes

add admin=>false  to your html->link calls

On 18/04/2011, MeatSandwich  wrote:
> Sorry for being a bit of a dumb-ass but I'm trying to learn and have
> been looking at this for a couple of days but I'm still not completely
> sure how it works. I'm following an offline tutorial about using
> prefixes.
>
> the tutorial says do this:
> 1 - uncomment the admin routing prefix in core.php
> 2 - add the following to users_controller.php:
>   public function dashboard() {
>   $role = $this->Auth->user('role');
>   if (!empty($role)) {
>   $this->redirect(array($role=>true, 
> 'action'=>'dashboard'));
>   }
>   }
>
>   public function admin_dashboard() {
>   }
>
>   public function manager_dashboard() {
>   }
>
> 3 - create three views for the above
> 4 - in app_controller add the authorize and session components with
> appropriate settings, then add:
>   public function isAuthorized() {
>   $role = $this->Auth->user('role');
>   $neededRole = null;
>   $prefix = !empty($this->params['prefix']) ? $this-
>>params['prefix'] : null;
>   if (!empty($prefix) && in_array($prefix,
> Configure::read('Routing.prefixes'))) {
>   $neededRole = $prefix;
>   }
>   return (empty($neededRole) || strcasecmp($role, 'admin') == 0 ||
> strcasecmp($role, $neededRole) == 0);
>   }
>
> 5 - in the default layout:
>$dashboardUrl = array('controller'=>'users', 'action'=>'dashboard');
>   if (!empty($user['role'])) {
>   $dashboardUrl[$user['role']] = true;
>   }
>   echo $this->Html->link('My Dashboard', $dashboardUrl);
> ?>
>
>
> Now the whole thing works and I can follow most of whats going on, but
> I'm confused with the last line in the isAuthorized method. What
> exactly does return (empty($neededRole) || strcasecmp($role, 'admin')
> == 0 || strcasecmp($role, $neededRole) == 0); actually return?
>
> Also, the above code works fine and when I log in as someone who is an
> admin they can view the admin_dashboard ok, but there after it seems
> any other link has an admin prefix. How do I stop that happening? I
> don't want to have to create an admin_ method for everything including
> the homepage!
>
> thanks in advance - Cake rules!
>
> --
> 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
>


-- 
 - S

+44 (0)7908 069 219

-- 
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


Generate RSS with attributes

2011-04-18 Thread Carachi
Hi,
I need create an RSS with some attribute inside the tags, like this:

http://search.yahoo.com/mrss/";>

Example media RSS playlist for the JW Player
http://www.longtailvideo.com


Big Buck Bunny - FLV Video
http://www.bigbuckbunny.org/
Big Buck Bunny is a short animated film by 
the Blender
Institute, part of the Blender Foundation. Like the foundation's
previous film Elephants Dream, the film is made using free and open
source software.
the Peach Open Movie 
Project
http://www.longtailvideo.com/jw/upload/
bunny.flv" duration="20" />




Big Buck Bunny - MP3 Audio with thumb
http://www.bigbuckbunny.org/
Big Buck Bunny is a short animated film by 
the Blender
Institute, part of the Blender Foundation. Like the foundation's
previous film Elephants Dream, the film is made using free and open
source software.
the Peach Open Movie 
Project






How can I solve my problem??
Thank you

-- 
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: Internal server error on my browser

2011-04-18 Thread varai
Hi,

contents of HTACCESS file in c:\wamp\www

RewriteEngine on
RewriteRule^$webroot/[L]
RewriteRule(.*) webroot/$1[L]
 

contents of HTACCESS file in c:\wamp\www\cakephp

   RewriteEngine on
   RewriteRule^$ app/webroot/[L]
   RewriteRule(.*) app/webroot/$1 [L]


contents of HTACCESS file in c:\wamp\www\merry_flowers

RewriteEngine on
RewriteRule^$webroot/[L]
RewriteRule(.*) webroot/$1[L]
 

contents of httpd.conf
ServerRoot "c:/wamp/bin/apache/apache2.2.11"

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the 
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80

#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a
DSO you
# have to place corresponding `LoadModule' lines at this location so
the
# directives contained in it are actually available _before_ they are
used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule authn_alias_module modules/mod_authn_alias.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
#LoadModule authn_dbd_module modules/mod_authn_dbd.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
#LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule cache_module modules/mod_cache.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule cgi_module modules/mod_cgi.so
#LoadModule charset_lite_module modules/mod_charset_lite.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule dav_lock_module modules/mod_dav_lock.so
#LoadModule dbd_module modules/mod_dbd.so
#LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
#LoadModule disk_cache_module modules/mod_disk_cache.so
#LoadModule dumpio_module modules/mod_dumpio.so
LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule ext_filter_module modules/mod_ext_filter.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule filter_module modules/mod_filter.so
#LoadModule headers_module modules/mod_headers.so
#LoadModule ident_module modules/mod_ident.so
#LoadModule imagemap_module modules/mod_imagemap.so
LoadModule include_module modules/mod_include.so
#LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
#LoadModule ldap_module modules/mod_ldap.so
#LoadModule logio_module modules/mod_logio.so
LoadModule log_config_module modules/mod_log_config.so
#LoadModule log_forensic_module modules/mod_log_forensic.so
#LoadModule mem_cache_module modules/mod_mem_cache.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule negotiation_module modules/mod_negotiation.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule ssl_module modules/mod_ssl.so
#LoadModule status_module modules/mod_status.so
#LoadModule substitute_module modules/mod_substitute.so
#LoadModule unique_id_module modules/mod_unique_id.so
#LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule version_module modules/mod_version.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule php5_module "c:/wamp/bin/php/php5.3.0/php5apache2_2.dll"



#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It

Re: Anyone having issues searching the Bakery?

2011-04-18 Thread chris
Yeah I've noticed issues with the book pages as well, but mainly
seemed to be able to work around them.

The bakery though, just dosn't seem to work at all.

On Apr 18, 2:44 pm, MeatSandwich 
wrote:
> I've noticed things wrong since the new style of the cookbook was
> released. Theres a bunch of pages which require you to scroll right to
> read some sentences as they don't seem to be wrapping properly. 
> EGhttp://book.cakephp.org/view/1152/Core-Validation-Rules
>
> I've tried on a couple of different computers and a few different
> browsers
>
> On Apr 18, 12:35 pm, chris  wrote:
>
> > This seems to have been happening to me for a few weeks now. Go to
>
> >http://bakery.cakephp.org/
>
> > and then perform a search for anything at all, just results in a blank
> > page with URLhttp://bakery.cakephp.org/articles
>
> > But I can view articles that I find via a Google search.

-- 
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: Anyone having issues searching the Bakery?

2011-04-18 Thread MeatSandwich
I've noticed things wrong since the new style of the cookbook was
released. Theres a bunch of pages which require you to scroll right to
read some sentences as they don't seem to be wrapping properly. EG
http://book.cakephp.org/view/1152/Core-Validation-Rules

I've tried on a couple of different computers and a few different
browsers

On Apr 18, 12:35 pm, chris  wrote:
> This seems to have been happening to me for a few weeks now. Go to
>
> http://bakery.cakephp.org/
>
> and then perform a search for anything at all, just results in a blank
> page with URLhttp://bakery.cakephp.org/articles
>
> But I can view articles that I find via a Google search.

-- 
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


Can someone explain this to me in English please

2011-04-18 Thread MeatSandwich
Sorry for being a bit of a dumb-ass but I'm trying to learn and have
been looking at this for a couple of days but I'm still not completely
sure how it works. I'm following an offline tutorial about using
prefixes.

the tutorial says do this:
1 - uncomment the admin routing prefix in core.php
2 - add the following to users_controller.php:
public function dashboard() {
$role = $this->Auth->user('role');
if (!empty($role)) {
$this->redirect(array($role=>true, 
'action'=>'dashboard'));
}
}

public function admin_dashboard() {
}

public function manager_dashboard() {
}

3 - create three views for the above
4 - in app_controller add the authorize and session components with
appropriate settings, then add:
public function isAuthorized() {
$role = $this->Auth->user('role');
$neededRole = null;
$prefix = !empty($this->params['prefix']) ? $this-
>params['prefix'] : null;
if (!empty($prefix) && in_array($prefix,
Configure::read('Routing.prefixes'))) {
$neededRole = $prefix;
}
return (empty($neededRole) || strcasecmp($role, 'admin') == 0 ||
strcasecmp($role, $neededRole) == 0);
}

5 - in the default layout:
'users', 'action'=>'dashboard');
if (!empty($user['role'])) {
$dashboardUrl[$user['role']] = true;
}
echo $this->Html->link('My Dashboard', $dashboardUrl);
?>


Now the whole thing works and I can follow most of whats going on, but
I'm confused with the last line in the isAuthorized method. What
exactly does return (empty($neededRole) || strcasecmp($role, 'admin')
== 0 || strcasecmp($role, $neededRole) == 0); actually return?

Also, the above code works fine and when I log in as someone who is an
admin they can view the admin_dashboard ok, but there after it seems
any other link has an admin prefix. How do I stop that happening? I
don't want to have to create an admin_ method for everything including
the homepage!

thanks in advance - Cake rules!

-- 
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


Anyone having issues searching the Bakery?

2011-04-18 Thread chris
This seems to have been happening to me for a few weeks now. Go to

http://bakery.cakephp.org/

and then perform a search for anything at all, just results in a blank
page with URL http://bakery.cakephp.org/articles

But I can view articles that I find via a Google search.

-- 
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: Anyway to change the default.ctp to another header.ctp ?

2011-04-18 Thread chris
You could use this to change to a different layout file in the
beforeFilter() method of your app_controller.php file

$this->layout = 'loggedin';

and create a loggedin.ctp file in your layouts directory. This file
can then look complety different to default.ctp

I have a few different layouts setup dependant on different user types
I have setup in my application, and switch between them in
beforeFilter.


On Apr 17, 9:36 am, Chuck  wrote:
> thanks!
>
> Chuck
>
> On Apr 17, 4:13 am, "Krissy Masters" 
> wrote:
>
> > You could have an if or switch block in the layout to echo an element
>
> > if($logged_in){
>
> > echo $this->Element('private_header, array());
>
> > //1 element header
>
> > } else {
>
> > //other header element
> > echo $this->Element('public_header, array());
>
> > }
>
> > K
>
> > -Original Message-
> > From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
>
> > Of Chuck
> > Sent: Saturday, April 16, 2011 5:23 PM
> > To: CakePHP
> > Subject: Anyway to change thedefault.ctpto another header.ctp ?
>
> > I know this might sound kinda noob.  As I observed, cakephp uses view/
> > layout/default.ctpas the header and footer.  If I click go to another
> > page, is there anyway I could use another header instead ofdefault.ctp? For 
> > example, say I want to change the header completely
> > after logging in. Anyone point me to the right direction? thanks.
>
> > Chuck.
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
> > 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 
> > athttp://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: Link submission email

2011-04-18 Thread dvvbrook79
Yeah ok sorry about that...heres my "submitlink.ctp" which is the
email i get. I have left the bottom part of the "controller" as i know
this is for admin purposesHOPE YOU CAN HELP,cause ive been looking
and cant seem to find anything wrong, but saying that im still fairly
new to cakeCheers for the assistance.






:



:



:
link($link['Link']['url'], $link['Link']
['url']); ?>


:



:




"HERES MY view"
create('Link', array('action' => 'submit')); ?>

inputs(array (
'legend' => false,
'Link.link_category_id' => array (
'label' => __('Category', true)
),
'Link.title',
'Link.url' => array(
'label' => __('URL', true)
),

'Link.description',
'Link.reciprocallink'

));
?>







show(); ?>

end(__('Submit Link', true)); ?>

"AND HERES MY controller"
 15,
'page' => 1,
'order' => array ('Link.created' => 'ASC'),
'conditions' => array ('Link.approved' => 1)
);

function beforeFilter() {

// Set up authentication
parent::beforeFilter();

// Allow access to public functions
$this->Auth->allowedActions = array(
'index', 'category', 'submit'
);

}

function index() {

// Get community page content
$page = $this->Page->find('first', array('conditions' => array
('slug' => 'links')));
$this->set('page', $page);
$this->set('title_for_layout', $page['Page']['title']);

// Display all categories
$link_categories = $this->LinkCategory->find('all');
$this->set('link_categories', $link_categories);

}

function category($slug) {

// Find Category
$link_category = $this->LinkCategory->findBySlug($slug);
$this->set('link_category', $link_category);

// Find Links in Category
$this->set('links', $this->paginate($this->LinkCategory->Link,
array ('Link.link_category_id' => $link_category['LinkCategory']
['id'])));

// Title
$this->set('title_for_layout', $link_category['LinkCategory']
['title']);

}

function submit() {

// Title
$this->set('title_for_layout', __('Submit Link', true));

// Load category list
$link_categories = $this->Link->LinkCategory->find('list',
array (
'order' => 'LinkCategory.title'
));
$this->set('linkCategories', $link_categories);

// Handle form submission
if (!empty($this->data)) {

// Check CAPTCHA was matched
if (!$this->Recaptcha->validate()) {
$this->Link->validate['captcha'] = array (
'rule' => array('comparison', '=', 0),
'message' => 'You did not enter the CAPTCHA
correctly.'
);
$this->set('captcha_incorrect', true);
}

// Save and redirect to received message
$this->Link->create();
$this->data['Link']['approved'] = 0;
if ($this->Link->save($this->data)) {

// Send email to admin
$this->set('link', $this->Link->findById($this->Link-
>id));
$this->Email->from =
__('DisneyVillaVacations.com', true) . ' <' .
Configure::read('Admin.email') . '>';
$this->Email->to   =
Configure::read('Admin.email');
$this->Email->subject  = __('DisneyVillaVacations.com
- Link Submission', true);
$this->Email->template = 'submit_link';
$this->Email->sendAs   = 'both';
$this->Email->send();

// Redirect back
$this->Session->setFlash('Your link has been
submitted, and is awaiting approval.');
$this->redirect(array('action' => 'index'));

}

}

}

On Apr 17, 8:56 pm, cricket  wrote:
> On Sun, Apr 17, 2011 at 9:17 AM, dvvbrook79
>
>  wrote:
> > Hi
>
> > I have alinksubmissionpage, and have just added a reciprocallink
> > field...which worked fine, however i cant get to draw this information
> > out of the "field" into theemailthat is sent to me when i have a
> >linksubmittedit ends up like this..
>
> > URL:http://www.example.com
> > Title: example
> > Description: Example example.etc
> > ReciprocalLink: "blank" (this is the info im trying to get from the
> > new field)
>
> > Can anyone point me in the right direction.
>
> There's no way anyone could spot the problem without seeing theemail
> template as well as the controller code to see what variables you're
> setting for the view (and how you're setting them).

-- 
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 hel