RyanMcClelland
6 years agoExpert
Having trouble with code for banner ads
We need to display banner ads on certain forums and topic pages in our community. I have used the Custom Text feature. We are having issues getting the random number and viewid to generate. Additionally my colleague reports that the div id is <div id="Ad728x90" style="text-align:center;display: inline-block;"> in the admin tool on staging. But when using Inspect Element in the browser, the Div ID is “lb728x90“
This is the code:
Custom Content 2
Original:
<#assign user_role = "v" />
<#list restadmin("/users/id/${user.id?c}/roles").roles.role as role>
<#if role.name?? && (role.name == "DOT_COM_FREE")>
<#assign user_role = "f" />
</#if>
</#list>
<#list restadmin("/users/id/${user.id?c}/roles").roles.role as role>
<#if role.name?? && (role.name == "DOT_COM_FREECCD")>
<#assign user_role = "f" />
</#if>
</#list>
<#list restadmin("/users/id/${user.id?c}/roles").roles.role as role>
<#if role.name?? && (role.name == "DOT_COM_PREMIUM")>
<#assign user_role = "p" />
</#if>
</#list>
<script type="text/javascript">
function getCookie(name)
{
var re = new RegExp(name + "=([^;]+)");
var value = re.exec(document.cookie);
return (value != null) ? unescape(value[1]) : null;
}
var advUserType='';
advUserType = getCookie("ADV");
if (getCookie("ADV") == "yes")
{advUserType="a";}else{advUserType='';}
</script>
<div id="lb728x90" style="align=center">
<script src="//msmedia.morningstar.com/mstar/jserver/site=ms.us/area=discuss.forum/size=728x90/pos=top/usrt=${user_role}" + advUserType + "/forumid=${coreNode.id}/random=${utils.numbers.randomIntWithCeiling(10000000)}/viewid=${utils.numbers.randomIntWithCeiling(10000000)}?"></script>
</div>