Hi Michal,
Dhealraigh sé seo an-aisteach, agus mar sin rialaigh mé amach coimhlintí plugin agus chuaigh sé díreach go dtí an comhad a PHP.
D'oibrigh mé an cód le beagán agus fuair an réiteach seo a leanas. B'fhéidir gurb é an rud amháin a dhéanann difear do mo láthair, ach is cosúil go raibh isteach chomh luath agus is comharthaí athfhriotail singil (\\ ') sa html, bhris an eagarthóir. Dá bhrí sin, d'athraigh mé go léir na Sleachta Sleachta dúbailte amháin, agus gach rud a d'oibrigh. Ina theannta sin, bhí orm a bhaint $ vbphrase ['vbenterprisetranslator_postin_noselection'] agus ghabhfaidh sí a hionad leis an teaghrán 'Béarla'. Féach ar athrú cód thíos i vbenterprisetranslator_functions_hooks.php:
AIMSIGH:
PHP Code:
function vbet_editor_toolbar_end(&$editor_template_name) {
if (!$vbulletin->templatecache["$editor_template_name"]) {
fetch_template("$editor_template_name");
}
$toReplace = '<div id=\"$editorid';
if (false === strpos($vbulletin->templatecache["$editor_template_name"], $toReplace)) {
$toReplace = '<div id=\"{$editorid';
}
require_once(DIR. '/includes/vbenterprisetranslator_functions_utils.php');
global $vbphrase, $vbulletin, $stylevar;
$additionalScript = '<div class=\'smallfont\' style=\'text-align:left;\'>'
.$vbphrase['vbenterprisetranslator_postin']
.' <label for=\'vbet_addbbcodes\'><input id=\'vbet_addbbcodes\' type=\'radio\' name=\'vbet_postInLanguage\' value=\''
.$vbulletin->userinfo['vbet_def_lang'].'\' checked>'
.'<img src=\'images/vbet/flags/'
.$vbulletin->userinfo['vbet_def_lang'].'.gif\' alt=\'$name\' border=\'0\'/>'
.$vbphrase['vbenterprisetranslator_flag_'.strtr($vbulletin->userinfo['vbet_def_lang'], '-', '_')]
.'</label> <label for=\'vbet_nobbcodes\'><input id=\'vbet_nobbcodes\' type=\'radio\' name=\'vbet_postInLanguage\' value=\'0\'>'
.$vbphrase['vbenterprisetranslator_postin_noselection']
.'</label></div>'.$toReplace;
$vbulletin->templatecache[$editor_template_name] =& vbet_replaceFirst($toReplace, $additionalScript, $vbulletin->templatecache["$editor_template_name"]);
}
Replace:
PHP Code:
function vbet_editor_toolbar_end(&$editor_template_name) {
if (!$vbulletin->templatecache["$editor_template_name"]) {
fetch_template("$editor_template_name");
}
$toReplace = '<div id=\"{$editorid';
require_once(DIR. '/includes/vbenterprisetranslator_functions_utils.php');
global $vbphrase, $vbulletin, $stylevar;
$additionalScript = '<div class=\"smallfont\" style=\"text-align:left;\">'
.$vbphrase['vbenterprisetranslator_postin']
.' <label for=\"vbet_addbbcodes\"><input id=\"vbet_addbbcodes\" type=\"radio\" name=\"vbet_postInLanguage\" value=\"'
.$vbulletin->userinfo['vbet_def_lang'].'\" checked>'
.'<img src=\"images/vbet/flags/'
.$vbulletin->userinfo['vbet_def_lang'].'.gif\" alt=\"$name\" border=\"0\"/>'
.$vbphrase['vbenterprisetranslator_flag_'.strtr($vbulletin->userinfo['vbet_def_lang'], '-', '_')]
.'</label> <label for=\"vbet_nobbcodes\"><input id=\"vbet_nobbcodes\" type=\"radio\" name=\"vbet_postInLanguage\" value=\"0\">'
. 'English</label></div>'
. $toReplace;
$vbulletin->templatecache[$editor_template_name] = vbet_replaceFirst($toReplace, $additionalScript, $vbulletin->templatecache[$editor_template_name]);
}
Fuair mé réidh leis an strpos glaoch chun acmhainní a shábháil, mar is cosúil leis an leagan crua-códaithe a bheith ag obair