Top-Themen

AppleEntwicklungHardwareInternetLinuxMicrosoftMultimediaNetzwerkeOff TopicSicherheitSonstige SystemeVirtualisierungWeiterbildungZusammenarbeit

Aktuelle Themen

Administrator.de FeedbackApache ServerAppleAssemblerAudioAusbildungAuslandBackupBasicBatch & ShellBenchmarksBibliotheken & ToolkitsBlogsCloud-DiensteClusterCMSCPU, RAM, MainboardsCSSC und C++DatenbankenDatenschutzDebianDigitiales FernsehenDNSDrucker und ScannerDSL, VDSLE-BooksE-BusinessE-MailEntwicklungErkennung und -AbwehrExchange ServerFestplatten, SSD, RaidFirewallFlatratesGoogle AndroidGrafikGrafikkarten & MonitoreGroupwareHardwareHosting & HousingHTMLHumor (lol)Hyper-VIconsIDE & EditorenInformationsdiensteInstallationInstant MessagingInternetInternet DomäneniOSISDN & AnaloganschlüsseiTunesJavaJavaScriptKiXtartKVMLAN, WAN, WirelessLinuxLinux DesktopLinux NetzwerkLinux ToolsLinux UserverwaltungLizenzierungMac OS XMicrosoftMicrosoft OfficeMikroTik RouterOSMonitoringMultimediaMultimedia & ZubehörNetzwerkeNetzwerkgrundlagenNetzwerkmanagementNetzwerkprotokolleNotebook & ZubehörNovell NetwareOff TopicOpenOffice, LibreOfficeOutlook & MailPapierkorbPascal und DelphiPeripheriegerätePerlPHPPythonRechtliche FragenRedHat, CentOS, FedoraRouter & RoutingSambaSAN, NAS, DASSchriftartenSchulung & TrainingSEOServerServer-HardwareSicherheitSicherheits-ToolsSicherheitsgrundlagenSolarisSonstige SystemeSoziale NetzwerkeSpeicherkartenStudentenjobs & PraktikumSuche ProjektpartnerSuseSwitche und HubsTipps & TricksTK-Netze & GeräteUbuntuUMTS, EDGE & GPRSUtilitiesVB for ApplicationsVerschlüsselung & ZertifikateVideo & StreamingViren und TrojanerVirtualisierungVisual StudioVmwareVoice over IPWebbrowserWebentwicklungWeiterbildungWindows 7Windows 8Windows 10Windows InstallationWindows MobileWindows NetzwerkWindows ServerWindows SystemdateienWindows ToolsWindows UpdateWindows UserverwaltungWindows VistaWindows XPXenserverXMLZusammenarbeit

PHP , Hintergrund definieren

Frage Internet

Mitglied: Coax

Coax (Level 1) - Jetzt verbinden

02.10.2006, aktualisiert 14.07.2008, 3922 Aufrufe, 1 Kommentar

ich habe mir ein script gedownloaden und möchte den Hintergrund der Seite ändern

Hallo, ich als php newb möchte jetzt mal was wissen,

Ich habe mir ein script gedownloaded und möchte nun den Hintergrund der immoment weiß ist auf diese Farbe hier ändern
#353947

Ich finde aber in dem script nicht Befehl dafür den body background zu ändern... sonder ich kann nur die Variablen der kästchen ändern wo die Tage und und so eingetragen sind...

hier mal der code


01.
<?php 
02.
 
03.
                 ///////////////////////////////////////////// 
04.
	//Declare some variables 
05.
	// 
06.
	$calendar_script          = "calendar2.php"; //The location of this script 
07.
	$calendar_language        = "ger";       //The extension of the calendar language file. 
08.
 
09.
	$content_background_color = "#535153";   //Background color of the column 
10.
	$content_font_color       = "white";   //The font color 
11.
	$content_font_size        = 10;          //Font-size in pixels 
12.
	$content_font_style       = "normal";    //Set to italic or normal 
13.
	$content_font_weight      = "normal";    //Set to bold or normal 
14.
 
15.
	$today_background_color   = "white";   //Background color of the column 
16.
	$today_font_color         = "#000000";     //The font color 
17.
	$today_font_size          = 10;          //Font-size in pixels 
18.
	$today_font_style         = "normal";    //Set to italic or normal 
19.
	$today_font_weight        = "bold";      //Set to bold or normal 
20.
 
21.
	$event_background_color   = "#DDDDDD";   //Background color of the column 
