Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: vbgamer45 on September 08, 2021, 03:06:34 PM

Title: 2.1 empty table column header question
Post by: vbgamer45 on September 08, 2021, 03:06:34 PM
Was working on updating a mod for SMF
Had this code
<table border="0" width="100%" class="windowbg">
<tr class="titlebg">
<td>&nbsp;</td>
<td>' , $txt['SMFQuiz_Common']['Quiz'] , '</td>
<td>' , $txt['SMFQuiz_Common']['Plays'] , '</td>
</tr>


What I found is it hid that column from showing even if there was data in it. In this case just an image.

if (isset($context['SMFQuiz']['popularQuizes']))
foreach ($context['SMFQuiz']['popularQuizes'] as $popularQuizRow)
{
echo ' <tr class="' , $counter % 2 == 1 ? 'windowbg' : 'windowbg' , '">
<td><img width="25" height="25" src="' , !empty($popularQuizRow['image']) ? $settings["default_images_url"] . '/quiz_images/Quizes/' . $popularQuizRow['image'] : $settings["default_images_url"] . '/quiz_images/Quizes/Default-64.png' , '"/></td>
<td width="100%"><table border="0" cellpadding="0" cellspacing="0"><tr><td><a href="' , $scripturl , '?action=SMFQuiz;sa=categories;id_quiz=' , $popularQuizRow['id_quiz'] , '">' , format_string($popularQuizRow['title']) , '</a>
';
if ($popularQuizRow['updated'] > $newDate)
echo '<td>&nbsp;<img src="' , $settings['default_images_url'] , '/quiz_images/new.gif"/></td>';

echo '
</td></tr></table></td>
<td align="center" class="nobr" >' , $popularQuizRow['quiz_plays'] , '</td>
</tr>
';
$counter++;
}

In order to fix. I had to add text to the column header.