Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Clear shoutbox in ACP [TTv3]
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Mods Completed

2019-04-06 16:45:06
This is for the original TT shoutbox and the ajshoutbox. I thought someone had already made a mod to do this, but I couldnt find it, so I mashed my own together from spare parts

In admincp.php, this is the link on the page. Adjust the width and height to suit your needs.

<td align="center"><a href="admincp.php?action=clearshout"><img src="images/admin/shoutclear.png" border="0" width="118" height="80" alt="" /><br /><?php echo T_("CLEAR_SHOUTBOX"); ?><br /></a></td>



at the bottom before ?> put

///////////////// CLEAR STOCK SHOUTBOX /////////////////////////////

if ($action == "clearshout") {

stdhead(T_("CLEAR_SHOUTBOX"));
error_reporting(E_ALL);

  begin_frame("".T_("CLEAR_SHOUTBOX")."");

?>
<br /><br />
<font size ='3'><center><?php echo T_("CLEAR_SHOUTBOX_TEXT"); ?></center></font>
<br /><br />

  <form enctype="multipart/form-data" method="post" action="admincp.php">
  <input type="hidden" name="action" value="clearshout" />
  <input type="hidden" name="do" value="delete" />
  <table class="f-border" cellspacing="0" cellpadding="5" width="100%" align="center">
  <tr><td colspan="2" align="center"><input type="submit" value="<?php echo T_("CLEAR_SHOUTBOX");?>" /></td></tr>
  </table></form>

  <?php
  end_frame();
 
  if ($do == "delete"){
        SQL_Query_exec("TRUNCATE TABLE `shoutbox`");
        write_log("Shoutbox cleared by $CURUSER[username]");
        $msg_shout = sqlesc("".T_("SHOUTBOX_CLEARED_MESSAGE")."");
        SQL_Query_exec("INSERT INTO shoutbox (userid, date, user, message) VALUES(0,'".get_date_time()."', 'System' ,".$msg_shout.")");
        autolink ("admincp.php", "<b><font color='#ff0000'>Shoutbox Cleared....</font></b>");

}
  navmenu();
  stdfoot();
}
///////////////END CLEAR STOCK SHOUTBOX //////////////////////////////////////////////


if you use the ajshoutbox, use this instead. Place this at the bottom before ?>
///////////////// CLEAR AJAX SHOUTBOX /////////////////////////////

if ($action == "clearshout" ) {

stdhead(T_("CLEAR_SHOUTBOX"));
error_reporting(E_ALL);

  begin_frame("".T_("CLEAR_SHOUTBOX")."");

?>
<br /><br />
<font size ='3'><center><?php echo T_("CLEAR_SHOUTBOX_TEXT"); ?></center></font>
<br /><br />

  <form enctype="multipart/form-data" method="post" action="admincp.php">
  <input type="hidden" name="action" value="clearshout" />
  <input type="hidden" name="do" value="delete" />
  <table class="f-border" cellspacing="0" cellpadding="5" width="100%" align="center">
  <tr><td colspan="2" align="center"><input type="submit" value="<?php echo T_("CLEAR_SHOUTBOX");?>" /></td></tr>
  </table></form>

  <?php
  end_frame();
 
  if ($do == "delete"){
        SQL_Query_exec("TRUNCATE TABLE `ajshoutbox`");
        write_log("AJAX Shoutbox cleared by $CURUSER[username]");
        $msg_shout = sqlesc("".T_("SHOUTBOX_CLEARED_MESSAGE")."");
        SQL_Query_exec("INSERT INTO ajshoutbox (uid, date, name, text) VALUES(0,'".get_date_time()."', 'System' ,".$msg_shout.")");
        autolink ("admincp.php", "<b><font color='#ff0000'> AJAX Shoutbox Cleared....</font></b>");

}
  navmenu();
  stdfoot();
}
///////////////END CLEAR AJAX SHOUTBOX //////////////////////////////////////////////


in english.php add

$LANG["CLEAR_SHOUTBOX_TEXT"] = "Are you sure you want to clear the shoutbox? You can't undo this";
$LANG["SHOUTBOX_CLEARED_MESSAGE"] = "The shoutbox has been cleared";
$LANG["CLEAR_SHOUTBOX"] = "Clear Shoutbox";


you may already have $LANG["CLEAR_SHOUTBOX"] = "Clear Shoutbox"; in your language file. Check and see first

upload image to images/admin/ folder
[ATTACH alt="2618"]5007._xfImport[/ATTACH]
shoutclear.png
shoutclear.png

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
2019-05-21 16:18:54
Thaks You ! M8 ?
2020-09-12 16:56:30
"MicroMonkey, post: 66402, member: 311":

This is for the original TT shoutbox and the ajshoutbox. I thought someone had already made a mod to do this, but I couldnt find it, so I mashed my own together from spare parts

