Vince Taglia
Member
2 questions. I am currently making a plugin that will extend the user upgrades and send an RCON command to the server specified. I am currently listening to class XenForo_UserUpgradeProcessor_PayPal (or at least I am trying to) . I am using the load_class_controller listener. Am I using the right listener for what I am trying to do? Also for that listener it says:
so for the class line I put
Am I doing that right? I always thought it would be
And finally am I calling my options correctly? Ex:
rcon_ip is the id for the option
The code below is what I am using to test the extension and see if I am calling my options correctly.
I go through an upgrade and if the file "Test.txt" has the info I told it to wright the extension and the option calling is correct. Thanks in advance!
My class name isCalled when instantiating a controller. This event can be used to extend the class that will be instantiated dynamically.
Callback signature:
$class, array &$extend
Arguments:
To use this event properly, determine if the class is one you want to extend. If so, add a new entry to $extend with the name of the class that should extend it. This class MUST be defined as follows:
- string $class - the name of the class to be created
- array &$extend - a modifiable list of classes that wish to extend the class. See below.
class My_Class_Name extends XFCP_My_Class_Name
{
// functionality to extend/override
}
This class must extend the non-existent XFCP_x class. This will be resolved at run time.
Code:
RconUpgrade_ControllerPublic_RconUpgrade
Code:
class RconUpgrade_ControllerPublic_RconUpgrade extends XFCP_RconUpgrade_ControllerPublic_RconUpgrade
Code:
class My_Class_Name extends Class_Being_Extended_Name
Code:
$rcon_ip = XenForo_Application::get('options')->rcon_ip;
The code below is what I am using to test the extension and see if I am calling my options correctly.
Code:
<?php
class RconUpgrade_ControllerPublic_RconUpgrade extends XFCP_RconUpgrade_ControllerPublic_RconUpgrade
{
$rcon_ip = XenForo_Application::get('options')->rcon_ip;
$rcon_port = XenForo_Application::get('options')->rcon_port;
$rcon_password = XenForo_Application::get('options')->rcon_password;
$rcon_command1 = XenForo_Application::get('options')->rcon_command;
$colon = ":";
$enter = "\n";
$File = "Test.txt";
$Handle = fopen($File, 'w');
fwrite($Handle, $rcon_ip);
fwrite($Handle, $colon);
fwrite($Handle, $rcon_port);
fwrite($Handle, $enter);
fwrite($Handle, $rcon_password);
fwrite($Handle, $enter);
fwrite($Handle, $rcon_command1);
fclose($Handle);
}
?>