Default avatar

Status: 
Solved
Question: 

I need to get a better understanding of the following step:
9. If users cannot upload an avatar, let’s display a default avatar.
(a) Make an image called “defaultavatar.jpg” and place it in the
/sites/default/files folder6.
(b) Fill in the following empty text7:
<?php echo ’’; ?>
This will display the defaultavatar.jpg whenever there is no avatar.
(c) Add a relationship: Content: Avatar (required)8.

All done untill here ... and now the confusing part:
(d) Add a filter: File ID: (select the new relationship here) is not
empty.

eeh? Create a new relationship with what? I already have filter for
Node: Type = Profile
Node: Published Yes

Responses

1. Add a new filter: File ID. In

Add a new filter: File ID.

In these settings, you will be able to select the relationship you have just created (avatar).

2. Makes sense!

However after doing so in filters ((Avatar) File: File ID not empty), I get <?php echo ’’; ?> where the default avatar pic should be.
Just to clarify it , in Basic settings-->Empty text: Filtered HTML with <?php echo ’’; ?>

If I change the filtered HTML to full HTML I get on top of the <?php echo ’’; ?> display, one missing image (when right click for properties gives this URL: drupal/content/’.base_path().’sites/default/files/avatars/defaultavatar.jpg ) So something gets wrong with the relative path.

3. Set the input to PHP, not

Set the input to PHP, not full html (you need to enable the core php filter module for this)

4. oops ..stupid me

done that ...only to bring new error message : Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/charos/public_html/drupal/includes/common.inc(1648) : eval()'d code on line 1

5. Defulat Avatar

I am getting the same error message. HELP!!

Is this PHP code correct? <?php echo ’’; ?>

I thought it was because I uploaded the defaultavatar.jpg file to the wrong directory.

6. Try replaying the ", and '

Try replaying the ", and ' with new ones. If your pdf reader displays them as "curly", they will produce errors.


<?php echo "; ?>

is not complete, check the book for the right code.

7. YES THAT WAS IT!!!!

I was copying and pasting from the pdf file. The ' were displayed with curlys!

That answered my Gallery issue too! This might be a good note to add to your book.

THANK YOU!

8. great !

Just put it as a footnote in the book because we are lazy and we just copy-paste and we don't notice! Shame on us...

9. Not getting it

WHERE do I "fill in the following empty text" from 9(b) above????

10. In the View, under "empty

In the View, under "empty text"