title: How do I pass a custom field to a hook (Invision Power Board [ipb] / PHP)
body: <p>A long shot but here's hoping someone has some experience coding PHP hooks for Invisions Power Board forum.</p>
  
  <p>I'm attempting to code a status addition and the PHP works fine on it's own, it's the passing of the IPB's reference to my hook that is the issue.</p>
  
  <p>I.E. You setup a custom field in your forum for MSN Username, then from within a skin / template hook you pass the custom field to the hook and then use your PHP code to check on the status.</p>
  
  <p>Here is the IPB skin code I am hooking into on Global->userInfoPane...</p>
  
  <pre><code>        &lt;if test="authorcfields:|:$author['custom_fields'] != """&gt;
                  &lt;foreach loop="customFieldsOuter:$author['custom_fields'] as $group =&gt; $data"&gt;
                          &lt;foreach loop="customFields:$author['custom_fields'][ $group ] as $field"&gt;
                                  &lt;if test="$field != ''"&gt;
                                          &lt;li&gt;
                                                  {$field}
                                          &lt;/li&gt;
                                  &lt;/if&gt;
                          &lt;/foreach&gt;
                  &lt;/foreach&gt;
          &lt;/if&gt;
  </code></pre>
  
  <p>Although I could easily add my own skin hook here.</p>
  
  <p>i.e.</p>
  
  <pre><code>&lt;if test="myHookHere:|:1===1"&gt;&lt;/if&gt;
  </code></pre>
  
  <p>Literally all I need is a single custom field entry from here passed to my hook. If I query every member when the hook is run then that will result in many extra sql queries per page view. All I want to do is pass that specific custom field to the hook...</p>
  
  <p>i.e. myHookHere( $customfield['msn_username'] )</p>
  
  <p>Is this possible? How do you reference the customfield? Can I execute pure PHP from here?</p>
  
  <p>Appreciate anyone that can help! I tried the official invision forums but not had much luck.</p>