TinyPortal

Development => Resources => Topic started by: raid on October 23, 2008, 04:43:03 PM

Title: [Simple Shoutbox] Shouts selection by page on admin panel
Post 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"):

Code (TPShout.template.php, Find this code) Select
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>';

Code (Replace with) Select
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:
Code (TPortaAdmin.english.php, Find this code) Select
$txt['tp-deleteallshouts'] = 'Delete all shouts?';
Code (Add before) Select
$txt['tp-deleteallshoutsonpage'] = 'Delete all shouts on this page?';

tested on SMF 1.1.6 and TP 1.0.6 Beta2
Title: Re: [Simple Shoutbox] Shouts selection by page on admin panel
Post by: G6Cad on October 23, 2008, 05:09:40 PM
What shoutbox module are you pointing this to ?
Title: Re: [Simple Shoutbox] Shouts selection by page on admin panel
Post by: raid on October 23, 2008, 05:15:32 PM
title corrected :)
Title: Re: [Simple Shoutbox] Shouts selection by page on admin panel
Post by: G6Cad on October 23, 2008, 05:19:39 PM
Thank you Raid  :up:  :)