MyBB Community Forums

Full Version: Use functions from UserCP on another page?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Well, I feel I've exhausted all other support resources for this, so time to ask for help.

I've made a plugin that recreates the UserCP layout on a page. Now, what hooks/functions would I need in the plugin to use {$requiredfields} or {$user_notepad} for example, just as they are in the UserCP where I can add them to my page's template and have them function the same?

With my generalized knowledge of PHP this makes sense, however if you need more info on what I'm trying to do just let me know.
Simply hook it to the global_start.

$plugins->add_hook('global_start', 'function_name');

Then you're able to use the variable everywhere.
(05-23-2016, 07:36 AM)Sazze Wrote: [ -> ]Simply hook it to the global_start.

$plugins->add_hook('global_start', 'function_name');

Then you're able to use the variable everywhere.

Thanks a lot for your reply. It's exactly what I want, but I'm not sure where to start. Basically what I'm trying to do is replicate the UCP Edit Profile (usercp.php?action=profile) under a new name with the same hooks and abilities, using the new page to save a few custom profile fields since I want to organize them into their own UCP category.

I think this would require:
1. The ability to use {$requiredfields}, {$userfields['fidx']}, {$customfieldval}, etc on the new page.
2. A new save button since the one on the profile page will not work with other pages:
<input type="submit" class="button" name="regsubmit" value="{$lang->update_profile}" />

If you have any idea on how to execute all of this I would appreciate the input.
Nvrm, got it.