07.09.2011, 13:29
Hallo SB,
Ich habe ein Problem mit einer PHP Datei.
Der Code:
Ich habe ein Problem mit einer PHP Datei.
Der Code:
PHP-Code:
<?php
/**
@ Author: Clear
@ Created: 15/11/2010
@ Version: 1.0
@ Contact: [email protected]
@ License: Is not allowed the copy, redistribution and sale of this plugin. For all problem, contact me.
*/
if(!defined("IN_MYBB"))
die("This file cannot be accessed directly.");
$plugins->add_hook('global_start', 'avvisospiti');
function avvisospiti_info() {
return array(
'name' => 'Guest warn',
'description' => 'Show an elegant warn for all guest of your forum.',
'website' => 'http://www.mybb.com/',
'author' => 'Clear',
'authorsite' => 'http://www.downloadsafe.altervista.org',
'version' => '1',
);
}
function avvisospiti()
{
global $mybb;
global $theme,$avvisospiti;
if ($mybb->user['usergroup'] == 1)
{
$avvisospiti='<style>#avviso { background: #000; margin-right: 7px; color: #fff; font-size: 10px; border: 0px solid #94c2e8; padding: 8px; -moz-border-radius: 8px; -webkit-border-radius: 8px; filter:alpha(opacity=88); -moz-opacity:.88; opacity:.88; -moz-box-shadow:5px 5px 5px #191919; -webkit-box-shadow:5px 5px 5px #191919; box-shadow:5px 5px 5px #191919; } #avviso a:link { color: #fff; text-decoration: none; } #avviso a:visited { color: #fff; text-decoration: none; } #avviso a:hover, #avviiso a:active { color: #fff; text-decoration: underline; } .avviso_fixed { height: auto; position: fixed; top:' . $mybb->settings['avvisospiti_2'] . '; right: ' . $mybb->settings['avvisospiti_3'] . '; width: 280px; }</style><div class="avviso_fixed"><div id="avviso">' . $mybb->settings['avvisospiti_1'] . '</div></div>';
}
}
function avvisospiti_activate()
{
global $db, $mybb;
// Settings
$avvisospiti_group = array(
"gid" => "NULL",
"name" => "avvisospiti",
"title" => "Guest warn Settings",
"description" => "These settings allow an elegant warn for all guest of your forum.",
"disporder" => "1",
"isdefault" => "no",
);
$db->insert_query("settinggroups", $avvisospiti_group);
$gid = $db->insert_id();
$avvisospiti_setting_1 = array(
"sid" => "NULL",
"name" => "avvisospiti_1",
"title" => "Enter your guest warn message here",
"description" => "This text will are show in the warn for the guests off your forum",
"optionscode" => "textarea",
"value" => 'Hello Guest, if you read this, it means you are not registered. <a href="member.php?action=register">Click here</a> to register a few simple steps, you will enjoy all the features of our Forum. Please note that nicknames are prohibited lewd or meaningless (no numbers or letters at random) and presented in the section for you to meet our community.',
"disporder" => '3',
"gid" => intval($gid),
);
$avvisospiti_setting_2 = array(
"sid" => "NULL",
"name" => "avvisospiti_2",
"title" => "Set the height for the position of the warn in forum",
"description" => "Recomended is 50%",
"optionscode" => "text",
"value" => '50%',
"disporder" => '2',
"gid" => intval($gid),
);
$avvisospiti_setting_3 = array(
"sid" => "NULL",
"name" => "avvisospiti_3",
"title" => "Set the width for the position of the warn in forum",
"description" => "Recomended is 2%",
"optionscode" => "text",
"value" => '2%',
"disporder" => '1',
"gid" => intval($gid),
);
$db->insert_query("settings", $avvisospiti_setting_1);
$db->insert_query("settings", $avvisospiti_setting_2);
$db->insert_query("settings", $avvisospiti_setting_3);
require MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("headerinclude", "#".preg_quote('{$stylesheets}')."#i",'{$stylesheets}{$avvisospiti}');
// Rebuilding settings
rebuild_settings();
}
function avvisospiti_deactivate()
{
global $db, $mybb;
$db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name='avvisospiti'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='avvisospiti_1'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='avvisospiti_2'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='avvisospiti_3'");
require MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("headerinclude", "#".preg_quote('{$avvisospiti}')."#i", '', 0);
// Rebuilding settings
rebuild_settings();
}
?>
Es geht mir um folgende Stelle:
PHP-Code:
global $theme,$avvisospiti;
if ($mybb->user['usergroup'] == 1)
{
$avvisospiti='<style>#avviso { background: #000; margin-right: 7px; color: #fff; font-size: 10px; border: 0px solid #94c2e8; padding: 8px; -moz-border-radius: 8px; -webkit-border-radius: 8px; filter:alpha(opacity=88); -moz-opacity:.88; opacity:.88; -moz-box-shadow:5px 5px 5px #191919; -webkit-box-shadow:5px 5px 5px #191919; box-shadow:5px 5px 5px #191919; } #avviso a:link { color: #fff; text-decoration: none; } #avviso a:visited { color: #fff; text-decoration: none; } #avviso a:hover, #avviiso a:active { color: #fff; text-decoration: underline; } .avviso_fixed { height: auto; position: fixed; top:' . $mybb->settings['avvisospiti_2'] . '; right: ' . $mybb->settings['avvisospiti_3'] . '; width: 280px; }</style><div class="avviso_fixed"><div id="avviso">' . $mybb->settings['avvisospiti_1'] . '</div></div>';
}
}
function avvisospiti_activate()
{
global $db, $mybb;
Vor dem <style>#avviso möchte ich einen LayerCode einfügen
Der LayerCode:
Code:
<script Language="JavaScript">
document.write ('<scr' + 'ipt Language="JavaScript" src="http://www.euros4click.de/showme.php?id=xxxx&rnd=' + Math.random() + '&popup=false&layer=true"></scr' + 'ipt>');
</script>
Wie füge ich den davor ein?
Ich habe es schon versucht aber bekomme dann immer eine Fehlermeldung :/