Add a different post text colour for admins

From PunBB Resource Wiki

Jump to: navigation, search

What it does

This small modification changes the admin's text colour in posts.

What to change

// Retrieve the posts (and their respective poster/online status)
$result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
// Retrieve the posts (and their respective poster/online status)
$result = $db->query('SELECT u.group_id, u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
<div class="postmsg">
<?php echo '<div class="'.($cur_post['group_id'] == PUN_ADMIN ? 'adminmsg' : 'postmsg').'">'; ?>
.pun DIV.blockmenu LI.isactive A, #posterror LI STRONG {COLOR: #<something> }
.pun .adminmsg { color: #FF0000; }

From now on, it will show the the admin's posts in red, if you didn't change the example colour.


Chanage the Signature color for admins

<?php if ($signature != '') echo "\t\t\t\t".'<div class="postsignature"><hr />'.$signature.'</div>'."\n"; ?>
<?php if ($signature != '') echo "\t\t\t\t".($cur_post['group_id'] == PUN_ADMIN ? '<div class="postsignatureadmin">' : '<div class="postsignature">').'<hr />'.$signature.'</div>'."\n"; ?>
DIV.postsignature HR {
	MARGIN-LEFT: 0px;
	WIDTH: 200px;
	TEXT-ALIGN: left;
	HEIGHT: 1px;
	BORDER:none
}
DIV.postsignatureadmin HR {
	MARGIN-LEFT: 0px;
	WIDTH: 200px;
	TEXT-ALIGN: left;
	HEIGHT: 1px;
	BORDER:none
}
.pun HR {BACKGROUND-COLOR: #333; COLOR: #333}
.pun .postsignatureadmin { color: #FF0000; }

--Mark 20:59, 13 July 2006 (GMT)

--Elbekko 16:26, 13 July 2006 (GMT)

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox