This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use lib qw( lib extlib ); | |
use MT; | |
MT->new; | |
use Data::ObjectDriver; | |
$Data::ObjectDriver::DEBUG = 1; | |
MT->model('blog')->load( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<MTUnless regex_replace="/\t/g","" strip_linefeeds="1"> | |
<mt:if tag="AssetType" eq="image"> | |
<mt:setvarblock name="href"><mt:if name="image_width" gt="640"><mt:AssetThumbnailURL width="640"><mt:else><mt:var name="a_href"></mt:if></mt:setvarblock> | |
<div class="article-image" style="text-align: left; width: <mt:var name="img_width">px;<mt:If name="align" eq="left"> float: left; margin-right: 10px;</mt:If><mt:If name="align" eq="right"> float: right; margin-left: 10px;</mt:If><mt:If name="align" eq="center"> margin: 0px auto;</mt:If>"> | |
<mt:var name="form_tag"> | |
<a rel="lightbox" href="<mt:var name="href">" title="<mt:if name="caption"><mt:var name="caption" escape="html"> </mt:if>(click to enlarge)"><mt:var name="img_tag"></a> | |
<mt:if name="description"><p class="credit"><mt:var name="description"></p></mt:if> | |
<mt:if var="caption" ne=""><p class="caption"><mt:var name="caption"></p></mt:if> | |
<mt:if name="enclose"></form></mt:if> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="cntBodyPhoto<mt:Unless name="align" eq="none"> <$mt:Var name="align"$></mt:Unless>" style="width:<$mt:Var name="img_width" op="+" value="4"$>px"> | |
<div class="img"><img src="<$mt:Var name="img_src"$>" alt="<mt:if name="img_alt"><$mt:var name="img_alt"$><mt:else><mt:If tag="AssetDescription" trim="1" strip_linefeeds="1"><$MTAssetDescription$><mt:Else><$mt:AssetLabel$></mt:If></mt:if>" width="<$mt:Var name="img_width"$>" height="<$mt:Var name="img_height"$>" /></div><mt:if name="caption" trim="1" strip_linefeeds="1"> | |
<div class="caption"><$mt:Var name="caption" nl2br="xhtml"$></div> | |
</mt:If></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mt:unless regex_replace="/\t/g","" strip_linefeeds="1"> | |
<mt:SetVar name="max_width" value="800" /> | |
<mt:SetVar name="max_thumbnail_width" value="450" /> | |
<mt:SetVarBlock name="alt_text"> | |
<mt:if name="caption"> | |
<$mt:var name="caption" remove_html="1" strip_linefeeds="1" trim="1"$> | |
<mt:else> | |
<$mt:AssetDescription remove_html="1" strip_linefeeds="1" trim="1"$> | |
</mt:if> | |
</mt:SetVarBlock> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MakeLink 11.03: | |
%text% | |
ページのタイトル。リンクから右クリックした時は、リンク文字列。テキスト選択時はそのテキスト | |
%url% | |
ページのURL。リンクから右クリックした時は、リンク先のURL | |
以下は未確認: | |
%title% | |
metaタグのdescriptionの値。リンクから右クリックした時は、リンクのtitle要素。テキスト選択時はページのタイトル | |
%imgurl% | |
画像を右クリックした時のその画像のURL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>Make Link Help - Defining Link Types</title> | |
<link rel="stylesheet" href="chrome://makelink/content/help/help.css"/> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
like="(^|,)2,3(,|$)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<MTVar name="total_entries" op="/" value="10" setvar="totalpages" /> | |
<MTIf name="total_entries" op="mod" value="10"><MTVar name="totalpages" regex_replace="/.\d$/","" setvar="totalpages" /><MTSetVar name="totalpages" op="++" /></MTIf> | |
<MTIf name="totalpages" gt="1"> | |
<MTPager> | |
<MTIfPagerHeader> | |
<MTPagerCurrent setvar="currentpage" /> | |
<MTVar name="currentpage" op="-" value="3" setvar="cutoffpagemin" /> | |
<MTVar name="currentpage" op="+" value="3" setvar="cutoffpagemax" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($entry) { | |
my $releasedate = 'field.dolreleasedate'; | |
if ($entry->authored_on < $entry->$releasedate) { | |
$entry->authored_on($entry->$releasedate); | |
$entry->save | |
or | |
die $app->trans_error( "Error saving : [_1]", $entry->errstr ); | |
MT::Util::start_background_task( | |
sub { | |
$app->rebuild_entry( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=head1 Object Callbacks | |
The Object callbacks are those that are tied to I<MT::Object> and its | |
descendants. This includes classes such as I<MT::Entry>, I<MT::Blog>, etc. | |
=over 4 | |
=item * <package>::pre_save | |
callback($cb, $obj, $original) |
OlderNewer