TinyPortal
Development => Resources => Topic started by: raid on October 23, 2008, 04:43:03 PM
On my forum, we use to keep shoutbox clean, and its hard select lots of shouts one by one to erease them.
I added this small code to add a checkbox on Shouts control panel to select all shouts on page (something like "Select All"):
echo '<tr class="windowbg">
<td colspan="2" align="left" class="normaltext">
<input name="tp_shoutsdelall" type="checkbox" value="ON" onclick="javascript:return confirm(\''.$txt['tp-confirm'].'\')"> <strong><em>'.$txt['tp-deleteallshouts'].'</em></strong></td><td colspan="2" align="right" class="smalltext"><b>'.$context['TPortal']['shoutbox_pageindex'].'</b>
</td>
</tr><tr><td colspan="4" class="windowbg2" align="center" valign="top">
<input type="submit" value="'.$txt['tp-send'].'" name="send"></td>
</tr>
</table>
</form>';
echo '<tr class="windowbg">
<td colspan="2" align="left" class="normaltext">';
//Checkbox to check Deletebox for all message on Admin shouts manage
echo '
<input type="checkbox" name="all" id="check_all" value="" onclick="invertAll(this, this.form, \'tp_shoutbox_remove\');" class="check" /> <em>'.$txt['tp-deleteallshoutsonpage'].'</em><br />';
echo '
<input name="tp_shoutsdelall" type="checkbox" value="ON" onclick="javascript:return confirm(\''.$txt['tp-confirm'].'\')"> <strong><em>'.$txt['tp-deleteallshouts'].'</em></strong></td><td colspan="2" align="right" class="smalltext"><b>'.$context['TPortal']['shoutbox_pageindex'].'</b>
</td>
</tr><tr><td colspan="4" class="windowbg2" align="center" valign="top">
<input type="submit" value="'.$txt['tp-send'].'" name="send"></td>
</tr>
</table>
</form>';
and then add this language string:
$txt['tp-deleteallshouts'] = 'Delete all shouts?';
$txt['tp-deleteallshoutsonpage'] = 'Delete all shouts on this page?';
tested on SMF 1.1.6 and TP 1.0.6 Beta2
What shoutbox module are you pointing this to ?
title corrected :)
Thank you Raid :up: :)