By dbourrion on
Hi
I'd like to show a bloc only if some certain words are on the page.
I was thinking to use the bloc validation code below but it isn't working (no bloc at all, even not it's title)
Can't see what is wrong - help welcome
Best regards
D
<?php
$text = file_get_contents('"http://127.0.0.1".$_SERVER['REQUEST_URI']');
echo (stristr ($text, 'words_i_m_seeking')) ? 'TRUE' : 'FALSE';
?>
Comments
Oh works a little better
This way
but I always got FALSE in return even when the word "magasin" is in the Drupal page where the bloc is testing
It looks like you want
It looks like you want 'return' instead of 'echo'.
Side note, the code looks like it will loop indefinitely. Since the block loads the the current page to see if it should display, the page will load the page to see if the block should display which will ...
Gasp
Infinite loop, i'm such a fool
Thx
D