Re: Update table without a form

2010-09-24 Thread cricket
On Fri, Sep 24, 2010 at 10:19 AM, KrogerLawOffices wrote: > I am building an app the keeps track of football games. Thought it > would be a good project to help me learn cakePHP. > > My "schedules" table has fields for hometeam, awayteam, homescore, > awayscore, and gamewinner. I created a model a

Re: Auth->allow component umpredictable

2010-09-24 Thread Mariano C.
Thank you :) On 24 Set, 23:54, nurvzy wrote: > Indeed, Miles J is correct. > > On Sep 24, 1:21 pm, Miles J wrote: > > > I'm not sure thats how Auth works, it only accepts actions: > > > // In books controller > > $this->Auth->allow('index'); > > > // In users controller > > $this->Auth->allow('c

Re: HABTM retrieve data

2010-09-24 Thread Tilen Majerle
emm...u mean to display for input select type? if it is so...then do this: {{{ $result = $this->Subscriber->Distributer->find("list"); $this->set(compact('result')); }}} //and then in view {{{ print $form->input("Distributer"); //will create a multiple select :D }}} -- Tilen Majerle http:

HABTM retrieve data

2010-09-24 Thread Avinash
I have two models subscribers and distribution list, the relation between them is HABTM, now some subscribers are associated with the distribution list. I'm giving an option of adding more subscribers to a distribution list, now i want to display list of subscribers which are not associated to that

Re: tree structure problem

