Hi, i'm trying to display the user's image in row of my CC table. As I 'm really not good in php, i have copy the code from another topic (topic about editing image in a form to modify or erase), wich is this one :
This one work really good in my form, but I can't make it run in my CC table. I just get the "No-image" picture, even if user has uploaded an image...
I have paste it in the cell where i want it display. Max said in another topic I read "Don't do an extra query, actually you are doing a query per row, which is wrong". SO I think this the error i do here, but i just don't know how to do this in a better way...
Does anybody have a suggestion ?
<?php
if ( isset($form->data['eleve_portrait']) && $form->data['eleve_portrait'] ) {
echo "<img src='".JURI::root()."images/elevemid_{eleve_portrait}' style='max-width:120px' />";
} else {
echo "<img src='".JURI::root()."images/00_no_image.jpg' style='max-width:120px' />";
}
?>
This one work really good in my form, but I can't make it run in my CC table. I just get the "No-image" picture, even if user has uploaded an image...
I have paste it in the cell where i want it display. Max said in another topic I read "Don't do an extra query, actually you are doing a query per row, which is wrong". SO I think this the error i do here, but i just don't know how to do this in a better way...
Does anybody have a suggestion ?