In admincp.php, this is the link on the page. Adjust the width and height to suit your needs.

<td align="center"><a href="admincp.php?action=clearshout"><img src="images/admin/shoutclear.png" border="0" width="118" height="80" alt="" /><br /><?php echo T_("CLEAR_SHOUTBOX"); ?><br /></a></td>



at the bottom before ?> put

///////////////// CLEAR STOCK SHOUTBOX /////////////////////////////

if ($action == "clearshout") {

stdhead(T_("CLEAR_SHOUTBOX"));
error_reporting(E_ALL);

  begin_frame("".T_("CLEAR_SHOUTBOX")."");

?>
<br /><br />
<font size ='3'><center><?php echo T_("CLEAR_SHOUTBOX_TEXT"); ?></center></font>
<br /><br />

  <form enctype="multipart/form-data" method="post" action="admincp.php">
  <input type="hidden" name="action" value="clearshout" />
  <input type="hidden" name="do" value="delete" />
  <table class="f-border" cellspacing="0" cellpadding="5" width="100%" align="center">
  <tr><td colspan="2" align="center"><input type="submit" value="<?php echo T_("CLEAR_SHOUTBOX");?>" /></td></tr>
  </table></form>

  <?php
  end_frame();

  if ($do == "delete"){
        SQL_Query_exec("TRUNCATE TABLE `shoutbox`");
        write_log("Shoutbox cleared by $CURUSER[username]");
        $msg_shout = sqlesc("".T_("SHOUTBOX_CLEARED_MESSAGE")."");
        SQL_Query_exec("INSERT INTO shoutbox (userid, date, user, message) VALUES(0,'".get_date_time()."', 'System' ,".$msg_shout.")");
        autolink ("admincp.php", "<b><font color='#ff0000'>Shoutbox Cleared....</font></b>");

}
  navmenu();
  stdfoot();
}
///////////////END CLEAR STOCK SHOUTBOX //////////////////////////////////////////////


if you use the ajshoutbox, use this instead. Place this at the bottom before ?>
///////////////// CLEAR AJAX SHOUTBOX /////////////////////////////

if ($action == "clearshout" ) {

stdhead(T_("CLEAR_SHOUTBOX"));
error_reporting(E_ALL);

  begin_frame("".T_("CLEAR_SHOUTBOX")."");

?>
<br /><br />
<font size ='3'><center><?php echo T_("CLEAR_SHOUTBOX_TEXT"); ?></center></font>
<br /><br />

  <form enctype="multipart/form-data" method="post" action="admincp.php">
  <input type="hidden" name="action" value="clearshout" />
  <input type="hidden" name="do" value="delete" />
  <table class="f-border" cellspacing="0" cellpadding="5" width="100%" align="center">
  <tr><td colspan="2" align="center"><input type="submit" value="<?php echo T_("CLEAR_SHOUTBOX");?>" /></td></tr>
  </table></form>

  <?php
  end_frame();

  if ($do == "delete"){
        SQL_Query_exec("TRUNCATE TABLE `ajshoutbox`");
        write_log("AJAX Shoutbox cleared by $CURUSER[username]");
        $msg_shout = sqlesc("".T_("SHOUTBOX_CLEARED_MESSAGE")."");
        SQL_Query_exec("INSERT INTO ajshoutbox (uid, date, name, text) VALUES(0,'".get_date_time()."', 'System' ,".$msg_shout.")");
        autolink ("admincp.php", "<b><font color='#ff0000'> AJAX Shoutbox Cleared....</font></b>");

}
  navmenu();
  stdfoot();
}
///////////////END CLEAR AJAX SHOUTBOX //////////////////////////////////////////////


in english.php add

$LANG["CLEAR_SHOUTBOX_TEXT"] = "Are you sure you want to clear the shoutbox? You can't undo this";
$LANG["SHOUTBOX_CLEARED_MESSAGE"] = "The shoutbox has been cleared";
$LANG["CLEAR_SHOUTBOX"] = "Clear Shoutbox";


you may already have $LANG["CLEAR_SHOUTBOX"] = "Clear Shoutbox"; in your language file. Check and see first

upload image to images/admin/ folder
[ATTACH]5007[/ATTACH]

I have more mnessage more image? empty shout (AJSHOUTBOX)
Thanks !


#======================================================================#
# CLEAR AJAX SHOUTBOX
#======================================================================#
if ($action == "clearshout" ) {

stdhead(T_("CLEAR_SHOUTBOX"));
error_reporting(E_ALL);

  begin_frame("".T_("CLEAR_SHOUTBOX")."");

  ?>
  <br />
  <font size='4'><center><?php echo T_("CLEAR_SHOUTBOX_TEXT"); ?>.</center></font><hr class="barre"/>
  <form enctype="multipart/form-data" method="post" action="admincp.php">
  <input type="hidden" name="action" value="clearshout" />
  <input type="hidden" name="do" value="delete" />
  <table cellspacing="0" cellpadding="5" width="60%" align="center">
  <tr><td colspan="2" align="center"><input type="submit" value="<?php echo T_("CLEAR_SHOUTBOX");?>" /></td></tr>
  </table></form>

  <?php
  end_frame();

  if ($do == "delete"){
        SQL_Query_exec("TRUNCATE TABLE `ajshoutbox`");
        write_log("AJAX Shoutbox effacé par $CURUSER[username]");
        $msg_shout = sqlesc("".T_("SHOUTBOX_CLEARED_MESSAGE")." ");
        SQL_Query_exec("INSERT INTO ajshoutbox (uid, date, name, text) VALUES(0,'".get_date_time()."', 'Robot Crazy' ,".$msg_shout.")");
        autolink ("admincp.php", "<b><font color='#ff0000'> AJAX Shoutbox effacé....</font></b>");

}
  navmenu();
  stdfoot();
}
#======================================================================#
# End CLEAR AJAX SHOUTBOX
#======================================================================#


Fonctions.php...

function autolink($al_url, $al_msg) {
   stdhead();
   begin_frame("Redirection Vers...");
   echo "\n<meta http-equiv=\"refresh\" content=\"3; url=$al_url\">\n";
   echo "<b>$al_msg</b>\n";
   echo "\n<b>Redirection...</b>\n";
   echo "\n[ <a href='$al_url'>Lien</a> ]\n";
   end_frame();
   stdfoot();
exit;
}

2021-01-31 12:56:36
I have a problem with the message, it deletes the shoutbox but it does not give the message with the image on the shoutbox?

======================================
j'ai un probleme avec le message, il supprime la shoutbox mais il ne donne pas le message avec l'image sur la shoutbox ?
2021-01-31 19:37:45
you cant just insert an image like that, you would probably have to use tags like [img][/img] and link to an image on site, but I never tried it, perhaps like
$msg_shout = sqlesc("".T_("SHOUTBOX_CLEARED_MESSAGE")."", [img][/img] );

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2021-01-31 20:22:39
2021-02-03 01:30:30
thank you I will test.
2021-02-03 21:49:31
always same problem it is of course on sql of the shout but I do not have them on the site ???

Lang:
$LANG["SHOUTBOX_CLEARED_MESSAGE"] = "[img]url[/img] La shoutbox a été nettoyé ! ";

Table SQL:



Shout vide:

Last edited by spiritblue on 2021-02-03 21:58:45
2021-02-04 05:12:21
Hello,
you can try with a smilie instead of an image!

//shout
$date=time();
$text = "Shoutbox vidée =balai ";
SQL_Query_exec("INSERT INTO `shoutbox` (id, userid, date, text, box) VALUES(null, 'System', $date,'$text', '1')");
//End Shout
2021-02-04 11:27:20
I noticed that your UID is 1, when it should be 0 if you are using system or a non-user as a user (which I recommend)
admincp.php
SQL_Query_exec("INSERT INTO ajshoutbox (uid, date, name, text) VALUES(0,'".get_date_time()."', 'Robot Crazy' ,".$msg_shout.")");


Here is my full getshout.php file
https://www.mediafire.com/file/5iqrekgxuwdg5yh/getshout.rar/file
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2021-02-04 13:25:10
2021-02-04 22:25:20
MicroMonkey the problem was with the getshout file, thanks a lot and thanks to SLy for your help.  ;)z
Last edited by spiritblue on 2021-02-06 17:21:19
2021-02-05 00:51:06
I hope everything is working well for you.  :) Make sure you pay attention to this section because it may not be the same as the user levels you have. Adjust those case numbers as needed. Also, mysqli_free_result can be deleted, its not needed. I commented it in my code because I like being able to know what I changed and why. Im stupid that way lol
switch ($ab[0]) {
case 8: // Site owner:
$name = "".$row['name']."";
break;
case 7: // Administrator:
$name = "".$row['name']."";
break;
case 6: // Super Moderator
$name = "".$row['name']."";
break;
case 5: // Moderator
$name = "".$row['name']."";
break;
case 4: // Uploader
$name = "".$row['name']."";
break;
case 3: // VIP
$name = "".$row['name']."";
break;
case 2: // Power User
$name = "".$row['name']."";
break;
case 1: // User
$name = "".$row['name']."";
break;
case 0: // System
$name = "".$row['name']."";
}

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2021-02-05 04:02:11
2021-02-06 17:19:26
yes i made the changes to the user color and rank and the same for the avatar and icon extensions, all are fine and I thank you again for your help very much appreciated as always.  :thum
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728