Stickyfan
01-04-2012, 11:59 PM
Please help. I'm trying to replace an image & link only when certain "Dealer" users visit my page. If the user is not a Dealer, the default image and link should be shown.
With my current code, I'm seeing the modified image and link when a Dealer users visits the page, but the problem is that the default image is shown as well (stacked below the Dealer image & link).
I think my problem is that I'm posting the Dealer image and link instead of "replacing" the default image and link. Here's my code:
if($dealer['user_id'] > 0){
print '
<h3>How It Works</h3>
<p>Click on each step to learn more</p>
<p style="text-align:center;"><img alt="" border="0" src="'.D.'uploads/users/images/why-pre-sell-dealer.gif" style="width:465px; height:306px;" usemap="#whatspresell" />
<map id="whatspresell" name="whatspresell">
<area alt="" class="colorbox {iframe:true,height:300,width:300}" coords="156,1,300,49" href="'.D.'files/why-pre-sell-popup.php?id=94" shape="rect" />
<area alt="" class="colorbox {iframe:true,height:625,width:810}" coords="327,77,463,131" href="'.D.'files/why-pre-sell-popup.php?id=95" shape="rect" />
<area alt="" class="colorbox {iframe:true,height:650,width:800}" coords="295,182,440,237" href="'.D.'files/why-pre-sell-popup.php?id=96" shape="rect" />
<area alt="" class="colorbox {iframe:true,height:700,width:900}" coords="156,258,303,302" href="'.D.'files/why-pre-sell-popup.php?id=97" shape="rect" />
<area alt="" class="colorbox {iframe:true,height:400,width:900}" coords="13,179,159,232" href="'.D.'files/why-pre-sell-popup.php?id=98" shape="rect" />
<area alt="" class="colorbox {iframe:true,height:450,width:550}" coords="1,62,134,119" href="'.D.'files/why-pre-sell-popup.php?id=106" shape="rect" />
</map>
</p>
';
}
print '
<h3>How It Works</h3>
<p>Click on each step to learn more</p>
<p style="text-align:center;"><img alt="" border="0" src="'.D.'uploads/users/images/why-pre-sell-2.gif" style="width:465px; height:306px;" usemap="#whatspresell" />
<map id="whatspresell" name="whatspresell">
<area alt="" class="colorbox {iframe:true,height:300,width:300}" coords="156,1,300,49" href="'.D.'files/why-pre-sell-popup.php?id=94" shape="rect" />
<area alt="" class="colorbox {iframe:true,height:625,width:810}" coords="327,77,463,131" href="'.D.'files/why-pre-sell-popup.php?id=95" shape="rect" />
<area alt="" class="colorbox {iframe:true,height:650,width:800}" coords="295,182,440,237" href="'.D.'files/why-pre-sell-popup.php?id=96" shape="rect" />
<area alt="" class="colorbox {iframe:true,height:700,width:900}" coords="156,258,303,302" href="'.D.'files/why-pre-sell-popup.php?id=97" shape="rect" />
<area alt="" class="colorbox {iframe:true,height:400,width:900}" coords="13,179,159,232" href="'.D.'files/why-pre-sell-popup.php?id=98" shape="rect" />
<area alt="" class="colorbox {iframe:true,height:450,width:550}" coords="1,62,134,119" href="'.D.'files/why-pre-sell-popup.php?id=99" shape="rect" />
</map>
</p>
';
?>
The only 2 differences between the Dealer and default sections are the src= image and the ID in the 6th "area". Here's a screen shot of my issue:
http://img600.imageshack.us/img600/2622/screenshot20120104at356.png (http://imageshack.us/photo/my-images/600/screenshot20120104at356.png/)
If you have questions I'll do my best to answer. Thank you!
With my current code, I'm seeing the modified image and link when a Dealer users visits the page, but the problem is that the default image is shown as well (stacked below the Dealer image & link).
I think my problem is that I'm posting the Dealer image and link instead of "replacing" the default image and link. Here's my code:
if($dealer['user_id'] > 0){
print '
<h3>How It Works</h3>
<p>Click on each step to learn more</p>
<p style="text-align:center;"><img alt="" border="0" src="'.D.'uploads/users/images/why-pre-sell-dealer.gif" style="width:465px; height:306px;" usemap="#whatspresell" />
<map id="whatspresell" name="whatspresell">
<area alt="" class="colorbox {iframe:true,height:300,width:300}" coords="156,1,300,49" href="'.D.'files/why-pre-sell-popup.php?id=94" shape="rect" />
<area alt="" class="colorbox {iframe:true,height:625,width:810}" coords="327,77,463,131" href="'.D.'files/why-pre-sell-popup.php?id=95" shape="rect" />
<area alt="" class="colorbox {iframe:true,height:650,width:800}" coords="295,182,440,237" href="'.D.'files/why-pre-sell-popup.php?id=96" shape="rect" />
<area alt="" class="colorbox {iframe:true,height:700,width:900}" coords="156,258,303,302" href="'.D.'files/why-pre-sell-popup.php?id=97" shape="rect" />
<area alt="" class="colorbox {iframe:true,height:400,width:900}" coords="13,179,159,232" href="'.D.'files/why-pre-sell-popup.php?id=98" shape="rect" />
<area alt="" class="colorbox {iframe:true,height:450,width:550}" coords="1,62,134,119" href="'.D.'files/why-pre-sell-popup.php?id=106" shape="rect" />
</map>
</p>
';
}
print '
<h3>How It Works</h3>
<p>Click on each step to learn more</p>
<p style="text-align:center;"><img alt="" border="0" src="'.D.'uploads/users/images/why-pre-sell-2.gif" style="width:465px; height:306px;" usemap="#whatspresell" />
<map id="whatspresell" name="whatspresell">
<area alt="" class="colorbox {iframe:true,height:300,width:300}" coords="156,1,300,49" href="'.D.'files/why-pre-sell-popup.php?id=94" shape="rect" />
<area alt="" class="colorbox {iframe:true,height:625,width:810}" coords="327,77,463,131" href="'.D.'files/why-pre-sell-popup.php?id=95" shape="rect" />
<area alt="" class="colorbox {iframe:true,height:650,width:800}" coords="295,182,440,237" href="'.D.'files/why-pre-sell-popup.php?id=96" shape="rect" />
<area alt="" class="colorbox {iframe:true,height:700,width:900}" coords="156,258,303,302" href="'.D.'files/why-pre-sell-popup.php?id=97" shape="rect" />
<area alt="" class="colorbox {iframe:true,height:400,width:900}" coords="13,179,159,232" href="'.D.'files/why-pre-sell-popup.php?id=98" shape="rect" />
<area alt="" class="colorbox {iframe:true,height:450,width:550}" coords="1,62,134,119" href="'.D.'files/why-pre-sell-popup.php?id=99" shape="rect" />
</map>
</p>
';
?>
The only 2 differences between the Dealer and default sections are the src= image and the ID in the 6th "area". Here's a screen shot of my issue:
http://img600.imageshack.us/img600/2622/screenshot20120104at356.png (http://imageshack.us/photo/my-images/600/screenshot20120104at356.png/)
If you have questions I'll do my best to answer. Thank you!