My PHP skills are not that good and I have been struggling to get some code to work once I have upgraded to EE2.
For EE1, I had this code to display avatars on certain forum pages that did not support avatars. I also wanted to display a default avatar as well.
Here is the EE1 code
<?php global \$DB;
\$query = "SELECT member_id, avatar_filename FROM exp_members WHERE screen_name='" . \\\\$DB->escape_str('{author}') . "'";
\$res = \$DB->query(\$query);
if(\$res->row['avatar_filename'] != '') {
echo "<img >row['avatar_filename'] . "\" >";
} else {
echo 'http://images.mydomain.com/images//anon_avatar.png';
}
?>Here is my updated EE2 code that does not seem to work:
<?php
\$query = $this->EE->db->query("SELECT member_id, avatar_filename FROM exp_members WHERE screen_name='" . \\\\$this->db->escape_str('{author}') . "'");
if(\$query->row['avatar_filename'] != '') {
echo "<img >row['avatar_filename'] . "\" >";
} else {
echo 'http://images.mydomain.com/images/anon_avatar.png';
}
?>Can someone help? Thank you!