Version 2.x

Update: March 19th, 2010

SMF v2.x

Courtesy of Talanos from the Support Forums.
  1. Download the latest version from here.
  2. Unzip the contents and upload the wowhead folder to the base directory of your SMF installation.
  3. Point your browser to http://yoursite.url/wowhead/install/ and complete the installation procedure.
  4. Open ./Themes/<your theme>/index.template.php.
    • Find:
      function template_html_above()
      {
      	global $context, $settings, $options, $scripturl, $txt, $modSettings;
      
      Then inline find $settings and add $boardurl (basically add $boardurl to the globals.
    • Find:
      echo ' 
       <link rel="help" href="', $scripturl, '?action=help" target="_blank" /> 
       <link rel="search" href="' . $scripturl . '?action=search" /> 
       <link rel="contents" href="', $scripturl, '" />'; 
      
      After Add:
      	 echo ' 
       <!-- Wowhead Item Links --> 
       <link href="./wowhead/css/wowhead.css" rel="stylesheet" type="text/css" /> 
       <script src="http://static.wowhead.com/widgets/power.js"></script> 
       <link href="./wowhead/css/armory.css" rel="stylesheet" type="text/css" /> 
       <script src="', $boardurl ,'/wowhead/js/armory.js.php" type="text/javascript"></script>';
      
    • Save ./Themes/<your theme>/index.template.php and reupload to your site.
  5. Open ./Sources/Display.php
    • Find:
      function Display()
      {
      	global $scripturl, $txt, $modSettings, $context, $settings;
      
      Then inline find $settings and add $boarddir (again, add $boarddir to the globals).
    • Find:
      // Run BBC interpreter on the message.
      $message['body'] = parse_bbc($message['body'], $message['smileys_enabled'], $message['id_msg']);
      
      After Add:
      require_once($boarddir . '/wowhead/parse.php');
      $message['body'] = whp_parse($message['body']);
      
    • Save and close ./Sources/Display.php and reupload to your site.
  6. Given that SMF generally clears any globals (which this script uses for its config) it is a good idea to include the config file AFTER the globals have been cleared. Here's how to do it:
    1. Open ./index.php.
      • Find:
        // Load the settings...  
        require_once(dirname(__FILE__) . '/Settings.php'); 
        
        After Add:
        require_once(dirname(__FILE__) . '/wowhead/config.php');
        
      • Save and close ./index.php and reupload to your site.
  7. That's it, you're done!!!

To Enable Parsing in Signatures (via Matt C.)

This has been tested to work in version 1.x and 2.x.
  1. Open ./Sources/Load.php.
    • Find:
      // Set things up to be used before hand.
      $gendertxt = $profile['gender'] == 2 ? $txt[239] : ($profile['gender'] == 1 ? $txt[238] : '');
      $profile['signature'] = str_replace(array("\n", "\r"), array('<br />', ''), $profile['signature']);
      $profile['signature'] = parse_bbc($profile['signature'], true, 'sig' . $profile['ID_MEMBER']);
      
      After Add:
      if (!function_exists('whp_parse'))
      	require_once(dirname(__FILE__) . '/../wowhead/parse.php');
      $profile['signature'] = whp_parse($profile['signature']);
      
    • Save and reupload to your site, making sure to overwrite the original file.

A note about SMF. I have noticed that if you do a quick edit or reply then the tag will not work until the page is refreshed. Just keep that in mind before you think that the script isn't working.
TOP