Re: java script detection at the time of site load

2012-01-20 Thread AD7six


On Jan 19, 7:51 pm, Miles J mileswjohn...@gmail.com wrote:
 Right but I would rather just set a cookie via JS and check it on the
 PHP side. Same effect.

As you stated previously: Clearly that's impossible

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Need Financial/Accounting Plugin for CakePHP 2.x

2012-01-20 Thread AD7six


On Jan 20, 2:11 am, Tanvir Gaus tanvir.g...@gmail.com wrote:
 Can anyone help me out with this one?

Premium-pay help, or your average point-me-at-google help?

AD

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: date Field in german format dd.mm.yyyy

2012-01-20 Thread AD7six


On Jan 20, 8:28 am, schulte.christ...@googlemail.com
schulte.christ...@googlemail.com wrote:
 Dear euromark,

 thanks for your advice...
 Can you provide me some more advice on this or maybe the code?
 TIA

If you're able to rewrite the string from dd.mm. to .mm.dd
(which is just a preg_replace call) - you just need to apply that in
beforeSave to any date values which match that format. What part of
that are you struggling with?

AD

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: date Field in german format dd.mm.yyyy

2012-01-20 Thread euromark
whats the problem using google here? ;)

date behavior cakephp

= 
http://www.izzycode.com/cakephp/cakephp-behavior-auto-date-formatting-parser.html




On 20 Jan., 09:58, AD7six andydawso...@gmail.com wrote:
 On Jan 20, 8:28 am, schulte.christ...@googlemail.com

 schulte.christ...@googlemail.com wrote:
  Dear euromark,

  thanks for your advice...
  Can you provide me some more advice on this or maybe the code?
  TIA

 If you're able to rewrite the string from dd.mm. to .mm.dd
 (which is just a preg_replace call) - you just need to apply that in
 beforeSave to any date values which match that format. What part of
 that are you struggling with?

 AD

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Routing Problem with CakePHP 2 in subdirectory without mod_rewrite

2012-01-20 Thread stefanski
Taking a plain CakePHP 2.0.5 (or minor) and installing it in a subdirectory 
without mod_rewrite (removing the 3 .htaccess and uncommenting 
Configure::write('App.baseUrl', env('SCRIPT_NAME')); in core.php) brings 
up the following problem:

Loading the root page like this: http://servername/some/subdir/ shows the 
error SomeController could not be found. 
whereas loading the root page like this: 
http://servername/some/subdir/index.php works

Might this be an Apache configuration issue? With CakePHP 1.3 I hadn't that 
problem on the same machine.

Thanks, Stefan

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Question about routing

2012-01-20 Thread heohni
Believe me I did, but in this case I didn't find a solution which
worked for my need.

On 19 Jan., 15:44, Thiago Belem cont...@thiagobelem.net wrote:
 Check the Router class on the documentation.

 --
 Thiago Belem,
 Desenvolvedor WEB

 Enviado do meu Android
 Em 19/01/2012 11:28, heohni heidi.anselstet...@consultingteam.de
 escreveu:







  Hi,

  from a relaunch I have many old links in google which all land on a
  404 page and I would like to redirect them to the new homepage. What
  do I have to do when I want to catch all of these links with this file
  name:

  /search.php?anylongquerystring

  to redirect it to the homepage?

  I tried this:
  Router::connect('/search*', array('controller' = 'pages', 'action' =
  'display', 'home'));

  But nothing happen, the links still go to the 404 page.

  What can I do better?

  Thanks!

  --
  Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
  Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
  others with their CakePHP related questions.

  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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Redirect Not Working - but it works for other redirects in the same controller.....

2012-01-20 Thread Mike
This is a weird issue.  I am using the same redirect several times in
the controller.  The redirect works for all of the other actions
except when I use an edit function.  The redirect is as follows:


$this-redirect(array('controller'='systems', 'action'='index',
'admin'=1));


I have checked to make sure there are no blank spaces before the ?php
tag.  The weirdest thing is that it works in other actions within this
controller.  After the user updates the record, the redirect is
supposed to show the index of the same controller again.

I am using Cake 2.0.1 and have changed the debug settings from 0 to 1
to 2.  They are now on 2.

