OpenSourceãšProã®2ã€ã®ããŒãžã§ã³ã§é åžãããŠããŸãã ããã®ããã®ãã©ã°ã€ã³ã¯ãã»ãããªãŒã¢ãŒãã§é åžãããŸãïŒwatchãwatchãpayãuseã
äžè¬çã«ãã·ã¹ãã ã¯OOPã®ç²Ÿç¥ã§æžãããŠãããã»ãšãã©ãã¹ãŠã®ãããã¿ã«ããã¯ããããORMãããããã¹ãŠãã»ãšãã©åé¡ãããŸãã...
ãã©ã°ã€ã³ã®ã€ã³ã¹ããŒã«
ã ãããæåã®ãã€ã³ãïŒãã©ã°ã€ã³ãã€ã³ã¹ããŒã«ããŸãã ãã©ã°ã€ã³ã®ã€ã³ã¹ããŒã«ã¯ä»¥äžã§æ§æãããŸãïŒ
- ãã©ã°ã€ã³ã®ããã$ mt / plugins / <plugin>ãã©ã°ã€ã³ã³ãŒãã«å ¥åããŸã
- $ mtpub / mt-static / plugins / <plugin>ã«éçãã©ã°ã€ã³ãã¡ã€ã«ã®ãã©ã«ããŒãå ¥åããŸã
- $ mt / extlib /ã®ã©ã€ãã©ãªã«å ¥åããå¿ èŠããããã©ããã確èªããŸã
- ãperlã®ã©ã€ãã©ãªãã€ã³ã¹ããŒã«ããå¿ èŠããããŸããïŒããšãããããã¯ã«é¢ããããã¥ã¡ã³ãã泚ææ·±ãåŠç¿ããŸã
- ãä»ãããã³ãã¬ãŒããæžãæããæ¹æ³ããšãããããã¯ã«é¢ããããã¥ã¡ã³ãã泚ææ·±ãåŠç¿ããŸãã
ãã©ã°ã€ã³ã®æ©èœãšè€éãã«å¿ããŠãæåŸã®2ã€ã®ãã€ã³ããéèŠãªã¿ã¹ã¯ã«ãªãå ŽåããããŸãã äžéšã®ãã©ã°ã€ã³ã¡ãŒã«ãŒã¯ãmt-hacks.comã®TemplateInstallerãªã©ããããã®ã¿ã¹ã¯ãç°¡çŽ åããã«ã¹ã¿ã ãã©ã°ã€ã³ãéçºããŸãã ã
ãããã£ãŠãMTçšã®ãã©ã°ã€ã³ãäœæããå Žåã¯ããŠãŒã¶ãŒãã§ããã ãåããå°ãªãããããã«æ éã«æ€èšããŠãã ããã
MTã®ãã©ã°ã€ã³ã®èª¬æ
ããã§ããã©ã°ã€ã³ãäœæããããšã«ããŸããã ãã©ã«ããŒæ§é ãäœæããŸããïŒ
plugins/coolplugin/
plugins/coolplugin/lib/
plugins/coolplugin/tmpl/
mt-static/plugins/coolplugin/
ãããŠã圌ãã¯èããŸããïŒäœã«ã€ããŠæžãã¹ããïŒ
ãŸããconfig.yamlãèšè¿°ããŸãã ãã©ã°ã€ã³ã®èª¬æã¯ãããã€ãïŒ4.xxã¿ã€ãïŒããå§ãŸããconfig.yamlãã¡ã€ã«ãä»ããŠç°¡åã§ã¢ã¯ã»ã¹å¯èœãªåœ¢åŒã§äœæã§ããŸãããã©ã°ã€ã³ã®ã¡ã€ã³ãã¡ã€ã«ã«å€æ°ã®ã³ãŒããè¿œå ããããšã¯ã§ããŸããã ããã§ã¯ãconfig.yamlãå«ããããšãã§ãããã®ãšå«ããã¹ããã®ã¯äœã§ããïŒ
ãããã 誰ãç¥ããŸãã ã ããã«äœãããã®ãââãç¥ãããå Žåã¯ã
$mt/lib/MT/Plugin.pm
ãšä»ã®ãã©ã°ã€ã³ã
$mt/lib/MT/Plugin.pm
ã
æãæçšãªãã®ã¯æ¬¡ã®ãšããã§ãã
nameïŒãã©ã°ã€ã³ã®ååã åãŸãããã«çãç·ããå§ãããŸãã idïŒãã©ã°ã€ã³åOneWord author_linkïŒãã©ã°ã€ã³ã®äœè ãžã®ãªã³ã¯ author_nameïŒãã©ã°ã€ã³äœæè å descriptionïŒ<__ trans phrase = "ãã©ã°ã€ã³ã®èª¬æããã©ã°ã€ã³ã¡ãã¥ãŒã§ãã©ââã°ã€ã³åãã¯ãªãã¯ãããšè¡šç€ºãããŸã"> ããŒãžã§ã³ïŒãã©ã°ã€ã³ã®ããŒãžã§ã³ schema_versionïŒãã©ã°ã€ã³ããŒã¿ã¹ããŒãããŒãžã§ã³ plugin_linkïŒãã©ã°ã€ã³ãããŒãžã§ããããŒãžãžã®ãªã³ã¯ doc_linkïŒãã©ã°ã€ã³ã®èª¬æãããããŒãžãžã®ãªã³ã¯ blog_config_templateïŒtemplate_name with_configuration_page.tpl l10n_classïŒãã©ã°ã€ã³::åœéåã¯ã©ã¹ ã¢ã€ã³ã³ïŒãã©ã°ã€ã³ç»å{gif / png / jpg / itd} èšå®ïŒ ã©ã®èšå®ïŒ ããã©ã«ãïŒãããã©ã«ãå€ã ã¹ã³ãŒãïŒããã° ã°ããŒãã«èšå®ïŒ ããã©ã«ãïŒãããéèŠã initïŒ$ãã©ã°ã€ã³::ã¢ãžã¥ãŒã«::åæåé¢æ° ã³ãŒã«ããã¯ïŒ ããã€ãã®ããã¯ïŒ$ãã©ã°ã€ã³::ã¢ãžã¥ãŒã«::ããã¯é¢æ° ã¿ã°ïŒ æ©èœïŒ TagNameïŒ$ãã©ã°ã€ã³::ã¢ãžã¥ãŒã«:: tag_function ãããã¯ïŒ BlockTagNameïŒ$ãã©ã°ã€ã³::ã¢ãžã¥ãŒã«:: block_function_function object_typesïŒ ãªããžã§ã¯ãïŒ fieldïŒtypeïŒãã®ãã£ãŒã«ãã¯ããŒã¿ããŒã¹ã®ãªããžã§ã¯ãã«è¿œå ãããŸã fieldïŒtype metaïŒãã®ãã£ãŒã«ãã¯ã¡ã¿ããŒã¿ããŒãã«ã«ä¿åãããããŒã¿ããŒã¹æ§é ãæŽæ°ããå¿ èŠã¯ãããŸãã ã¢ããªã±ãŒã·ã§ã³ïŒ ïŒå¿ããŠããŸã£ãåŸ
äžåºŠã«ãã¹ãŠã®ã»ã¯ã·ã§ã³ãå¿ èŠã«ãªãããšã¯ã»ãšãã©ãããŸããããããã«äœããããã«ã€ããŠã®èª¬æãäžè¶³ããŠãããšãããã«å€ãã®åé¡ãçºçããŸãã
äžèšã§ã¯ãç§èªèº«ãåºãããããã¹ãŠã説æããŸããã
icon:
ãªã©ã®äºçŽ°ãªããšã§ãããããã¥ã¡ã³ãã§ã¯ãªãMTèªäœã®ã³ãŒãã§çºèŠãããŸããã
ãã©ã°ã€ã³æ§æ
èšå®ã«ã€ããŠã¯å€ãã®ããšãæžãããŠããŸãã MTã¯éžæè¢ãæäŸããŸããèšå®ããŒãžãèªåã§äœæããããèªåãžã§ãã¬ãŒã¿ã䜿çšããŸãã ãã©ã°ã€ã³ã2-3-4ã®åçŽãªè¡/ãã§ãã¯ããã¯ã¹/ãªã©ã§æ§æãããŠããå Žåããã¡ãããèªåçæããã°ã©ã ã䜿çšããæ¹ãã¯ããã«ç°¡åã§é«éã§ãã äžè¬çã«ãåºæ¬ã¯Adept MT Byrne Reeseã®èšäºã HOWTOïŒOwn plugin settings page ãã§åœ¹ç«ã¡ãŸãïŒByrneã¯MTã«ã€ããŠå€ãã®ããšãç¥ã£ãŠããŸãã圌ã®æçš¿ãèªãããšããå§ãããŸãïŒã
æ§æã«é¢é£ããããã€ãã®ãã€ã³ãã説æããããšæããŸããããã®èª¬æã¯ã©ãã«ãèŠã€ãããŸããã§ããã
ãã©ã°ã€ã³æ§æäžã®ããŒã¿ã®æ€èšŒ
MTèªäœã¯ãããŒã¿ãå®éã«ã©ãã§ãæ€èšŒããŸããã ç®çã®åã«ãã£ã¹ããããåŸãæ倧å€ãä¿æãããããæ€èšŒã®æ¹æ³ãèŠã€ããã®ã¯ããã»ã©ç°¡åã§ã¯ãªãããšãããããŸããã
ãã®ãããããã«ã¯ãinitããã¯ã§èšå®ããããã©ã°ã€ã³ã¯ã©ã¹ããããŸãïŒäžèšã®config.yamlãåç §ïŒã ã¡ãœããèªäœïŒããšãã°ãplugins / OurPlugin / lib / Plugin.pmã«ãããŸãïŒã¯ãæãåçŽãªå Žåã¯æ¬¡ã®ããã«ãªããŸãã
package OurPlugin::Plugin use base 'MT::Plugin'; sub cb_init { my $p = shift; return bless $p, 'OurPlugin::Plugin'; }
config.yamlã«ã¯æ¬¡ã®ããã«èšè¿°ãããŠããŸãã
init: $OurPlugin::Plugin::cb_init
ãã®ãããä¿åæã«OurPlugin :: PluginïŒsave_configãåŒã³åºããããªããžã§ã¯ããããã·ã¥å ã®ãã©ãŒã ããŒã¿ãã¹ã³ãŒããšãªã¢ã®3ã€ã®åŒæ°ãäžããããŸãã
ãã§ã«ããŒã¹MT ::ãã©ã°ã€ã³ããããããäœãããªããã°ããŠãŒã¶ãŒãå ¥åãæ±ãããã®ã¯ãã¹ãŠãã®ãŸãŸä¿åãããŸãã æ€èšŒãè¡ãã«ã¯ã次ã®ãã®ãå¿ èŠã§ãã
sub save_config { my ($plugin, $args, $scope) = @_; my @errors; # if (@errors) { return $plugin->error("<br />\n".join("<br />\n", @errors)); } return $plugin->SUPER::save_config($args, $scope); } ## end sub save_config
ããã«ãããä¿åæã«äžæ°å³ãªãšã©ãŒããŒãžãçæãããæ»ããã¿ã³ã衚瀺ãããŸãã ãªãã§ïŒ å¥ã®æ¹æ³ã§è¡ãããšãã§ããŸãïŒå¥ã®é¢æ°load_configãè¿œå ããŸãïŒ
sub load_config { my ($plugin, $args, $scope) = @_; $plugin->SUPER::load_config($args, $scope); # - , $plugin->error() if($plugin->errstr) { # Set $args->{error} to display error banner right before plugin settings $args->{error} = $plugin->errstr; } } ## end sub load_config
ãããŠãæ§æãã³ãã¬ãŒãã«ããŒã¹ãæ¿å ¥ããŸã
<mt:if name="error"> <mtapp:statusmsg id="generic-error" class="error"> <mt:var name="error"> </mtapp:statusmsg> </mt:if>
ãããã£ãŠãä»»æã®ããŒã¿ãä¿åãããŸãããèšå®ãŠã£ã³ããŠãéããšããŠãŒã¶ãŒã«ã¯äœãééã£ãŠããã®ããããããŸãã ã©ã¡ãã®æ¹æ³ãéžæãããã¯ããªã次第ã§ããäž¡æ¹ã®æ¹æ³ãããŸããŸãªå Žé¢ã§äœ¿çšã§ããŸãã å€ãã®æšæºã¿ã°ã¯ãã©ã°ã€ã³æ§æãã³ãã¬ãŒãå ã§ã¯æ©èœããªãããšã«æ³šæããŠãã ããã ã€ãŸãããããã¯äœ¿çšå¯èœã§ããããã³ãã¬ãŒãã¯åå¥ã®ç¬ç«ããã³ã³ããã¹ãã§ã³ã³ãã€ã«ããããããèšå®ãçæãããããã°IDããããŸãã-ãããŠãããã§
load_config
ã¯
$args->{...}
load_config
$args->{...}
ã«èšå®ããããã«
load_config
å©ãã«
load_config
$args->{...}
å¿ èŠãªå€æ°
$args->{...}
ããã䜿çšããªããšãéåžžã©ãããŠãŒã¶ãŒã«ããã³ãââããåºãããšãã§ããŸããã
ãã©ã°ã€ã³ãæ§æããããã®JQueryæ¥ç¶
ãšãŠãé¢çœãç¬éã MT5ã¯jQãå®å šã«äœ¿çšããŸãããMT4ã§ã¯ããã§ã¯ãããŸããã åæã«ãMT4ã®äžéšã®ãã©ã°ã€ã³ã¯ãã§ã«jQãããŒãããŠãããããåžžã«jQãããŒãããã ãã§ã¯ããããã§ç«¶åãçºçããŸãã
ç§èªèº«ã¯ãblog_config.tmplã®ãã®ãããªéšåã§ããã決å®ããŸããã
<mt:If tag="Version" lt="5"> <script type="text/javascript"> // prevent double-load of jQuery, save if jQ already loaded its state if(window.jQuery) { window.__PLUG_jQ = window.jQuery; window.__PLUGB = window.$; } </script> <script type="text/javascript" src="<$mt:StaticWebPath$>jquery/jquery.js"></script> <script type="text/javascript"> // Restore there jQ state, if it was loaded before if(window.__PLUG_jQ) { window.jQuery = window.__PLUG_jQ; window.$ = window.__PLUGB; window.__PLUG_jQ = undefined; window.__PLUGB = undefined; } </script> </mt:If>
ãã®ã¡ãœããã¯ããŸãçŸãããããŸããããjQãæ£ç¢ºã«ããŒãããã$ / jQueryãæªããªããªãããšã確èªã§ããŸãã
ã¿ã°ããžãã¯
ããã§ã¿ã°ãèããŠã¿ãŸãããïŒé¢æ°ãšãããã¯ã
ã¿ã°é¢æ°ã¯ãçŸåšã®ã³ã³ããã¹ããåŒæ°ãæ¡ä»¶ãåãåãã䜿çšãããæååãè¿ãç¹å®ã®é¢æ°ã§ãã ãã³ãã¬ãŒãã§ã¯ãã¿ã°ã¯
<$mt:$>
ä»ããŠåç §ãããŸãã
å€å žçãªè³ªåïŒ
- ã¿ã°ã§èšå®ãååŸããæ¹æ³ã¯ïŒ
sub tag_somemytag { my ($ctx, $args, $cond) = @_; my $blog_id = $ctx->stash('blog_id'); my $some_param = MT->component('OurPlugin')->get_config_value('some_param', 'blog:' . $blog_id); # my $config = MT->component('OurPlugin')->get_config_hash('blog:' . $blog_id); # .... } ## end sub tag_somemytag
- ä»ã®ã¿ã°ã䜿çšããã¿ã°ãäœæããæ¹æ³ã¯ïŒ
sub tag_somemytag { my ($ctx, $args, $cond) = @_; my $text = "<$mt:SomeOtherTag$>"; .... my $t = MT::Template->new; $t->text($t); return $t->build($ctx) or $ctx->error($t->errstr); } ## end sub tag_somemytag
- ãã°ãå ±åããã«ã¯ïŒ
ãŸããå®éã«ã¯ã¡ããã©$ctx->error("error message");
ããããããã«å ããŠããã·ã£ãŒãåãããããšã©ãŒã¡ãœããããããŸããäŸãã°ã$ctx->_no_entry_error();
ã
詳现ã«ã€ããŠã¯ã$ mt / lib / MT / Template / Context.pmãåç §ããŠãã ããã
ãããã¯ã¿ã°ã¯ãã«ãŒããæ¡ä»¶ããŸãã¯ãã³ãã¬ãŒãã§ãå éšããå®çŸ©ãããŠãããããããã¯èªäœããããã®ã³ã³ãã€ã«æ¹æ³ã決å®ããäœãã§ãã ãããã¯config.yamlã®ã¿ã°/ãããã¯ã§èª¬æãããŠããŸãïŒäžèšåç §ïŒã é åã®å€å žçãªã¿ã°ã«ãŒãã¯æ¬¡ã®ããã«ãªããŸãã
sub tag_myloop { my($ctx, $args, $cond) = @_; my $builder = $ctx->stash('builder'); # . # , - my $tokens = $ctx->stash('tokens'); # , my $res = ''; my $vars = $ctx->{__stash}{vars} ||= {}; for my $i (0..$#looparray) { my $item = $looparray[$i]; # , local $vars->{__item__} = $item; # local $vars->{__first__} = $i == 0; local $vars->{__last__} = ($i==($#looparray-1)); local $vars->{__odd__} = ($i % 2) == 0; local $vars->{__even__} = ($i % 2) == 1; local $vars->{__counter__} = $i+1; defined(my $out = $builder->build($ctx, $tokens, $cond)) or return $ctx->error($builder->errstr); $res .= $out; } return $res; }
ãããã£ãŠãæ¬äœã¯å¿ èŠãªåæ°ã ãã³ã³ãã€ã«ãããé£çµãããŠçºè¡ãããŸãã ãã¡ãããå¿ èŠã«å¿ããŠå¥ã®ããžãã¯ãäœæããããšãã§ããŸãããããã¯ããã»ã©æçœã§ã¯ãªãããšã§ãããããã£ãŠãäžè¬çãªã«ãŒã«ã«åŸãããšããå§ãããŸããã¿ã°ãããã¯ã¯ãå¿ èŠãªããŒã¿ãžã®ã¢ã¯ã»ã¹ãæäŸããŸãã
ã³ãŒã«ããã¯ïŒã«ãŒãã«ããã¯
äžè¬ã«ãMTã«ã¯ãã»ãšãã©ãã¹ãŠã®å Žåã«ãã³ãã©ãŒãåºå®ããæ©èœãå«ãŸããŠããŸãã å©çšå¯èœãªå Žæã®è©³çŽ°ã«ã€ããŠã¯ãããã¥ã¡ã³ããåç §ããŠãã ããããã ããããã§ããã¹ãŠããªã¹ããããŠããããã§ã¯ãªããäž»ãªãã®ã®ã¿ããªã¹ããããŠããŸãã ããšãã°ã管çããã«ã§ããŒãžã®ãã³ãã¬ãŒããèšå®ããå¿ èŠãããå Žåã¯ã
MT::App::CMS::template_param.
ããã¯ãå®çŸ©ããå¿ èŠããããŸãã ãŸããããŒãžã®åºåãå€æŽããå¿ èŠãããå Žåã¯ãtemplate_outputã䜿çšãããŸãã ãããã®ããã¯ã¯ã管çããã«ã§ç¬èªã®ããŒãžãäœæãããå Žåã«éåžžã«åœ¹ç«ã¡ãŸãïŒèŠæ±ãããã°ã次ã®æçš¿ã§ïŒã ã©ã®ãããªçš®é¡ã®ããã¯ãçºçããããèŠã€ããå¿ èŠãããå Žåã
run_callbacks
ã®MTã³ãŒããgrepããŠã察å¿ããã¢ãžã¥ãŒã«ã®PODãåæããŠãã ããã
ã³ãŒã«ããã¯ã®ãããã¯ã¯ããããå Žåã«é·ãéåãããšãã§ãããããæçš¿å ã®twitterãžã®ãªã³ã¯ãèªåçã«å±éãããªã©ãæãåçŽãªäŸã玹ä»ããŸãã
config.yamlã§å®çŸ©
ã³ãŒã«ããã¯ïŒ MT ::ãšã³ããª:: pre_saveïŒ$ OurPlugin ::ãã©ã°ã€ã³:: cb_entry_pre_save ïŒcms_pre_save.entryïŒ$ OurPlugin ::ãã©ã°ã€ã³:: cb_cms_pre_save_entry ïŒapi_pre_save.entryïŒ$ OurPlugin ::ãã©ã°ã€ã³:: cb_api_pre_save_entry
ä¿åããåã«ã¬ã³ãŒãã®ããã¹ããåŠçãç¶ããããšãã§ãã3ã€ã®ãã€ã³ãããããŸãã
-
MT::Entry::pre_save
ããŒã¿ããŒã¹ã«ä¿åããçŽåã«ORMãã³ãã©ãŒããåŒã³åºãããŸãã -
cms_pre_save.entry
管çããã«ã§ç·šéãããšãã«ã¬ã³ãŒããä¿åããåã«åŒã³åºãããŸã -
api_pre_save.entry
-RPCãŸãã¯ATOMãä»ããŠç·šéãããšãã«ã¬ã³ãŒããä¿åããåã«åŒã³åºãããŸã
Entry_pre_saveã¯ãæ£èŠè¡šçŸã§ããã¹ããåŠçããã ããªã®ã§ãã¿ã¹ã¯ã«æé©ã§ãã ã ãããç§ãã¡ã¯æžãïŒ
sub cb_entry_pre_save { my ($cb, $entry, $original) = @_; my $txt = $entry->text; if ($txt ne $original->text) { my $newtxt = $txt; # regexp from twitter-blackbird-pie plugin $newtxt =~ s/([^a-zA-Z0-9_]|^)([@\xef\xbc\xa0]+)([a-zA-Z0-9_]{1,20})(\/[a-zA-Z][a-zA-Z0-9\x80-\xff-]{0,79})?/$1@<a href="http://twitter.com/intent/user?screen_name=$3" class="twitter-action">$3</a>/ug; $entry->text($newtxt) if ($newtxt ne $txt); } return 1; } ## end sub cb_entry_pre_save
ã¢ããªã±ãŒã·ã§ã³ïŒç®¡çè èšå®
MTèªäœã¯ããã€ãã®ãå¥åã®ãéšåã«åå²ãããåéšåã¯éå§ç¹ããèµ·åãããŸãã ããã¯ïŒ
- CMSïŒmt.cgiãadminïŒ
- ã³ã¡ã³ãïŒmt-comments.cgiãäžè¬ããã®æ°ããã³ã¡ã³ãã®åä¿¡ïŒ
- ãŠã£ã¶ãŒãïŒmt-wizard.cgiãã€ã³ã¹ããŒã«
- ã¢ããã°ã¬ãŒãïŒmt-upgrade.cgiãããŒã¿ããŒã¹ã®æŽæ°æã«åŒã³åºãããŸãïŒ
- æ€çŽ¢ãæ€çŽ¢::ããªãŒããã¹ãïŒmt-search.cgiãmt-ftsearch.cgiããµã€ãã®å ¬ééšåã§æ€çŽ¢ïŒ
- ActivityFeedsïŒmt-feed.cgiãRSS / Atomãžã§ãã¬ãŒã¿ãŒïŒ
- ãã©ãã¯ããã¯ãNotifyList
config.yamlã¢ããªã±ãŒã·ã§ã³ã»ã¯ã·ã§ã³ã®åéšåã«ã€ããŠããã©ã°ã€ã³ãå±é/眮æããç¬èªã®ãã©ã¡ãŒã¿ãŒãšèšå®ãèšå®ã§ããŸãã ã»ã¯ã·ã§ã³å šäœã®ææžåã¯éåžžã«äžååã§ãïŒPODã§ã®ã¿äœ¿çšæ¹æ³ã確èªããŠãã ããïŒã
ãã®ã»ã¯ã·ã§ã³ã®äž»ãªçšéã¯ãå¿ èŠãªajaxåŒã³åºãã宣èšããããšã§ãã ããšãã°ãå ¬éãµã€ãã§å©çšã§ããajaxã¡ãœããïŒ
applitcationsïŒ ã³ã¡ã³ãïŒ ã¡ãœããïŒ record_some_infoïŒ$ OurPlugin ::ãã©ã°ã€ã³:: ajax_record_some_info
ãã©ã°ã€ã³ã§ã®æ©èœïŒ
sub ajax_record_some_info { my ($app) = @_; my $blog = $app->blog; my $result = "{'error': 'No information supplied'}"; my $user_name = $app->param('user_name'); my $info = $app->param('info'); if ($user_name && $info) { $result = do_store_info($user_name, $info); # } $app->send_http_header(""); $app->print($result); return $app->{no_print_body} = 1; } ## end sub ajax_record_some_info
ã¿ã€ãã®äœããã€ã³ã¿ãŒãã§ãŒã¹ã«è¿œå ããŸãïŒã³ãŒããçæãããããã¹ãçæããå¿ èŠããããŸãïŒïŒ
var u = mtGetUser(); if(u && !u.is_anonymous) { jQuery.post({ url: '<mt:CGIPath encode_js='1'><mt:CommentScript encode_js='1'>', '__mode': 'record_some_info', 'user_name': u.name, 'info': 'he he' });
æçš¿ã®URLã¯<mtïŒCGIPath encode_js = '1'> <mtïŒCommentScript encode_js = '1'>ãã³ãã«ããååŸããå¿ èŠããããŸããå Žæã«ãã£ãŠç°ãªãå ŽåããããŸãã åŸæ¥ã®è§£æ±ºçã¯ãMTèªèº«ãè¡ãããã«.jsãã¡ã€ã«ãçæãããããã®ãããªãã®ãããããŒãã³ãã¬ãŒãã«å ¥åããããšã§ãã
<script>COMMENTS_URL = '<mt:CGIPath encode_js='1'><mt:CommentScript encode_js='1'>';</script>
å¿ èŠã«å¿ããŠCOMMENTS_URLã䜿çšããŸãã
éããç¬é
ããŒã¿ããŒã¹ã®æäœãæ¢åã®ãªããžã§ã¯ãã®æ¡åŒµæ¹æ³ãæ°ãããªããžã§ã¯ãã®äœææ¹æ³ãããã³ç®¡çããã«ãši18nã®è³ªåã§èªåã®ããŒãžãäœæããæ¹æ³ã«ã€ããŠã¯èª¬æããŸããã§ããã ããã«ã€ããŠã¯æ¬¡ã®å·ã§èªãã§ãã ããã
䟿å©ãªãªã³ã¯
- MovableType-ãã©ãããã©ãŒã ã®å ¬åŒãŠã§ããµã€ã
- MovableType Developer Center-éçºè åãå ¬åŒããã¥ã¡ã³ã
- forums.movabletype.orgã®HOWTO-ãã©ãŒã©ã ã§éåžžã«åœ¹ç«ã€æ å ±ãèŠã€ããããã®Googleãã«ãã
- mt-devã¡ãŒã«ãªã¹ãã¯ãæçšãªæ å ±ãååŸããããã®ãã1ã€ã®é£ãã¹ãããã§ãã å°ãè ã£ãã