NoahY / q2a-badges

Badges plugin for Question2Answer
http://www.question2answer.org/
43 stars 32 forks source link

Badges page invalid html #48

Open doekia opened 8 years ago

doekia commented 8 years ago

It seems there is a bug on the badge page list.

Actually I have fixed it with this nasty patch on line 109 of qa-badge-page.php:

foreach($qa_content as $k => &$v) {
        if(strpos($k,'custom') !== 0)
                continue;
    if (in_array($k, array('custom','custom2')))
        continue;
    $qa_content['custom2'] .= $v;
    unset($qa_content[$k]);
}

$qa_content['custom2'] .='<tr><td class="badge-entry"><span class="total-badges">'.count($badges).' '.qa_lang('badges/badges_total').'</span>'.($totalawarded > 0 ? ', <span class="total-badge-count">'.$totalawarded.' '.qa_lang('badges/awarded_total').'</span>':'').'</td></tr></table>';
NonlinearFruit commented 8 years ago

I have verified that this fix works. Thanks @doekia!