$PhotoPath = MG_getFilePath($src, $A['media_filename']); $ext = pathinfo($PhotoPath, PATHINFO_EXTENSION); $RelativePath = $_MG_CONF['mediaobjects_url'] . "/{$src}/"; $RelativeTNPath = $_MG_CONF['mediaobjects_url'] . '/tn/'; $RelativePath .= $A['media_filename'][0] . '/' . $A['media_filename'] . '.' . $ext; $RelativeTNPath .= $A['media_filename'][0] . '/' . $A['media_filename'] . '_150x150.' . $ext; $imgsize = @getimagesize($PhotoPath); if ($imgsize == false) { continue; } $title = '<p><b><font color="#ffffff" size="20">' . strip_tags($A['media_title']) . '</font></b></p>'; $desc = '<p>' . strip_tags($A['media_desc']) . '</p>'; $retval .= '<image ' . 'imageURL="' . $RelativePath . '" ' . 'thumbURL="' . $RelativeTNPath . '" ' . 'linkURL="' . $RelativePath . '" linkTarget="" >' . LB; $retval .= '<caption><![CDATA[' . $title . $desc . ']]></caption>' . LB; $retval .= '</image>' . LB; } return $retval; } $aid = isset($_REQUEST['aid']) ? COM_applyFilter($_REQUEST['aid'], true) : 0; $album_data = MG_getAlbumData($aid, array('album_id', 'display_image_size', 'album_title'), true); list($dImageWidth, $dImageHeight) = MG_getImageSize($album_data['display_image_size']); $dImageWidth = $dImageWidth - 70; $title = strip_tags($album_data['album_title']); $xml = ''; $charset = COM_getCharset(); $xml .= '<?xml version="1.0" encoding="' . $charset . '"?>' . LB; $xml .= '<simpleviewergallery title="' . $title . '" galleryStyle="' . $_MG_CONF['simpleviewer']['galleryStyle'] . '" maxImageWidth="' . $_MG_CONF['simpleviewer']['maxImageWidth'] . '" maxImageHeight="' . $_MG_CONF['simpleviewer']['maxImageHeight'] . '" textColor="' . $_MG_CONF['simpleviewer']['textColor'] . '" frameColor="' . $_MG_CONF['simpleviewer']['frameColor'] . '" frameWidth="' . $_MG_CONF['simpleviewer']['frameWidth'] . '" thumbColumns="' . $_MG_CONF['simpleviewer']['thumbColumns'] . '" thumbRows="' . $_MG_CONF['simpleviewer']['thumbRows'] . '" thumbPosition="' . $_MG_CONF['simpleviewer']['thumbPosition'] . '" showOpenButton="' . $_MG_CONF['simpleviewer']['showOpenButton'] . '" showFullscreenButton="' . $_MG_CONF['simpleviewer']['showFullscreenButton'] . '">' . LB; $xml .= MG_getItems($album_data); $xml .= '</simpleviewergallery>' . LB; header("Content-type: text/xml; charset=" . $charset); echo $xml;
function MG_xml() { global $MG_albums, $_MG_CONF, $LANG_CHARSET; $xml = ''; header("Content-type: text/xml; charset=" . $LANG_CHARSET); echo "<?xml version=\"1.0\" encoding=\"" . $LANG_CHARSET . "\"?>\n"; $xml .= "<rss version=\"2.0\">\n"; $xml .= " <channel>\n"; $xml .= " <title><![CDATA[ XML for Media Gallery ]]></title>\n"; $xml .= " <link>" . $_MG_CONF['site_url'] . "</link>\n"; $xml .= " <description>XML Mini SlideShow for Media Gallery</description>\n"; $xml .= " <language>en-us</language>\n"; $xml .= " <generator>Media Gallery version 1.4</generator>\n"; $xml .= " <lastBuildDate>" . date('r', time()) . "</lastBuildDate>\n"; $xml .= " <ttl>120</ttl>\n"; $xml .= MG_getAlbumList(); $xml .= MG_getItems(); $xml .= " </channel>\n"; $xml .= "</rss>\n"; echo $xml; }
function MG_xml() { global $MG_albums, $_MG_CONF, $LANG_CHARSET; $aid = 0; if (isset($_REQUEST['aid'])) { $aid = COM_applyFilter($_REQUEST['aid'], true); } $xml = ''; header("Content-type: text/xml"); $xml .= "<slides>\n"; $xml .= MG_getItems(); $xml .= "</slides>\n"; echo $xml; }
function MG_xml() { global $MG_albums, $_MG_CONF, $LANG_CHARSET; if (isset($_REQUEST['aid'])) { $aid = COM_applyFilter($_REQUEST['aid'], true); } else { $aid = 0; } $mode = 'sv'; switch ($MG_albums[$aid]->display_image_size) { case 0: $dImageWidth = 500; $dImageHeight = 375; break; case 1: $dImageWidth = 600; $dImageHeight = 450; break; case 2: $dImageWidth = 620; $dImageHeight = 465; break; case 3: $dImageWidth = 720; $dImageHeight = 540; break; case 4: $dImageWidth = 800; $dImageHeight = 600; break; case 5: $dImageWidth = 912; $dImageHeight = 684; break; case 6: $dImageWidth = 1024; $dImageHeight = 768; break; case 7: $dImageWidth = 1152; $dImageHeight = 804; break; case 8: $dImageWidth = 1280; $dImageHeight = 1024; break; case 9: $dImageWidth = $_MG_CONF['custom_image_width']; $dImageHeight = $_MG_CONF['custom_image_height']; break; default: $dImageWidth = 620; $dImageHeight = 465; break; } $dImageWidth = $dImageWidth - 70; $title = strip_tags($MG_albums[$aid]->title); $xml = ''; header("Content-type: text/xml; charset=" . $LANG_CHARSET); echo "<?xml version=\"1.0\" encoding=\"" . $LANG_CHARSET . "\"?>\n"; $xml .= '<simpleviewerGallery maxImageWidth="' . $dImageWidth . '" maxImageHeight="' . $dImageHeight . '" textColor="' . $_MG_CONF['simpleviewer']['textcolor'] . '" frameColor="' . $_MG_CONF['simpleviewer']['framecolor'] . '" frameWidth="' . $_MG_CONF['simpleviewer']['framewidth'] . '" stagePadding="' . $_MG_CONF['simpleviewer']['stagepadding'] . '" thumbnailColumns="' . $_MG_CONF['simpleviewer']['thumbnailcolumns'] . '" thumbnailRows="' . $_MG_CONF['simpleviewer']['thumbnailrows'] . '" navPosition="' . $_MG_CONF['simpleviewer']['navposition'] . '" title="' . $title . '" enableRightClickOpen="' . $_MG_CONF['simpleviewer']['enablerightclickopen'] . '" backgroundImagePath="" ' . ' thumbPath="' . $_MG_CONF['mediaobjects_url'] . '/tn/" ' . ' imagePath="' . $_MG_CONF['mediaobjects_url'] . '/disp/">'; $xmlend = '</simpleviewerGallery>'; $xml .= MG_getItems('sv'); $xml .= $xmlend; echo $xml; }