Hi,

On a project I'm working on, a table generated by an #ask function lists
image pages in one of the columns, and I wanted to display thumbnails,
instead of image file names, in that column. Then I had the thought that
inline queries should *always* display thumbnails for images (assuming
linking is set to true) - after all, why would someone just want to see a
list of image names?

Anyway, below is the two-line addition to accomplish that. Feel free to add
it in to the code - I think it would definitely be an improvement.

-Yaron


Index: includes/SMW_DV_WikiPage.php
===================================================================
--- includes/SMW_DV_WikiPage.php        (revision 28671)
+++ includes/SMW_DV_WikiPage.php        (working copy)
@@ -88,6 +88,8 @@
                }
                if ( ($linked === NULL) || ($linked === false) ) {
                        return $this->m_prefixedtext;
+               } elseif ($this->m_namespace == NS_IMAGE) { // display
thumbnail for images
+                       return '[[' . str_replace("'", ''',
$this->m_prefixedtext) . '|' . $this->m_textform . '|thumb]]';
                } else {
                        return '[[:' . str_replace("'", ''',
$this->m_prefixedtext) . '|' . $this->m_textform . ']]';
                }
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to