-1

How can I add banners after categories in main page in Phpbb? like this photo

I tried in forumlist_body.html, viewforum_body.html and viewtopic_body.html. But I never see a difference. I use phpbb 3.1. my style page in admin panel its my style in admin panel. I used DVGFX theme but it inheritanced from prosilver. Thanks.

mymiracl
  • 583
  • 1
  • 16
  • 24

1 Answers1

1

The file to change is forumlist_body.html

Here are the original lines 11 to 27

<!-- IF forumrow.S_IS_CAT or forumrow.S_FIRST_ROW  or forumrow.S_NO_CAT  -->
    <div class="forabg">
        <div class="inner">
        <ul class="topiclist">
            <li class="header">
                <!-- EVENT forumlist_body_category_header_row_prepend -->
                <dl class="icon">
                    <dt><div class="list-inner"><!-- IF forumrow.S_IS_CAT --><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a><!-- ELSE -->{L_FORUM}<!-- ENDIF --></div></dt>
                    <dd class="topics">{L_TOPICS}</dd>
                    <dd class="posts">{L_POSTS}</dd>
                    <dd class="lastpost"><span>{L_LAST_POST}</span></dd>
                </dl>
                <!-- EVENT forumlist_body_category_header_row_append -->
            </li>
        </ul>
        <ul class="topiclist forums">
<!-- ENDIF -->

You have to prepend something like this :

<!-- IF forumrow.S_IS_CAT -->
    add your ADS here
<!-- ENDIF -->

But the best way is to overload the forumlist_body_category_header_before event. So your code should be :

<!-- IF forumrow.S_IS_CAT -->
    <a href="site2.com">
        <img alt="" height="80" src="site1.com/reklam/ads.jpg"; width="1000">
    </a> 
<!-- ENDIF -->
<!-- IF forumrow.S_IS_CAT or forumrow.S_FIRST_ROW  or forumrow.S_NO_CAT  -->
    <div class="forabg">
        <div class="inner">
        <ul class="topiclist">
            <li class="header">
                <!-- EVENT forumlist_body_category_header_row_prepend -->
                <dl class="icon">
                    <dt><div class="list-inner"><!-- IF forumrow.S_IS_CAT --><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a><!-- ELSE -->{L_FORUM}<!-- ENDIF --></div></dt>
                    <dd class="topics">{L_TOPICS}</dd>
                    <dd class="posts">{L_POSTS}</dd>
                    <dd class="lastpost"><span>{L_LAST_POST}</span></dd>
                </dl>
                <!-- EVENT forumlist_body_category_header_row_append -->
            </li>
        </ul>
        <ul class="topiclist forums">
<!-- ENDIF -->        

This tips will help you during dev : Check that in PCA > General > Server configuration > Load Settings > General options > Recompile stale style components is set to Yes . So you don't have to reload cache after each update

Alexandre Tranchant
  • 4,426
  • 4
  • 43
  • 70
  • Did you have removed bracket each side of `add your ADS` here ? Did your clear cache ? Did you change settings to detect each style modification and calculated them ? – Alexandre Tranchant Jan 21 '17 at 08:55
  • {L_TOPICS}
    its my code. for ads.
    – mymiracl Jan 21 '17 at 09:07
  • I edited my answer. Don't forget to clean cache. And please could you be a little more explicit ? What do you mean by "it didn't work" ? – Alexandre Tranchant Jan 21 '17 at 09:15
  • I did but no changes. I'm new in phpbb. I did this change in my styles/themename/template/forumlist_body.html. But i never see a change. – mymiracl Jan 21 '17 at 09:24
  • I edited my main question. My style DVGFX but it inheritanced prosilver. I made changes to two themes. But cant see a change. – mymiracl Jan 21 '17 at 09:30
  • Setting the new style as default will not change the existing style for you or other existing members. Check in your owwn user profile that your are using this DVGFX style too. – Alexandre Tranchant Jan 21 '17 at 09:57
  • I checked it. I use DVGFX style but also i made all changes in two themes. – mymiracl Jan 21 '17 at 10:02
  • 1
    I tried to delete forumlist_body.html but site didnt down. Is it normal ? – mymiracl Jan 21 '17 at 10:05
  • no ! It is not normal. If site is still working, it is because of misconfiguration. You're not using this theme. – Alexandre Tranchant Jan 21 '17 at 10:08
  • It is work because inheritanced from prosilver. I deleted two forumlist_body and site down. But my problem never solved. – mymiracl Jan 21 '17 at 10:16
  • This tips will help you during dev : Check that in PCA > General > Server configuration > Load Settings > General options > Recompile stale style components: is set to `Yes` . So you don't have to reload cache after each update. – Alexandre Tranchant Jan 21 '17 at 10:29
  • 1
    It's work!!! Thanks so much. But i reload cache after all update. I dont understand how its work :) – mymiracl Jan 21 '17 at 10:39
  • Generating style is heavy. So there is a cache system to provide good performances. You could reload cache manually after each modification, or you could modify this option. (But I think you should reload cache the first time you changed this option. – Alexandre Tranchant Jan 21 '17 at 10:49
  • Okey. I understand it. Thanks i cant solve without you :) – mymiracl Jan 21 '17 at 10:50