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?
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} <input type="submit" class="button" name="submit"');
find_replace_templatesets('newthread', "#".preg_quote('<input type="submit" class="button" name="submit"')."#s", '{$as_post} <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} <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
?
Are those commands to be pasted then press enter somewhere and those things will be done automatically?
Nono, I'm not lazy but I'm scared.
^ 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} <input type="submit" class="button" name="submit"');