九/080
tMessage修改一处错误
今天在后台看到一些朋友的留言,猛然发现用户名都是terrysco。。。看来是取用户名的时候写错了,修改如下:
<?php
function theme_tmessage_admin_form($form) {
drupal_add_css(drupal_get_path(‘module’, ‘tmessage’) . ‘/tmessage.css’);
$output = ”;
$messages = tmessage_get_message();
if ($messages) {
foreach ($messages as $message) {
$output .= ‘<hr class="break_line" />’;
$output .= ‘<div class="tmessage">’;
$output .= ‘<div class="tmessage_body">’;
$output .= drupal_render($form['mid'][$message->mid]);
$output .= ‘<strong>’ .check_plain($message->name). ‘</strong>’;
$output .= check_plain($message->content);
$output .= ‘</div>’;
$output .= ‘<div class="tmessage_author_info">’;
// here.
if ($message->uid) {
$from = user_load(array(‘uid’ => $message->uid));
$username = check_plain($from->name);
}
else {
$username = variable_get(‘anonymous’, t(‘no name’));
}
// ends.
$output .= ‘<span class="tmessage_name_link">’ .$username. ‘ [' .check_plain($message->contact). ']</span>’;
$output .= ‘<span class="tmessage_addr">’ .format_date($message->last, ‘custom’, ‘Y-m-d H:i’). ‘ [' .$message->hostname. ']</span>’;
$output .= ‘</div></div>’;
}
$output .= ‘<div class="tmessage_op">’ .drupal_render($form). ‘</div>’;
$output .= theme(‘pager’);
}
return $output;
}
?>
相关文章
分类目录
- Book Remarks (9)
- CMS/FrameWork (45)
- Javascript/jQuery (3)
- Linux/Mac/DB (42)
- Mobile Platform (2)
- PHP/Python/Ruby (12)
- The Bible 2 Me (5)
- Web Architecture (5)
- Web Security (7)
- 互联网改变生活 (7)
随机文章
标签
近期评论
- canadian franchises for sale 发表在《drupal中文文档中缺少部分翻译》
- 宇宙博客 » Gnome环境下几个不错的软件 | Terrysco’s Blog 发表在《Gnome环境下几个不错的软件》
- Bright 发表在《等宽编程字体Monaco》
- Ryat 发表在《Mac平台软件推荐》
- 长龙博客 发表在《关于drupal架构的思考》