17.08.2008, 14:44
Hallo,
ich habe so eben auf MyBB 1.4 aktualisiert und versuche jetzt ein Plugin anzupassen, dass die welcomeblocks editieren soll. die Funktion edit_templates() sah ursprünglich einmal anders aus, daher der Umweg ;-)
Leider passiert gar nichts...
Vielen Dank schonmal für eure Hilfe!
ich habe so eben auf MyBB 1.4 aktualisiert und versuche jetzt ein Plugin anzupassen, dass die welcomeblocks editieren soll. die Funktion edit_templates() sah ursprünglich einmal anders aus, daher der Umweg ;-)
PHP-Code:
//Zum aktivieren
$guest['title'] = "header_welcomeblock_guest";
$guest['search'] = "{\$lang->welcome_register}</a>";
$guest['replace'] = "{\$lang->welcome_register}</a> — <a href=\"{\$v['pagesroot']}/index2.php\">{\$mybb->settings['homename']}</a>";
$member['title'] = "header_welcomeblock_member";
$member['search'] = "{\$lang->welcome_logout}</a>";
$member['replace'] = "{\$lang->welcome_logout}</a> — <a href=\"{\$v['gameroot']}/index.php\">{\$mybb->settings['homename']}</a>";
$admin['title'] = "header_welcomeblock_member_admin";
$admin['search'] = "<a href=\"{\$mybb->settings['bburl']}/{\$config['admin_dir']}/index.php\">{\$lang->welcome_admin}</a>";
$admin['replace'] = "<a href=\"{\$mybb->settings['bburl']}/{\$config['admin_dir']}/index.php\" target=\"_blank\">{\$lang->welcome_admin}</a>";
edit_templates($guest['search'], $guest['replace'], $guest['title']);
edit_templates($member['search'], $member['replace'], $member['title']);
edit_templates($admin['search'], $admin['replace'], $admin['title']);
PHP-Code:
//Zum deaktiveren
$guest['title'] = "header_welcomeblock_guest";
$guest['replace'] = "{\$lang->welcome_register}</a>";
$guest['search'] = "{\$lang->welcome_register}</a> — <a href=\"{\$v['pagesroot']}/index2.php\">{\$mybb->settings['homename']}</a>";
$member['title'] = "header_welcomeblock_member";
$member['replace'] = "{\$lang->welcome_logout}</a>";
$member['search'] = "{\$lang->welcome_logout}</a> — <a href=\"{\$v['gameroot']}/index.php\">{\$mybb->settings['homename']}</a>";
$admin['title'] = "header_welcomeblock_member_admin";
$admin['replace'] = "<a href=\"{\$mybb->settings['bburl']}/{\$config['admin_dir']}/index.php\">{\$lang->welcome_admin}</a>";
$admin['search'] = "<a href=\"{\$mybb->settings['bburl']}/{\$config['admin_dir']}/index.php\" target=\"_blank\">{\$lang->welcome_admin}</a>";
edit_templates($guest['search'], $guest['replace'], $guest['title']);
edit_templates($member['search'], $member['replace'], $member['title']);
edit_templates($admin['search'], $admin['replace'], $admin['title']);
PHP-Code:
if(!function_exists("edit_templates"))
{
function edit_templates($search, $replace, $title)
{
if(!function_exists("find_replace_templatesets"))
{
require MYBB_ROOT."inc/adminfunctions_templates.php";
find_replace_templatesets($title, '#'.$search.'#', $replace);
}
}
}
Leider passiert gar nichts...
Vielen Dank schonmal für eure Hilfe!