MyBB Community Forums

Full Version: Rename file setting
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I'm looking for a way to create a setting in my plugin which can rename a file. In summary:

rename($oldfile, $newfile);

$oldfile = current url of the file
$newfile = $mybb->settings['key']

I apply the setting, but when I apply the setting I want the $newfile become the $oldfile, and the $newfile become the $mybb->settings['key']. How can I do it?
You can hook into admin_config_settings_change and use the function based on the setting value there.

Check this plugin for example: https://github.com/TommM/flpavatar/blob/...p.php#L164