ruben |
|
---|---|
i have the shopsystem plugin running at my site, and added the prdct_extra lines to be able to add some extra photo's. how can i change the code in the shopsystem.detail.php code so it shows a "No Photo" image when the prdct_extra field is empty?
i tried a little bit myself but i have no php coding skills at all
if (empty($row1['prdct_extra9']) {$shopsystem_items .= "<td width=\"200px\"><img src=\"images/geenfoto.jpg width=\"100px\" id=\"ads\" \"></td>" : '';} else {
$shopsystem_items .= "<td width=\"200px\"><a href=\"datas/users/".$cfg['plugin']['shopsystem']['shopsystem_userid']."/".$row1['prdct_extra9']."\" target=\"_blank\">
<img src=\"datas/users/".$cfg['plugin']['shopsystem']['shopsystem_userid']."/".$row1['prdct_extra9']."\" width=\"100px\" id=\"ads\" \"></a>" : '';};
|
lukgoh |
|
---|---|
You can use a callback in the tpl file. <!-- IF {WHAT_EVER_THE_IMG_TAG_IS} --> <img src="{WHAT_EVER_THE_IMG_TAG_IS}" /> <!-- ENDIF -->
Luke. |
Kingsley |
|
---|---|
or: <!-- IF {SHOPSYSTEM EXTRA LINE} --> {SHOPSYSTEM EXTRA LINE} <!-- ELSE --> <img src="{WHAT_EVER_THE_IMG_TAG_IS}" /> (e.g. no image photo) <!-- ENDIF --> |
lukgoh |
|
---|---|
<!-- IF {SHOPSYSTEM_EXTRA_LINE} --> <img src="{SHOPSYSTEM_EXTRA_LINE}" /> <!-- ENDIF --> He doesn't want to display anything if it isnt set. |
ruben |
|
||||
---|---|---|---|---|---|
i changed some things but it still shows the code where there shouldn't be an img like this
Added 2 hours later: already found a solution! |
|||||
This post was edited by ruben (2013-01-06 21:49, 12 years ago) |
lukgoh |
|
---|---|
What was your solution? |
Twiebie |
|
---|---|
He wanted to show a 'No image available' image when a product didn't have an image. |
lukgoh |
|
---|---|
Ah man, I didn't read his first post properly. At least its sorted, good job. How comes Kingsley's suggestion didn't work, because Genoa doesn't support template call backs or something? |
Twiebie |
|
||||
---|---|---|---|---|---|
Nah, the code in the shop plugin is like this:
|
lukgoh |
|
---|---|
Oh yeah, wow. I need to get my shop module finished so people can stop using this outdated stuff. |
Twiebie |
|
---|---|
#36729 lukgoh: How's that shop module coming along? |
lukgoh |
|
---|---|
I haven't had any time to work on it, or any of my other modules except I have started working on a project/portfolio but I have a client who needs the shop module so that should be released fully functioning in the next 2-3 weeks. |
ruben |
|
||
---|---|---|---|
this is what i wanted, if prdct_extra4 is empty (or now i set '0' in the form were i add the photo's) there is a 'nophoto' image showing.
|