Move ads on profile to below crucial user information

Roger Ghostraven Posted in Technical Support 6 years ago

I am trying to move the OSSN Ads to the bottom of the profile page so friends, the photo album, and the chat module are first in the list. I think the right area to change in the ossn_com.php file is:

ossn_add_hook('newsfeed', "sidebar:right", 'ossn_ads_sidebar', 300);

I have tried changing to:

ossn_add_hook('newsfeed', "sidebar:right", 'ossn_ads_sidebar', 1000);

and

ossn_add_hook('newsfeed', "sidebar:right", 'ossn_ads_sidebar', $priority = 1000);

but it just stays glued to the top. How can I fix this, Having info on friend and other stuff all the way at the bottom is not a good setup, especially when I have about 15 ads before them.

Replies
us Roger Ghostraven Replied 6 years ago

Thank you Zet. You are amazing. It is exactly how I wanted it now.

German Michael Zülsdorff Replied 6 years ago

Actually you'll be out of luck doing it that way since the ads placement on the profile page is hardcoded in components/OssnProfile/plugins/default/profile/pages/profile.php

As a quick and dirty workaround you can
- make a backup of profile.php first
- and move line 131 below the ossn-profile-modules div like

            <div class="ossn-profile-sidebar hidden-xs">
            <div class="ossn-profile-modules">
                <?php if (ossn_is_hook( 'profile', 'modules')) { 
                            $params[ 'user'] = $user; 
                            $modules = ossn_call_hook('profile', 'modules', $params); 
                            echo implode( '', $modules);
                } ?>

            </div>               
            <?php if (com_is_active( 'OssnAds')) { echo ossn_plugin_view( 'ads/page/view_small'); } ?>
        </div>

I'll do a pull request to make this configurable from inside the ads component for future releases