%~if adsize eq '300x250' and $ad_300x250%>
<%~if forum_id eq '4' or page_id eq 'login'%>
<%~if admod eq 'mobile' or $admod eq 'tablet'%>
<%~-- Serve ad for tablet/mobile --%>
<%~else%>
<%~endif%>
<%~else%>
<%~if admod eq 'mobile' or $admod eq 'tablet'%>
<%~-- Serve ad for tablet/mobile --%>
<%~else%>
<%~endif%>
<%~endif%>
<%~elsif adsize eq '300x600' and $ad_300x600%>
<%~if admod eq 'mobile' or $admod eq 'tablet'%>
<%~-- Serve ad for tablet/mobile --%>
<%~else%>
<%~if forum_id eq '4' or page_id eq 'login'%>
<%~else%>
<%~endif%>
<%~endif%>
<%~elsif adsize eq '728x90' and $ad_728x90%>
<%~if forum_id eq '4' or page_id eq 'login'%>
<%~-- Serve leaderboard ad --%>
<%~else%>
<%~-- Serve leaderboard ad --%>
<%~endif%>
<%~endif%>