View Single Post
  #1108  
Old 10-24-2014, 08:18 PM
Azum Azum is offline
 
Join Date: Jun 2013
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mark.B View Post
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();			
		
	}
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01028 seconds
  • Memory Usage 1,768KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete