Re: Pagination with GET params

2009-12-05 Thread Mono
Thanks for your answer, but that wasmt working.
I found the solution:

paginator-options ( 'url' = array ($this-passedArgs, '?' = 'for='.
$toSearch));

... if you want url's with anchor, then use:

paginator-options ( 'url' = array ($this-passedArgs, '?' = 'for='.
$toSearch, '#' = 'anchor_name'));


Regards!
claudio.


On Nov 28, 8:46 pm, Dave davidcr...@gmail.com wrote:
 'url'=$this-params should do it.  Is this what you tried originally?

 On Fri, Nov 27, 2009 at 5:22 AM, Mono sirmonit...@gmail.com wrote:
  HI!

  My URL loos at the moment like this:
  .../articles/search?for=google

  And for the second page from the pagination it should looks like:
  .../articles/search/page:2?for=google

  But at the moment it looks like this:
  .../articles/search/?for=google/page:2

  How should the $paginator-options (array ('url' = 'XXX')); looks
  like to build the URL i want?

  Thanks a lot!
  mono.

  Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
  with their CakePHP related questions.

  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-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
   more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Pagination - Wrong URL's (/page:x/page:x/....)

2009-12-05 Thread Mono
Thanks for your answer! But it doesn't works...
I tried with:

$paginator-options (array ('url' = $this-passedArgs));
and
$paginator-options (array ('url' = array_merge ($this-
passedArgs)));

$this-passedArgs contains my article_history_id (56)
but in both cases, for the 2nd page, the url looks like:

.../article-history/view/56/page:2/56/page:2

If i leave the $paginator-options () void, the urls looks like:

.../article-history/view/56/page:2/page:2

any idea?

Thanks again and best regards!
claudio.


On Nov 30, 11:41 am, Bogdan I. Bursuc bogdanbursu...@gmail.com
wrote:
 Do you have merge in the view your url params with the PaginatorHelper ?

 Something like this ?
 $paginator-options('url'=array_merge(array('lang'=$lang),
 $this-passedArgs));

 On Mon, 2009-11-30 at 01:22 -0800, Mono wrote:
  Somehow the url's for my paginations looks like:

  .../articles/page:2/page:2
  .../articles/page:3/page:3
  

  After I click on next page, they looks like:

  .../articles/page:2/page:2/page:2
  .../articles/page:3/page:3/page:3
  

  My controller:

     function articles ($id = null)
     {
             $this-paginate['Article'] = array
             (
                     'conditions' = array ('Article.id' = $id),
                     'contain' = array
                     (
                             'Tag',
                             'User' = array
                             (
                                     'fields' = array ('id', 
  'use_status_id', 'firstname',
  'lastname', 'avatar'),
                                     'UseStatus'
                             )
                     ),
                     'order' = array ('Article.created DESC'),
                     'limit' = 10,
                     'page' = 1
             );

             $this-set ('results', $this-paginate ('Article'));
     }

  The view:

  
  
  ?=$paginator-numbers ()?

  How can I fix it? I'm using CakePHP 1.2.5

  Thank a lot for any hint!

  Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
  with their CakePHP related questions.

  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-php+unsubscr...@googlegroups.com For more options, visit this group 
  athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Pagination - Wrong URL's (/page:x/page:x/....)

2009-11-30 Thread Mono
Somehow the url's for my paginations looks like:

.../articles/page:2/page:2
.../articles/page:3/page:3


After I click on next page, they looks like:

.../articles/page:2/page:2/page:2
.../articles/page:3/page:3/page:3



My controller:

function articles ($id = null)
{
$this-paginate['Article'] = array
(
'conditions' = array ('Article.id' = $id),
'contain' = array
(
'Tag',
'User' = array
(
'fields' = array ('id', 
'use_status_id', 'firstname',
'lastname', 'avatar'),
'UseStatus'
)
),
'order' = array ('Article.created DESC'),
'limit' = 10,
'page' = 1
);

$this-set ('results', $this-paginate ('Article'));
}


The view:



?=$paginator-numbers ()?

How can I fix it? I'm using CakePHP 1.2.5


Thank a lot for any hint!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Pagination with GET params

