Sponsor-Board.de
Thema geschlossen  Thema schreiben 

PHP Problem

Verfasser Nachricht

Beiträge: 1.608
Bewertung: 9
Registriert seit: Aug 2010
Status: offline


Beitrag: #1
PHP Problem

Hallo SB,
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 :/


Mit freundlichem Gruß
Damian P.

07.09.2011 13:29
 
Webseite des Benutzers besuchen Alle Beiträge dieses Benutzers finden

Beiträge: 266
Bewertung: 9
Registriert seit: Jul 2010
Status: offline


Beitrag: #2
RE: PHP Problem

z.b.:

<?php

<PHP-Quellcode>

echo '<HTML-Quellcode>';

<PHP-Quellcode>

?>


[Link: Registrierung erforderlich]
Biete Sponsoring:
Teamspeak 2 / 3
Webspace
Datenbank
Fast Download
Game Server (Battlefield 3, Counter Strike Source u.v.m.)

07.09.2011 13:37
 
Webseite des Benutzers besuchen Alle Beiträge dieses Benutzers finden

Beiträge: 2.199
Bewertung: 74
Registriert seit: Oct 2007
Status: offline


Beitrag: #3
RE: PHP Problem

Du solltest einen Layer Code besser in den Footer einbauen und zwar vor den tag </body>.


[Link: Registrierung erforderlich]
[Link: Registrierung erforderlich]

07.09.2011 13:40
 
Webseite des Benutzers besuchen Alle Beiträge dieses Benutzers finden

Beiträge: 1.608
Bewertung: 9
Registriert seit: Aug 2010
Status: offline


Beitrag: #4
RE: PHP Problem

Thomas schrieb:
Du solltest einen Layer Code besser in den Footer einbauen und zwar vor den tag </body>.


Ja das ist klar

nur möchte ich das das Layer nur für Gäste sichtbar ist

Dieses Plugin ist schon so gecodet das es nur Gäste sehen

Wenn der Code also davor steht sehen das Layer nur die Gäste Wink


Mit freundlichem Gruß
Damian P.

07.09.2011 13:43
 
Webseite des Benutzers besuchen Alle Beiträge dieses Benutzers finden

Beiträge: 266
Bewertung: 9
Registriert seit: Jul 2010
Status: offline


Beitrag: #5
RE: PHP Problem

könntest die Gäste eine Id 0 geben z.b.: und den Usern ID 1.

Einfache IF abfrage fertig Wink

Hatte ich auch schon mal dran gebastelt Smile


[Link: Registrierung erforderlich]
Biete Sponsoring:
Teamspeak 2 / 3
Webspace
Datenbank
Fast Download
Game Server (Battlefield 3, Counter Strike Source u.v.m.)

07.09.2011 13:57
 
Webseite des Benutzers besuchen Alle Beiträge dieses Benutzers finden

Beiträge: 1.608
Bewertung: 9
Registriert seit: Aug 2010
Status: offline


Beitrag: #6
RE: PHP Problem

So Maurice hat mit ein extra Addon geschrieben

Danke dafür Smile

Closed


Mit freundlichem Gruß
Damian P.

07.09.2011 16:19
 
Webseite des Benutzers besuchen Alle Beiträge dieses Benutzers finden
Thema geschlossen  Thema schreiben 

 Druckversion anzeigen
 Thema einem Freund senden
 Thema abonnieren
 Thema zu den Favoriten hinzufügen

Sponsor-Board.de

Community
Über uns
Partner
Powered by Mybb: Copyright 2002-2024 by MyBB Group - Deutsche-Übersetzung von Mybb.de
 
© 2007-2024 Sponsor-Board.de - Hosted by OVH

Willkommen auf SB!   Sie benötigen ein Sponsoring?   1. Anmelden   2. Sponsoring-Anfrage erstellen   3. Nachrichten von Sponsoren erhalten   Kostenlos!   Jetzt registrieren