Loading...
 
Skip to main content

History: UserPagekodewulf

Preview of version: 7

Welcome to my page.

I'm a new member of the TikiWiki development team. Still learning a lot and discovering cool things about Tiki everyday.

Copy to clipboard
<?php // Displays an image from the image gallery // Use: // {IMAGE()}caption{IMAGE} // (image=>image_name) the image name // (gallery=>gallery_name) the gallery name // // if image is a name it has to be exact. // if gallery is omitted, and image is a name, the first match in the // first gallery will be shown. // if gallery is used, and image is a name, the match will be shown. function wikiplugin_image_help() { return tra("Displays an image from the image gallery"); } function wikiplugin_image($data,$params) { global $dbTiki; global $tikilib; global $imagegallib; if (!is_object($imagegallib)) { require_once("lib/imagegals/imagegallib.php"); } extract($params); if (isset($image)) { if (is_numeric($image)) { $image_id = $image; } else { if (isset($gallery)) { if (is_numeric($gallery)) { $gallery_id = $gallery; } else { $query = "select galleryId, name, description from tiki_galleries where (name like '%".$gallery."%' or description like '%".$gallery."%')"; $result = $dbTiki->query($query); $res = $result->fetchRow(DB_FETCHMODE_ASSOC); if (isset($res)) { $gallery_id = $res['galleryId']; } else { $gallery_id = -1; } } } else { $gallery_id = -1; } $image_id = $imagegallib->get_first_image("name_desc", $image, $gallery_id); } } $result = ''; if (isset($image_id)) { if (!isset($data) || empty($data)) { $info = $imagegallib->get_image_info($image_id); $data = $info['description']; } $result .= "<table><tr><td style=\"text-align:center;\">"; $result .= "<img src='show_image.php?id=$image_id'alt='$data'/>"; if (!empty($data)) { $result .= "<br />".$data; } $result .= "</td></tr></table>"; } return $result; } ?>


History

Information Version
Kodewulf 8
View
Kodewulf 7
View
Kodewulf 6
View
Kodewulf 5
View
Kodewulf 4
View
Kodewulf 3
View
Kodewulf 2
View