Webmastersite.net
Register Log In

Show Thumbshot or Affiliate Ad
How to show one or the other.

Comments on Show Thumbshot or Affiliate Ad

hai
Forum Regular

Usergroup: Customer
Joined: Apr 03, 2007
Location: NY & PA

Total Topics: 94
Total Comments: 339
hai
Posted Nov 26, 2010 - 8:44 AM:

On the linkbit template...

this code shows the thumbshot:

<IF {SWITCH_THUMBSHOTS}><td style="vertical-align: top;"><div class="thumbshot">{LINKTHUMBSHOT}</div></td></IF>


and I had added this code to show the affiliate ads:

<IF {LINKAFFILIATECODEBOOL}>{LINKAFFILIATECODE}</IF>


but that makes for a very crowded linkbit when the listing is an affiliate ad with two images being displayed. When that happens, the thumbshot is always a 'coming soon' image anyway due to the affiliate url.

So, with a little luck, I modified the code to be the following and now if the listing is an affiliate ad that will show, otherwise it shows the thumbshot.

<IF {LINKAFFILIATECODEBOOL}><td style="vertical-align: top;"><div class="thumbshot">{LINKAFFILIATECODE}</div></td><OTHERWISE><IF {SWITCH_THUMBSHOTS}><td style="vertical-align: top;"><div class="thumbshot">{LINKTHUMBSHOT}</div></td></IF></IF>


Hope this helps others!
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Nov 27, 2010 - 9:07 PM:

You can simplify it a bit to
<td style="vertical-align: top;"><div class="thumbshot"><IF {LINKAFFILIATECODEBOOL}>{LINKAFFILIATECODE}<OTHERWISE IF {SWITCH_THUMBSHOTS}>{LINKTHUMBSHOT}</IF></div></td>
hai
Forum Regular

Usergroup: Customer
Joined: Apr 03, 2007
Location: NY & PA

Total Topics: 94
Total Comments: 339
hai
Posted Dec 07, 2010 - 1:22 PM:

Cleaner, smaller code. Thanks Paul!
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.