Quote:
Originally Posted by Mark.B
That's a weird one....I don't have any AME options showing anywhere (although I do use AME) so haven't run into this.
I can't understand why it would affect code run at another hook. It's just an if conditional, which is closed off. So whether it returns true or false, it ought not to affect any other hooks.
Could it be that the AME checkbox only shows on the WYSIWYG? That would explain it, as you've turned the WYSIWIG off with my code.....though only in the mobile style. Shouldn't affect a normal style.
Slightly baffled, I'm afraid.
|
Took me awhile to figure it out, but AME adds the convert URLs to video checkbox by looking for the newpost_disablesmilies hook, if present, it injects the checkbox before the smilies checkbox... and from what I can tell the newpost_disablesmilies hook only gets called in the WYSIWYG editor.
I'm working on trying to change it to something else, like attachments... maybe you could help.
Like this code here works, but I want it to show up after the attachments box, not before it... which is what it currently does. (note newpost_attachment was newpost_disablesmilies until I changed it).
Code:
hook: parse_templates
if ($vbulletin->templatecache['newpost_attachment'])
{
require_once(DIR . '/includes/ame_prep.php');
$ame = new AME_editor_prep($vbulletin, THIS_SCRIPT);
$ame->add_template_injection(
array(
'type' => 'cache',
'name' => 'newpost_attachment',
'search' => '$final_rendered = \'',
'replace' => '$final_rendered = \'<li><label for="cb_parseame"><input type="checkbox" name="parseame" value="1" id="cb_parseame" tabindex="1" %2$s /> \' . vB_Template_Runtime::parsePhrase("ame_auto_convert") . \'</label><input type="hidden" name="parseame_check" value="1" /><input type="hidden" name="parseame_wasdisabled" value="%1$d" /></li>'
)
);
$ame->do_template_injections();
}