$$loop row as speechdata index as speechindex select count(*) from speechdata where playerindex='%%player.playerindex%%'$$
$$speechcount=speechdata.0$$
$$endloop$$
$$if (speechcount !EQUALS "0")$$
<td>
<table align=center cellspacing=1 border=0 class=style2 width=700px>
<tr><th height=30px colspan=2>Last $$MAXSPEECHLINES$$ Quotes</th></tr>
$$loop row as speechdata index as speechindex select count(*),* from speechdata where playerindex='%%player.playerindex%%' group by speech order by count(*) desc limit %%MAXSPEECHLINES%%$$
<tr>
$$coloured=colouredtext2html(speechdata.speech)$$
<td align=left height=27px>$$coloured$$</td>
</tr>
$$endloop speech$$
</table>
</td>
$$endif$$
<br>
