Skip to content

Instantly share code, notes, and snippets.

@pkdavies
Created January 29, 2013 11:14
Show Gist options
  • Save pkdavies/4663505 to your computer and use it in GitHub Desktop.
Save pkdavies/4663505 to your computer and use it in GitHub Desktop.
<?php
define('_JEXEC', 1);
define('DS', DIRECTORY_SEPARATOR);
if (file_exists(dirname(__FILE__) . '/defines.php')) {
include_once dirname(__FILE__) . '/defines.php';
}
if (!defined('_JDEFINES')) {
define('JPATH_BASE', dirname(__FILE__));
require_once JPATH_BASE.'/includes/defines.php';
}
require_once JPATH_BASE.'/includes/framework.php';
/**
*
* @param integer $item_id
* @param string $eid
* @param string $type
* @return string
*/
function getZooElementData($item_id=0, $eid='', $type='') {
$db =& JFactory::getDBO();
$query = "SELECT elements FROM #__zoo_item WHERE id = " . (int) $item_id;
$db->setQuery($query);
$elements = json_decode($db->loadResult(), true);
return utf8_decode($elements[$eid][0][$type]);
}
$bodytext_id = "ea0ca3b8-309d-4cf5-941c-9fb4f0dac499";
$article_id = (empty($_REQUEST['id']))? 206 : $_REQUEST['id'];
$data = getZooElementData($article_id, $bodytext_id, 'value');
?>
<!DOCTYPE html>
<html>
<head></head>
<body>
<textarea style="width:100%; height:400px;" identifier="<?php echo $bodytext_id; ?>"><?php echo $data; ?></textarea>
<?php echo $data; ?>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment