If you want to change background of the Entire Answer Node:
function a_list_item($a_item)
{$bgcolor = "";
$level = $a_item['raw']['level'];
switch ($level) {
//Change colour values below
case QA_USER_LEVEL_SUPER:
$bgcolor = "#AAAAAA"; break;
case QA_USER_LEVEL_ADMIN:
$bgcolor = "#BBBBBB"; break;
case QA_USER_LEVEL_MODERATOR:
$bgcolor = "#CCCCCC"; break;
case QA_USER_LEVEL_EDITOR:
$bgcolor = "#DDDDDD"; break;
case QA_USER_LEVEL_EXPERT:
$bgcolor = "#EEEEEE"; break;
}
if ($bgcolor == "") {
qa_html_theme_base::a_list_item($a_item);
} else {
$this->output('<div style="background-color:'.$bgcolor.' !important;">');
qa_html_theme_base::a_list_item($a_item);
$this->output('</div>');
}
}
function head_custom() {
qa_html_theme_base::head_custom();
$this->output('<style>.qa-a-list-item {background-color:initial;}</style>');
}
If you want to change background of just the Answer content:
function a_item_content($a_item)
{
$bgcolor = "";
$level = $a_item['raw']['level'];
switch ($level) {
case QA_USER_LEVEL_SUPER:
$bgcolor = "#AAAAAA"; break;
case QA_USER_LEVEL_ADMIN:
$bgcolor = "#BBBBBB"; break;
case QA_USER_LEVEL_MODERATOR:
$bgcolor = "#CCCCCC"; break;
case QA_USER_LEVEL_EDITOR:
$bgcolor = "#DDDDDD"; break;
case QA_USER_LEVEL_EXPERT:
$bgcolor = "#EEEEEE"; break;
}
if ($bgcolor == "") {
qa_html_theme_base::a_item_content($a_item);
} else {
$this->output('<div style="padding: 2px; background-color:'.$bgcolor.'">');
qa_html_theme_base::a_item_content($a_item);
$this->output('</div>');
}
}