⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 weblog.vm

📁 这个weblogging 设计得比较精巧
💻 VM
📖 第 1 页 / 共 2 页
字号:
        #foreach( $pageNum in [1..$numPages] )            #set( $i = $pageNum - 1 )            #set( $start = $limit * $i )            <a href="?q=${utilities.encode($term)}&${USERNAME_KEY}=$!{username}&n=${limit}&o=${start}"               >$pageNum</a>#if( $pageNum != $numPages) | #end        #end    #end    </h3>#end#** * Display link to chronologically previous entry in the * same category (if specified).**##macro( showPreviousEntryLink $category)    <span id="previousEntry">    #if( $pageModel.previousEntry )        #if ( $category != 'nil' )#set( $catPath = $category )#end  ## was a category supplied?        #set( $previousEntry = $pageModel.previousEntry )        <a href="$ctxPath$previousEntry.getPermaLink($catPath)"            title="Previous Entries"            >&laquo; $utilities.truncateNicely($previousEntry.title, 30, 30, "...")</a>    #end    </span>#end#** * Display link to chronologically next entry in the * same category (if specified).**##macro( showNextEntryLink $category)    <span id="nextEntry">    #if( $pageModel.nextEntry )        #if ( $category != 'nil' )#set( $catPath = $category )#end  ## was a category supplied?        #set( $nextEntry = $pageModel.nextEntry )        <a href="$ctxPath$nextEntry.getPermaLink($catPath)"            title="Next Entries"            >$utilities.truncateNicely($nextEntry.title, 30, 30, "...") &raquo;</a>    #end    </span>#end#** * Shows weblog entries from specified category  * using specified page as a "day template" for the display of each day. * If a specific weblog entry is specified by the current request (using * the anchor tag), then shows the only the specified entry (using the day * template) along with the comments associated with that entry. * * @param pageName   Page name of page to serve as day template. * @param maxEntries Maximum number of entries to be shown. * @param category   Only display weblog entries from this category. *##macro( showWeblogEntriesInCategory $pageName $maxEntries $category )    #if ( $pageModel.getWeblogEntry() )        #set( $entry = $pageModel.getWeblogEntry() )    #end    #set( $dayTemplateId = $pageModel.getPageIdByName($pageName) )    #if ( !$dayTemplateId ) ## if no page name, try Preview space        #set ( $dayTemplateId = $pageName )    #end    #if( $entry )        #set( $day = $entry.pubTime )        #set( $entries = [ $entry ] )        #parse( $dayTemplateId )        <div class="trackbackUrl">           $text.get( "macro.weblog.trackback" ) #showTrackbackURL($entry)        </div>        #showComments($entry)        #if($website.allowComments && $entry.commentsStillAllowed)            #showCommentForm($entry)        #else            $text.get("comments.disabled")        #end    #else        #if( $searchResults )            #set( $map = $searchResults )            #showSearchAgainForm()            #showSearchSummary()        #else            #set( $map = $pageModel.getRecentWeblogEntries($maxEntries, $category) )        #end        #foreach( $day in $map.keySet() )            #set( $entries = $map.get($day) )            #parse( $dayTemplateId )        #end        #if( $searchResults )            #showSearchPager()        #end        <div class="next-previous">        #showPreviousEntryLink($category)        #showNextEntryLink($category)        </div>    #end#end#** * Shows weblog entries using specified page as a "day template" for * the display of each day. If a specific weblog entry is specified * by the current request (using the anchor tag), then shows the only * the specified entry (using the day template) along with the comments * associated with that entry. * * @param pageName Page name of page to serve as day template. * @param maxEntries Maximum number of entries to be shown. *##macro( showWeblogEntries $pageName $maxEntries )#showWeblogEntriesInCategory($pageName $maxEntries 'nil')#end#** * Show the last $maxEntries number of weblogentry titles in a category, * as links to the individual posts.  Names of fields * must be different than in showWeblogEntries (those * values take precedence for some reason).**##macro( showRecentEntriesInCategory $entryCount $catPath )   #set( $xmap = $pageModel.getRecentWeblogEntries($entryCount,$catPath) )   <ul class="recentposts">   #foreach( $day in $xmap.keySet() )       #set( $recentEntries = $xmap.get($day) )       #foreach ($var in $recentEntries)           <li class="recentposts"><a href="$baseURL/page/$userName/?entry=$utilities.encode($var.anchor)">$var.title</a></li>       #end   #end   </ul>#end#** * Show the last $maxEntries number of weblogentry titles, * as links to the individual posts.  Names of fields * must be different than in showWeblogEntries (those * values take precedence for some reason).**##macro( showRecentEntries $entryCount )#showRecentEntriesInCategory($entryCount "nil")#end#** * Show the last $maxEntries number of weblogentry titles, as links to * entry links.  Names of fields must be different than in showWeblogEntries * (those values take precedence for some reason).**##macro( showRecentEntryLinksInCategory $numEntries $cat)   #set( $xmap = $pageModel.getRecentWeblogEntries($numEntries, $cat) )   <ul class="linkblog">   #foreach( $day in $xmap.keySet() )       #set( $recentEntries = $xmap.get($day) )       #foreach ($var in $recentEntries)           <li class="linkblog">           #if ($var.link)              <a href="$var.link" title="$utilities.removeAndEscapeHTML($var.text)">$var.title</a>           #else              $var.title           #end           #if ($pageHelper.isUserAuthorizedToEdit())              &nbsp;[<a href="$pageHelper.getEntryEditUrl($var)">$text.get( "macro.weblog.editentry" )</a>]           #end           </li>       #end   #end   </ul>#end#** * Show the last $maxEntries number of weblogentry titles, as links to * entry links.  Names of fields must be different than in showWeblogEntries * (those values take precedence for some reason).**##macro( showRecentEntryLinks $numEntries )#showRecentEntryLinksInCategory($numEntries "nil")#end#** * Display language form for selection a different language.  This is only a form, no div * or anything around it. *##macro( showLanguageForm )    ## first check for errors during possible previous langauge change    #if ($languageError)        <p>$languageError</p>    #end    #set( $locales = $pageHelper.getSupportedLanguages() )    #if ($locales)       #foreach($locale in $locales)          <a class="imageLink" href="$ctxPath/language${pageHelper.getPathInfo()}?language=${locale}">             <img src="$ctxPath/images/flag_${locale.toString().toLowerCase()}.gif" alt="${locale.getDisplayLanguage()}" />          </a>          <br />       #end    #else        <p>$text.get("macro.weblog.nolanguages")</p>    #end#end#** * Display links to Previous and/or Next chronological Entry.  Also * display link to "main" page if either is present.**##macro( showNextPreviousLinks )    #set( $catLink = "" )    #if ( $catPath ) #set( $catLink = "?catname=$catPath" ) #end    <div class="next-previous">    #if ($pageModel.previousEntry)        #set( $previousEntry = $pageModel.previousEntry )        <a href="$ctxPath/page/$userName/$page.link/$utilities.encode($previousEntry.anchor)$catLink"            title="$previousEntry.title"            >&laquo; $utilities.truncateNicely($previousEntry.title, 30, 30, "...")</a> |    #end    #if ( $pageModel.previousEntry || $pageModel.nextEntry)        <a href="$ctxPath/page/$userName/$page.link$catLink">$page.name</a>    #end    #if ($pageModel.nextEntry)        #set( $nextEntry = $pageModel.nextEntry )        | <a href="$ctxPath/page/$userName/$page.link/$utilities.encode($nextEntry.anchor)$catLink"            title="$nextEntry.title"            >$utilities.truncateNicely($nextEntry.title, 30, 30, "...") &raquo;</a>    #end    </div>#end#** * Method to retrieve a full encoded anchor tag for a WeblogEntry.**##macro( showAnchorTag $entry )    <a name="$utilities.encode($entry.anchor)" id="$utilities.encode($entry.anchor)"></a>#end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -