Hallo, Gast! (Registrieren)

Wir wünschen allen Besuchern frohe Ostern!

Letzte Ankündigung: MyBB 1.8.37 veröffentlicht (04.11.23)


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste
Texte in Shoutbox automatisch löschen?
#1
Hallo,

ich habe nun das Forum durch und mybbcoder auch, aber ich konnten nichts dazu finden, dabei meinte ich, ich hätte es schon mal irgendwo gelesen..

Wie kann ich es einstellen, dass jeden Abend die Shoutbox automatisch gelöscht wird? (Also die postings darin?)

Lieben Gruss Mera Luna
#2
Ist schon ein wenig älter, versuch es aber mal.
https://www.mybb.de/forum/showthread.php...61#pid8661
MyBBoard.de jetzt auf YouTube!
Fehlender Plan wird durch Wahnsinn ersetzt!!Toungue
Gruß Krafdi    www.krafdi.de
#3
Hey Krafdi,

danke für die schnelle Antwort, nur leider wie unter dem von dir angegeben Link, finde ich das eval("\$shouts .= \"".$templates->get('shoutbox_shout')."\";"); nicht, vielleicht weils schon älter ist?

Und als ich den dort angegebenen kompletten Code eingefügt habe, war mein ganzes Forum leider futsch:

So ist mein Code von der Shoutbox.php:


<?php
/**
* Shoutbox Plugin for MyBB
* Copyright © 2007 MyBB Mods
*
* By: Musicalmidget
* Website: http://mods.mybboard.com/
* Version: 2.0.1
*/

$plugins->add_hook('global_start', 'shoutbox_link');

function shoutbox_info()
{
return array(
'name' => 'Shoutbox',
'description' => 'Add a fully integrated shoutbox to your MyBB installation.',
'website' => 'http://mods.mybboard.com/',
'author' => 'Musicalmidget',
'authorsite' => 'http://www.musicalmidget.com/',
'version' => '2.0.1'
);
}

