All pastes #14469 Raw Edit

Someone

public text v1 · immutable
#14469 ·published 2005-06-14 05:50 UTC
rendered paste body
			list ($ret, $img ) = GalleryEmbed::getImageBlock($blockoptions);
			print_r ($blockoptions);
//			print_r($ret);
//			print_r($img);

 Array ( [blocks] => |randomImage|dailyImage [show] => |heading [maxSize] => 210 [itemFrame] => notebook [albumFrame] => notebook )

<div class="gbBlock">
      <h3> Picture of the Day </h3>
  
                          
  <table class="ImageFrame_notebook" border="0" cellspacing="0" cellpadding="0">

      <tr>
    <td class="TL"></td>
        <td class="TT"><div class="H"></div></td>
        <td class="TR"></td>
    </tr>
    <tr>
  <td class="LL"><div class="V">&nbsp;</div></td>  <td rowspan="1" colspan="1" class="IMG"
  ><a href="http://devtest.ozgreg.com/wpg2/LadyTalbotDrive/IMG_0028.jpg.html?g2_GALLERYSID_3368ea=6527d6fcb43f066de18a85e48bab656f" >
  
      <img src="http://devtest.ozgreg.com/wpg2/393-5/IMG_0028.jpg?g2_GALLERYSID_3368ea=6527d6fcb43f066de18a85e48bab656f" width="150" height="150" id="IFid8" class="ImageFrame_image" alt="IMG_0028.jpg" longdesc=""/>

      </a></td>
  <td class="RR"><div class="V">&nbsp;</div></td>  </tr>
          <tr>
    <td class="BL"></td>
        <td class="BB"><div class="H"></div></td>
        <td class="BR"></td>
    </tr>
    </table>

  
  
   </div>

    /**
     * Get HTML for an image block
     *
     * @param array ('blocks' => string, 'show' => string, (optional)'heading' => int,
     *                (optional)'itemId' => int, (optional)'maxSize' => int)
     * 'blocks' is a pipe (|) separated list, of one or more possible blocks which are:
     * randomImage|recentImage|viewedImage|randomAlbum|recentAlbum|viewedAlbum|specificItem
     * dailyImage|weeklyImage|monthlyImage|dailyAlbum|weeklyAlbum|monthlyAlbum
     * 'show' is a pipe (|) separated list of one or more possible choices which are:
     * title|date|views|owner|heading|fullSize or just 'none'
     * If you choose 'blocks' => 'specificItem', you must specify 'itemId' too.
     * example: GalleryEmbed::getImageBlock(array('blocks' => 'randomImage',
     *                                            'show' => 'title|date'));
     * @return array object GalleryStatus
     *               string html content
     * @static
     */
    function getImageBlock($params) {
	global $gallery;
	$moduleId = 'imageblock';
	$blockHtml = null;

	/* Load the module list */
	list ($ret, $moduleStatus) = GalleryCoreApi::fetchPluginStatus('module');
	if ($ret->isError()) {
	    return array($ret->wrap(__FILE__, __LINE__), null);
	}

	if (isset($moduleStatus[$moduleId]) && !empty($moduleStatus[$moduleId]['active'])
	        && $moduleStatus[$moduleId]['active']) {
	    /* Load the G2 templating engine */
	    GalleryCoreApi::requireOnce(dirname(__FILE__) . '/GalleryTemplate.class');
	    $template = new GalleryTemplate(dirname(__FILE__) . '/../../..');
	    $template->setVariable('l10Domain', 'module_' . $moduleId);

	    /* Generate the imageblock */
	    GalleryCoreApi::requireOnce(
		dirname(__FILE__) . '/../../imageblock/classes/ImageBlockHelper.class');
	    list ($ret, $tpl) = ImageBlockHelper::loadImageBlocks($template, $params);
	    if ($ret->isError()) {
		return array($ret->wrap(__FILE__, __LINE__), null);
	    }

	    if (!empty($tpl)) {
		/* Render and get the imageblock html */
		list ($ret, $blockHtml) = $template->fetch(dirname(__FILE__) . '/../../../' . $tpl);
		if ($ret->isError()) {
		    return array($ret->wrap(__FILE__, __LINE__), null);
		}
	    }
	} else {
	    return array(GalleryStatus::error(ERROR_CONFIGURATION_REQUIRED, __FILE__, __LINE__), null);
	}
	return array(GalleryStatus::success(), $blockHtml);
    }