Aros, Acos, Aros_acos, Groups data disappear from mysql?!

2011-04-26 Thread piousbox
Hi all, I am writing this app: http://InfiniteShelter.com For some reason, at some point (maybe when new users register) either the table aros, or acos, or aros_acos, or groups get truncated. I don't know how it happens, but sometimes my data just disappears from the database. It's very annoying

Re: Several questions about ACL

2011-02-19 Thread piousbox
Obrigado para a resposta. Porém, eu preciso um web-interface para modificar ACO e ARO artigos. não se por que usar o ACL Behavior, ele é mesmo de o padrão ACL component. A coisa q eu deseo é, um interface q permiti um administrator fazer isso sim escrevendo codigo no PHP: $group = & $this->User->G

Several questions about ACL

2011-02-16 Thread piousbox
) 1 14 2 Group 2 (null) 15 18 3 Group 3 (null) 19 26 5 1 User1 Piousbox2 3 6 2 User2 (null) 16 17 7 3 User3 (null) 20 21 8 1 User4 (nul

Re: Fatal error: Call to a member function entity() on a non-object in /var/www/cake/1.3/cake/libs/view/helper.php on line 567

2010-11-27 Thread piousbox
;, "of", "helpers");* in helper > class which helpers will helper use :D > > i think this is problem... > -- > Tilen Majerlehttp://majerle.eu > > 2010/11/26 piousbox > > > I get this while testing. Here's my test code: > > > function testLogin_

Fatal error: Call to a member function entity() on a non-object in /var/www/cake/1.3/cake/libs/view/helper.php on line 567

2010-11-26 Thread piousbox
I get this while testing. Here's my test code: function testLogin_register() { $actual = $this->Text->login_register(); } and the helper code that's being tested: function login_register($user = false) { // ... $out = ''; $out .= $this->Form->create('User'

Re: How should I redirect from CakePHP to an external resource?

2010-11-10 Thread piousbox
0 at 10:15 AM, piousbox wrote: > > That's one of the mistakes I made, yes. > > > I figured it out and instead of a line like this: > > > Redirect /specshttp://domain.com/specs > > > I now have this: > > > RewriteRule ^specs$http://domain.com/spec

Re: How should I redirect from CakePHP to an external resource?

2010-11-10 Thread piousbox
2010 at 2:27 PM, victor piousbox wrote: > > I understand that the Router should be used for matching URLs to controller > > actions. However suppose I have several dozen relative urls that I want to > > redirect to external resources, like so: > > > /learning (g

How should I redirect from CakePHP to an external resource?

2010-11-09 Thread victor piousbox
I understand that the Router should be used for matching URLs to controller actions. However suppose I have several dozen relative urls that I want to redirect to external resources, like so: /learning (goes to) http://learning.mydomain.com /events http://events.mydomain.com /histo

Re: Why is this SQL query so slow?

2010-10-11 Thread piousbox
'associationForeignKey' => 'tag_id', 'unique' => true ) ); So I think maybe this was causing the problem: article hasOne and hasMany childarticles. So I removed hasOne and I think it's working fine now. thanks all

Why is this SQL query so slow?

