[development] Block php snippet not failing
Earl Miles
merlin at logrus.com
Sat Oct 31 21:59:24 UTC 2009
Jeff Greenberg wrote:
> In D6, I have the page url of mypage.com/catalog/16?page=0%2C1
>
>
> I have the following snipped in the pages section of a block, with the
> PHP snippet option chosen:
>
>
> <?php
> if ($_GET['q']) {
> $my_drupal_path = $_GET['q'];
> } else { $my_drupal_path = substr($_SERVER['REQUEST_URI'], 1);
> }
>
> if ( stristr($my_drupal_path, 'catalog/16?page=0%2C0') ||
> ((stristr($my_drupal_path, 'catalog/16')) &&
> (stristr($my_drupal_path, 'catalog/16?page')===false))
> ) return true;
> else return false;
> ?>
Check $_GET['page'] for that part, rather than checking the request uri.
More information about the development
mailing list