Código PHP:
<?php
/**
// Dont allow direct linking
defined( '_JEXEC' ) or die('Restricted access');
$kunena_my = &JFactory::getUser();
$fbConfig =& CKunenaConfig::getInstance();
$kunena_db = &JFactory::getDBO();
if ($fbConfig->fb_profile == 'cb')
{
$msg_params = array(
'username' => &$msg_username,
'messageobject' => &$fmessage,
'subject' => &$msg_subject,
'messagetext' => &$msg_text,
'signature' => &$msg_signature,
'karma' => &$msg_karma,
'karmaplus' => &$msg_karmaplus,
'karmaminus' => &$msg_karmaminus
);
$profileHtml = $kunenaProfile->showProfile($fmessage->userid, $msg_params);
} else {
$profileHtml = null;
}
?>
<table width = "100%" border = "0" cellspacing = "0" cellpadding = "0">
<tbody>
<tr class = "fb_sth">
<th colspan = "2" class = "view-th <?php echo $boardclass; ?>sectiontableheader">
<a name = "<?php echo $msg_id; ?>"></a>
<?php
echo CKunenaLink::GetSamePageAnkerLink($msg_id, '#'.$msg_id)
?>
</th>
</tr>
<tr> <!-- -->
<td class = "fb-msgview-right">
<table width = "100%" border = "0" cellspacing = "0" cellpadding = "0">
<tr>
<td align = "left">
<?php
$msg_time_since = _KUNENA_TIME_SINCE;
$msg_time_since = str_replace('%time%', time_since($fmessage->time, CKunenaTools::fbGetInternalTime()), $msg_time_since);
if ($prevCheck < $fmessage->time && !in_array($fmessage->thread, $read_topics)) {
$msgtitle = 'msgtitle_new';
} else {
$msgtitle = 'msgtitle';
}
?>
<span class = "<?php echo $msgtitle; ?>"><?php echo $msg_subject; ?> </span> <span class = "msgdate" title="<?php echo $msg_date; ?>"><?php echo $msg_time_since; ?></span>
</td>
<td align = "right">
<span class = "msgkarma">
<?php
if (isset($msg_karma)) {
echo $msg_karma;
if (isset($msg_karmaplus))
echo ' ' . $msg_karmaplus . ' ' . $msg_karmaminus;
}
else {
echo ' ';
}
?>
</span>
</td>
</tr>
<tr>
<td colspan = "2" valign = "top">
<div class = "msgtext"><?php
$style = (isset($GLOBALS['Joni_message']) && strpos($GLOBALS['Joni_message'], "[code") === false && strpos($GLOBALS['Joni_message'], "[CODE") === false && strpos($GLOBALS['Joni_message'], "[img") === false && strpos($GLOBALS['Joni_message'], "[IMG") === false) ? ';float:left' : "";
JoniJnm_Tools::showPos("kunena_msg_left_".$mmm, array(), '<div style="padding:10px'.$style.'">', '</div>');
echo $msg_text; ?>
</div>
<?php
if (!isset($msg_closed))
{
?>
<div id = "sc<?php echo $msg_id; ?>" class = "switchcontent">
<!-- make this div distinct from others on this page -->
<?php
//see if we need the users realname or his loginname
if ($fbConfig->username) {
$authorName = $kunena_my->username;
}
else {
$authorName = $kunena_my->name;
}
//contruct the reply subject
$resubject = kunena_htmlspecialchars(strtolower(substr($msg_subject, 0, strlen(_POST_RE))) == strtolower(_POST_RE) ? $msg_subject : _POST_RE .' '. $msg_subject);
?>
<form action = "<?php echo JRoute::_(KUNENA_LIVEURLREL. '&func=post'); ?>" method = "post" name = "postform" enctype = "multipart/form-data">
<input type = "hidden" name = "parentid" value = "<?php echo $msg_id;?>"/>
<input type = "hidden" name = "catid" value = "<?php echo $catid;?>"/>
<input type = "hidden" name = "action" value = "post"/>
<input type = "hidden" name = "contentURL" value = "empty"/>
<input type = "text" name = "subject" size = "35" class = "inputbox" maxlength = "<?php echo $fbConfig->maxsubject;?>" value = "<?php echo $resubject;?>"/>
<textarea class = "inputbox" name = "message" rows = "6" cols = "60" style = "height: 100px; width: 100%; overflow:auto;"></textarea>
<?php
// Begin captcha . Thanks Adeptus
if ($fbConfig->captcha && $kunena_my->id < 1) { ?>
<?php echo _KUNENA_CAPDESC.' '?>
<input name="txtNumber" type="text" id="txtNumber" value="" style="vertical-align:middle" size="10">
<img src="index2.php?option=com_kunena&func=showcaptcha" alt="" /><br />
<?php
}
// Finish captcha
?>
<input type = "submit" class = "fb_button fb_qr_fire" name = "submit" value = "<?php @print(_GEN_CONTINUE);?>"/>
<input type = "button" class = "fb_button fb_qm_cncl_btn" id = "cancel__<?php echo $msg_id; ?>" name = "cancel" value = "<?php @print(_KUNENA_CANCEL);?>"/>
<small><em><?php echo _KUNENA_QMESSAGE_NOTE?></em></small>
</form>
</div>
<?php
}
JoniJnm_Tools::showPos("kunena_msg_in_".$mmm, array(), "<br />");
?>
</td>
</tr>
</table>
</td>
<!-- -->
</tr>
<tr>
<td class = "fb-msgview-left-b">
</td>
<td class = "fb-msgview-right-b" >
<div class="fb_message_editMarkUp_cover">
<?php
if ($fmessage->modified_by) {
echo '<span class="fb_message_editMarkUp">'. _KUNENA_EDITING_LASTEDIT .': '. date(_DATETIME, $fmessage->modified_time) .' '. _KUNENA_BY .' '. CKunenaTools::whoisID($fmessage->modified_by) .'.';
if ($fmessage->modified_reason) {
echo _KUNENA_REASON .': '. kunena_htmlspecialchars(stripslashes($fmessage->modified_reason));
}
echo '</span>';
}
if ($fbConfig->reportmsg && $kunena_my->id > 1)
{
echo '<span class="fb_message_informMarkUp">'.CKunenaLink::GetReportMessageLink($catid, $msg_id, _KUNENA_REPORT).'</span>';
}
if (isset($msg_ip))
{
echo '<span class="fb_message_informMarkUp">'.CKunenaLink::GetMessageIPLink($msg_ip).'</span>';
} ?>
</div>
<div class="fb_message_buttons_cover">
<div class="fb_message_buttons_row">
<?php
//we should only show the Quick Reply section to registered users. otherwise we are missing too much information!!
/* onClick="expandcontent(this, 'sc<?php echo $msg_id;?>')" */
if ($kunena_my->id > 0 && !isset($msg_closed)):
?>
<span id = "fb_qr_sc__<?php echo $msg_id;?>" class = "fb_qr_fire" style = "cursor:pointer">
<?php echo
isset($fbIcons['quickmsg']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['quickmsg'] . '" border="0" alt="' . _KUNENA_QUICKMSG . '" />' . '' : ' <img src="' . KUNENA_URLEMOTIONSPATH . 'quickmsg.gif" border="0" alt="' . _KUNENA_QUICKMSG . '" />'; ?>
</span>
<?php
endif;
?>
<?php
if ($fbIcons['reply'])
{
if (!isset($msg_closed))
{
echo " " . $msg_reply;
echo " " . $msg_quote;
if ($is_Moderator) echo ' </div><div class="fb_message_buttons_row">';
if (isset($msg_merge)) {
echo " " . $msg_merge;
}
if (isset($msg_split)) {
echo " " . $msg_split;
}
if (isset($msg_delete)) {
echo " " . $msg_delete;
}
if (isset($msg_edit)) {
echo " " . $msg_edit;
}
}
else {
echo $msg_closed;
}
}
else
{
if (!isset($msg_closed))
{
echo $msg_reply;
?>
|
<?php
echo $msg_quote;
if (isset($msg_delete)) {
echo " | " . $msg_delete;
}
if (isset($msg_move)) {
echo " | " . $msg_move;
}
if (isset($msg_edit)) {
echo " | " . $msg_edit;
}
if (isset($msg_sticky)) {
echo " | " . $msg_sticky;
}
if (isset($msg_lock)) {
echo "| " . $msg_lock;
}
}
else {
echo $msg_closed;
}
}
?>
</div>
</div>
<?php
if (isset($msg_signature)) {
echo '<div class="msgsignature">';
echo $msg_signature;
echo '</div>';
}
?>
</td>
</tr>
<?php JoniJnm_API::display("message:tr", $fmessage); ?>
</tbody>
</table>
<!-- Begin: Message Module Positions -->
<?php
if (count(JModuleHelper::getModules('kunena_msg_'.$mmm)))
{
?>
<div class = "kunena_msg_<?php echo $mmm; ?>">
<?php
$document = &JFactory::getDocument();
$renderer = $document->loadRenderer('modules');
$options = array('style' => 'xhtml');
$position = 'kunena_msg_'.$mmm;
echo $renderer->render($position, $options, null);
?>
</div>
<?php
}
?>
<!-- Finish: Message Module Positions -->
<?php
// --------------------------------------------------------------
// Legend to the variables used
// --------------------------------------------------------------
// $msg_id = Message ID#
// $msg_username = Username (with email link if enabled)
// $msg_avatar = User Avatar
// $msg_usertype = User Type (Visitor/Member/moderator/Admin)
// $msg_userrank = User Rank
// $msg_userrankimg = User Rank Image
// $msg_posts = Post Count
// $msg_karma = Karma Points
// $msg_karmaplus = Linked Image for Karma+
// $msg_karmaminus = Linked Image for Karma-
// $msg_ip = IP of Poster
// $msg_ip_link = Link to look up IP of Poster
// $msg_date = Date of Post
// $msg_subject = Post Subject
// $msg_text = Post Text
// $msg_signature = User's Signature
// $msg_reply = Reply Option
// $msg_quote = Quote Option
// $msg_edit = Edit Option
// $msg_closed = Locked/Diabled message
// $msg_delete = Delete Option
// $msg_sticky = Sticky/Unsticky Option
// $msg_lock = Lock/Unlock Option
// $msg_aim = User's AIM
// $msg_icq = User's ICQ#
// $msg_msn = User's MSN
// $msg_yahoo = User's Yahoo
// $msg_profile = Image link to user's Profile Page
// $msg_pms = Linked image for PMS2
// $msg_buddy = Add buddy image link
// $msg_loc = User's Location
// $msg_regdate = User's Registration Date
// $tabclass[$k] = CSS Class for TD (use to alternate colors)
// fb_messagebody = CSS Class for post text
// fb_signature = CSS Class for signature
?>