Hello,
I've enabled Development Tools and I've came across some issues, maybe you can point out what I'm doing wrong.
Created 'New Add-On' under name 'MCBans' id/title (No:
Installation Code: or
Uninstallation Code: defined)
Created 'Code Event Listener':
Listen to Event: template_hook
Execute Callback: MCBans :: Lookup
Checked:
Enable Callback Execution
Description: MCBans Lookup
Add-On: MCBans
Created Folder: MCBans in library/
Created Folder: Listener in library/MCBans
Created File: MCBans.php in library/MCBans/
Code:
Code:
<?php
class MCBans
{
public static function Lookup($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
{
if ($hookName == 'message_user_info')
{
$url = "http://justonemoreblock.com/mcbans/?username=";
$contents = file_get_contents($url);
echo $contents;
}
}
}
?>
No clue if this would work or not.
Basically this will connect to a remote site, the username name is input by a $custom.field, so I won't have to define, by ideal way is too include it the template like
{MCBans.Lookup}{$custom.userfield.minecraft_username} and it will pull the username from the already added database.
http://justonemoreblock.com/mcbans/?username=rogerthemaestro (Random account pulled off MCBans)
This info will be displayed. (Template will be re-designed once this works.
Please any assistance will be appreciated.
Regards,
Cory