Any ideas?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: java script detection at the time of site load

2012-01-20 Thread vaibhav pathak
yes you are but i want to do it for just my knowledge enhancement.
 Thanks for reply.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: java script detection at the time of site load

2012-01-20 Thread vaibhav pathak
is anyone has idea about how Google is doing that?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


cakephp first step

2012-01-20 Thread marcogo
hi
please apologize my english

i want to display 2 tables from mysql on the same page

no relationship between 2 table

only show 2 differente tables in a same page...

i try
make 2 different model
make 2 different controller

but i can see only the first table, but not the second one

thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: cakephp first step

2012-01-20 Thread Tilen Majerle
create one controller
and there work with 2 tables (models)

you can load models on the fly with $this-loadModel('ModelName');
and access to him with $this-ModelName

http://api20.cakephp.org/class/controller#method-ControllerloadModel
--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2012/1/20 marcogo marco.geri...@gmail.com

 hi
 please apologize my english

 i want to display 2 tables from mysql on the same page

 no relationship between 2 table

 only show 2 differente tables in a same page...

 i try
 make 2 different model
 make 2 different controller

 but i can see only the first table, but not the second one

 thanks

 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 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


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: date Field in german format dd.mm.yyyy

2012-01-20 Thread schulte.christ...@googlemail.com
Thanks to all, the problem is solved now.

I tried so many different things that I messed up the whole thing.
Now I took a step back and started over with the DateBehavior.php and
now it's working.

Christian

On 20 Jan., 10:47, euromark dereurom...@googlemail.com wrote:
 whats the problem using google here? ;)

 date behavior cakephp

 =http://www.izzycode.com/cakephp/cakephp-behavior-auto-date-formatting...

 On 20 Jan., 09:58, AD7six andydawso...@gmail.com wrote:







  On Jan 20, 8:28 am, schulte.christ...@googlemail.com

  schulte.christ...@googlemail.com wrote:
   Dear euromark,

   thanks for your advice...
   Can you provide me some more advice on this or maybe the code?
   TIA

  If you're able to rewrite the string from dd.mm. to .mm.dd
  (which is just a preg_replace call) - you just need to apply that in
  beforeSave to any date values which match that format. What part of
  that are you struggling with?

  AD

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Including queried information in default layout

2012-01-20 Thread Dave D
I'm looking to create a site where I can have a navigation list on one
side of each page where the list of links is taken from a database
table.

I can create the list of links just fine in the layout, but I'm suck
looking at how I might be able to get the list out from the database.
I've been looking around the internet to see how I might be able to
work it in, but I haven't been able to find anything that would work
for sure, so I was thinking I should get some input from this group
before I continue.

The first idea I saw was to include the model in the AppController,
but I can't get that to work in the slightest.  I tried putting this
in my AppController:

$this-loadModel('Sitelist');

Which breaks everything, giving me the error: Parse error: syntax
error, unexpected T_VARIABLE, expecting T_FUNCTION in /path/to/cake/
app/Controller/AppController.php on line 36 .

I already created a Sitelist model, controller and view with basic
CRUD and I'm able to edit everything fine through another page.

I've also seen the suggestion to create a component that gets included
in all of the controllers which queries the database to get the list,
which then gets used by the layout, but I haven't found anything about
that written after version 1.2.

I'm working with CakePHP 2.0.5.  If anybody knows what the proper way
to get a list like this populated, please let me know.

Thanks!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Including queried information in default layout

2012-01-20 Thread Sam Sherlock
Is the load model call the line with the error?

Can you post more code?

The component idea should be fine.

More details of your bab/menu model would be good.

