
Gabums85
User
Jan 27, 2012, 2:45 PM
Post #1 of 16
(1331 views)
Shortcut
|
|
Membership plugin - author specific photo
|
Can't Post
|
|
Hello all, I was hoping someone could help me out here. I have added a photo uploader under user accounts so that way, when a user posts something, their image will show up next to their post. I found this code <?php echo $record['createdBy.fullname'] ?> that works perfect for adding the users name that posted the information but I can't seem to get anything to work for images. I've tried
<?php foreach ($record['avatar'] as $upload): ?> <?php echo $upload['createdBy.avatar'] ?> <?php endforeach ?> But that doesn't work.. No image shows up at all...I've tried...
<?php list(list($current_user_with_uploads),) = getRecords(array('tableName' => 'accounts', 'where' => mysql_escapef('num = ?', $CURRENT_USER['num']), 'allowSearch' => false)); ?> <?php if (sizeof(@$current_user_with_uploads['avatar'])): $upload = $current_user_with_uploads['avatar'][0] ?> <img src="<?php echo $upload['urlPath'] ?>" /> <?php else: ?> <img src="images/fpo_avatar.jpg" width="75" height="75" /> <?php endif ?> Where I get an image (my image) but it shows up for EVERY post. I'm assuming because it is using "current_user" commands and I'm the one signed in. Is there anything I can do to make this work? Thanks! Gab
|