• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • 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.

Dr.Yontem

Formerly Tilkißey
#10
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>" ;
}
}

}
}
 
R

ragtek

Guest
#11
yes
you could include a second check

$hookName2 = substr($hookName,0,3);
if ($hookName2 == 'ad_'){..
 
R

ragtek

Guest
#12
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
 
R

ragtek

Guest
#15
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
 
R

ragtek

Guest
#17
[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]
 

DroidHost

Well-known member
#19
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.