- S
On 20 Jan 2012 16:13, Dave D its.dave.daw...@gmail.com wrote:

 I'm looking to create a site where I can have a navigation list on one
 side of each page where the list of links is taken from a database
 table.

 I can create the list of links just fine in the layout, but I'm suck
 looking at how I might be able to get the list out from the database.
 I've been looking around the internet to see how I might be able to
 work it in, but I haven't been able to find anything that would work
 for sure, so I was thinking I should get some input from this group
 before I continue.

 The first idea I saw was to include the model in the AppController,
 but I can't get that to work in the slightest.  I tried putting this
 in my AppController:

 $this-loadModel('Sitelist');

 Which breaks everything, giving me the error: Parse error: syntax
 error, unexpected T_VARIABLE, expecting T_FUNCTION in /path/to/cake/
 app/Controller/AppController.php on line 36 .

 I already created a Sitelist model, controller and view with basic
 CRUD and I'm able to edit everything fine through another page.

 I've also seen the suggestion to create a component that gets included
 in all of the controllers which queries the database to get the list,
 which then gets used by the layout, but I haven't found anything about
 that written after version 1.2.

 I'm working with CakePHP 2.0.5.  If anybody knows what the proper way
 to get a list like this populated, please let me know.

 Thanks!

 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 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


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Including queried information in default layout

2012-01-20 Thread Dave D
The loadmodel line is the one that gets the error.  I copied and
pasted the AppController.php directly from the sample placeholder
class, so I get:

?php
App::uses('Controller', 'Controller');

class AppController extends Controller {
$this-loadModel('Sitelist');
}

And then there's the licence part at the top and the This is a
placeholder class stuff in the middle, after App::uses(...).  When I
get rid of the $this-loadModel(...); line, it works, but that's the
default file because the only line I added was the loadModel line.

The menu is a very simple list.  In my template right now, I have the
list in a div like so:

div id=sitenavigation
ul
li class=menuitema href=link1hereLink 1 name/a/li
li class=menuitema href=link2hereLink 2 name/a/li
...
/ul
/div

My database just has a table that has the sitelist id, the name for
the link, and one more column for the link itself.

I'd just like to be able to have the links get generated from the
database, where the href contents and the name part is taken from that
table.

As a side note, is there any good component reference information for
2.0.5?  The stuff from the cookbook about creating components (http://
book.cakephp.org/2.0/en/controllers/components.html) is a whopping 4
lines long.  The part from the 1.3 book (http://book.cakephp.org/1.3/
view/996/Creating-Components) has a section on calling models from
components, but I'm too new at Cake to know if that would work, and it
says it's not generally recommended.


Thanks!

On Jan 20, 12:12 pm, Sam Sherlock sam.sherl...@gmail.com wrote:
 Is the load model call the line with the error?

 Can you post more code?

 The component idea should be fine.

 More details of your bab/menu model would be good.

 - S
 On 20 Jan 2012 16:13, Dave D its.dave.daw...@gmail.com wrote:

  I'm looking to create a site where I can have a navigation list on one
  side of each page where the list of links is taken from a database
  table.

  I can create the list of links just fine in the layout, but I'm suck
  looking at how I might be able to get the list out from the database.
  I've been looking around the internet to see how I might be able to
  work it in, but I haven't been able to find anything that would work
  for sure, so I was thinking I should get some input from this group
  before I continue.

  The first idea I saw was to include the model in the AppController,
  but I can't get that to work in the slightest.  I tried putting this
  in my AppController:

  $this-loadModel('Sitelist');

  Which breaks everything, giving me the error: Parse error: syntax
  error, unexpected T_VARIABLE, expecting T_FUNCTION in /path/to/cake/
  app/Controller/AppController.php on line 36 .

  I already created a Sitelist model, controller and view with basic
  CRUD and I'm able to edit everything fine through another page.

  I've also seen the suggestion to create a component that gets included
  in all of the controllers which queries the database to get the list,
  which then gets used by the layout, but I haven't found anything about
  that written after version 1.2.

  I'm working with CakePHP 2.0.5.  If anybody knows what the proper way
  to get a list like this populated, please let me know.

  Thanks!

  --
  Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
  Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
  others with their CakePHP related questions.

  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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Including queried information in default layout

2012-01-20 Thread Sam Sherlock
You need to place the loadmodel within a method - such as beforeFilter.

Also you will benefit from learning how php classes work.

- S
On 20 Jan 2012 17:51, Dave D its.dave.daw...@gmail.com wrote:

 The loadmodel line is the one that gets the error.  I copied and
 pasted the AppController.php directly from the sample placeholder
 class, so I get:

 ?php
 App::uses('Controller', 'Controller');

 class AppController extends Controller {
$this-loadModel('Sitelist');
 }

 And then there's the licence part at the top and the This is a
 placeholder class stuff in the middle, after App::uses(...).  When I
 get rid of the $this-loadModel(...); line, it works, but that's the
 default file because the only line I added was the loadModel line.

 The menu is a very simple list.  In my template right now, I have the
 list in a div like so:

 div id=sitenavigation
