Sometimes, forum owners prefer to configure the resource in a way that hides (or conversely shows) different information for guests of the forum and registered participants. A common example is displaying advertisements to forum guests and stopping the display of ads for users immediately after they log in to the forum. This can be implemented without installing additional mods (modules) on your resource.
Changes are made to the theme files used via FTP (you cannot make these edits through the “Admin Panel”).
Advertisements for Forum Users and Guests
1. Ads only for forum users (authorized users):
<!-- IF S_USER_LOGGED_IN --> code for ads for users <-- ENDIF -->
In this case, the information between the tags (or the code from the ad network) will be displayed only for users who have logged into the forum with their username and password.
2. Ads only for guests:
<!-- IF not S_USER_LOGGED_IN --> code for ads for guests <!-- ENDIF -->
With this condition applied, guests of the forum will see the ads, while logged-in users will not.
3. Different ads (information) for forum guests and users:
<!-- IF S_USER_LOGGED_IN --> info-1 for users <!-- ELSE --> info-2 for guests <!-- ENDIF -->
With this condition, info-1 is displayed only for forum users, and info-2 is for guests of your site.
Ads in the First and Last Messages
1. Ads only in the very first message of the topic:
<!-- IF not START and postrow.S_ROW_COUNT == 0 --> code from the ad network <!-- ENDIF -->
2. Ads in the first message on all pages of the topic:
<!-- IF postrow.S_FIRST_ROW --> code from the ad network <!-- ENDIF -->
3. Ads in the last message on all pages of the topic:
<!-- IF postrow.S_LAST_ROW --> code from the ad network <!-- ENDIF -->
Prohibiting Ads in Specific Topics and Posts
1. Prohibiting ads in a specific category (forum branch):
<!-- IF FORUM_ID != x --> code from the ad network <!-- ENDIF -->
Instead of “x,” insert your numeric value for the FORUM CATEGORY where you want to prohibit the display of ads.
2. Prohibiting ads in a specific topic (forum message):
<!-- IF TOPIC_ID != 1 --> code from the ad network <!-- ENDIF -->
Instead of “x,” insert your numeric value for the FORUM TOPIC where you want to prohibit the display of ads.
SEO Specialist Tip: The presence or absence of ads on the forum will not directly affect the website’s search rankings (we’re talking about a reasonable amount of permissible ads, such as Adsense or Yandex Display Network). However, ads can influence user behavior, which directly affects the site’s ranking. Therefore, the forum administrator should ensure that ads are displayed in a way that does not repel visitors and does not reduce the usability of the resource.
