Skip to content

Instantly share code, notes, and snippets.

@imarklee
Created May 24, 2014 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imarklee/49c07340f22122b384e1 to your computer and use it in GitHub Desktop.
Save imarklee/49c07340f22122b384e1 to your computer and use it in GitHub Desktop.
API for rendering popbox
<?php
// Include EasySocial's engine
require_once(JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php');
if (JFactory::getDocument()->getType() == 'html') {
// We also need to render the styling from EasySocial.
$doc = Foundry::document();
$doc->init();
$page = Foundry::page();
$page->processScripts();
}
?>
<?php
// In your respective extension / plugin / module, if you have the user id,
// Replace the 62 with the appropriate user id.
$userId = 62;
$user = Foundry::user($userId);
?>
<a href="<?php echo $user->getPermalink();?>"
data-popbox="module://easysocial/profile/popbox"
data-popbox-position="top"
data-user-id="<?php echo $user->id;?>"
><?php echo $user->getName();?></a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment