Book Image

concrete5 Beginner's Guide

Book Image

concrete5 Beginner's Guide

Overview of this book

Table of Contents (19 chapters)
concrete5
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – adding a Gravatar picture to the guestbook


Follow these steps to easily add a Gravatar to the guestbook:

  1. You will need to create the directory folder within blocks, guestbook, templates and copy the file from concrete\blocks\guestbook\view.php into the templates directory. After you've copied it, rename it to gravatar.php to make it clear what the templates are going to be used for.

  2. The default block template contains quite a lot of code as it contains some functions to manage the comments. We won't have to bother with it, but we have to find our way around it. There are only a few lines we have to insert. Open gravatar.php and search for the following loop; it's not the whole content of the file! Insert the highlighted lines in your file:

    foreach($posts as $p) { ?>
      <?php  if($p['approved'] || $bp->canWrite()) { ?>
        <div class="guestBook-entry">
          <?php  if($bp->canWrite()) { ?> 
            <div class="guestBook-manage-links">
          ...