News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

because there is no hook in the user profile,summary section smf 2.1

Started by Dhayzon, September 05, 2020, 10:35:44 PM

Previous topic - Next topic

Dhayzon

how to execute a code only in the summary section, using only hooks

Dhayzon

 sol:


add_integration_function('integrate_load_custom_profile_fields', 'Mod\Mod::load_custom_profile_fields',false);
         
    public  static function load_custom_profile_fields($memID, $area){
       
        if($area == 'summary'){
            $scroll = new Helpers\ScriptVars\ScriptVars();
            $scroll->scroll(); 
        }
       
    }


Arantor

The other option is to hook onto the main profile areas hook, and replace the call to summary with a call to your function, which should also call summary. (And reset the template in $context back to 'summary')

Advertisement: