[RC] Shoutbox add-on: Erase Shoutbox Contents MOD

This shoutbox, fully integrates in phpbb2, support smilies and bbcode
this shoutbox is a shoutbox written for phpbb2, therefor it makes uses of templates and language files

Moderator: Moderators

Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

[RC] Shoutbox add-on: Erase Shoutbox Contents MOD

Postby Sophia on Fri 30. Sep, 2005 19:41

Fully Integrated Shoutbox add-on: Erase Shoutbox Contents MOD

This simple mod gives you an admin link under the General menu to totally erase (empty) the contents of the Shoutbox, with a simple click. You must have installed Niels Fully Integrated Shoutbox first!

The table prefix for this file is set at "phpbb_".

Please note I offer absolutely NO support for the Fully Integrated Shoutbox itself. You can find support on the author's website (link in the install file).

  • MOD Title: Fully Integrated Shoutbox add-on: Erase shoutbox contents
  • MOD Version: 1.0.0
  • MOD Author: Sophiia
  • MOD Description: An easy way to erase the contents of the Shoutbox, from the General menu in the Admin Panel.
  • Installation Level: Easy
  • Installation Time: 1 minute

Again, you will need to install Niels Fully Integrated Shoutbox for this MOD to be of any use. (The link is in the install file.)

  • The ShoutboxErase_MOD_1.0.0_.txt file:
Code: Select all
##############################################################
## MOD Title: Fully Integrated Shoutbox add-on: Erase shoutbox contents
## MOD ShoutboxErase Author: Sophiia < sophiia@users.sourceforge.net > (Sophia Arlington)
## MOD Fully Integrated Shoutbox author: Niels Chr. Denmark < ncr@db9.dk > ( http://mods.db9.dk )
## MOD Description: An easy way to erase the contents of the Fully Integrated Shoutbox, from the General menu in the Admin Panel.
## MOD Version: 1.0.0
##
## Installation Level: (Easy)
## Installation Time: 1 Minutes
##
## Files To Edit: None
##
## Included Files: admin_truncate_shoutbox.php
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes: You will need Niels Fully Integrated Shoutbox for this MOD to be of any use!
## It is available at: http://mods.db9.dk/
##
## Just drop the admin_truncate_shoutbox.php file in the admin dir.
## To delete the Shoutbox contents, just click the "Empty Shoutbox" link,
## under the menu "General" in your Admin Panel.
##
##############################################################
## MOD History:
##
##   Sep 30th 2005 - Version 1.0.0
##         - First Release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ COPY ]------------------------------------------
#
copy admin_truncate_shoutbox.php to admin/admin_truncate_shoutbox.php

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM


  • The admin_truncate_shoutbox.php file:
Code: Select all
<?php
/***************************************************************************
*                        admin_truncate_shoutbox.php
*                            -------------------
*
*      Version         : 1.0.0
*      Email         : sophiia@users.sourceforge.net
*      Copyright      : Sophiia 2005
*
***************************************************************************/

/***************************************************************************
*
*   This program is free software; you can redistribute it and/or modify
*   it under the terms of the GNU General Public License as published by
*   the Free Software Foundation; either version 2 of the License, or
*   (at your option) any later version.
*
***************************************************************************/

define('IN_PHPBB', 1);

if(   !empty($setmodules) )
{
   $file = basename(__FILE__);
   $module['General']['Empty Shoutbox'] = $file;
   return;
}

//
// Let's set the root dir for phpBB
//
$phpbb_root_path = '../';
require($phpbb_root_path . 'extension.inc');
require('pagestart.' . $phpEx);
//
//check for userlevel
//
if( !$userdata['session_logged_in'] )
{
   header('Location: ' . append_sid("login.$phpEx?redirect=admin/admin_truncate_shoutbox.$phpEx", true));
}

if( $userdata['user_level'] != ADMIN )
{
   message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
}
//end check

//
// Begin erasing the stuff in the Shoutbox by Sophiia
//

$page_title = 'Updating the database and Erasing contents of the Shoutbox';

echo '<table width="100%" cellspacing="1" cellpadding="2" border="0" class="forumline">';
echo '<tr><th>Updating the database and Erasing contents of the Shoutbox</th></tr><tr><td><span class="genmed"><ul type="circle">';


$sql = array();
$sql[] = "TRUNCATE TABLE `" . $table_prefix . "shout`";

for( $i = 0; $i < count($sql); $i++ )
{
   if( !$result = $db->sql_query ($sql[$i]) )
   {
      $error = $db->sql_error();

      echo '<li>' . $sql[$i] . '<br /> +++ <font color="#FF0000"><b>Error:</b></font> ' . $error['message'] . '</li><br />';
   }
   else
   {
      echo '<li>' . $sql[$i] . '<br /> +++ <font color="#00AA00"><b>Successful</b></font></li><br />';
   }
}


echo '</ul></span></td></tr><tr><td class="catBottom" height="28">&nbsp;</td></tr>';

echo '<tr><th>Truncate of table is complete</th></tr><tr><td><span class="genmed"><br /></span></td></table>';

include('page_footer_admin.' . $phpEx);
?>



This is it :) Have fun!

Sophiia
Sophia
Poster
Poster
 
Posts: 6
Joined: Wed 12. Jan, 2005 18:38

Return to Fully integrated shoutbox [2.0.6/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron