Naming Conventions

2011-05-27 Thread Marcus Silva
Hey folks, Coding an application and got stuck with some naming conventions issue. The app that I am building will have one Package, packages has many prices. I am not entirely sure how the tables should be name. Should they be named: packages (model = Package) and the packages price table

Re: Pagination Limits

2011-05-27 Thread Marcus Silva
This is how you can do it: $this-paginate['Account']['limit'] = 3; $this-paginate['Account']['order'] = 'RAND()'; $this-paginate['Account']['conditions'] = array(); $this-set('accounts',$this-paginate('Account')); Replace Account with the model name. Thats how you do it in the controller. If

Re: Naming Conventions

2011-05-27 Thread Marcus Silva
Thanks brother... On May 27, 10:51 am, Kunal P kp2...@gmail.com wrote: packages_prices wont work, because Cake will consider it as many to many link table, will look for packages prices tables differently. So you need to use *package_prices * * * TIPs : If you are not sure how cake would

Saving data in Behavior

2009-12-14 Thread Marcus Silva
Hello folks, Just writing a model Behavior and got stuck onto something Is there a way to save multiple records using the beforeSave method in the Behavior??? I got the following code, but for some reason it fails or the data is erased etc... foreach($files as $i = $file){

New cakephp site - feedback pls!

2009-05-19 Thread Marcus Silva
Hi folks, Been a while since i last posted in the group, but I have just put one of my websites online which was developed using cake... Would you please take a look and let me know what you guys think... Its only a simple one but any feedback would be greatly appreaciated. Brazilian

Record permission handling solution!!!!

2009-03-09 Thread Marcus Silva
I am looking for an easy way to manage user added record to the db. I thought that I could use the following idea: Create a tabled with the following fields: id,record_id,user_id and record_model. Basically the idea is to add/delete a entry into that table like so: id =

Re: Any one looking for a freelance work

2009-01-25 Thread Marcus Silva
I am interested, Please send me more information in a private message. Regards Marcus Silva On Jan 25, 8:55 am, Novice Programmer novice.prog...@gmail.com wrote: Hello, Please get in touch with me if you are looking for a freelance work. I have a site based on cakephp and want to add

Mobile billing component

2009-01-11 Thread Marcus Silva
Hello everyone, I need to write something to collect payment for a website via mobile phones. I was just wondering if any of you knew of any good companies and also if there is a component to do the job already out there. Any help helps many thanks in advance Marcus Silva

Cakephp interactive home page tutorial...

2008-12-18 Thread Marcus Silva
Hi folks, while many of you may find this question completely irrelevant, i still would like to ask it and any help would be kindly appreciated. Does anyone know a good tutorial that I could use to create something similar to the Cakephp home page sliding content effects? I do know that Cake

Re: Cakephp interactive home page tutorial...

2008-12-18 Thread Marcus Silva
Hi Kyle, That's exactly what I was looking for. thank you Kyle Decot wrote: I think what your referring to is know is the Coda Slider Effect. There's a really good tutorial of how to do this at: http://jqueryfordesigners.com/coda-slider-effect/ Marcus Silva wrote: Hi folks

jQuery helper....

2008-12-08 Thread Marcus Silva
Does anyone know if anyone has written a jQuery helper? Really need one to add similar features found here: http://ui.jquery.com/demos to a site. Any hints/help will be greatly appreciated. Many thanks in advance. --~--~-~--~~~---~--~~ You received this

Re: jQuery helper....

2008-12-08 Thread Marcus Silva
Hey Gonzalo, Thanks for the help. On Dec 8, 1:10 pm, Gonzalo Servat [EMAIL PROTECTED] wrote: On Mon, Dec 8, 2008 at 10:47 AM, Marcus Silva [EMAIL PROTECTED]wrote: Does anyone know if anyone has written a jQuery helper? Really need one to add similar features found here: http

Re: CakePHP Revision 7896: HABTM Issue (deleting one relation deletes other relations)

2008-11-28 Thread Marcus Silva
Had exactly the same problem :http://groups.google.com/group/cake-php/ browse_thread/thread/64516dd7a1b63d0c/f350fa78c7cfc772? hl=enlnk=gstq=an+easy+way+to+add+roles#f350fa78c7cfc772 nobody has replied to my post. Very sad It must be a bug for sure, I ended up writting my on function to add

Problem with HABTM relationship...

2008-11-28 Thread Marcus Silva
Hello, This is my problem: I have a user model which is linked to a role model via a HABTM association. When a new record is added all the associations are added correctly, the problem is when I delete a record, the associated records are not deleted as expected. Cake also showed the

Re: HABTM pagination

2008-11-27 Thread Marcus Silva
Hi Rafael, I think what you really need is to use paginate in the following way in conjunction with custom conditions: $conditions = array(); //Add your conditions here $this-paginate['Model']['conditions'] = $conditions; //now set the data $this-set( 'data', $this-paginate('Model') );

An easy way to add roles to users....

2008-11-27 Thread Marcus Silva
Hi folks, I am posting this in the hope that some of you may be able to help. I have a User model which has a HABTM association to Role and vice versa. I would like to add role to a user in the following way: Tables: users: fields..., HABTM Role roles: id,name-- HABTM

Re: HABTM pagination

2008-11-27 Thread Marcus Silva
Rafael just answered your question!!! On Nov 27, 1:59 pm, grigri [EMAIL PROTECTED] wrote: @Markus and Rafael What's wrong with just going like this? $this-set('data', $this-paginate('Model', $conditions)); Works fine for me hth grigri On Nov 27, 12:41 pm, Marcus Silva [EMAIL

A new cakesite...

2008-11-25 Thread Marcus Silva
Hi guys, I am planning on building (maybe) a site for us cakephp users. I would like to know weather it would be a good idea to build such a site and what type of feature you would suggest. The question I ask is this, would you use such a site and what would like to see in it? Any comment

Re: A new cakesite...

2008-11-25 Thread Marcus Silva
A forum would be quite good, but I want something better than a forum. Any more suggestions bakers On Nov 25, 1:24 pm, BeroFX [EMAIL PROTECTED] wrote: A forum, Cake needs a decent forum (www.cakephpforum.netis offline 90% of the time), a knowledge base with snippets and articles..

Re: A new cakesite...

2008-11-25 Thread Marcus Silva
that is sorely missing from one of those resources, we can add it in. -Mark On Nov 25, 8:19 am, Marcus Silva [EMAIL PROTECTED] wrote: Hi guys, I am planning on building (maybe) a site for us cakephp users. I would like to know weather it would be a good idea to build such a site and what

Re: A new cakesite...

2008-11-25 Thread Marcus Silva
on enhancing and enriching the already existing resources. And if there is a feature that is sorely missing from one of those resources, we can add it in. -Mark On Nov 25, 8:19 am, Marcus Silva [EMAIL PROTECTED] wrote: Hi guys, I am planning on building (maybe) a site for us cakephp

Re: Manage App's CSS/Scripts

2008-11-18 Thread Marcus Silva
Most of the solutions provide are very ugly and messy as well. What you really want is to add and remove css/js files as and when you want and display them when you want too. To do that you need this: In the app_controller.php declare a var to hold all the js and scc files like so: var

Re: acess url only from email

2008-11-12 Thread Marcus Silva
the referrer as the provider (gmail, yahoo) but client based applications (thunderbird or outlook) will have a blank referrer. -EW On Nov 11, 4:16 pm, Marcus Silva [EMAIL PROTECTED] wrote: Hi, I am not sure if I got your question right, but if I did you might be ok doing the following

Re: acess url only from email

2008-11-11 Thread Marcus Silva
Hi, I am not sure if I got your question right, but if I did you might be ok doing the following: Create an email hash key like Jon Bennett suggested, when the user comes back to your site take make the user go to a url on your site where you can check the hashed value, then send the user to

Re: Dilemma over choosing right model table structure

2008-11-08 Thread Marcus Silva
more than one image associated, then just use a habtm association and create a join table! I've been using this method for over a year and a half and I've never thought about doing it any other way. Cheers, Adam On Nov 8, 9:29 am, Marcus Silva [EMAIL PROTECTED] wrote: That does help Adam

Dilemma over choosing right model table structure

2008-11-07 Thread Marcus Silva
Hi folks, I am trying to create system which will let users upload media to the server, the question that I ask is weather using a single table to store the uploaded files is better than using separate tables to store each file type in terms of coding. Seems to me that if I use the multiple

Re: Dilemma over choosing right model table structure

2008-11-07 Thread Marcus Silva
, this prevents you from having to constantly check the media type if you're iterating through one array with multiple media types. Hope that helps. Cheers, Adam On Nov 8, 3:06 am, Marcus Silva [EMAIL PROTECTED] wrote: Hi folks, I am trying to create system which will let users upload

Help with validation rule in behaviour

2008-11-05 Thread Marcus Silva
Hi guys, I am completely stuck and cannot figure out what I am doing wrong. I have created a custom Upload behaviour but I cannot get the following validation rule to work. Just after the setup function in the behaviour I call this function _create_validation_rule($model){} which sets the

Displaying dynamic pages as static cached pages

2008-11-04 Thread Marcus Silva
Hello all, Someone has recently asked about serving dynamic pages as static, so I decided to write something very quickly solution that those who need it can use. Its here ... http://www.marsilva.karoo.net/blog/ bear in mind that I have not managed to find the time to actually explain what the

Re: Building Tagging feature in my site

2008-11-03 Thread Marcus Silva
Hi, If i did understand what you are trying to achive you could design your tag relationship in the following way: Tables --- Tags id name model created updated more if needed etc... then you would have a linking table which would link tags to its repective associated model.

Automatic upload behaviour

2008-11-03 Thread Marcus Silva
Hello, I am trying to create a upload behaviour that does what the system I am building needs it to do. I need to know what would be the proper way to do it and what are the prebuilt functions that the framework uses by order they are called. Hope someone can help. Cheers

Re: Politics aside.....

2008-10-28 Thread Marcus Silva
Very nice, got stuck on this page though http://radar.barackobama.com/news_items/ The links would not work and could not go back to the home page. On Oct 28, 4:43 pm, Nate [EMAIL PROTECTED] wrote: Hey, very cool. You should submit this to the Cookbook's In the Wild page. On Oct 28, 11:33

Re: Building an online shop in CakePhp

2008-10-27 Thread Marcus Silva
Thanks for the tip. On Oct 26, 7:33 pm, keymaster [EMAIL PROTECTED] wrote: Have a look at the bakesale project on cakeforge. Also, just be aware that phpshop is being re-developed oncakephp. On Oct 26, 2:27 pm, Marcus Silva [EMAIL PROTECTED] wrote: Hi guys, I hope that some of you may

Building an online shop in CakePhp

2008-10-26 Thread Marcus Silva
Hi guys, I hope that some of you may be able to help me with this. I am trying to build an online shopping application in Cakephp to be used as a module for a bigger application. I was just wondering if any of you would have any recommendation as to how I could approach this and the sort of

Re: PHP Editor

2008-10-20 Thread Marcus Silva
I always use Notepad++, its a great multi language and easy to use editor. It can be downloaded at: http://notepad-plus.sourceforge.net/uk/site.htm Hope you like it. Cheers On Oct 20, 11:22 am, Liebermann, Anja Carolin [EMAIL PROTECTED] wrote: What also works and doesn't need installation

Re: The HABM h bug!

2008-10-20 Thread Marcus Silva
in some cases. -- Bernhard J. M. Grün 2008/10/20 Marcus Silva [EMAIL PROTECTED] Hi everyone, I am not really sure weather the following is a bug or not, but it appears to be. I my user model I have the follwoing HABM relationship: var $hasAndBelongsToMany = array

The HABM h bug!

2008-10-20 Thread Marcus Silva
Hi everyone, I am not really sure weather the following is a bug or not, but it appears to be. I my user model I have the follwoing HABM relationship: var $hasAndBelongsToMany = array( 'MemberOfClub' = array( 'className' = 'Club',

Re: CakePHP - Warning - Cannot modify header information - headers already sent by

2008-10-16 Thread Marcus Silva
Try removing any hidden character you may have after the php closing tag (?). Example: ?remove anything after the tag Hope it helps Cheers Marcus On Oct 16, 11:31 am, imu [EMAIL PROTECTED] wrote:

Re: Solution to sharing sessions subdomains!!!

2008-10-14 Thread Marcus Silva
No, not really, but will look into it. how about some example how you manage your with memcache? As to the above problem, i really dont't like it as the loggeg in keeps logged in for a very long time (hours) by default. hope you can share. Cheers On Oct 14, 6:51 am, benko [EMAIL PROTECTED]

Re: help with get product by user, function in products controller

2008-10-14 Thread Marcus Silva
Ok, You might be able to do this: Add a relationship in your user model; example: User hasMany Product etc... Then in you controller you can do the following: $this-User-id = $id; //Passed in the function $userProducts = $this-User-Product-find('all',$params = array( 'conditions' = add

Solution to sharing sessions subdomains!!!

2008-10-13 Thread Marcus Silva
Hello everyone, I am currently building an application where sessions will be shared accross the entire network. I think I found a solution to the problem, but it only works when security level is set to low in app/config/core.php Cakephp version 1.2 RC3 In cake/libs/session.php around line