Random Image Relation
I want a random picture for each gallery Is it possible to realise with a relation like this ? Class Gallery extends AppModel { var $hasOne= array( 'RandomImage' = array('className' = 'Picture', 'foreignKey'= 'gallery_id', 'order' = 'RAND()', )); } Regards --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cake bake doesn't find new tables
You have to clean the cache. Delete all files in tmp/cache/models. Best Regards Am 30.09.2008 um 14:54 schrieb Kenchu: I use cake bake to generate all my controllers, views and models. Unfortunatelyl cake bake doesn't seem to realize the changes I make in my database anymore. I've added a couple of more tables, but when I try to bake some new models, they aren't even in the list of models. Only the old tables are. I've checked the database configuration multiple times and cannot see anything that would suggest why cake is acting this way. database.php class DATABASE_CONFIG { var $default = array( 'driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'root', 'password' = '', 'database' = 'mydb', 'prefix' = '', ); } If I do this in the command prompt: mysql (password and user details) ENTER use mydb; ENTER show tables; ENTER I get this: +-+ | Tables_in_mydb | +-+ | adresses| | bankaccounts| | banks | | cars| | categories | | comments| | countries | | orders | | orders_products | | products| | searches| | users | +-+ 12 rows in set (0.00 sec) Using cake bake I get these: Possible Models based on your current database: 1. Bankaccount 2. Bank 3. Category 4. Comment 5. Country 6. Order 7. OrdersProduct 8. Product 9. Search 10. User Cars and adresses are new tables. Both of them are not present in the list. Any ideas what's wrong here? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: pushing my luck -- complete pm system?
This should be kind of easy to write on your own setup a new database table: id int sender_id int foreign key to user table receiver_id int foreign key to user table message varchar Then create a message write form and a message list template for inbox and outbox. The controller has some crud functions that can be generated by cake and a simple send and index function. Thats it ;) Regards Am 30.09.2008 um 21:31 schrieb rocket: PM stands for private messages. basically a system inside cake that will allow my users to send messaages to eachother. On Sep 30, 12:35 pm, Gonzalo Servat [EMAIL PROTECTED] wrote: On Tue, Sep 30, 2008 at 1:26 PM, rocket [EMAIL PROTECTED] wrote: I'm about to write a PM system for users... but why invent the wheel? Anyone know of a good prebuilt cake pm system, or a vendor I can use? * What does PM stand for? Your abbreviation search returned 164 meanings* Which one of the 164 does your PM stand for? - Gonzalo --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
organise application structure for new project in cake
Hey CakePhp Friends, its my first post on the list but i really need help on creating this project. Ok here is the Situation: I have to programm a Web Application for publishing Events, Parties and some Photos. I created a database in Mysql and want to write this Application with the CakePHP Framework because i want to extend it later on. First i need a application structure for this Thinking Schema: Template Layout Breadcrump Navigation Left Menu Content Home Gallery Latest Galleries Picturelist with Pagination Picture Detail View with Ajax Interface to scroll through the pictures (done in jquery) Events Search by Date by City by Capitalletter Resultlist with Pagination Show Latest Today Yesterday Last Week Last 4 Week Last 2 Month Locations List with Filter by Category Discos Restaurants Bars etc. by Letter by City Detail View With Comments Some Static Pages Admin View with Login and some CRUD Actions Locations, Events, Galleries add, edit, delete Ok thats it. Seems to be a little bit more complex than the samle blog sample isnt it ;) First Question: Is Cake the right framework to do this job ? I experimented a bit with the Zend Framework but this was far more complex than i thougt. I know php5 very well but thats not what i think a framework is about. I would have to write many components and helpers myself. I only want so set up the database and the helpers and then only use the framework components for the business logic. And i don't want to use other CMS Systems because i want control and overview about the whole logic of my application and because known CMS Systems often get exploited. Ok here we go. 1 How can i divide this Schema into modules, controllers and actions for cake? 2 What would be the best way to route such a application? 3 Which Cake components, helpers, etc. do i need to realize this? 3 Which components are given and which do i have to write myself ? Ok to the Database Setup. I have some relations between the tables. For example Gallery: Picture, Locations. Should i use the internal system of cake for relation modelling or should i use normal mysql statements with joins? Isnt this too slow ? A friend of mine made some templates and layouts for the site so i don't have to worry about the views. I want to realize this project in 2 Weeks. Is this realistic ? Regards Markus --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---