/** * Prints the content of a codeblock for an image, album or Zenpage newsarticle or page. * * @param int $number The codeblock you want to get * @param mixed $what optonal object for which you want the codeblock * * @return string */ function printCodeblock($number = 1, $what = NULL) { $codeblock = getCodeblock($number, $what); if ($codeblock) { $context = get_context(); eval('?>' . $codeblock); set_context($context); } }
<img src="<?php echo getRandomImages()->getCustomImage(NULL, 192, 48, 192, 48, NULL, null, false); ?> " width="195" height="48"/> </div> </div> <div id="page-date" class="opa60"> <?php echo NewsUtil::printPageLastChangeDate(); ?> </div> <?php $codeBlock = getCodeblock(2); if (isset($codeBlock) && ThemeUtil::clean($codeBlock, false) != '') { ?> <div id="album-description" class="page opa60"> <?php printCodeBlock(2); ?> </div> <?php } ?> <div id="page-filler" class="opa20"> </div> </div>
/** * Prints the content of a codeblock for an image, album or Zenpage newsarticle or page. * * NOTE: This executes PHP and JavaScript code if available * * @param int $number The codeblock you want to get * @param mixed $what optonal object for which you want the codeblock * * @return string */ function printCodeblock($number = 0, $what = NULL) { if (is_object($what)) { $codeblock = $what->getCodeblock(); if ($codeblock) { $codeblocks = unserialize($codeblock); $codeblock = $codeblocks[$number]; } else { return; } } else { $codeblock = getCodeblock($number); } if ($codeblock) { $context = get_context(); eval('?>' . $codeblock); set_context($context); } }