Dnyan
Well-known member
Hello All,
I want equivalent way to do this function in xF2 script. can anyone help me out for this.
	
	
	
		
Thank You
				
			I want equivalent way to do this function in xF2 script. can anyone help me out for this.
		Code:
	
	public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
    {
    
            if($hookName === "page_container_head")
            {
                $options = XenForo_Application::get('options');
                $os_user = $template->getParam('visitor');
                
                $params = $template->getParams();
                
                $hash = hash('sha512', $options->os_hash . $os_user['user_id']);
                $params['os_hash'] = $hash;
                $params += $hookParams;
                
                $contents .= $template->create('onesignal_js', $params);
            }
            
            if($hookName === "page_container_head")
            
            {
                $contents .= "<link rel=\"manifest\" href=\"os_manifest\">";
            }
        
    }Thank You
 
 
		 
 
		