22.
	$event_background_color2  = "#EEEEEE";   //Background color of the 2nd column (event popup) 
23.
	$event_font_color         = "#000000";   //The font color 
24.
	$event_font_size          = 10;          //Font-size in pixels 
25.
	$event_font_style         = "normal";    //Set to italic or normal 
26.
	$event_font_weight        = "bold";      //Set to bold or normal 
27.
  $event_popup_width        = "250";       //Width  of the popup for the events 
28.
  $event_popup_height       = "350";       //Height of the popup for the events 
29.
	 
30.
	$head_background_color    = "#DDDDDD";   //Background color of the column 
31.
	$head_font_color          = "green";   //The font color 
32.
	$head_font_size           = 11;          //Font-size in pixels 
33.
	$head_font_style          = "normal";    //Set to italic or normal 
34.
	$head_font_weight         = "bold";      //Set to bold or normal 
35.
	 
36.
	//darussol: CSS OPTIONS FOR WEEK DAYS 
37.
	$days_head_background_color = "#DDDDDD";   //Background color of the column 
38.
	$days_head_font_color       = "gray";   //The font color 
39.
	$days_head_font_size        = 11;          //Font-size in pixels 
40.
	$days_head_font_style       = "normal";    //Set to italic or normal 
41.
	$days_head_font_weight      = "bold";      //Set to bold or normal 
42.
	 
43.
	$table_border             = 0;           //The border of the table 
44.
	$table_cellspacing        = 1;           //Cellspacing of the table 
45.
	$table_cellpadding        = 2;           //Cellpadding of the table 
46.
	$table_width              = '';          //Table width in pixels or %'s 
47.
	$table_height             = '';          //Table height in pixels or %'s 
48.
	 
49.
	$head_link_color          = "green";    //The color of the link for previous/next month 
50.
	 
51.
	$font_family = "Verdana"
52.
	 
