View Full Version : Using Turn ads off field in a conditional

06-22-2008, 07:45 PM
Morgan, can you give us an example of how you would test for the setting of the field used to turn GAB ads off in a conditional?

Basically we're trying to setup out "Recent Posts" menu to exclude a specific forum (that has an RSS feed from EBAY) from the recent posts search results if the member has turned off advertising.

<td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&amp;exclude=257" accesskey="2">$vbphrase[todays_posts]</a></td>

Is basically what the link with the exclusion would look like, while those that didn't have GAB ads turned off would get:

<td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily" accesskey="2">$vbphrase[todays_posts]</a></td>


The field we're using for turning GAB ads off is profilefieldid 21 in the profilefield table.

The other way I thought to do this was to check for membership in the group that's allowed to turn ads off sorta like:

<if condition="is_member_of($bbuserinfo,61)"><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getnew&amp;exclude=257" accesskey="2">Get New Posts</a></td>

While members not in that group get the search without the exclusion,
but that's a bit imprecise as they may be allowed to turn them off but have them still turned on.

Anyway, any assistance or syntax you could provide would be greatly appreciated!

James and Susan

Actually, it might be better to tie it to whatever GAB looks at as a condition? In case members that don't have the right to turn ads off have that field set anyway.

06-24-2008, 04:46 PM
Try either $vbulletin->userinfo['field21'] or $bbuserinfo['field21'] in a code or template conditional respectively.