Форумы / Cotonti / Support / shopsystem

ruben
#1 06.01.2013 17:48

i have the shopsystem plugin running at my site, and added the prdct_extra lines to be able to add some extra photo's.
but when there is no photo-url added it does add the code accept for the URL that was not added
so i get an image with a dead url

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 cheeky

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
#2 06.01.2013 18:15

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
#3 06.01.2013 18:42

or:

<!-- IF {SHOPSYSTEM EXTRA LINE} -->

{SHOPSYSTEM EXTRA LINE}

<!-- ELSE -->

<img src="{WHAT_EVER_THE_IMG_TAG_IS}" /> (e.g. no image photo)

<!-- ENDIF -->

lukgoh
#4 06.01.2013 18:49

<!-- IF {SHOPSYSTEM_EXTRA_LINE} -->

<img src="{SHOPSYSTEM_EXTRA_LINE}" />

<!-- ENDIF -->

He doesn't want to display anything if it isnt set.

ruben
#5 06.01.2013 18:56

i changed some things but it still shows the code where there shouldn't be an img like this

<a href="datas/users/1/"><img src="datas/users/1/" width="100px" id="ads" ">



     {SHOPSYSTEM_ITEMS}
<!-- IF {SHOPSYSTEM_ITEMSEX4} -->{SHOPSYSTEM_ITEMSEX4}<!-- ENDIF -->
<!-- IF {SHOPSYSTEM_ITEMSEX5} -->{SHOPSYSTEM_ITEMSEX5}<!-- ENDIF -->
<!-- IF {SHOPSYSTEM_ITEMSEX6} -->{SHOPSYSTEM_ITEMSEX6}<!-- ENDIF -->
<!-- IF {SHOPSYSTEM_ITEMSEX7} -->{SHOPSYSTEM_ITEMSEX7}<!-- ENDIF -->
<!-- IF {SHOPSYSTEM_ITEMSEX8} -->{SHOPSYSTEM_ITEMSEX8}<!-- ENDIF -->
<!-- IF {SHOPSYSTEM_ITEMSEX9} -->{SHOPSYSTEM_ITEMSEX9}<!-- ENDIF -->
     {SHOPSYSTEM_ITEMSEND}
     {SHOPSYSTEM_OPENCLOSED}

 

Added 2 hours later:

already found a solution!

Отредактировано: ruben (06.01.2013 21:49, 11 лет назад)
lukgoh
#6 06.01.2013 22:26

What was your solution?

Twiebie
#7 06.01.2013 22:32

He wanted to show a 'No image available' image when a product didn't have an image.
He's using an old shop plugin for Genoa, and most of the stuff posted above wasn't going to work.

Because he manually needed to add images to every product anyway, I suggested he could just as well manually add a 'No image available' image to products that didn't have their own image.

lukgoh
#8 06.01.2013 23:08

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
#9 06.01.2013 23:11

Nah, the code in the shop plugin is like this:

while ($row = sed_sql_fetcharray($sql))
{  
    // products output
    $shopsystem_items .= "<div id=\"shop_item\">";
    $shopsystem_items .= "<div id=\"shop_image\">";
    $shopsystem_items .= "<h2>".$L['shopystem']['prdcttitle']."".$row['prdct_title']."</h2><hr />";
    $shopsystem_items .= "<center><a href=\"plug.php?e=shopsystem&m=detail&id=".$row['prdct_id']."\"><img src=\"datas/".$cfg['plugin']['shopsystem']['shopsystem_thumbimg']."/".$cfg['plugin']['shopsystem']['shopsystem_userid']."/".$row['prdct_url']."\" width=\"".$cfg['plugin']['shopsystem']['shopsystem_xthumb']."\"></a></center>";
    $shopsystem_items .= "</div>";
    $shopsystem_items .= "<div id=\"shop_desc\" style=\"width:".$cfg['plugin']['shopsystem']['shopsystem_xdesc'].";\">";
    $shopsystem_items .= "<h2>".$L['shopystem']['prdctdesc']."</h2><hr />";
    $shopsystem_items .= "<p><img src=\"plugins/shopsystem/img/help.png\"> ".$row['prdct_desc']."</p>";
    $shopsystem_items .= "<p><img src=\"plugins/shopsystem/img/money.png\"> ".$row['prdct_price']." ".$cfg['plugin']['shopsystem']['shopsystem_money']."</p>";
    $shopsystem_items .= "<p><img src=\"plugins/shopsystem/img/cart_error.png\"> ".$row['prdct_amount']." ".$L['shopystem']['prdct_amount']."</p>";
    $shopsystem_items .= "<a href=\"plug.php?e=shopsystem&m=cart&id=".$row['prdct_id']."\"><img src=\"plugins/shopsystem/img/cart_add.png\"> ".$L['shopystem']['prdctaddtocart']."</a>";
    $shopsystem_items .= "<a href=\"plug.php?e=shopsystem&m=detail&id=".$row['prdct_id']."\"><img src=\"plugins/shopsystem/img/magnifier.png\"> ".$L['shopystem']['prdctdetails']."</a>";
    $shopsystem_items .= "</div>";
    $shopsystem_items .= "</div>";
}
$t-> assign(array(
    "SHOPSYSTEM_TITLE" => $plugin_title, 
    "SHOPSYSTEM_OPENCLOSED" => $plugin_closed, 
    "SHOPSYSTEM_LOGO" => "<img src=\"".$cfg['plugin']['shopsystem']['shopsystem_logo']."\">", 
    "SHOPSYSTEM_ITEMS" => $shopsystem_items, 
    "SHOPSYSTEM_SUBTITLE" => $shopsystem_menu,    
));

 

lukgoh
#10 06.01.2013 23:14

Oh yeah, wow. I need to get my shop module finished so people can stop using this outdated stuff. 

Twiebie
#11 07.01.2013 21:11
#36729 lukgoh:

Oh yeah, wow. I need to get my shop module finished so people can stop using this outdated stuff. 

How's that shop module coming along?

lukgoh
#12 08.01.2013 17:43

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
#13 09.01.2013 09:56

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.

if($row1['prdct_extra4']=='0') 
{ $shopsystem_items .= "<td width=\"200px\"><img src=\"images/nophoto.jpg\" width=\"100px\" id=\"ads\" ></td>";}
 else { $shopsystem_items .= "<td width=\"200px\"><a href=\"datas/users/".$cfg['plugin']['shopsystem']['shopsystem_userid']."/".$row1['prdct_extra4']."\" class=\"fancybox\">
<img src=\"datas/users/".$cfg['plugin']['shopsystem']['shopsystem_userid']."/".$row1['prdct_extra4']."\" width=\"100px\" id=\"ads\" ></a></td>"; };