53.
	/* 17 June 2004 : Check readme.txt for MySQL code for the database table *
54.
 
55.
	$events_from_database     = false;        //Set to true if you want to retrieve events 
56.
	$database                 = "database";  //Name of the database within the event_table 
57.
  $server                   = "localhost"; //Name of the server 
58.
  $username                 = "username";  //MySQL username 
59.
  $password                 = "********";  //MySQL password 
60.
  $event_table              = "calendar_events"; //Name of the calendar_events 
61.
	// 
62.
	///////////////////////////////////////////// 
63.
	 
64.
	///////////////////////////////////////////// 
65.
	//Load the language into usable variables 
66.
	// 
67.
 
68.
	//darussol: TRANSLATION (18 May 2004) 
69.
	//        : Fill in the names of the days/months in variables 
70.
	//e-man   : LOAD TRANSLATION FILE INTO VARIABLES (from darussol)(19 May 2004) 
71.
	//        : Put the days/months names from language file into a array	 
72.
 
73.
	$language_file  = "calendar." . $calendar_language;	    //Language file into variable 
74.
	$fd             = fopen( $language_file, "r" );             //Open the language file 
75.
	$fd             = fread( $fd, filesize( $language_file ) ); //Read the opened file 
76.
	$language_array = explode( "\n" , $fd );                    //Put file info into array  
77.
 
78.
	$dayname   = array_slice($language_array,0,7); //The names of the days 
79.
 
80.
	$monthname = array_slice($language_array,7);   //The rest of the language file are the monthnames 
81.
	// 
82.
	///////////////////////////////////////////// 
83.
 
84.
 
85.
	///////////////////////////////////////////// 
86.
	//Use the date to build up the calendar. From the Query_string or the current date 
87.
	//	 
88.
	if( isset( $_GET['date'] ) ) 
89.
		list($month,$year) = explode("-",$_GET['date']); 
90.
	else 
91.
92.
		$month = date("m"); 
93.
		$year  = date("Y"); 
94.
95.
	// 
96.
	///////////////////////////////////////////// 
97.
 
98.
	$date_string = mktime(0,0,0,$month,1,$year); //The date string we need for some info... saves space ^_^ 
99.
 
100.
	$day_start = date("w",$date_string);  //The number of the 1st day of the week 
101.
 
102.
	///////////////////////////////////////////// 
103.
	//Filter the current $_GET['date'] from the QUERY_STRING 
104.
	// 
105.
	$QUERY_STRING = ereg_replace("&date=".$month."-".$year,"",$_SERVER['QUERY_STRING']); 
106.
	// 
107.
	///////////////////////////////////////////// 
108.
	 
109.
 
110.
	///////////////////////////////////////////// 
111.
	//Calculate the previous/next month/year 
112.
	// 
113.
	if( $month < 12 ) 
114.
115.
		$next_month = $month+1; 
116.
		$next_date = $next_month."-".$year
117.
118.
	else 
119.
120.
		$next_year = $year+1; 
121.
		$next_date = "1-".$next_year
122.
		$next_month = 1; 
123.
124.
	if( $month > 1 ) 
125.
126.
		$previous_month = $month-1; 
127.
		$next_month    = $month+1; 
128.
		$previous_date = $previous_month."-".$year
129.
130.
	else 
131.
132.
		$previous_year = $year-1; 
133.
		$previous_date = "12-".$previous_year
134.
		$previous_month = 12; 
135.
136.
	// 
137.
	///////////////////////////////////////////// 
138.
 
139.
	// darussol: DEFINITION OF THETRANSLATED MONTH+YEAR TO BE USED IN THE TABLE AND INFO-TITLES (18 May 2004) 
140.
	// e-man   : USING THE VALUES OF THE PREVIOUS AND NEXT MONTH FOR THE TITLE DAY (19 May 2004); 
141.
	$table_caption_prev = $monthname[$previous_month-1] . " " . $year; // previous 
142.
	$table_caption      = $monthname[date("n",$date_string)-1] . " " . $year; // current 
143.
  if ($next_month == 13){ 
144.
    $next_month = 1; 
145.
    $year++; 
146.
147.
	$table_caption_foll = $monthname[$next_month-1] . " " . $year;   // following 
148.
	 
149.
	///////////////////////////////////////////// 
150.
	//Print the calendar css code 
151.
	// 
152.
  echo
153.
		<style type=\"text/css\"
154.
			a.cal_head 
155.
156.
				color: " . $head_link_color . "
157.
158.
			a.cal_head:hover 
159.
160.
				text-decoration: none; 
161.
162.
			.cal_head 
163.
164.
				background-color: " . $head_background_color . "
165.
				color:            " . $head_font_color . "
166.
				font-family:      " . $font_family . "
167.
				font-size:        " . $head_font_size . "
168.
				font-weight:      " . $head_font_weight . "
169.
				font-style:       " . $head_font_style . "
170.
171.
			.cal_days /*darussol*
172.
173.
				background-color: " . $days_head_background_color . "
174.
				color:            " . $days_head_font_color . "
175.
				font-family:      " . $font_family . "
176.
				font-size:        " . $days_head_font_size . "
177.
				font-weight:      " . $days_head_font_weight . "
178.
				font-style:       " . $days_head_font_style . "
179.
180.
			.cal_content 
181.
182.
				background-color: " . $content_background_color . "
183.
				color:            " . $content_font_color . "
184.
				font-family:      " . $font_family . "
185.
				font-size:        " . $content_font_size . "
186.
				font-weight:      " . $content_font_weight . "
187.
				font-style:       " . $content_font_style . "
188.
189.
			.cal_today 
190.
191.
				background-color: " . $today_background_color . "
192.
				color:            " . $today_font_color . "
193.
				font-family:      " . $font_family . "
194.
				font-size:        " . $today_font_size . "
195.
				font-weight:      " . $today_font_weight . "
196.
				font-style:       " . $today_font_style . "
197.
198.
 			.cal_event, a.cal_event /* e-man 17-06-04 *
199.
200.
				background-color: " . $event_background_color . "
201.
				color:            " . $event_font_color . "
202.
				font-family:      " . $font_family . "
203.
				font-size:        " . $event_font_size . "
204.
				font-weight:      " . $event_font_weight . "
205.
				font-style:       " . $event_font_style . "
206.
207.
		</style> 
208.
  "; 
209.
	// 
210.
	///////////////////////////////////////////// 
211.
	 
212.
 
213.
	///////////////////////////////////////////// 
214.
	//show events in popup? 
215.
	// 
216.
	if (isset ($_GET['show_event'])){ 
217.
    list ($year, $month, $day) = explode ("-", $_GET['event_date']); 
218.
    $query = " 
219.
      SELECT * 
220.
      FROM " . $event_table . " 
221.
      WHERE EventYear  = '" . $year . "
222.
      AND   EventMonth = '" . $month . "
223.
      AND   EventDay   = '" . $day . "
224.
      ORDER BY EventTime ASC 
225.
    "; 
226.
 
227.
    /* connect to the database *
228.
    $database_connection = mysql_connect ($server, $username, $password); 
229.
    mysql_select_db ($database, $database_connection); 
230.
    $result = mysql_query ($query) or die(mysql_error()); 
231.
 
232.
    /* initize the variabele color_alternated (boolean) *
233.
    $color_alternated = false; 
234.
 
235.
    /* header of the table *
236.
    echo "<table width=\"100%\" border=\"" . $table_border . "\" cellpadding=\"" . $table_cellpadding . "\" cellspacing=\"" . $table_cellspacing . "\">"
237.
 
238.
    $date_string = mktime(0,0,0,$month,$day,$year); 
239.
    $month = sprintf("%01d",$month); 
240.
 
241.
    echo "<tr><td align=\"center\" class=\"cal_head\" colspan=\"2\">".$day." " . $monthname[$month] . " ".$year."</td></tr>"
242.
 
243.
    /* loop through the results via a mysql_fetch_assoc () *
244.
    while ($record = mysql_fetch_assoc ($result)){ 
245.
      if ($color_alternated){ 
246.
        $color_alternated = false; 
247.
        $background_color_row = $event_background_color
248.
249.
      else
250.
        $color_alternated = true; 
251.
        $background_color_row = $event_background_color2
252.
253.
      echo "<tr class=\"cal_event\"
254.
              <td style=\"background-color:".$background_color_row."\" width=\"1\">" . $record['EventTime'] . "</td> 
255.
              <td style=\"background-color:".$background_color_row."\">" . nl2br($record['Event']) . "</td> 
256.
            </tr>"; 
257.
258.
    /* close the table *
259.
    echo "</table>"
260.
 
261.
    /* bring an exit so the script will terminate*
262.
    exit
263.
264.
	// 
265.
	///////////////////////////////////////////// 
266.
	 
267.
	///////////////////////////////////////////// 
268.
	//Print the calendar table header 
269.
	// 
270.
	echo
271.
		<script language=\"javascript\"
272.
      function open_event(date_stamp){ 
273.
        window.open(\"" . $calendar_script . "?show_event=true&event_date=\" + date_stamp, \"calendar_popup\",\"height=" . $event_popup_height . ",width=".$event_popup_width."\"); 
274.
275.
		</script> 
276.
		<table border=\"" . $table_border . "\" cellpadding=\"" . $table_cellpadding . "\" cellspacing=\"" . $table_cellspacing . "\" style=\"height:" . $table_height . "\" width=\"" . $table_width . "\"
277.
			<tr> 
278.
				<td align=\"center\" class=\"cal_head\"><a class=\"cal_head\" href=\"" . $_SERVER['PHP_SELF'] . "?" . $QUERY_STRING . "&amp;date="
279.
                $previous_date . "\" title=\"" . $table_caption_prev . "\">&laquo;</a></td> 
280.
				<td align=\"center\" class=\"cal_head\" colspan=\"5\">" . $table_caption . "</td> 
281.
				<td align=\"center\" class=\"cal_head\"><a class=\"cal_head\" href=\"" . $_SERVER['PHP_SELF'] . "?" . $QUERY_STRING . "&amp;date="
282.
                $next_date . "\" title=\"" . $table_caption_foll . "\">&raquo;</a></td> 
283.
			</tr> 
284.
			<tr> 
285.
				<td class=\"cal_days\">".$dayname[0]."</td> 
286.
				<td class=\"cal_days\">".$dayname[1]."</td> 
287.
				<td class=\"cal_days\">".$dayname[2]."</td> 
288.
				<td class=\"cal_days\">".$dayname[3]."</td> 
289.
				<td class=\"cal_days\">".$dayname[4]."</td> 
290.
				<td class=\"cal_days\">".$dayname[5]."</td> 
291.
				<td class=\"cal_days\">".$dayname[6]."</td> 
292.
			</tr><tr> 
293.
			"; 
294.
	// 
295.
	///////////////////////////////////////////// 
296.
	 
297.
	///////////////////////////////////////////// 
298.
	//The empty columns before the 1st day of the week 
299.
	// 
300.
	for( $i = 0 ; $i < $day_start; $i++ ) 
301.
302.
		echo "<td class=\"cal_content\">&nbsp;</td>"
303.
304.
	// 
305.
	///////////////////////////////////////////// 
306.
	 
307.
	$current_position = $day_start; //The current (column) position of the current day from the loop 
308.
	 
309.
	$total_days_in_month = date("t",$date_string); //The total days in the month for the end of the loop 
310.
 
311.
	///////////////////////////////////////////// 
312.
	//Retrieve events for the current month + year 
313.
	//e-man : added 07 June 04 
314.
  if ($events_from_database
315.
316.
    $database_connection = mysql_connect ($server, $username, $password); 
317.
    mysql_select_db ($database, $database_connection); 
318.
    $result = mysql_query(" 
319.
      SELECT * 
320.
      FROM " . $event_table . " 
321.
      WHERE 
322.
        EventYear = '" . $year . "
323.
      AND 
324.
        EventMonth = '" . $month . "
325.
    "); 
326.
    while ($record = mysql_fetch_assoc($result)){ 
327.
      $event[$record['EventDay']] = $record
328.
329.
330.
	// 
331.
	///////////////////////////////////////////// 
332.
 
333.
	///////////////////////////////////////////// 
334.
	//Loop all the days from the month 
335.
	// 
336.
	for( $i = 1; $i <= $total_days_in_month ; $i++) 
337.
338.
		$class = "cal_content"
339.
		 
340.
		if( $i == date("j") && $month == date("n") && $year == date("Y") ) 
341.
			$class = "cal_today"
342.
		 
343.
		$current_position++; 
344.
 
345.
    /* is there any event on this day? Yes, create a link. No clear the (previous) string *
346.
		$link_start = ""
347.
		$link_end   = ""
348.
 
349.
 
350.
    /* if there is an event do *
351.
		if( isset($event[$i]) ) 
352.
353.
      $link_start = "<a href=\"javascript:;\" class=\"cal_event\" onclick=\"javascript: open_event('".$year."-".$month."-".$i."');\">"
354.
      $link_end   = "</a>"
355.
      $class      = "cal_event"
356.
357.
 
358.
    /* for the event filter *
359.
    /* e-man : added 07 June 04 *
360.
    $date_stamp = $year."-".$month."-".sprintf( "%02d",$i); 
361.
     
362.
		echo "<td align=\"center\" class=\"" . $class . "\">" . $link_start . $i . $link_end . "</td>"
363.
		if( $current_position == 7 ) 
364.
365.
			echo "</tr><tr>\n"
366.
			$current_position = 0; 
367.
368.
369.
	// 
370.
	///////////////////////////////////////////// 
371.
	 
372.
	$end_day = 7-$current_position; //There are  
373.
	 
374.
	///////////////////////////////////////////// 
375.
	//Fill the last columns 
376.
	//	 
377.
	for( $i = 0 ; $i < $end_day ; $i++ ) 
378.
		echo "<td class=\"cal_content\"></td>\n"
379.
	// 
380.
	///////////////////////////////////////////// 
381.
	 
382.
	echo "</tr></table>";  // Close the table 
383.
?>



Ich habe es mal mit <body background="#353947"> versucht aber ich weiß nicht ob das so richtig ist oder wie man überhaupt so einen Befehl in php einbindet

würde mich über Hilfe freuen

gruß Fabian
Mitglied: Maxerateur
14.07.2008 um 14:46 Uhr
mmh. soweit ich das richtig sehe, steht da nirgendwo die Hintergrundfarbe für den kompletten Body drinnen.
Schreib doch oben die typischen HTML Sachen drüber. Die Datei sähe dann so aus:

-Datei.php:

<!DOCTYPE HTML PUBLIC " -W3CDTD HTML 4.01//EN">
<html>
<head>
<title>Dein Titel</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#353947">

<?php
dein php code
?>
</body>
</html>


Hoffe dir hat das geholfen!
Bitte warten ..
Neuester Wissensbeitrag
Humor (lol)

Linkliste für Adventskalender

(3)

Information von nikoatit zum Thema Humor (lol) ...

Ähnliche Inhalte
Heiß diskutierte Inhalte
Windows Server
DHCP Server switchen (24)

Frage von M.Marz zum Thema Windows Server ...

SAN, NAS, DAS
gelöst HP-Proliant Microserver Betriebssystem (14)

Frage von Yannosch zum Thema SAN, NAS, DAS ...

Grafikkarten & Monitore
Win 10 Grafikkarte Crash von Software? (13)

Frage von Marabunta zum Thema Grafikkarten & Monitore ...

Erkennung und -Abwehr
Spam mit eigener Domain (12)

Frage von NoobOne zum Thema Erkennung und -Abwehr ...