(This is more of an overall programming / PHP question than Cake ..
but it will ultimately be built in Cake, and this community kicks ass
so I figured I would throw it out there)
Hello everyone. Here is the challenge I am working on:
I want to build a system that would allow you to control the re
Perfect, thank you.
On Aug 10, 9:32 am, brian wrote:
> Try the Set
> class.http://book.cakephp.org/view/640/Sethttp://blogs.bigfish.tv/adam/2008/03/24/sorting-with-setsort-in-cakep...
>
>
>
> On Mon, Aug 10, 2009 at 9:46 AM, John R wrote:
>
> > I have an arra
I have an array that I need to sort by an associative key. PHP's usort
() function is what I need, however it won't work inside a controller.
Example:
function cmp($a, $b)
{
return strcmp($a["fruit"], $b["fruit"]);
}
$fruits[0]["fruit"] = "lemons";
$fruits[1]["fruit"] = "apples";
$fruits[2]
I think there is a way to do this, but it is escaping me ..
I have two tables: entries and votes
Users vote on entry, which are stored inside table "votes" like:
id entry_idip
1 2 129.192.12.4
2 1 129.192.12.4
3 2
Isn't this what deleteAll() is for?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-p
Hey folks .. OP here ..
Curious if anyone has any insight on this problem that is still
plaguing my app! Any assistance would be MUCH appreciated.
John
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group
by a
> link, check the link) and Apache is try to find a default page for
> error 500.
> Does this happen only for 1 controller or you have other controllers
> correctly working ?
>
> On May 12, 7:12 pm, "Jonathan Snook" <[EMAIL PROTECTED]> wrote:
>
> > On
My app is throwing up a server 500 error and I can't figure out why/
where. The page isn't helpful either, only showing this:
Missing Method in ContestsController
Error: The action 500.shtml is not defined in controller
ContestsController
Error: Create ContestsController::500.shtml() in file:
t; 'TABLE_ALIAS.modified DESC',
> 'limit' => 15
>
> If you can get past the 500 errors, post the SQL that Cake is creating.
>
> On Sun, Apr 20, 2008 at 10:55 AM, b logica <[EMAIL PROTECTED]> wrote:
> > What does the server
k.
> I think you need to back up a few steps.
>
> On Mon, Apr 21, 2008 at 10:19 AM, John R <[EMAIL PROTECTED]> wrote:
>
> > Here is the query:
>
> > SELECT *, MAX(`Photo`.`revision_id`) as revision_id FROM `photos` AS
> > `Photo` LEFT JOIN `users` AS `User` ON
Here is the query:
SELECT *, MAX(`Photo`.`revision_id`) as revision_id FROM `photos` AS
`Photo` LEFT JOIN `users` AS `User` ON (`Photo`.`user_id` =
`User`.`id`) WHERE `Photo`.`contest_id` = 1 AND 1=1 GROUP BY
`Photo`.`user_id` LIMIT 12
Basically, it is grabbing all records like it is supposed to
Ha ... I lied :) I thought it was working perfectly, and it's very
close, but here is what is happening:
Here is the statement: http://bin.cakephp.org/view/251108990
What it does is successfully returns the proper amount of images.
However, it screws up the grouping. Here is a sample output:
Haha .. tried something I thought had no chance of working, and of
course it works perfectly:
'fields' => array( '*', 'MAX(Photo.revision_id) as revision_id')
Hope it helps your struggle too! Thanks for your help!
--~--~-~--~~~---~--~~
You received this message be
' => 'TABLE_ALIAS.modified DESC',
> 'limit' => 15
>
> If you can get past the 500 errors, post the SQL that Cake is creating.
>
> On Sun, Apr 20, 2008 at 10:55 AM, b logica <[EMAIL PROTECTED]> wrote:
> > What does the server log say
I have an "activity list" and am saving the creation datetime in the
database.
In my view, I want to be able to say "5 minutes ago", "2 hours ago"
for the time submitted instead of the complete datetime. I wrote the
function that takes the datetime, converts it to a timestamp and then
performs th
a) You're doing $this->data , right?
b) Is the form action going to the right place?
On Apr 19, 7:31 pm, Matias Veleda <[EMAIL PROTECTED]> wrote:
> Hey guys,
>
> I'm new to CakePHP. I followed the instructions in the manual, the
> example case and everytime I want to update my databaser from a
t;[EMAIL PROTECTED]> wrote:
> Try something like this:
>
> $criteria = array(
> 'fields' => array(
> 'TABLE_ALIAS.user_id', 'MAX(TABLE_ALIAS.revision_id)'
> ),
> 'conditions' => array(
>
you have many users
> > you could easily have more than 15 records where the greatest
> > revision_id's are equal, and they won't be useful for showing only the
> > most recent revisions.)
>
> > On Apr 18, 4:10 pm, John R <[EMAIL PROTECTED]> wrote:
>
How do you all set the current user per controller?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send
In this app, users can upload photos, and then revise them.
The app stores a log of all revisions so they can easily go back to
them.
The database has: user_id and revision_id
I am trying to write a statement that grabs only the 15 latest
(highest #) revisions for all users.
So .. if the table
When a user is at http://roar.domain.com and clicks on say, upload
photo (that requires login) http://roar.domain.com/upload, it takes
them to http://www.domain.com, just like a good little app.
However, after a successful login, it takes them to http://www.domain.com/upload
Any idea how I can t
You win!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more option
PS: Anyone else think Google should have a better way to paste code?
Here is the external paste so you can actually read the model:
http://bin.cakephp.org/view/2092329615
On Apr 14, 9:58 am, John R <[EMAIL PROTECTED]> wrote:
> I have a HABTM relationship that is working, excep
I have a HABTM relationship that is working, except it only returns
the first result. Here is the entry in my User model:
var $hasAndBelongsToMany = array(
'Contests' =>
array('className'
=> 'Contest',
'joinTable'
I have a pretty basic form that looks like this:
create(); ?>
checkbox('contest.agree'); ?> I have read & agreed to the
contest rules
end('Join This Contest!'); ?>
This is in the 'contests' controller.
When the form is submitted however, I get this:
Array
(
[Users] => Array
(
Hint: input('password'); ?>
On Apr 9, 2:16 pm, Baz <[EMAIL PROTECTED]> wrote:
> Because there are so many bits and pieces associated with Auth, it's hard to
> diagnose your problem without ALL your code. However, let's try the reverse.
> Look at these:
>
> http://book.cakephp.org/view/172/authent
Just curious ..
The only features I really use in an editor are code highlighting and
FTP ... all of the crazy PHP IDEs are incredibly bloated for me. What
do you all use?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Grou
Is there an easy way with Cake to get /js/register.js to be
automatically included in register.ctp? (And conversely not included
if it doesn't exist?)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
The next step of my uber fun app is getting Amazon s3 to play nice
with CakePHP. Sure, I can add the class to Vendors and do everything
manually - but what is the cooler way? Are there any components/
helpers built to orchestrate this?
--~--~-~--~~~---~--~~
You rece
rentStage();
> if ($this->action != $currentStage){
> $this->setAction($currentStage);
> }
>
> }
>
> function submit() {
>
> }
>
> function vote() {
>
> }
>
> Hope that helps.
>
> Cheers,
> Adam
>
> On Apr 4, 5:15
That was it! The 'else' worked like a charm. Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, sen
Nope..
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options,
I've been desperately trying to figure out a good method to use
dynamic subdomains and I am so close!
Here is what I have going on:
1) My app_controller checks the subdomain against the database and
makes sure it's valid. If not, it redirect - works great!
2) I put the following hack inside rou
Careful to not be too specific :)
I don't see how a model behavior would help me here ...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.c
Note: The ugly/obvious way to do this would be to put a switch inside
every function in contests_controller that checks the stage and then
either redirects if it's not that stage or w/e. I am hoping for a more
glamorous option! :)
On Apr 3, 2:15 pm, John R <[EMAIL PROTECTED]>
My application is a series of "contests" with different stages
(submission, voting, awards, etc.)
For each stage, the site is going to function completely differently.
During Stage 1 (submission) for instance, you will be able to upload,
critique, etc. The front page will be a huge list of all su
So strange .. when I hit login FROM the subdomain, this is my
$_SESSION:
Array ( [Config] => Array ( [userAgent] => XXX [time] =>
1207229748 [rand] => X [timeout] => 10 ) [Auth] => Array
( [redirect] => http://sample.domain.com/contest ) )
The [redirect] is fine ..
When I do a successfu
Nope ... I am using routing and baseURL is commented out.
Any other ideas here?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsu
I have an application that uses virtual subdomains to point to a
controller.
If you are in http://sample.domain.com and click Login, it takes you
to http://www.domain.com/login like it is supposed to. However, when
you login, it redirects to:
http://www.domain.com/http:/sample.domain.com/
Isn't
Adding on to that ...
Say you have a user hasMany comments setup.
There are parameters for order, limit, etc.
Say you want the latest 5 comments on one page, but you want 100 on
the next page. If you only have one hasMany, how do you do this?
Me thinks I'm missing something here
--~--~
Say you set a User model up via hasMany to photos, comments, threads,
etc.
Does this mean every single time you do a User->read or find that it
is going to potentially return thousands and thousands of results? Is
there a way to only return the comments on say pages you want
comments??
--~--~
pr = print_r (a PHP function)
Putin your view to see what the array looks like
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To u
I have an application that features a number of "contests". The root
of the site houses all of the core site functionality (domain.com/
login, domain.com/register).
Originally, I wanted to use dynamic subdomains to handle the
contests ..
so http://contestname.domain.com would open that contests
Along with the disclaimer that this might not be a GREAT way to do
this method, I present my first CakePHP tutorial: Reset Password
http://www.johnroa.net/2008/03/27/cakephp-tutorial-reset-password-cake-12xxx/
Enjoy!
--~--~-~--~~~---~--~~
You received this message
I am trying to setup something similar (but not identical) to Digg Spy
(http://www.digg.com/spy).
Basically, I want a "latest activity" on my front page, and then call
some sort of function to load new events in real time from various
controllers to this div. From the Spy tutorials I have seen, t
So .. according to the API, you can send params with setFlash() to be
used in the view. That is fine and dandy .. however, is it possible to
use those params to set the class of the div? The only parameter
flash() allows is the key.
What I am trying to do is pass a parameter called "class" so I c
Maybe I am crazy, but I use a totally different kind of routing. In
your case:
Router::connect('/*', array('controller' => 'pages', 'action' =>
'showLog'));
and then set the variable in the function:
function showLog($id)
{
//do something with $id
}
Obviously this works better when
Yeah, I realized I was thinking about this illogically and can't do
what I was thinking. Thanks anywho! :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-ph
I couldn't be more confused by the last two posts ... =[
jonknee:
That seems like an option to re-create flash(). So you would set a
variable, the page reloads, and it shows the message. What I am trying
to do is trigger a popup window without the page reloading.
Siegfried:
With your script,
Ok .. I understand you can call it from the view .. but if you look 4
posts above, my goal is to call it inside a controller, like you would
a flash():
function checkValid($whatever)
{
if (validation logic)
$this->modal('Success!', 'This is valid!', '/valid');
else
Excuse me if this is a simple question .. but assuming that is a
Javascript function .. how would I call it from the Controller?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group,
You can also easily modify the flash() function and add an additional
parameter for which layout to render.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-p
I am gathering I might need some sort of Ajax listener loaded on each
page and activate it via the Controller? Help! =[
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send ema
(Sorry if my other post shows up too)
What major Web 2.0 sites use CakePHP?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubsc
Are there any major Web 2.0 sites using Cake? It seems to me most use
proprietary or something like Smarty+.
Some insight would be very helpful!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To p
55 matches
Mail list logo