• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

show all hooks available

Status
Not open for further replies.

DroidHost

Well-known member
This is not a big add on ...
it will help many ....

this add-on Will Show all the Hooks available in the style and there position(location)

it can be disable from options
and it will work only for userID == 1
 

Attachments

  • DH_ShowHooks.zip
    DH_ShowHooks.zip
    1.4 KB · Views: 122
  • showhooks1.webp
    showhooks1.webp
    9 KB · Views: 137
  • showhooks2.webp
    showhooks2.webp
    28.8 KB · Views: 288
Is there a way to only show the Ad hook templates?
i think these codes will work correctly
open and edit Listener file (which is included the first post)
PHP:
<?php
class DroidHost_ShowHooks_listener
{
public static function templateHookShow($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
{
$options = XenForo_Application::get('options');
$showHookName = $options->showHookName;
$visitor = XenForo_Visitor::getInstance();
$userid = $visitor['user_id'];
if ($showHookName == 1 and $userid == 1 )
{
if(strstr($hookName, 'ad_'))
       {
$contents .= "<span class='subHeading'>$hookName</span>" ;
}
}

}
}
 
yes
you could include a second check

$hookName2 = substr($hookName,0,3);
if ($hookName2 == 'ad_'){..
 
i think these codes will work correctly
open and edit Listener file (which is included the first post)
PHP:
<?php
class DroidHost_ShowHooks_listener
{
public static function templateHookShow($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
{
$options = XenForo_Application::get('options');
$showHookName = $options->showHookName;
$visitor = XenForo_Visitor::getInstance();
$userid = $visitor['user_id'];
if ($showHookName == 1 and $userid == 1 )
{
if(strstr($hookName, 'ad_'))
      {
$contents .= "<span class='subHeading'>$hookName</span>" ;
}
}

}
}
no this would also show all hooks with ad_ in the title. for example 'dad_hook', 'ragtek_pad_post' would also be shown;) and because it cuts the title, you'll only see ad_hook & ad_post
 
i'm using something similar in my add-on, but with some extras (because i don't think that we'll ever release it:D ) some suggestions=>

1. sometimes hooks suround some elements, so show: hook foo start ... hook foo end
2. we've included the hook params. On mouseover you could show the name & params
 
[ot]
awww no sharey :-( lol
no, ATM it's impossible
Our developer tools are too "custom" with too many dependencies and hardcoded paths & other applications.
Once we finish the refactoring, we'll share it...
[/ot]
 
i'm using something similar in my add-on, but with some extras (because i don't think that we'll ever release it:D ) some suggestions=>

1. sometimes hooks suround some elements, so show: hook foo start ... hook foo end
2. we've included the hook params. On mouseover you could show the name & params
I will try ...
I am not good as u guys ,,,
 
Status
Not open for further replies.
Top Bottom