5bee3060f8e756ba365cd7de8764537cdf8b44d9
[atutor.git] / mods / wiki / fragments / patches / clickableimages
1 To make clickable images, we'll need to patch the ewiki_link_regex_callback()
2 function. It must recall itself to get images rendered as links.
3
4 - edit ewiki.php
5 - search for "function ewiki_link_regex_callb"
6 - after the whole code block "#-- anchors"\n... insert:
7
8    #-- image links
9    if (strpos($title, "://") && ($title != $href)) {
10       $tmp_img = ewiki_link_regex_callback(array("[$title]"));
11       if (strpos($tmp_img, "<img") === 0) {
12          $title = $tmp_img;
13          $force_noimg = 1;
14       }
15    }
16
17 - save and test your changed ewiki.php
18
19 To get a clickable image, then just write in your WikiPages something like:
20 [http://www.google.com/ "http://images.org/pic1.png"]
21
22 WARNING: You open your Wiki up for advertisements and spamming if you allow
23 this. I'd personally vote against this function, because Wiki was meant as
24 a hyperTEXT system based upon the HTML (HyperTextMarkupLanguage) - but this
25 tweak will get you near HPML (HyperPictureMarkupLanguage).
26
27 And on another side note: it's probably simpler just to enable _HTML.