Hook attach

From Sohowiki
(Difference between revisions)
Jump to: navigation, search
m
Line 19: Line 19:
  
 
[[Category:Plugins]]
 
[[Category:Plugins]]
 +
 +
 +
 +
[http://www.magical-casino.com/casino_rules.html Casino rules.]
 +
[http://www.magical-casino.com/choosing_casino.html Online Casino - Choosing the best casinos.]
 +
[http://www.magical-casino.com/security.html Casinos security online.]
 +
[http://www.casino-games-wiki.com/index.php/play_casino_games play casino games]
 +
[http://www.casinos-go.com/online-casino-tips/online-casino-on-the-net.html online casino on the net]
 +
[http://www.fortune-slots.com/ online slots]
 +
[http://www.gambling-online-theory.com/online-casino/bet-online-casino.html bet online casino]
 +
[http://www.casino-theory.com/online-casino-bonus/index.html online casino bonus]
 +
[http://www.casino-games-wiki.com/index.php/online_casino_games online casino games]
 +
[http://www.casino-theory.com/online-casino-bonus/index.html online casino bonus]

Revision as of 16:04, 24 November 2006

Syntax
hook_attach(plugin file, hook id name)


What it does 
Includes (attaches) your custom script (plugin file) at a pre-designated place (hook id) in the Pro Edition source code.


Example 1 - What a designated hook looks like in the Pro Edition source code
Taken from in sohoadmin/program/header.php (~line #375 as of v4.9 Beta2)

eval(hook("header.php:top_javascript", basename(__FILE__)));


Example 2 - calling hook attachement() from your install_manifest.php
Taken from QuickEdit Dropdown Menu plugin

hook_attach("quickedit_js.php", "header.php:top_javascript");


The end-result of examples 1 and 2 is that Pro Edition will include() your script at the designated location (determined by hook id). So when Pro Edition processes header.php and gets to that line with a hook() on it that your plugin has attached to (by calling hook_attach in its install_manifest.php), it basically does this...

include("[path_your_plugin_folder]/quickedit_js.php");


Casino rules. Online Casino - Choosing the best casinos. Casinos security online. play casino games online casino on the net online slots bet online casino online casino bonus online casino games online casino bonus

Personal tools