2009-11-27 Thread Mono
HI!

My URL loos at the moment like this:
.../articles/search?for=google

And for the second page from the pagination it should looks like:
.../articles/search/page:2?for=google

But at the moment it looks like this:
.../articles/search/?for=google/page:2

How should the $paginator-options (array ('url' = 'XXX')); looks
like to build the URL i want?


Thanks a lot!
mono.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Full text search including Tags (HABTM)

2009-08-06 Thread Mono

Hi!

I have Articles with Tags (HABTM-Relation)... Now I'm trying to create
a full text search and I need to be able to search through the Tags.

I have this and it works only for Article.title and Article.content:


$toSearch = Sanitize::escape ($this-params['url']['for']);

$options = array
(
'contain' = array ('Tag'),
'fields' = array
(
*, MATCH (Article.title, Article.content) 
AGAINST ('$toSearch' IN
BOOLEAN MODE) AS relevance
),
'conditions' = array
(
MATCH (Article.title, Article.content) AGAINST 
('$toSearch' IN
BOOLEAN MODE)
),
'order' = array (relevance DESC, Article.title ASC)
);

debug ($this-Article-find ('all', $options));
.

... but what I need, is something like this (see the 'Tag.name' into
the MATCH's - it doesn't work):

$options = array
(
'contain' = array ('Tag'),
'fields' = array
(
*, MATCH (Article.title, Article.content, 
Tag,name) AGAINST
('$toSearch' IN BOOLEAN MODE) AS relevance
),
'conditions' = array
(
MATCH (Article.title, Article.content, 
Tag.name) AGAINST
('$toSearch' IN BOOLEAN MODE)
),
'order' = array (relevance DESC, Article.title ASC)
);


I really would appreciate it if anyone could give me some hints.

Thanks a lot!
Claudio.

--~--~-~--~~~---~--~~
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-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Article full text search including Tags (HABTM)

2009-08-06 Thread Mono

Hi!

I have Articles with Tags. The same Tags are used y many Articles
(HABTM-Relation)...
Now I'm trying to create a full text search and I need to be able to
search through the Article.title and Article.content, as well as
through the Tag.name.

At the moment I have this (it works only for Article.title and
Article.content):


$toSearch = Sanitize::escape ($this-params['url']['for']);

$options = array
(
'contain' = array ('Tag'),
'fields' = array
(
*, MATCH (Article.title, Article.content) 
AGAINST ('$toSearch' IN
BOOLEAN MODE) AS relevance
),
'conditions' = array
(
MATCH (Article.title, Article.content) AGAINST 
('$toSearch' IN
BOOLEAN MODE)
),
'order' = array (relevance DESC, Article.title ASC)
);

debug ($this-Article-find ('all', $options));
.

... but what I need, is something like this (see the 'Tag.name' into
the MATCH's - it doesn't work):

$options = array
(
'contain' = array ('Tag'),
'fields' = array
(
*, MATCH (Article.title, Article.content, 
Tag,name) AGAINST
('$toSearch' IN BOOLEAN MODE) AS relevance
),
'conditions' = array
(
MATCH (Article.title, Article.content, 
Tag.name) AGAINST
('$toSearch' IN BOOLEAN MODE)
),
'order' = array (relevance DESC, Article.title ASC)
);


I really would appreciate it if anyone could give me some hints.

Thanks a lot!
Claudio.

--~--~-~--~~~---~--~~
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-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to submit form elements that are disabled?

2009-01-23 Thread Mono

U could try with:

$form-input('frmInputQuantity', array('label'='Quantity:',
'readonly'='readonly'));





On 22 Jan., 22:49, Pyrite thelette...@gmail.com wrote:
 I want to have a form text input get submitted, but also want it to be
 disabled on display.

 Eg. $form-input('frmInputQuantity', array('label'='Quantity:',
 'disabled'='disabled'));

 This does not get submitted into $this-data. How can I change what
 gets posted to $this-data with the form helper?

--~--~-~--~~~---~--~~
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-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Closing $ajax-form()

2009-01-23 Thread Mono

When u use the ajax-form, the only difference with a normal form is
the first line.

Normal Form:

