Ejemplo n.º 1
0
function dyn_type_foreign_post(&$data, &$ds, &$flags)
{
  /* are there any comments? */
  if($ds['m_created'] < time() - 60*30) return;
	$comments = MsgModel::getComments($ds['m_key']);
	/* define the standard actions for this post */
	$metaElements = array();//array(ageToString($ds['m_created']));
	/* insert entries from the cmd array in $flags (these come from plugins) */
	if(is_array($flags['cmd'])) foreach($flags['cmd'] as $cmd) $metaElements[] = $cmd;
	/* admin users get to see an "inspect" button */
  if(object('user')->isAdmin()) $metaElements[] = '<a target="_blank" href="'.actionUrl('inspect', 'test', array('id' => $ds['m_key'])).'">Inspect</a>';
  $metaElements[] = 'not published yet';
  $text = h2_post_excerpt($data['text'], $ds['m_key']);
  /* onward to the actual display of the message: */
  ?><div class="post disabled" id="post_<?php 
echo $ds['m_key'];
?>
">
  	  <div class="postimg"><img src="img/anonymous.png" width="64"/></div>
		  <div class="postcontent">
			  <div>
    			<? if($ds['m_author'] != $ds['m_owner']) print(HubbubEntity::linkFromId($ds['m_author']).' ► '); ?>
  			  <?php 
echo HubbubEntity::linkFromId($ds['m_owner']);
?>
			    <?php 
echo $text;
?>
			  </div>
			  <div class="postmeta"><?php 
echo implode(' · ', $metaElements);
?>
</div>
      </div>
			<div class="post_actions" id="post_<?php 
echo $ds['m_key'];
?>
_actions"></div>
      <div id="post_<?php 
echo $ds['m_key'];
?>
_temp" style="display:none"></div>
		</div><?
}