function shoutbox_activate()
{
global $db;

// Create `shouts` table
$db->query("
CREATE TABLE `".TABLE_PREFIX."shouts` (
sid smallint unsigned NOT NULL auto_increment,
uid smallint unsigned NOT NULL default '0',
username varchar(120) NOT NULL default '',
message text NOT NULL default '',
dateline bigint(30) NOT NULL default '0',
ipaddress varchar(30) NOT NULL default '',
PRIMARY KEY (`sid`)
) TYPE=MyISAM
");

// Insert new setting group
$db->query("INSERT INTO `".TABLE_PREFIX."settinggroups` VALUES (NULL, 'shoutbox', 'Shoutbox', 'Settings related to the shoutbox plugin.', 20, '');");
$gid = $db->insert_id();

// Insert new settings
$db->query("INSERT INTO `".TABLE_PREFIX."settings` VALUES (NULL, 'sb_shouts_per_page', 'Shouts Per Page', 'The number of shouts to show on each shoutbox page.', 'text', '25', 1, $gid);");
$db->query("INSERT INTO `".TABLE_PREFIX."settings` VALUES (NULL, 'sb_refresh_time', 'Auto Refresh Time', 'The number of seconds between auto-refreshes in the shoutbox.<br />Set the time to <strong>0</strong> to disable auto-refresh.', 'text', '60', 2, $gid);");
$db->query("INSERT INTO `".TABLE_PREFIX."settings` VALUES (NULL, 'sb_max_consec_shouts', 'Maximum Consecutive Shouts', 'The maximum number of consecutive shouts that a user may post before another user shouts.', 'text', '5', 3, $gid);");
$db->query("INSERT INTO `".TABLE_PREFIX."settings` VALUES (NULL, 'sb_max_length', 'Maximum Shout Length', 'The maximum allowed length of shouts. This setting applies to <strong>all</strong> users.', 'text', '150', 4, $gid);");
$db->query("INSERT INTO `".TABLE_PREFIX."settings` VALUES (NULL, 'sb_guest_shouting', 'Allow Guest Shouting', 'Would you like to allow guests to shout in the shoutbox?', 'yesno', 'no', 5, $gid);");
$db->query("INSERT INTO `".TABLE_PREFIX."settings` VALUES (NULL, 'sb_allow_html', 'Allow HTML', 'Would you like to allow users to post HTML code into the shoutbox? <strong>Note:</strong> Please ensure that you are aware of the risks before enabling this setting.', 'yesno', 'no', 6, $gid);");
$db->query("INSERT INTO `".TABLE_PREFIX."settings` VALUES (NULL, 'sb_allow_mycode', 'Allow MyCode', 'Would you like to allow the use of MyCode in the shoutbox?', 'yesno', 'yes', 7, $gid);");
$db->query("INSERT INTO `".TABLE_PREFIX."settings` VALUES (NULL, 'sb_allow_smilies', 'Allow Smilies', 'Would you like to allow the use of smilies in the shoutbox?', 'yesno', 'yes', 8, $gid);");
$db->query("INSERT INTO `".TABLE_PREFIX."settings` VALUES (NULL, 'sb_allow_imgcode', 'Allow [img] Code', 'Would you like to allow users to post images in the shoutbox?', 'yesno', 'no', 9, $gid);");
$db->query("INSERT INTO `".TABLE_PREFIX."settings` VALUES (NULL, 'sb_width', 'Shoutbox Width', 'The width of the shoutbox popup window.', 'text', '400', 10, $gid)");
$db->query("INSERT INTO `".TABLE_PREFIX."settings` VALUES (NULL, 'sb_height', 'Shoutbox Height', 'The height of the shoutbox popup window.', 'text', '350', 11, $gid)");

// Rebuild settings
rebuildsettings();

// Create an array of new templates
$new_templates['shoutbox'] = "<html>
<head>
<title>{\$mybb->settings[\'bbname\']} - {\$lang->shoutbox}</title>
{\$headerinclude}
{\$refresh}
</head>
<body>
<table border=\"0\" cellspacing=\"{\$theme[\'borderwidth\']}\" cellpadding=\"{\$theme[\'tablespace\']}\" class=\"tborder\">
<tr>
<td class=\"thead\"><strong>{\$lang->shoutbox}</strong></td>
</tr>
{\$multipage_top}
{\$shouts}
{\$multipage_bottom}
</table>
{\$add_shout}
</body>
</html>";

$new_templates['shoutbox_add_shout'] = "<br />
<form method=\"post\" action=\"shoutbox.php\">
<input type=\"hidden\" name=\"action\" value=\"do_add\">
<table border=\"0\" cellspacing=\"{\$theme[\'borderwidth\']}\" cellpadding=\"{\$theme[\'tablespace\']}\" class=\"tborder\">
<tr>
<td class=\"trow1\" align=\"center\">{\$lang->shout} <input type=\"text\" name=\"message\" size=\"40\" maxlength=\"{\$mybb->settings[\'sb_max_length\']}\"> <input type=\"submit\" name=\"submit\" value=\"{\$lang->add_shout}\"><br /><span class=\"smalltext\"><a href=\"shoutbox.php\">{\$lang->refresh}</a></span></td>
</tr>
</table>
</form>";

$new_templates['shoutbox_delete_shout'] = "<html>
<head>
<title>{\$mybb->settings[\'bbname\']} - {\$lang->shoutbox}</title>
{\$headerinclude}
</head>
<body>
<form method=\"post\" action=\"shoutbox.php\">
<input type=\"hidden\" name=\"action\" value=\"do_delete\" />
<input type=\"hidden\" name=\"sid\" value=\"{\$shout[\'sid\']}\" />
<table border=\"0\" cellspacing=\"{\$theme[\'borderwidth\']}\" cellpadding=\"{\$theme[\'tablespace\']}\" class=\"tborder\">
<tr>
<td class=\"trow1\">{\$lang->confirm_shout_delete}<br /><br /><input type=\"submit\" name=\"deletesubmit\" value=\"{\$lang->yes}\" />&nbsp;<input type=\"button\" name=\"cancel\" value=\"{\$lang->no}\" onclick=\"javascript:history.back();\" /></td>
</tr>
</table>
</form>
</body>
</html>";

$new_templates['shoutbox_edit_shout'] = "<html>
<head>
<title>{\$mybb->settings[\'bbname\']} - {\$lang->shoutbox}</title>
{\$headerinclude}
</head>
<body>
<form method=\"post\" action=\"shoutbox.php\">
<input type=\"hidden\" name=\"action\" value=\"do_edit\" />
<input type=\"hidden\" name=\"sid\" value=\"{\$shout[\'sid\']}\" />
<table border=\"0\" cellspacing=\"{\$theme[\'borderwidth\']}\" cellpadding=\"{\$theme[\'tablespace\']}\" class=\"tborder\">
<tr>
<td class=\"trow1\"><input type=\"text\" name=\"message\" value=\"{\$message}\" size=\"40\" maxlength=\"{\$mybb->settings[\'sb_max_length\']}\" /></td>
</tr>
</table>
<br />
<div align=\"center\">
<input type=\"submit\" name=\"submit\" value=\"{\$lang->edit_shout}\" />
</div>
</form>
</body>
</html>";

$new_templates['shoutbox_error'] = "<html>
<head>
<title>{\$mybb->settings[\'bbname\']}</title>
{\$headerinclude}
</head>
<body>
<table border=\"0\" cellspacing=\"{\$theme[\'borderwidth\']}\" cellpadding=\"{\$theme[\'tablespace\']}\" class=\"tborder\">
<tr>
<td class=\"trow1\">{\$message}</td>
</tr>
</table>
</body>
</html>";

$new_templates['shoutbox_error_no_shouts'] = "<tr>
<td class=\"trow1\">{\$lang->error_no_shouts}</td>
</tr>";

$new_templates['shoutbox_multipage'] = "<tr>
<td class=\"{\$bgcolor}\" align=\"center\">\$multipage_links</td>
</tr>";

$new_templates['shoutbox_shout'] = "<tr>
<td class=\"{\$bgcolor}\" align=\"left\" title=\"{\$title}\"><small>{\$shout[\'username\']}{\$shout[\'message\']}{\$options}</small></td>
</tr>";

// Insert the new templates
foreach($new_templates as $title => $template)
{
$db->query("INSERT INTO `".TABLE_PREFIX."templates` VALUES (NULL, '$title', '$template', '-1', '120', '', '1158715531')");
}

// Add the shoutbox link to the "header_welcomeblock_member" template
require MYBB_ROOT.'/inc/adminfunctions_templates.php';
find_replace_templatesets('header_welcomeblock_member', '#{\$lang->welcome_open_buddy_list}</a>#', "{\$lang->welcome_open_buddy_list}</a>{\$shoutbox_link}");
find_replace_templatesets('header_welcomeblock_guest', '#{\$lang->welcome_current_time}</span>#', "{\$lang->welcome_current_time}{\$shoutbox_link}</span>");
}

function shoutbox_deactivate()
{
global $db;

// Drop shouts table
$db->query("DROP TABLE `".TABLE_PREFIX."shouts`");

// Delete setting group
$db->query("DELETE FROM `".TABLE_PREFIX."settinggroups` WHERE name='shoutbox'");

// Delete settings
$db->query("DELETE FROM `".TABLE_PREFIX."settings` WHERE name IN ('sb_shouts_perpage,sb_refresh_time,sb_max_consec_shouts,sb_max_length,sb_guest_shouting,sb_allow_html,sb_allow_mycode,sb_allow_smilies,sb_allow_imgcode,sb_width,sb_height')");

// Rebuild settings
rebuildsettings();

// Generate an array of templates to delete
$delete_templates = array('shoutbox', 'shoutbox_add_shout', 'shoutbox_delete_shout', 'shoutbox_edit_shout', 'shoutbox_error', 'shoutbox_error_no_shouts', 'shoutbox_multipage', 'shoutbox_shout');

// Delete shoutbox templates
foreach($delete_templates as $title)
{
$db->query("DELETE FROM `".TABLE_PREFIX."templates` WHERE title='$title' AND sid='-1'");
}

// Remove the shoutbox link from the "header_welcomeblock_member" template
require MYBB_ROOT.'/inc/adminfunctions_templates.php';
find_replace_templatesets('header_welcomeblock_member', '#{\$shoutbox_link}#', '', 0);
find_replace_templatesets('header_welcomeblock_guest', '#{\$shoutbox_link}#', '', 0);
}

function shoutbox_link()
{
global $mybb, $lang, $shoutbox_link;

if(!isset($mybb->settings['bblanguage']))
{
$mybb->settings['bblanguage'] = 'english';
}

$lang->set_language($mybb->settings['bblanguage']);
$lang->load('shoutbox');

$shoutbox_link = " | <a href=\"#\" onClick=\"MyBB.popupWindow('shoutbox.php', 'shoutbox', ".$mybb->settings['sb_width'].", ".$mybb->settings['sb_height'].");\">".$lang->shoutbox."</a>";
}
?>

Wo genau muss ich da nun was ändern? Wäre lieb wenn mir jemand dann den komplett neuen Code hier niederschreiben könnte, da ich absolut neu auf diesem Gebiet bin.

Vielen Dank schon mal im Vorraus.

Mera Luna


Möglicherweise verwandte Themen…
Thema Verfasser Antworten Ansichten Letzter Beitrag
  Texte zerrissen! Ralph_Ka 2 1.302 03.05.2007, 10:26
Letzter Beitrag: Ralph_Ka
  Standard Mail texte teleshoppingfan 1 1.265 27.02.2007, 14:05
Letzter Beitrag: Mak
  Farben ändern; Texte ändern/einfügen ?? nils05 1 1.777 11.10.2005, 15:23
Letzter Beitrag: Michael