2010-09-24 Thread marvelade
Good news and bad news: I presumably found a way: prepare("SELECT id,keyword FROM keywords WHERE parent_id='" . $parent . "' AND approved = 1"); $stmt -> execute(); while ($row = $stmt -> fetch(PDO::FETCH_ASSOC)) { $right = rebuild_tree($row['id'],

Re: Auth->allow component umpredictable

2010-09-24 Thread nurvzy
Indeed, Miles J is correct. On Sep 24, 1:21 pm, Miles J wrote: > I'm not sure thats how Auth works, it only accepts actions: > > // In books controller > $this->Auth->allow('index'); > > // In users controller > $this->Auth->allow('collection', 'register'); > > On Sep 24, 11:32 am, "Mariano C."

Re: tree structure problem

2010-09-24 Thread marvelade
the more I get to know PHP, the more I need to write recursive functions... :) I'll try to come up with something and post my findings. grtz, Marv On Sep 24, 7:45 pm, cricket wrote: > On Fri, Sep 24, 2010 at 11:49 AM, marvelade wrote: > > > I suppose I need to add 'lft' and 'rght' fields to

Re: Problem with internal Database interaction at getting Classinfo

2010-09-24 Thread Senpu
Thank you all for the good replys, i could solve it by test and fail :D In the VillageModel was a condition, which was wrong baked so it couldn't work. *Thumbup* On Sep 24, 8:10 pm, cricket wrote: > On Fri, Sep 24, 2010 at 10:18 AM, Senpu wrote: > > The problem is, i do not execute the query o

Re: Helper in appcontroller making error for form

2010-09-24 Thread Miles J
Is Form in the $helpers array? On Sep 24, 11:58 am, Kyle wrote: > I made my own helper to check if a user is logged in. > > When I add the helper to the appcontroller rather than to each > individual controller it throws back: > > Notice (8): Undefined property: View::$Form [APP\views\users > \lo

Re: $this->params['named'] is empty

2010-09-24 Thread Miles J
Because you are not passing them as named params, you are passing them as method arguments. public function view($category) { } On Sep 24, 7:17 am, Sarpidon wrote: > Hi. I am not sure what I am doing wrong but even though I am using > named params $this->params['named'] always shows up as empty.

Re: Access shell function from controller

2010-09-24 Thread Avinash
Thanks, figured it out ! Avinash On Sep 22, 2:19 am, cricket wrote: > On Tue, Sep 21, 2010 at 11:16 AM, Avinash wrote: > > How can i access shell from controller. > > Actually here's what i'm trying do to. I have to send sms as per the > > scheduler, for that i have set cron job which will invo

Please suggest how to Sort by related/Child Model field..

2010-09-24 Thread Karam
I would be thankful if you can please help me. I have a complex problem here which need to fix. It's about the following situation: I have a model "Artist" that has a relation to some models like songs, lessons, lessonsParts. I want to paginate the Artist-Model and sort the relationship by 'Lesson

Helper in appcontroller making error for form

2010-09-24 Thread Kyle
I made my own helper to check if a user is logged in. When I add the helper to the appcontroller rather than to each individual controller it throws back: Notice (8): Undefined property: View::$Form [APP\views\users \login.ctp, line 3] Fatal error: Call to a member function create() on a non-obje

Update table without a form

2010-09-24 Thread KrogerLawOffices
I am building an app the keeps track of football games. Thought it would be a good project to help me learn cakePHP. My "schedules" table has fields for hometeam, awayteam, homescore, awayscore, and gamewinner. I created a model and controller based on this table that can be called to update the g

$this->params['named'] is empty

2010-09-24 Thread Sarpidon
Hi. I am not sure what I am doing wrong but even though I am using named params $this->params['named'] always shows up as empty. Routes Router::connect('/news/:category', array('controller' => 'categories', 'action' => 'view'), array('pass' => array('category'))); View echo $html->link($link['nam

Re: Public Opinion Needed

2010-09-24 Thread calzone
use a url shortening service and store all the favorites as shortened urls in a cookie array :P On Sep 24, 7:05 am, Andrei Mita wrote: > If you decide not to use session, query cache will help a lot. Checking on > demand if a give post is saved as a favorite instead of pulling all > favorites is

Re: acl and admin routing?

2010-09-24 Thread calzone
I don't think people are getting what I'm asking. Either that or I'm not understanding the answers. How do I set ACL permissions based on the presence of a particular string at the beginning of the url (for example /admin/*) or of the action name (admin_*)? I only see examples of ACL being used

Re: Auth->allow component umpredictable

2010-09-24 Thread Miles J
I'm not sure thats how Auth works, it only accepts actions: // In books controller $this->Auth->allow('index'); // In users controller $this->Auth->allow('collection', 'register'); On Sep 24, 11:32 am, "Mariano C." wrote: > Hi, this is my app_controller > > class AppController extends Controlle

Auth->allow component umpredictable

2010-09-24 Thread Mariano C.
Hi, this is my app_controller class AppController extends Controller { var $components = array('DebugKit.Toolbar', 'Auth', 'Session', 'Facebook.Connect'); var $helpers = array('Facebook.Facebook'); function beforeFilter() { $this->Auth->allow(array(

Re: Strange behavior on shared hosting

2010-09-24 Thread euromark
yeah you shouldnot use Tag.id inside containable! just call it id etc On 24 Sep., 20:06, cricket wrote: > On Thu, Sep 23, 2010 at 7:49 PM, Thomas wrote: > > Hi, > > I have a Cake application that's running perfectly on my local > > machines - Windows7 and Os/X (both have XAMPP 1.7.1 with PHP 5.

Re: Problem with internal Database interaction at getting Classinfo

2010-09-24 Thread cricket
On Fri, Sep 24, 2010 at 10:18 AM, Senpu wrote: > The problem is, i do not execute the query on will.. > > There is a database-class-relation between the two Controllers > "BuildingController" and "VillageController" > > Each Building got a villages_id in database. So Cake does auto- > magically co

Re: Strange behavior on shared hosting

2010-09-24 Thread cricket
On Thu, Sep 23, 2010 at 7:49 PM, Thomas wrote: > Hi, > I have a Cake application that's running perfectly on my local > machines - Windows7 and Os/X (both have XAMPP 1.7.1 with PHP 5.2.9). > I tried to deploy it on a shared hosting environment (PHP 5.2.14) and > it is mostly ok.. However, I get tw

Re: Big problems trying to use "medium" as a model name

2010-09-24 Thread cricket
On Fri, Sep 24, 2010 at 5:52 AM, psybear83 wrote: > Hi everybody > > I have upgraded a CakePHP application from 1.2.0.x to 1.3, and > everything works quite fine now, except one thing. > > I have a "Medium" model (which will hold data of books, DVD's, > newspapers etc.), which has a HABTM relation

Re: tree structure problem

2010-09-24 Thread cricket
On Fri, Sep 24, 2010 at 11:49 AM, marvelade wrote: > > > I suppose I need to add 'lft' and 'rght' fields to my database but how > do I calculate these values? I never heard of MPTT before and I think > I understand the basics after reading an article about it (http:// > articles.sitepoint.com/arti

Re: How to execute bash(.sh) files in cake php

2010-09-24 Thread cricket
On Fri, Sep 24, 2010 at 8:25 AM, euromark wrote: > thx > personally, i think this is still more secure than letting a user > upload stuff outside his jailed home folder > > i just need a way to delete uploaded zip files after they have been > successfully imported from cake > your approach would m

Re: Error on website

2010-09-24 Thread j.blotus
should create a ticket On Sep 23, 10:21 pm, Mike wrote: > Under Learn - > "CakePHP cheatsheet" the PDF isn't there: > > Not Found > > Error: The requested address '/files/Resources/CakePHP-1.2- > Cheatsheet.pdf' was not found on this server. > > Cheers. Check out the new CakePHP Questions site h

Re: Problem with internal Database interaction at getting Classinfo

2010-09-24 Thread Andrei Mita
Something has to trigger the query. A find or read. Please post your code. On Fri, Sep 24, 2010 at 5:18 PM, Senpu wrote: > The problem is, i do not execute the query on will.. > > There is a database-class-relation between the two Controllers > "BuildingController" and "VillageController" > > Ea

Re: tree structure problem

2010-09-24 Thread marvelade
I suppose I need to add 'lft' and 'rght' fields to my database but how do I calculate these values? I never heard of MPTT before and I think I understand the basics after reading an article about it (http:// articles.sitepoint.com/article/hierarchical-data-database/2), but I can't really think of

Re: acl and admin routing?

2010-09-24 Thread BrendonKoz
If you want something like a SUPER ADMIN level and a standard admin level, then you'd want to create a master ACO. The book sort of shows this in the introduction of ACL, but not in the actual code examples. For instance, an example tree: Site - Admin - - Controller 1 Admin - - Controller 2 Admin

Re: Problem with internal Database interaction at getting Classinfo

2010-09-24 Thread Senpu
The problem is, i do not execute the query on will.. There is a database-class-relation between the two Controllers "BuildingController" and "VillageController" Each Building got a villages_id in database. So Cake does auto- magically connect the two controllers with each other. When i now go to

Re: Public Opinion Needed

2010-09-24 Thread Andrei Mita
If you decide not to use session, query cache will help a lot. Checking on demand if a give post is saved as a favorite instead of pulling all favorites is another option. On Fri, Sep 24, 2010 at 4:25 PM, Dave Maharaj wrote: > Yes from the database…sorry > > > > They are all saved / pulled from

RE: Public Opinion Needed

2010-09-24 Thread Dave Maharaj
Yes from the database.sorry They are all saved / pulled from db. From: Andrei Mita [mailto:andrei.m...@gmail.com] Sent: September-24-10 4:11 AM To: cake-php@googlegroups.com Subject: Re: Public Opinion Needed Where do you get the favorite posts from? Do you have them in a db? On Fri,

RE: Public Opinion Needed

2010-09-24 Thread Dave Maharaj
They are in a table...hence the " At login I get all the saved Posts id's and save then to the users session," Easier to read the session data to see if it’s a saved posts rather then hit the db on every page view for view user to check if it’s a saved post -Original Message- From: j

Re: Good Photo Carousels for CakePHP?

2010-09-24 Thread WhyNotSmile
Thank you, that looks good! I hadn't come across it while I was searching either, so thanks for the pointer! Sharon On Sep 24, 11:30 am, Tonu Tusk wrote: > galleria sitting on jquery has worked for me. > > http://galleria.aino.se/ > > On Sep 23, 4:14 pm, WhyNotSmile wrote: > > > Hi everyone,

Re: Execute Linux commands from controller

2010-09-24 Thread Andrei Mita
And also try with passthru. On Fri, Sep 24, 2010 at 2:53 PM, euromark wrote: > yours is probably related to > > http://groups.google.com/group/cake-php/browse_thread/thread/c8665b6c098e2059 > > not having the "right" to execute this as apache script (having group > www-data) > > > On 24 Sep., 13:

Re: Problem with internal Database interaction at getting Classinfo

2010-09-24 Thread Andrei Mita
How do you execute the query? On Thu, Sep 23, 2010 at 10:44 PM, Senpu wrote: > I'm sorry to explain it like this, but i can't describe it better, its > strange > > I get this Error-message at index-action: > > Warning (512): SQL Error: 1054: Unknown column 'buildings.village_id' > in 'where clau

Re: app_helper file is not working

2010-09-24 Thread Tilen Majerle
that will be for sure, that is on wrong place...put it in app\app_helper and make class: {{{ class AppHelper extends Helper { //some methods, if u use __construct method, make sure that you call parent::__construct() too } }}} -- Tilen Majerle http://majerle.eu 2010/9/24 S Silva > Maybe

Re: app_helper file is not working

2010-09-24 Thread S Silva
Maybe app_helper is in the wrong place? 2010/9/24 dhiraj ray > hi > > i'm trying to make function isactive in root in file app_helper > > i call this function in header > > $html->isactive(); > > sow error function not decleare > > plese help > > thanks in advance. > > Check out the new CakePHP

app_helper file is not working

2010-09-24 Thread dhiraj ray
hi i'm trying to make function isactive in root in file app_helper i call this function in header $html->isactive(); sow error function not decleare plese help thanks in advance. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

Re: How to execute bash(.sh) files in cake php

2010-09-24 Thread euromark
thx personally, i think this is still more secure than letting a user upload stuff outside his jailed home folder i just need a way to delete uploaded zip files after they have been successfully imported from cake your approach would mean i would have to hard code the location of the file. but sho

Re: Opening a preview window from Page Edit

2010-09-24 Thread euromark
i was thinking: http://www.queness.com/resources/html/modal/jquery-modal-window.html the model windows let ajax get the rendered view and open this modal window with the new content this way you have a preview without annoying new windows popping up (every browser handles this differently). just a

Re: Opening a preview window from Page Edit

2010-09-24 Thread Urs
Is this u r looking for? create('Foo', array('target' => '_blank', 'action' => 'edit'));?> end('Submit')?> Regards, Arjun On Sep 23, 6:59 pm, WhyNotSmile wrote: > Thanks Euromark.  Could you point me to an example of what you mean > and how it works? > > I can get the information to appear in a

Re: Execute Linux commands from controller

2010-09-24 Thread euromark
yours is probably related to http://groups.google.com/group/cake-php/browse_thread/thread/c8665b6c098e2059 not having the "right" to execute this as apache script (having group www-data) On 24 Sep., 13:44, Urs wrote: > I am trying to execute the script scriptos.sh : > > #!/bin/bash > ssh t...@1

Re: How to execute bash(.sh) files in cake php

2010-09-24 Thread Guru
Thank u for ur reply cricket. On Sep 23, 4:19 pm, Guru wrote: > Hi, > >  How can we execute bash(.sh) files from controller? > >  Example : I have a file abc.sh. Whose contents are >      #!/bin/bash >      # declare STRING variable >      STRING="Hello World" >      #print variable on a screen >

Error on website

2010-09-24 Thread Mike
Under Learn - > "CakePHP cheatsheet" the PDF isn't there: Not Found Error: The requested address '/files/Resources/CakePHP-1.2- Cheatsheet.pdf' was not found on this server. Cheers. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related question

Strange behavior on shared hosting

2010-09-24 Thread Thomas
Hi, I have a Cake application that's running perfectly on my local machines - Windows7 and Os/X (both have XAMPP 1.7.1 with PHP 5.2.9). I tried to deploy it on a shared hosting environment (PHP 5.2.14) and it is mostly ok.. However, I get two failures that I can't resolve and would really appreciat

Problem with internal Database interaction at getting Classinfo

2010-09-24 Thread Senpu
I'm sorry to explain it like this, but i can't describe it better, its strange I get this Error-message at index-action: Warning (512): SQL Error: 1054: Unknown column 'buildings.village_id' in 'where clause' [CORE\cake\libs\model\datasources\dbo_source.php, line 681] correspondending query: Que

Re: Execute Linux commands from controller

2010-09-24 Thread Urs
I am trying to execute the script scriptos.sh : #!/bin/bash ssh t...@192.168.1.30 "cat /proc/version | sed 's/ //g' | cut -d'(' - f4 | cut -c1-6" > osdetails cat osdetails Here, I m finding the type of OS and echoing it.. I m calling the script by : exec('../shellscripts/scriptos.sh', $os); If

Address in email header

2010-09-24 Thread FandaR
I am using CakePHP framework, so I set this variables: $this->Email->from = Configure::read('Site.noreplyemail'); $this->Email->return = Configure::read('Site.noreplyemail'); $this->Email- >replyTo=Configure::read('Site.noreplyemail'); where Configure::r

Re: Good Photo Carousels for CakePHP?

2010-09-24 Thread Tonu Tusk
galleria sitting on jquery has worked for me. http://galleria.aino.se/ On Sep 23, 4:14 pm, WhyNotSmile wrote: > Hi everyone, any chance someone can give me some pointers on creating > a photo carousel in cakePHP? > > Basically I would like it to have a big image at the top, and then > thumbnails

Big problems trying to use "medium" as a model name

2010-09-24 Thread psybear83
Hi everybody I have upgraded a CakePHP application from 1.2.0.x to 1.3, and everything works quite fine now, except one thing. I have a "Medium" model (which will hold data of books, DVD's, newspapers etc.), which has a HABTM relationship to an "Author" model. In version 1.2. this was no problem,