ul
li class=menuitema href=link1hereLink 1 name/a/li
li class=menuitema href=link2hereLink 2 name/a/li
...
/ul
 /div

 My database just has a table that has the sitelist id, the name for
 the link, and one more column for the link itself.

 I'd just like to be able to have the links get generated from the
 database, where the href contents and the name part is taken from that
 table.

 As a side note, is there any good component reference information for
 2.0.5?  The stuff from the cookbook about creating components (http://
 book.cakephp.org/2.0/en/controllers/components.html) is a whopping 4
 lines long.  The part from the 1.3 book (http://book.cakephp.org/1.3/
 view/996/Creating-Components) has a section on calling models from
 components, but I'm too new at Cake to know if that would work, and it
 says it's not generally recommended.


 Thanks!

 On Jan 20, 12:12 pm, Sam Sherlock sam.sherl...@gmail.com wrote:
  Is the load model call the line with the error?
 
  Can you post more code?
 
  The component idea should be fine.
 
  More details of your bab/menu model would be good.
 
  - S
  On 20 Jan 2012 16:13, Dave D its.dave.daw...@gmail.com wrote:
 
   I'm looking to create a site where I can have a navigation list on one
   side of each page where the list of links is taken from a database
   table.
 
   I can create the list of links just fine in the layout, but I'm suck
   looking at how I might be able to get the list out from the database.
   I've been looking around the internet to see how I might be able to
   work it in, but I haven't been able to find anything that would work
   for sure, so I was thinking I should get some input from this group
   before I continue.
 
   The first idea I saw was to include the model in the AppController,
   but I can't get that to work in the slightest.  I tried putting this
   in my AppController:
 
   $this-loadModel('Sitelist');
 
   Which breaks everything, giving me the error: Parse error: syntax
   error, unexpected T_VARIABLE, expecting T_FUNCTION in /path/to/cake/
   app/Controller/AppController.php on line 36 .
 
   I already created a Sitelist model, controller and view with basic
   CRUD and I'm able to edit everything fine through another page.
 
   I've also seen the suggestion to create a component that gets included
   in all of the controllers which queries the database to get the list,
   which then gets used by the layout, but I haven't found anything about
   that written after version 1.2.
 
   I'm working with CakePHP 2.0.5.  If anybody knows what the proper way
   to get a list like this populated, please let me know.
 
   Thanks!
 
   --
   Our newest site for the community: CakePHP Video Tutorials
  http://tv.cakephp.org
   Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
   others with their CakePHP related questions.
 
   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

 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 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


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: java script detection at the time of site load

2012-01-20 Thread Miles J
Always gotta be a smart ass.

Its *not* possible to detect JS with PHP outright. Detecting if a
cookie exists isn't really detecting it, it's a workaround.

On Jan 20, 12:52 am, AD7six andydawso...@gmail.com wrote:
 On Jan 19, 7:51 pm, Miles J mileswjohn...@gmail.com wrote:

  Right but I would rather just set a cookie via JS and check it on the
  PHP side. Same effect.

 As you stated previously: Clearly that's impossible

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


'roles' not being detected correctly in app controller

2012-01-20 Thread Daniel
I have a user on the database with a 'roles' field set to 'admin' and
a variable $admin that is set in the app controller:

function beforeFilter() {
$this-Auth-allow('index', 'view', 'confirm', 'captcha',
'reload_captcha', 'display');
$this-set('logged_in', $this-_loggedIn());
$this-set('admin', $this-_isAdmin());
}
function _loggedIn() {
$logged_in = false;
if ($this-Auth-user())
$logged_in = true;
return $logged_in;
}
function _isAdmin() {
if (($this-Auth-user())  ($this-Auth-user('roles') == 'admin'))
return true;
return false;
}

The problem is that the variable $admin is coming back as false in the
default.ctp file.
I am using Cake 2.  Any ideas as to what is going on?  This worked
fine in Cake 1.3.

Thanks.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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