$form-create (...)
  $form-input ()
  $form-input ()
$form-end ('Send')

Ajax Form:

$ajax-form (...)
  $form-input ()
  $form-input ()
$form-end ('Send')








On 22 Jan., 22:47, Pyrite thelette...@gmail.com wrote:
 How do you put the close tag in a form created by $ajax-form() ?? Why
 is there not an $ajax-formEnd() similar to the FormHelper's $form-end
 () ?

 Also, when I create a form with $ajax-form(), and I add a submit with
 $ajax-submit(), it does not submit the form. A usage example would be
 great. I can only get it to submit the form if I use $form-end
 ('Submit') instead of $ajax-submit().

--~--~-~--~~~---~--~~
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-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Fatal error: CakePHP core could not be found

2009-01-23 Thread Mono

Hello!!

My Cake-App works perfect on my localhost, but after i uploaded it i
become the error msg:

Warning: Failed opening 'cake/bootstrap.php' for inclusion
(include_path='/mnt/web2/13/38/51150638/htdocs/plPATH_SEPARATOR/mnt/
web2/13/38/51150638/htdocs/pl/app/PATH_SEPARATOR.:') in /mnt/
web2/13/38/51150638/htdocs/pl/app/webroot/index.php on line 84

Fatal error: CakePHP core could not be found. Check the value of
CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to
the directory containing your /cake core directory and your /vendors
root directory. in /mnt/web2/13/38/51150638/htdocs/pl/app/webroot/
index.php on line 85

...and i dont know why.

if i do a var_dump on the define CAKE_CORE_INCLUDE_PATH in the file
app/webroot/index.php i get:

string(34) /mnt/web2/13/38/51150638/htdocs/pl

... and that looks ok. The url to my app is: http://cbmono.de/pl/
similar as on my localhost: http://localhost/pl/


Could anyone help me pls?

Best regards!
claudio.


--~--~-~--~~~---~--~~
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-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake debug html code

2009-01-23 Thread Mono

At the bottom from views/layouts/default.ctp u ll find the line of
code that display the sql query statemets. Just put that  line
somewhere else. But that isnt rly a good idea, cause when u go online
with ur site, u ll need to stay in a debug lvl 2 in order to c that
msg's.



On Jan 22, 11:44 am, Invizibility invizibil...@gmail.com wrote:
 Hi all,

 I'd like to change the location where cake inserts its debug
 statements (SQL queries, timings) in my layout. The reason is that
 when my app goes alpha and is sent to QA I would like them to quickly
 know which queries are being fired and what is happening but in an
 optional way. Hence using CSS/DHTML magic I would like to put it in
 the top of the page in a collapsed DIV element.

 Is there a variable similar to content_for_layout? I saw cakeDebug but
 that didnt help and it still printed the logs in the same location.

 A good samaritan pointed me to DebugKit but thats something which I
 dont want to use. Any suggestions would be highly appreciated.

 Thanks,
 Inviz.

--~--~-~--~~~---~--~~
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-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: get method validation

2009-01-20 Thread Mono

Hi!

U can use the php function: is_numeric (http://de.php.net/manual/en/
function.is-numeric.php)

 kinda:

function  (id = null)
{
  if (empty ($id) || !is_numeric ($id)) // error!!!
  else // save/update/delete
}

Regards!
mono.


On Jan 18, 8:32 pm, Delirium tremens pedbe...@gmail.com wrote:
 Do you know

 form action=ascript.php method=get
 input type=hidden name=id value=a

 and

 http://www.asite.com/script.php?id=a

 ?

 Valid IDs are numbers. How do I prevent my script from assigning
 invalid values to id?

 On 18 jan, 17:18, Webweave webwe...@gmail.com wrote:

  Not clear on what your question means, are you asking about validation
  rules?

  On Jan 18, 7:30 am, Delirium tremens pedbe...@gmail.com wrote:

   How to validate an id passed not by post, but by get? I do not have to
   output an error message to hackers and crackers, do I? I tested using /
   ^[0-9]{1,10}$/ as rule, nothing as message and passing an a, but it
   did not output an error message.

--~--~-~--~~~---~--~~
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-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---