« ajax chat | main | "手で作る本" »

April 16, 2006

sort by thumbnail

for another perspective of this blog archives, i put a new template to the test. in short, it publishes recent entries sorted only by thumbnail. click here for more details.

http://aprilsnow.ciao.jp/blog/image.php

if you'd like to generate an image index like this, you have to use the simple plugin "MTGetsrcURL" to get an absolute path from each image tag and rewrite a part of its instructions properly, for it's currently impossible for this plugin to omit entries without images. now you can get the plugin and see its basic instructions here.

http://www.rickdom.com/mt3/archives/2005/08/index.html

at first, you should follow the same way to customize index version (see the latter one). next, delete all the tags representing a list of images and just replace it with either source code below. just as a side note, you should better use the php source code if the web server allows you to execute it.


# php ver.
<ul class="thumbnails">
<MTArchiveList>
<MTEntries category="">
<?php
$src = "<$MTEntryBody getsrcurl="1"$>";
if(strpos($src, ".jpg") != false || strpos($src, ".gif") != false || strpos($src, ".png") != false ){
echo '<li><a href="<$MTEntryPermalink$>" title="<$MTEntryTitle$>">' .
'<img src="<$MTEntryBody getsrcurl="1"$>" alt="<$MTEntryTitle$> image" height="50" />' .
'</a></li>';
}
?>
</MTEntries>
</MTArchiveList>
</ul>

# javascript ver.
<ul class="thumbnails">
<MTArchiveList>
<MTEntries category="">
<script type="text/JavaScript"><!--
src = "<$MTEntryBody getsrcurl="1"$>";
if(src.indexOf(".jpg") != -1 || src.indexOf(".gif") != -1 || src.indexOf(".png") != -1){
document.writeln('<li><a href="<$MTEntryPermalink$>" title="<$MTEntryTitle$>">');
document.writeln('<img src="<$MTEntryBody getsrcurl="1"$>" alt="<$MTEntryTitle$> image" height="50" />');
document.writeln('</a></li>');
}
//--></script>
</MTEntries>
</MTArchiveList>
</ul>

[ category : script ]

posted by fuyubi @ 1:21 AM

Trackback

trackback url for this entry
http://aprilsnow.ciao.jp/mt/mt-tb.cgi/66


 





cookie 


 <a>   <b>   <i>   <blockquote>