23.02.2008, 12:44
Django, wenn du die Seite neu lädst,steht dann der Shout auch nicht drin? Ich muss öfter mal die Seite neuladen damit der erste Shout angezeigt wird, danach funkt es bestens.
<script type="text/javascript" src="jscripts/shoutbox.js?ver=121"></script>
Schumuckl schrieb:$sf_shoutbox_data .= "<tr id='shout-{$row[id]}'><td class='{$class}'>» {$delete}{$username} - {$date_time} -- {$message}</td></tr>";
function spicefuse_shoutbox_activate()
{
global $db;
// create table
$db->query("CREATE TABLE `".TABLE_PREFIX."sf_shouts` (
`id` int(10) NOT NULL auto_increment,
`uid` int(10) NOT NULL,
`shout_msg` text NOT NULL,
`shout_date` int(10) NOT NULL,
`shout_ip` varchar(30) NOT NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM");
$db->query("INSERT INTO ".TABLE_PREFIX."sf_shouts VALUES (NULL, 1, 'Test Shout! Without any shout, shoutbox will display Loading... forever.. you need at least one shout, so here it is.', ".time().", '127.0.0.1')");
// create a group
$db->query("INSERT INTO `".TABLE_PREFIX."settinggroups` VALUES (NULL, 'sf_shoutbox', 'SpiceFuse Shoutbox', 'Settings for the AJAX shoutbox.', 1, '');");
$id = $db->insert_id();
// insert settings
$db->query("INSERT INTO `".TABLE_PREFIX."settings` VALUES (NULL, 'sf_sb_shouts_main', '# of Shouts to display', 'The maximum number of shouts you want to be displayed.', 'text', '10', 1, {$id})");
$db->query("INSERT INTO `".TABLE_PREFIX."settings` VALUES (NULL, 'sf_sb_refresh_interval', 'Refresh Interval', 'How many seconds before the shoutbox is reloaded using AJAX transparently. ', 'text', '30', 0, {$id})");
$db->query("INSERT INTO `".TABLE_PREFIX."settings` VALUES (NULL, 'sf_sb_allow_mycode', 'Allow MyCode?', 'Allow MyBB code in shouts to format text using [b], [i] etc..?', 'yesno', 'yes', 0, {$id})");
$db->query("INSERT INTO `".TABLE_PREFIX."settings` VALUES (NULL, 'sf_sb_allow_smilies', 'Allow Smilies?', 'Allow smilies in shouts?', 'yesno', 'yes', 0, {$id})");
$db->query("INSERT INTO `".TABLE_PREFIX."settings` VALUES (NULL, 'sf_sb_allow_imgcode', 'Allow IMGCode?', 'Allow images in shoutbox? Note: Some can post too big images and mess up your layout.', 'yesno', 'no', 0, {$id})");
$db->query("INSERT INTO `".TABLE_PREFIX."settings` VALUES (NULL, 'sf_sb_height', 'ShoutBox Height', 'Set the height for shoutbox here.', 'text', '125', 0, {$id})");
$db->query("INSERT INTO `".TABLE_PREFIX."settings` VALUES (NULL, 'sf_sb_datetime', 'ShoutBox Date/Time', 'PHP date time format for shoutbox. <a href=\"http://php.net/date\" target=\"_blank\">check here</a> for more info.', 'text', 'd-m-H:i', 0, {$id})");
$db->query("INSERT INTO `".TABLE_PREFIX."settings` VALUES (NULL, 'sf_sb_full_ppage', 'Shouts per page on full view?', 'The number of shouts you want to be displayed, per page, on the full shoutbox view.', 'text', '15', 0, {$id})");
$db->query("INSERT INTO `".TABLE_PREFIX."settings` VALUES (NULL, 'sf_sb_allow_smods', 'Allow super mods to delete?', 'Allow super mods to delete shouts in the shoutbox?', 'yesno', 'yes', 0, {$id})");
$db->query("INSERT INTO `".TABLE_PREFIX."settings` VALUES (NULL, 'sf_sb_guestview', 'Guests can View Shoutbox?', 'Are guests allowed to view shoutbox?', 'yesno', 'yes', 0, {$id})");
// load templates
$sf_shoutbox_tpl = addslashes(implode("", file('../inc/plugins/tpl_sf_shoutbox.txt')));
$sf_sboxfull_tpl = addslashes(implode("", file('../inc/plugins/tpl_sf_sboxfull.txt')));
// insert templates
$db->query("INSERT INTO `".TABLE_PREFIX."templates` VALUES (NULL, 'sf_shoutbox', '{$sf_shoutbox_tpl}', '-1', '121', '', '1167510304')");
$db->query("INSERT INTO `".TABLE_PREFIX."templates` VALUES (NULL, 'sf_shoutbox_full', '{$sf_sboxfull_tpl}', '-1', '121', '', '1167510304')");
// rebuild settings...
rebuildsettings();
global $plugins_cache, $cache, $active_plugins, $plugins_cache;
$plugins_cache['active'] = $active_plugins;
$cache->update("plugins", $plugins_cache);
cpmessage("Please follow the instructions at spicefuse.com and perform the next steps of editing the templates.");
}