Display avatar based on information from the query string

Last modified: October 6, 2006 - 00:13

This snippet is useful when using the paging.module http://drupal.org/project/paging and avatars, but could be adapted to show and hide any area based on a query string parameter.

        If displaying a page (vs a teaser)
            Look for the 'from' parameter
            If present and value is greater than 0
                Suppress the picture

In the node.tpl,php file replace your standard

<?php if ( $picture) : ?>
    <div class="picture">
      <?php print $picture ?>
    </div>
    <?php endif; ?>

with

<?php if ( $picture ): ?>
<?php
$from
= $_GET['from'];
?>

   <?php if ( ! $from || $from == 0 ): ?>
    <div class="picture">
      <?php print $picture ?>
    </div>
    <?php endif; ?>
  <?php endif; ?>

 
 

Drupal is a registered trademark of Dries Buytaert.