MyBB Community Forums

Full Version: [Enhanced Account Switcher] Options in frontend doesn't show up
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Plugin's link: http://community.mybb.com/mods.php?action=view&pid=408

What I did:
  1. Downloaded the plugin to my PC
  2. Uploaded the whole inc folder to the whole forum's directory
  3. Activated the plugin in the admin CP
  4. Configured the settings

This is my website: forum.international-union.com

UPDATE: I tried to switch back to Default theme and the options are available. I think it isn't compatible with (any other) themes. My current theme is Vienna.
Readme file Wrote:Check template edits by reference to the function accountswitcher_apply_template_edits() in inc/plugins/accountswitcher/as_admincp.php

http://pastebin.com/WhNQBhME
Sorry, my mistake, I missed out the Installation section in the Readme.txt. Now I've read and don't understand (5), which is the one you're saying.

What shall I do with the code? Huh
example
find_replace_templatesets('header_welcomeblock_member', '#{\$lang->welcome_pms_usage}#', '{\$lang->welcome_pms_usage}<!-- AccountSwitcher -->{$as_header}<!-- /AccountSwitcher -->');
template => header_welcomeblock_member
find
{$lang->welcome_pms_usage}
replace with
{$lang->welcome_pms_usage}<!-- AccountSwitcher -->{$as_header}<!-- /AccountSwitcher -->
/**
 * Applies the template edits.
 *
 */
function accountswitcher_apply_template_edits()
{
require_once MYBB_ROOT."/inc/adminfunctions_templates.php";
// Apply the template edits
find_replace_templatesets('header_welcomeblock_member', '#{\$lang->welcome_pms_usage}#', '{\$lang->welcome_pms_usage}<!-- AccountSwitcher -->{$as_header}<!-- /AccountSwitcher -->');
find_replace_templatesets('newreply', "#".preg_quote('<input type="submit" class="button" name="submit"')."#s", '{$as_post}&nbsp;<input type="submit" class="button" name="submit"');
find_replace_templatesets('newthread', "#".preg_quote('<input type="submit" class="button" name="submit"')."#s", '{$as_post}&nbsp;<input type="submit" class="button" name="submit"');
find_replace_templatesets('showthread_quickreply', "#".preg_quote('<input type="submit" class="button" value="{$lang->post_reply}')."#s", '{$as_post}&nbsp;<input type="submit" class="button" value="{$lang->post_reply}');
find_replace_templatesets('newreply', "#".preg_quote('{$lang->reply_to}</strong>')."#s", '{$lang->reply_to}</strong><a name="switch" id="switch"></a>');
find_replace_templatesets('newthread', "#".preg_quote('{$lang->post_new_thread}</strong>')."#s", '{$lang->post_new_thread}</strong><a name="switch" id="switch"></a>');
find_replace_templatesets('showthread', "#".preg_quote('{$quickreply}')."#s", '<a name="switch" id="switch"></a>{$quickreply}');
find_replace_templatesets("header", "#".preg_quote('{$pm_notice}')."#i", '{$pm_notice}{$pm_switch_notice}');
find_replace_templatesets("header", "#".preg_quote('{$menu_memberlist}')."#i", '{$menu_memberlist}{$menu_accountlist}');
find_replace_templatesets("header", "#".preg_quote('<div id="container">')."#i", '{$as_sidebar}<div id="container">');
find_replace_templatesets("postbit", "#".preg_quote('{$post[\'onlinestatus\']}')."#i", '{$post[\'onlinestatus\']}{$post[\'authorchange\']}');
find_replace_templatesets("postbit_classic", "#".preg_quote('{$post[\'onlinestatus\']}')."#i", '{$post[\'onlinestatus\']}{$post[\'authorchange\']}');
find_replace_templatesets("postbit", "#".preg_quote('{$post[\'user_details\']}')."#i", '{$post[\'user_details\']}{$post[\'attached_accounts\']}');
find_replace_templatesets("postbit_classic", "#".preg_quote('{$post[\'user_details\']}')."#i", '{$post[\'user_details\']}{$post[\'attached_accounts\']}');
find_replace_templatesets("member_profile", "#".preg_quote('{$profilefields}')."#i", '{$profilefields}{$profile_attached}');
find_replace_templatesets("memberlist_user", "#".preg_quote('{$user[\'profilelink\']}')."#i", '{$user[\'profilelink\']}{$user[\'attached_accounts\']}');
find_replace_templatesets("headerinclude", "#".preg_quote('var modal_zindex = 9999')."#i", 'var modal_zindex = 9995');
}
What's the
find_replace_templatesets

? Undecided
Are those commands to be pasted then press enter somewhere and those things will be done automatically? Angel

Nono, I'm not lazy but I'm scared. Confused
^ plugin is working on default theme but not on Vienna theme =>
plugin was unable to add required codes in Vienna theme as it has modified templates.

so to make the plugin work on Vienna theme, you have to physically inspect the code in templates and modify if required.
(2015-06-07, 11:56 AM).m. Wrote: [ -> ]was unable to add required codes in Vienna theme as it  has modified templates.

Is my theme considered as bad/poorly-coded?
^ Vienna theme templates are modified much and some plugins do not work without adding codes manually!
Help!

This kind how:

find_replace_templatesets('newreply', "#".preg_quote('<input type="submit" class="button" name="submit"')."#s", '{$as_post}&nbsp;<input type="submit" class="button" name="submit"');