2010-10-08 Thread victor piousbox
I have a website with a bunch of articles. This is one of the queries executed by I assume the Paginator: SELECT COUNT(*) AS `count` FROM `articles` AS `Article` LEFT JOIN `authors` AS `Author` ON (`Article`.`author_id` = `Author`.`id`) LEFT JOIN `websites` AS `Website` ON (`Article`.`website_id`

Re: echoing a bigger font

2010-06-06 Thread piousbox
Well, you don't have a print or an echo statement there. It would help to do the following: Which is the same as: (given that your Apache setup allows that shorthand.) _V On Jun 5, 7:58 am, ytbryan wrote: > Hi all, > > If i am printing out a variable $result like the below in my view > >

Re: How do I write $this->render() to a variable?

2010-05-19 Thread piousbox
Maybe you're looking to do something like $rendered_view = $this- >requestAction('/controller/action/params',array('return')); and also if you're using Auth component, you may want to allow your requested actions in beforeFilter(). http://book.cakephp.org/view/434/requestAction _V On May 18, 4

Re: belongsTo and hasMany relation split in two queries

2010-05-18 Thread piousbox
make sure that in the database you have column comments.picture_id which makes the relationship Picture has_many Comment. You don't have to use belongs_to as that's just the inverse of has_many. You can really make do with only one. If you want, you can add another column, pictures.is_commented (

Re: array_rand not working!

2010-05-18 Thread piousbox
First, if you're developing this application, I strongly advice not messing with caching until you're ready to deploy. In particular, you do $banners_tmp = Cache::read('banners'); even if it returns empty? Maybe you're looking at only your cached version all the time, not what's in your database?

Re: Layout

2010-05-18 Thread piousbox
Yes, definitely. It so happened that of a dozen or so webapps I've written, ALL of them are CRUD-like. That's because once you begin to manage data of any degree of complexity, you can't do without CRUD. If you don't need CRUD, perhaps you don't need cakePHP. If your site is so simple as not to req

Re: A little complexed find()

2010-05-18 Thread piousbox
Some people may throw rocks at me, but I find writing custom SQL queries not a bad solution for some tasks. Mind you! I <3 cakePHP and I tried doing the most complex finds using cakePHP conventions, with php arrays containing all my conditions... and I consistently run over my memory limit (128Mb a

Re: WorldPay component

2010-04-23 Thread piousbox
If you googled it and didn't find it, perhaps it's not there. The good news is that you can write the component/helper yourself. CakePHP rests on top of PHP, that means anything you can do in PHP is doable in cakePHP. So, what you need to do is either to include the WorldPay into your application u

Re: $html->css() is giving the wrong path

2010-04-23 Thread piousbox
>From http://book.cakephp.org/view/206/Inserting-Well-Formatted-elements This: css('forms'); ?> Gives you this: The file is here: /app/webroot/css/forms.css where /app/ is /nh/ in your case. You can try messing with defined constants in /nh/webroot/index.php and figure out where your "webroot" ac

Re: How to add a view with no controller and no model?

2010-04-23 Thread piousbox
Yeah, you don't have to write SQL as you can use the regular $this- >Model->findAll() methods. Reference: >http://book.cakephp.org/view/73/Retrieving-Your-Data But, I found for myself that writing sql syntax is sometimes easier. Now, it looks like you want to have models. You need the views too, a

Re: mac users, which ide are you using to develop cakephp?

2010-04-22 Thread piousbox
I second that. NetBeans is the best IDE I've experienced. (I'm not a Mac, a Fedora user.) On Apr 19, 12:42 pm, jacmoe wrote: > Disclaimer: I am not a Mac user, but.. > I heartily recommend NetBeans. :) > Eclipse is nice, but NetBeans is faster, leaner and more productive, > IMO. > It's a very un

Re: different types of Users

2010-03-17 Thread piousbox
First, take a look at ACL component. If you can make it work, that's what you need. (Although it's really confusing, and I don't use it for my needs). If you decide to not use ACL, you'll use Auth component (that's just being able to login; you'd use it with ACL, too), then store your user.id in a

Re: CakeFest IV - America - Help us pick a location!

2010-03-16 Thread piousbox
I live in Chicago and I naturally recommend my city (because I want to attend). I hope it's beyond doubt that in central US, Chicago should be picked over St. Louis, Indianapolis, Detroit, or any other city. However, I imagine that New York, being a bigger city, would get more votes. Nothing's wro

Re: PHP 5.3 open short tag does't working on cakePHP 1.2.6

2010-03-16 Thread piousbox
Well first off, the grammar of PHP is unambiguous so you should be able to use a regular expression to convert all the short tags. Here's a linux command to replace one string with another in all text files in a folder grep -rl ‘OLD’ . | xargs sed -i -e ’s/OLD/NEW/’ But you need to modify this to