• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Kalender

Midnight

Neues Mitglied
Hy Leute, ich habe seit zwei Tagen versucht einen Kalender zu finden (wie den hier vom Forum) für unsere HP. Wir müssen dort jede menge Termine von Vereinen eintragen aber ich finde einfach keinen.
Könnt ihr mir helfen und sagen wo man den html her bekommt für einen solchen Kalender? Alles was ich bis jetzt gefunden habe kann man nur verlinken und die sehen alle schlecht aus.

Danke schon mal für eure hilfe
 
Ok, also muss man sich sowas selber Bauen wenn ich es richtig verstehe? Oder gibt es irgendwo Seiten wo man sich solche Kalendercodes runter Kopieren kann?
Also wenn ich sowas selber Bauen müsste kann ich gleich mein Totestag mit reinschreiben :grin:
 
Ok, also muss man sich sowas selber Bauen wenn ich es richtig verstehe? Oder gibt es irgendwo Seiten wo man sich solche Kalendercodes runter Kopieren kann?
Also wenn ich sowas selber Bauen müsste kann ich gleich mein Totestag mit reinschreiben :grin:

GIDF! bzw...schau dir den link von mir mal an...da ist alles gut erklärt.
 
.........

Wie von dieser Seite sagst du ? Ich kann dir den Quellcode von dem Kalender dieser Seite geben wenn du damit was anfangen kannst (ehrlich gesagt ich nicht):


TEIL 1:

body {
-x-system-font:none;
background:#E1E1E2 none repeat scroll 0 0;
color:#000000;
font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;
font-size:10pt;
font-size-adjust:none;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:normal;
line-height:normal;
margin:5px 10px 10px;
padding:0;
}
a:link, body_alink {
color:#22229C;
}
a:visited, body_avisited {
color:#22229C;
}
a:hover, a:active, body_ahover {
color:#FF4400;
}
.page {
background:#FFFFFF none repeat scroll 0 0;
color:#000000;
}
td, th, p, li {
-x-system-font:none;
font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;
font-size:10pt;
font-size-adjust:none;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:normal;
line-height:normal;
}
.tborder {
background:#D1D1E1 none repeat scroll 0 0;
border:1px solid #0B198C;
color:#000000;
}
.tcat {
-x-system-font:none;
background:#869BBF url(images/gradients/gradient_tcat.gif) repeat-x scroll left top;
color:#FFFFFF;
font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;
font-size:10pt;
font-size-adjust:none;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:bold;
line-height:normal;
}
.tcat a:link, .tcat_alink {
color:#FFFFFF;
text-decoration:none;
}
.tcat a:visited, .tcat_avisited {
color:#FFFFFF;
text-decoration:none;
}
.tcat a:hover, .tcat a:active, .tcat_ahover {
color:#FFFF66;
text-decoration:underline;
}
.thead {
-x-system-font:none;
background:#5C7099 url(images/gradients/gradient_thead.gif) repeat-x scroll left top;
color:#FFFFFF;
font-family:tahoma,verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;
font-size:11px;
font-size-adjust:none;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:bold;
line-height:normal;
}
.thead a:link, .thead_alink {
color:#FFFFFF;
}
.thead a:visited, .thead_avisited {
color:#FFFFFF;
}
.thead a:hover, .thead a:active, .thead_ahover {
color:#FFFF00;
}
.tfoot {
background:#3E5C92 none repeat scroll 0 0;
color:#E0E0F6;
}
.tfoot a:link, .tfoot_alink {
color:#E0E0F6;
}
.tfoot a:visited, .tfoot_avisited {
color:#E0E0F6;
}
.tfoot a:hover, .tfoot a:active, .tfoot_ahover {
color:#FFFF66;
}
.alt1, .alt1Active {
background:#F5F5FF none repeat scroll 0 0;
color:#000000;
}
.alt2, .alt2Active {
background:#E1E4F2 none repeat scroll 0 0;
color:#000000;
}
td.inlinemod {
background:#FFFFCC none repeat scroll 0 0;
color:#000000;
}
.wysiwyg {
-x-system-font:none;
background:#F5F5FF none repeat scroll 0 0;
color:#000000;
font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;
font-size:10pt;
font-size-adjust:none;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:normal;
line-height:normal;
}
textarea, .bginput {
-x-system-font:none;
font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;
font-size:10pt;
font-size-adjust:none;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:normal;
line-height:normal;
}
.button {
-x-system-font:none;
font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;
font-size:11px;
font-size-adjust:none;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:normal;
line-height:normal;
}
select {
-x-system-font:none;
font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;
font-size:11px;
font-size-adjust:none;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:normal;
line-height:normal;
}
option, optgroup {
font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;
font-size:11px;
}
.smallfont {
-x-system-font:none;
font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;
font-size:11px;
font-size-adjust:none;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:normal;
line-height:normal;
 
.........

TEIL 2:

}
.time {
color:#666686;
}
.navbar {
-x-system-font:none;
font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;
font-size:11px;
font-size-adjust:none;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:normal;
line-height:normal;
}
.highlight {
color:#FF0000;
font-weight:bold;
}
.fjsel {
background:#3E5C92 none repeat scroll 0 0;
color:#E0E0F6;
}
.fjdpth0 {
background:#F7F7F7 none repeat scroll 0 0;
color:#000000;
}
.panel {
background:#E4E7F5 url(images/gradients/gradient_panel.gif) repeat-x scroll left top;
border:2px outset;
color:#000000;
padding:10px;
}
.panelsurround {
background:#D1D4E0 url(images/gradients/gradient_panelsurround.gif) repeat-x scroll left top;
color:#000000;
}
legend {
-x-system-font:none;
color:#22229C;
font-family:tahoma,verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;
font-size:11px;
font-size-adjust:none;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:normal;
line-height:normal;
}
.vbmenu_control {
-x-system-font:none;
background:#738FBF none repeat scroll 0 0;
color:#FFFFFF;
font-family:tahoma,verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;
font-size:11px;
font-size-adjust:none;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:bold;
line-height:normal;
padding:3px 6px;
white-space:nowrap;
}
.vbmenu_control a:link, .vbmenu_control_alink {
color:#FFFFFF;
text-decoration:none;
}
.vbmenu_control a:visited, .vbmenu_control_avisited {
color:#FFFFFF;
text-decoration:none;
}
.vbmenu_control a:hover, .vbmenu_control a:active, .vbmenu_control_ahover {
color:#FFFFFF;
text-decoration:underline;
}
.vbmenu_popup {
background:#FFFFFF none repeat scroll 0 0;
border:1px solid #0B198C;
color:#000000;
}
.vbmenu_option {
-x-system-font:none;
background:#BBC7CE none repeat scroll 0 0;
color:#000000;
cursor:pointer;
font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;
font-size:11px;
font-size-adjust:none;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:normal;
line-height:normal;
white-space:nowrap;
}
.vbmenu_option a:link, .vbmenu_option_alink {
color:#22229C;
text-decoration:none;
}
.vbmenu_option a:visited, .vbmenu_option_avisited {
color:#22229C;
text-decoration:none;
}
.vbmenu_option a:hover, .vbmenu_option a:active, .vbmenu_option_ahover {
color:#FFFFFF;
text-decoration:none;
}
.vbmenu_hilite {
-x-system-font:none;
background:#8A949E none repeat scroll 0 0;
color:#FFFFFF;
cursor:pointer;
font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;
font-size:11px;
font-size-adjust:none;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:normal;
line-height:normal;
white-space:nowrap;
}
.vbmenu_hilite a:link, .vbmenu_hilite_alink {
color:#FFFFFF;
text-decoration:none;
}
.vbmenu_hilite a:visited, .vbmenu_hilite_avisited {
color:#FFFFFF;
text-decoration:none;
}
.vbmenu_hilite a:hover, .vbmenu_hilite a:active, .vbmenu_hilite_ahover {
color:#FFFFFF;
text-decoration:none;
}
.bigusername {
font-size:14pt;
}
td.thead, th.thead, div.thead {
padding:4px;
}
.pagenav a {
text-decoration:none;
}
.pagenav td {
padding:2px 4px;
}
.shade, a.shade:link, a.shade:visited {
color:#777777;
text-decoration:none;
}
a.shade:active, a.shade:hover {
color:#FF4400;
text-decoration:underline;
}
.tcat .shade, .thead .shade, .tfoot .shade {
color:#DDDDDD;
}
.fieldset {
margin-bottom:6px;
}
.fieldset, .fieldset td, .fieldset p, .fieldset li {
font-size:11px;
}
form {
display:inline;
}
label {
cursor:default;
}
.normal {
font-weight:normal;
}
.inlineimg {
vertical-align:middle;
}
.underline {
text-decoration:underline;
}
200 x 90
<html lang="de" dir="ltr">
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"/>
<meta content="vBulletin 3.6.7" name="generator"/>
<meta content="HTML, HTM, Programmierung, HTML Anfänger, HTML Fortgeschrittene, XHTML und DHTML, PHP, MySQL, CSS und Javascript, Linux, Apache, Datenrettung, Partnerprogramme" name="keywords"/>
<meta content="html.de hilft HTML-Anfängern und HTML-Profis bei Fragen rund um die Programmierung mit HTML, XHTML und DHTML, PHP, MySQL, CSS und Javascript." name="description"/>
<style id="vbulletin_css" type="text/css">
1 <!--
2/* vBulletin 3 CSS For Style 'Standard-Style' (styleid: 1) */
3body
4{
5 background: #E1E1E2;
6 color: #000000;
7 font: 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
8 margin: 5px 10px 10px 10px;
9 padding: 0px;
10}
11a:link, body_alink
12{
13 color: #22229C;
14}
15a:visited, body_avisited
16{
17 color: #22229C;
18}
19a:hover, a:active, body_ahover
20{
21 color: #FF4400;
22}
23.page
24{
25 background: #FFFFFF;
26 color: #000000;
27}
28td, th, p, li
29{
30 font: 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
31}
32.tborder
33{
34 background: #D1D1E1;
35 color: #000000;
36 border: 1px solid #0B198C;
37}
38.tcat
39{
40 background: #869BBF url(images/gradients/gradient_tcat.gif) repeat-x top left;
41 color: #FFFFFF;
42 font: bold 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
43}
44.tcat a:link, .tcat_alink
45{
46 color: #ffffff;
47 text-decoration: none;
48}
49.tcat a:visited, .tcat_avisited
50{
51 color: #ffffff;
52 text-decoration: none;
53}
54.tcat a:hover, .tcat a:active, .tcat_ahover
55{
56 color: #FFFF66;
57 text-decoration: underline;
58}
59.thead
60{
61 background: #5C7099 url(images/gradients/gradient_thead.gif) repeat-x top left;
62 color: #FFFFFF;
63 font: bold 11px tahoma, verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
64}
65.thead a:link, .thead_alink
66{
 
TEIL 3:

67 color: #FFFFFF;
68}
69.thead a:visited, .thead_avisited
70{
71 color: #FFFFFF;
72}
73.thead a:hover, .thead a:active, .thead_ahover
74{
75 color: #FFFF00;
76}
77.tfoot
78{
79 background: #3E5C92;
80 color: #E0E0F6;
81}
82.tfoot a:link, .tfoot_alink
83{
84 color: #E0E0F6;
85}
86.tfoot a:visited, .tfoot_avisited
87{
88 color: #E0E0F6;
89}
90.tfoot a:hover, .tfoot a:active, .tfoot_ahover
91{
92 color: #FFFF66;
93}
94.alt1, .alt1Active
95{
96 background: #F5F5FF;
97 color: #000000;
98}
99.alt2, .alt2Active
100{
101 background: #E1E4F2;
102 color: #000000;
103}
104td.inlinemod
105{
106 background: #FFFFCC;
107 color: #000000;
108}
109.wysiwyg
110{
111 background: #F5F5FF;
112 color: #000000;
113 font: 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
114}
115textarea, .bginput
116{
117 font: 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
118}
119.button
120{
121 font: 11px verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
122}
123select
124{
125 font: 11px verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
126}
127option, optgroup
128{
129 font-size: 11px;
130 font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
131}
132.smallfont
133{
134 font: 11px verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
135}
136.time
137{
138 color: #666686;
139}
140.navbar
141{
142 font: 11px verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
143}
144.highlight
145{
146 color: #FF0000;
147 font-weight: bold;
148}
149.fjsel
150{
151 background: #3E5C92;
152 color: #E0E0F6;
153}
154.fjdpth0
155{
156 background: #F7F7F7;
157 color: #000000;
158}
159.panel
160{
161 background: #E4E7F5 url(images/gradients/gradient_panel.gif) repeat-x top left;
162 color: #000000;
163 padding: 10px;
164 border: 2px outset;
165}
166.panelsurround
167{
168 background: #D1D4E0 url(images/gradients/gradient_panelsurround.gif) repeat-x top left;
169 color: #000000;
170}
171legend
172{
173 color: #22229C;
174 font: 11px tahoma, verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
175}
176.vbmenu_control
177{
178 background: #738FBF;
179 color: #FFFFFF;
180 font: bold 11px tahoma, verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
181 padding: 3px 6px 3px 6px;
182 white-space: nowrap;
183}
184.vbmenu_control a:link, .vbmenu_control_alink
185{
186 color: #FFFFFF;
187 text-decoration: none;
188}
189.vbmenu_control a:visited, .vbmenu_control_avisited
190{
191 color: #FFFFFF;
192 text-decoration: none;
193}
194.vbmenu_control a:hover, .vbmenu_control a:active, .vbmenu_control_ahover
195{
196 color: #FFFFFF;
197 text-decoration: underline;
198}
199.vbmenu_popup
200{
201 background: #FFFFFF;
202 color: #000000;
203 border: 1px solid #0B198C;
204}
205.vbmenu_option
206{
207 background: #BBC7CE;
208 color: #000000;
209 font: 11px verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
210 white-space: nowrap;
211 cursor: pointer;
212}
213.vbmenu_option a:link, .vbmenu_option_alink
214{
215 color: #22229C;
216 text-decoration: none;
217}
218.vbmenu_option a:visited, .vbmenu_option_avisited
219{
220 color: #22229C;
221 text-decoration: none;
222}
223.vbmenu_option a:hover, .vbmenu_option a:active, .vbmenu_option_ahover
224{
225 color: #FFFFFF;
226 text-decoration: none;
227}
228.vbmenu_hilite
229{
230 background: #8A949E;
231 color: #FFFFFF;
232 font: 11px verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
233 white-space: nowrap;
234 cursor: pointer;
235}
236.vbmenu_hilite a:link, .vbmenu_hilite_alink
237{
238 color: #FFFFFF;
239 text-decoration: none;
240}
241.vbmenu_hilite a:visited, .vbmenu_hilite_avisited
242{
243 color: #FFFFFF;
244 text-decoration: none;
245}
246.vbmenu_hilite a:hover, .vbmenu_hilite a:active, .vbmenu_hilite_ahover
247{
248 color: #FFFFFF;
249 text-decoration: none;
250}
251/* ***** styling for 'big' usernames on postbit etc. ***** */
252.bigusername { font-size: 14pt; }
253
254/* ***** small padding on 'thead' elements ***** */
255td.thead, th.thead, div.thead { padding: 4px; }
256
257/* ***** basic styles for multi-page nav elements */
258.pagenav a { text-decoration: none; }
259.pagenav td { padding: 2px 4px 2px 4px; }
260
261/* ***** de-emphasized text */
262.shade, a.shade:link, a.shade:visited { color: #777777; text-decoration: none; }
263a.shade:active, a.shade:hover { color: #FF4400; text-decoration: underline; }
264.tcat .shade, .thead .shade, .tfoot .shade { color: #DDDDDD; }
265
266/* ***** define margin and font-size for elements inside panels ***** */
267.fieldset { margin-bottom: 6px; }
268.fieldset, .fieldset td, .fieldset p, .fieldset li { font-size: 11px; }
269
270/* ***** don't change the following ***** */
271form { display: inline; }
272label { cursor: default; }
273.normal { font-weight: normal; }
274.inlineimg { vertical-align: middle; }
275.underline { text-decoration: underline; }
276-->
</style>
<script type="text/javascript">
1 <!--
2var SESSIONURL = "";
3var IMGDIR_MISC = "images/misc";
4var vb_disable_ajax = parseInt("0", 10);
5// -->
</script>
<script src="clientscript/vbulletin_global.js?v=367" type="text/javascript">
1/*======================================================================*\
2|| #################################################################### ||
3|| # vBulletin 3.6.7 PL1
4|| # ---------------------------------------------------------------- # ||
5|| # Copyright ©2000-2007 Jelsoft Enterprises Ltd. All Rights Reserved. ||
6|| # This file may not be redistributed in whole or significant part. # ||
7|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
8|| # vBulletin® - Instant Community | http://www.vbulletin.com/license.html # ||
9|| #################################################################### ||
10\*======================================================================*/
11
12// #############################################################################
13// Initial setup
14
15// ensure SESSIONURL exists
16if (typeof(SESSIONURL) == "undefined")
17{
18 var SESSIONURL = "";
19}
20
21// ensure vbphrase exists
22if (typeof(vbphrase) == "undefined")
23{
24 var vbphrase = new Array();
25}
26
27// Array of message editor objects
28var vB_Editor = new Array();
29
30// Ignore characters within
tags in messages for length check
31var ignorequotechars = false;
32
33// Number of pagenav items dealt with so far
34var pagenavcounter = 0;
35
36// #############################################################################
37// Browser detection and limitation workarounds
38
39// Define the browser we have instead of multiple calls throughout the file
40var userAgent = navigator.userAgent.toLowerCase();
41var is_opera = ((userAgent.indexOf('opera') != -1) || (typeof(window.opera) != 'undefined'));
42var is_saf = ((userAgent.indexOf('applewebkit') != -1) || (navigator.vendor == 'Apple Computer, Inc.'));
43var is_webtv = (userAgent.indexOf('webtv') != -1);
44var is_ie = ((userAgent.indexOf('msie') != -1) && (!is_opera) && (!is_saf) && (!is_webtv));
 
.........

TEIL 4:

45var is_ie4 = ((is_ie) && (userAgent.indexOf('msie 4.') != -1));
46var is_ie7 = ((is_ie) && (userAgent.indexOf('msie 7.') != -1));
47var is_moz = ((navigator.product == 'Gecko') && (!is_saf));
48var is_kon = (userAgent.indexOf('konqueror') != -1);
49var is_ns = ((userAgent.indexOf('compatible') == -1) && (userAgent.indexOf('mozilla') != -1) && (!is_opera) && (!is_webtv) && (!is_saf));
50var is_ns4 = ((is_ns) && (parseInt(navigator.appVersion) == 4));
51var is_mac = (userAgent.indexOf('mac') != -1);
52
53// Catch possible bugs with WebTV and other older browsers
54var is_regexp = (window.RegExp) ? true : false;
55
56// Is the visiting browser compatible with AJAX?
57var AJAX_Compatible = false;
58
59// Help out old versions of IE that don't understand element.style.cursor = 'pointer'
60var pointer_cursor = (is_ie ? 'hand' : 'pointer');
61
62/**
63* Workaround for heinous IE bug - add special vBlength property to all strings
64* This method is applied to ALL string objects automatically
65*
66* @return integer
67*/
68String.prototype.vBlength = function()
69{
70 return (is_ie && this.indexOf('\n') != -1) ? this.replace(/\r?\n/g, '_').length : this.length;
71}
72
73if ('1234'.substr(-2, 2) == '12') // (which would be incorrect)
74{
75 String.prototype.substr_orig = String.prototype.substr;
76
77 /**
78 * Overrides IE's original String.prototype.substr to accept negative values
79 *
80 * @param integer Substring start position
81 * @param integer Substring length
82 *
83 * @return string
84 */
85 String.prototype.substr = function(start, length)
86 {
87 return this.substr_orig( (start < 0 ? this.length + start : start), length);
88 };
89}
90
91/**
92* Pop function for browsers that don't have it built in
93*
94* @param array Array from which to pop
95*
96* @return mixed null on empty, value on success
97*/
98function array_pop(a)
99{
100 if (typeof a != 'object' || !a.length)
101 {
102 return null;
103 }
104 else
105 {
106 var response = a[a.length - 1];
107 a.length--;
108 return response;
109 }
110}
111
112if (typeof Array.prototype.shift === 'undefined')
113{
114 Array.prototype.shift = function()
115 {
116 for(var i = 0, b = this[0], l = this.length-1; i < l; i++)
117 {
118 this = this[i + 1];
119 }
120 this.length--;
121 return b;
122 };
123}
124
125/**
126* Push function for browsers that don't have it built in
127*
128* @param array Array onto which to push
129* @param mixed Value(s) to push onto - you may use multiple arguments here, eg: array_push(myArray, 1, 2, 3, 4, ...)
130*
131* @return integer Length of array
132*/
133function array_push(a, values)
134{
135 for (var i = 1; i < arguments.length; i++)
136 {
137 a[a.length] = arguments;
138 }
139 return a.length;
140}
141
142/**
143* Function to emulate document.getElementById
144*
145* @param string Object ID
146*
147* @return mixed null if not found, object if found
148*/
149function fetch_object(idname)
150{
151 if (document.getElementById)
152 {
153 return document.getElementById(idname);
154 }
155 else if (document.all)
156 {
157 return document.all[idname];
158 }
159 else if (document.layers)
160 {
161 return document.layers[idname];
162 }
163 else
164 {
165 return null;
166 }
167}
168
169/**
170* Function to emulate document.getElementsByTagName
171*
172* @param object Parent object (eg: document)
173* @param string Tag type (eg: 'td')
174*
175* @return array
176*/
177function fetch_tags(parentobj, tag)
178{
179 if (parentobj == null)
180 {
181 return new Array();
182 }
183 else if (typeof parentobj.getElementsByTagName != 'undefined')
184 {
185 return parentobj.getElementsByTagName(tag);
186 }
187 else if (parentobj.all && parentobj.all.tags)
188 {
189 return parentobj.all.tags(tag);
190 }
191 else
192 {
193 return new Array();
194 }
195}
196
197/**
198* Function to count the number of tags in an object
199*
200* @param object Parent object (eg: document)
201* @param string Tag type (eg: 'td')
202*
203* @return integer
204*/
205function fetch_tag_count(parentobj, tag)
206{
207 return fetch_tags(parentobj, tag).length;
208}
209
210
211
212// #############################################################################
213// Event handlers
214
215/**
216* Handles the different event models of different browsers and prevents event bubbling
217*
218* @param event Event object
219*
220* @return event
221*/
222function do_an_e(eventobj)
223{
224 if (!eventobj || is_ie)
225 {
226 window.event.returnValue = false;
227 window.event.cancelBubble = true;
228 return window.event;
229 }
230 else
231 {
232 eventobj.stopPropagation();
233 eventobj.preventDefault();
234 return eventobj;
235 }
236}
237
238/**
239* Handles the different event models of different browsers and prevents event bubbling in a lesser way than do_an_e()
240*
241* @param event Event object
242*
243* @return event
244*/
245function e_by_gum(eventobj)
246{
247 if (!eventobj || is_ie)
248 {
249 window.event.cancelBubble = true;
250 return window.event;
251 }
252 else
253 {
254 if (eventobj.target.type == 'submit')
255 {
256 // naughty safari
257 eventobj.target.form.submit();
258 }
259 eventobj.stopPropagation();
260 return eventobj;
261 }
262}
263
264// #############################################################################
265// Message manipulation and validation
266
267/**
268* Checks that a message is valid for submission to PHP
269*
270* @param string Message text
271* @param mixed Either subject text (if you want to make sure it exists) or 0 if you don't care
272* @param integer Minimum acceptable character limit for the message
273*
274* @return boolean
275*/
276function validatemessage(messagetext, subjecttext, minchars)
277{
278 if (is_kon || is_saf || is_webtv)
279 {
280 // ignore less-than-capable browsers
281 return true;
282 }
283 else if (subjecttext.length < 1)
284 {
285 // subject not specified
286 alert(vbphrase['must_enter_subject']);
287 return false;
288 }
289 else
290 {
291 var stripped = PHP.trim(stripcode(messagetext, false, ignorequotechars));
292
293 if (stripped.length < minchars)
294 {
295 // minimum message length not met
296 alert(construct_phrase(vbphrase['message_too_short'], minchars));
297 return false;
298 }
299 else if (typeof(document.forms.vbform) != 'undefined' && typeof(document.forms.vbform.imagestamp) != 'undefined')
300 {
301 // This form has image verification enabled
302 document.forms.vbform.imagestamp.failed = false;
303
304 if (document.forms.vbform.imagestamp.value.length != 6)
305 {
306 alert(vbphrase['complete_image_verification']);
307 document.forms.vbform.imagestamp.failed = true;
308 document.forms.vbform.imagestamp.focus();
309 return false;
310 }
311 else
312 {
313 return true;
314 }
315 }
316 else
317 {
318 // everything seems ok
319 return true;
320 }
321 }
322}
323
324
325/**
326* Strips quotes and bbcode tags from text
327*
328* @param string Text to manipulate
329* @param boolean If true, strip <x> otherwise strip [x]
330* @param boolean If true, strip all
331*
332* @return string
333*/
334function stripcode(str, ishtml, stripquotes)
335{
336 if (!is_regexp)
337 {
338 return str;
339 }
340
341 if (stripquotes)
342 {
343 var start_time = new Date().getTime();
344
345 while ((startindex = PHP.stripos(str, '[quote')) !== false)
346 {
347 if (new Date().getTime() - start_time > 2000)
 
.........

TEIL 5:

348 {
349 // while loop has been running for over 2 seconds and has probably gone infinite
350 break;
351 }
352
353 if ((stopindex = PHP.stripos(str, '[/quote]')) !== false)
354 {
355 fragment = str.substr(startindex, stopindex - startindex + 8);
356 str = str.replace(fragment, '');
357 }
358 else
359 {
360 break;
361 }
362 str = PHP.trim(str);
363 }
364 }
365
366 if (ishtml)
367 {
368 // exempt image tags -- they need to count as characters in the string
369 // as the do as BB codes
370 str = str.replace(/<img[^>]+src="([^"]+)"[^>]*>/gi, '$1');
371
372 var html1 = new RegExp("<(\\w+)[^>]*>", 'gi');
373 var html2 = new RegExp("<\\/\\w+>", 'gi');
374
375 str = str.replace(html1, '');
376 str = str.replace(html2, '');
377
378 var html3 = new RegExp('(&nbsp;)', 'gi');
379 str = str.replace(html3, ' ');
380 }
381 else
382 {
383 var bbcode1 = new RegExp("\\[(\\w+)[^\\]]*\\]", 'gi');
384 var bbcode2 = new RegExp("\\[\\/(\\w+)\\]", 'gi');
385
386 str = str.replace(bbcode1, '');
387 str = str.replace(bbcode2, '');
388 }
389
390 return str;
391}
392
393// #############################################################################
394// vB_PHP_Emulator class
395// #############################################################################
396
397/**
398* PHP Function Emulator Class
399*/
400function vB_PHP_Emulator()
401{
402}
403
404// =============================================================================
405// vB_PHP_Emulator Methods
406
407/**
408* Find a string within a string (case insensitive)
409*
410* @param string Haystack
411* @param string Needle
412* @param integer Offset
413*
414* @return mixed Not found: false / Found: integer position
415*/
416vB_PHP_Emulator.prototype.stripos = function(haystack, needle, offset)
417{
418 if (typeof offset == 'undefined')
419 {
420 offset = 0;
421 }
422
423 index = haystack.toLowerCase().indexOf(needle.toLowerCase(), offset);
424
425 return (index == -1 ? false : index);
426}
427
428/**
429* Trims leading whitespace
430*
431* @param string String to trim
432*
433* @return string
434*/
435vB_PHP_Emulator.prototype.ltrim = function(str)
436{
437 return str.replace(/^\s+/g, '');
438}
439
440/**
441* Trims trailing whitespace
442*
443* @param string String to trim
444*
445* @return string
446*/
447vB_PHP_Emulator.prototype.rtrim = function(str)
448{
449 return str.replace(/(\s+)$/g, '');
450}
451
452/**
453* Trims leading and trailing whitespace
454*
455* @param string String to trim
456*
457* @return string
458*/
459vB_PHP_Emulator.prototype.trim = function(str)
460{
461 return this.ltrim(this.rtrim(str));
462}
463
464/**
465* Emulation of PHP's preg_quote()
466*
467* @param string String to process
468*
469* @return string
470*/
471vB_PHP_Emulator.prototype.preg_quote = function(str)
472{
473 // replace + { } ( ) [ ] | / ? ^ $ \ . = ! < > : * with backslash+character
474 return str.replace(/(\+|\{|\}|\(|\)|\[|\]|\||\/|\?|\^|\$|\\|\.|\=|\!|\<|\>|\:|\*)/g, "\\$1");
475}
476
477/**
478* Emulates PHP's preg_match_all()... sort of
479*
480* @param string Haystack
481* @param string Regular expression - to be inserted into RegExp(x)
482*
483* @return mixed Array on match, false on no match
484*/
485vB_PHP_Emulator.prototype.match_all = function(string, regex)
486{
487 var gmatch = string.match(RegExp(regex, "gim"));
488 if (gmatch)
489 {
490 var matches = new Array();
491
492 var iregex = new RegExp(regex, "im");
493 for (var i = 0; i < gmatch.length; i++)
494 {
495 matches[matches.length] = gmatch.match(iregex);
496 }
497
498 return matches;
499 }
500 else
501 {
502 return false;
503 }
504}
505
506/**
507* Emulates unhtmlspecialchars in vBulletin
508*
509* @param string String to process
510*
511* @return string
512*/
513vB_PHP_Emulator.prototype.unhtmlspecialchars = function(str)
514{
515 f = new Array(/&lt;/g, /&gt;/g, /&quot;/g, /&amp;/g);
516 r = new Array('<', '>', '"', '&');
517
518 for (var i in f)
519 {
520 str = str.replace(f, r);
521 }
522
523 return str;
524}
525
526/**
527* Unescape CDATA from vB_AJAX_XML_Builder PHP class
528*
529* @param string Escaped CDATA
530*
531* @return string
532*/
533vB_PHP_Emulator.prototype.unescape_cdata = function(str)
534{
535 var r1 = /<\=\!\=\[\=C\=D\=A\=T\=A\=\[/g;
536 var r2 = /\]\=\]\=>/g;
537
538 return str.replace(r1, '<![CDATA[').replace(r2, ']]>');
539}
540
541/**
542* Emulates PHP's htmlspecialchars()
543*
544* @param string String to process
545*
546* @return string
547*/
548vB_PHP_Emulator.prototype.htmlspecialchars = function(str)
549{
550 //var f = new Array(/&(?!#[0-9]+;)/g, /</g, />/g, /"/g);
551 var f = new Array(
552 (is_mac && is_ie ? new RegExp('&', 'g') : new RegExp('&(?!#[0-9]+;)', 'g')),
553 new RegExp('<', 'g'),
554 new RegExp('>', 'g'),
555 new RegExp('"', 'g')
556 );
557 var r = new Array(
558 '&amp;',
559 '&lt;',
560 '&gt;',
561 '&quot;'
562 );
 
...

TEIL 5:

563
564 for (var i = 0; i < f.length; i++)
565 {
566 str = str.replace(f, r);
567 }
568
569 return str;
570}
571
572/**
573* Searches an array for a value
574*
575* @param string Needle
576* @param array Haystack
577* @param boolean Case insensitive
578*
579* @return integer Not found: -1 / Found: integer index
580*/
581vB_PHP_Emulator.prototype.in_array = function(ineedle, haystack, caseinsensitive)
582{
583 var needle = new String(ineedle);
584
585 if (caseinsensitive)
586 {
587 needle = needle.toLowerCase();
588 for (var i in haystack)
589 {
590 if (haystack.toLowerCase() == needle)
591 {
592 return i;
593 }
594 }
595 }
596 else
597 {
598 for (var i in haystack)
599 {
600 if (haystack == needle)
601 {
602 return i;
603 }
604 }
605 }
606 return -1;
607}
608
609/**
610* Emulates PHP's strpad()
611*
612* @param string Text to pad
613* @param integer Length to pad
614* @param string String with which to pad
615*
616* @return string
617*/
618vB_PHP_Emulator.prototype.str_pad = function(text, length, padstring)
619{
620 text = new String(text);
621 padstring = new String(padstring);
622
623 if (text.length < length)
624 {
625 padtext = new String(padstring);
626
627 while (padtext.length < (length - text.length))
628 {
629 padtext += padstring;
630 }
631
632 text = padtext.substr(0, (length - text.length)) + text;
633 }
634
635 return text;
636}
637
638/**
639* A sort of emulation of PHP's urlencode - not 100% the same, but accomplishes the same thing
640*
641* @param string String to encode
642*
643* @return string
644*/
645vB_PHP_Emulator.prototype.urlencode = function(text)
646{
647 text = escape(text.toString()).replace(/\+/g, "%2B");
648
649 // this escapes 128 - 255, as JS uses the unicode code points for them.
650 // This causes problems with submitting text via AJAX with the UTF-8 charset.
651 var matches = text.match(/(%([0-9A-F]{2}))/gi);
652 if (matches)
653 {
654 for (var matchid = 0; matchid < matches.length; matchid++)
655 {
656 var code = matches[matchid].substring(1,3);
657 if (parseInt(code, 16) >= 128)
658 {
659 text = text.replace(matches[matchid], '%u00' + code);
660 }
661 }
662 }
663
664 // %25 gets translated to % by PHP, so if you have %25u1234,
665 // we see it as %u1234 and it gets translated. So make it %u0025u1234,
666 // which will print as %u1234!
667 text = text.replace('%25', '%u0025');
668
669 return text;
670}
671
672/**
673* Works a bit like ucfirst, but with some extra options
674*
675* @param string String with which to work
676* @param string Cut off string before first occurence of this string
677*
678* @return string
679*/
680vB_PHP_Emulator.prototype.ucfirst = function(str, cutoff)
681{
682 if (typeof cutoff != 'undefined')
683 {
684 var cutpos = str.indexOf(cutoff);
685 if (cutpos > 0)
686 {
687 str = str.substr(0, cutpos);
688 }
689 }
690
691 str = str.split(' ');
692 for (var i = 0; i < str.length; i++)
693 {
694 str = str.substr(0, 1).toUpperCase() + str.substr(1);
695 }
696 return str.join(' ');
697}
698
699// initialize the PHP emulator
700var PHP = new vB_PHP_Emulator();
701
702// #############################################################################
703// vB_AJAX_Handler
704// #############################################################################
705
706/**
707* XML Sender Class
708*
709* @param boolean Should connections be asyncronous?
710*/
711function vB_AJAX_Handler(async)
712{
713 /**
714 * Should connections be asynchronous?
715 *
716 * @var boolean
717 */
718 this.async = async ? true : false;
719}
720
721// =============================================================================
722// vB_AJAX_Handler methods
723
724/**
725* Initializes the XML handler
726*
727* @return boolean True if handler created OK
728*/
729vB_AJAX_Handler.prototype.init = function()
730{
731 if (typeof vb_disable_ajax != 'undefined' && vb_disable_ajax == 2)
732 {
733 // disable all ajax features
734 return false;
735 }
736
737 try
738 {
739 this.handler = new XMLHttpRequest();
740 return (this.handler.setRequestHeader ? true : false);
741 }
742 catch(e)
743 {
744 try
745 {
746 this.handler = eval("new A" + "ctiv" + "eX" + "Ob" + "ject('Micr" + "osoft.XM" + "LHTTP');");
747 return true;
748 }
749 catch(e)
750 {
751 return false;
752 }
753 }
754}
755
756/**
757* Detects if the browser is fully compatible
758*
759* @return boolean
760*/
761vB_AJAX_Handler.prototype.is_compatible = function()
762{
763 if (typeof vb_disable_ajax != 'undefined' && vb_disable_ajax == 2)
764 {
765 // disable all ajax features
766 return false;
767 }
768
769 if (is_ie && !is_ie4) { return true; }
770 else if (typeof XMLHttpRequest != 'undefined')
771 {
772 try { return XMLHttpRequest.prototype.setRequestHeader ? true : false; }
773 catch(e)
774 {
775 try { var tester = new XMLHttpRequest(); return tester.setRequestHeader ? true : false; }
776 catch(e) { return false; }
777 }
778 }
779 else { return false; }
780}
781
782/**
783* Checks if the system is ready
784*
785* @return boolean False if ready
786*/
787vB_AJAX_Handler.prototype.not_ready = function()
788{
789 return (this.handler.readyState && (this.handler.readyState < 4));
790}
791
792/**
793* OnReadyStateChange event handler
794*
795* @param function
796*/
797vB_AJAX_Handler.prototype.onreadystatechange = function(event)
798{
799 if (!this.handler)
800 {
801 if (!this.init())
802 {
803 return false;
804 }
805 }
806 if (typeof event == 'function')
807 {
808 this.handler.onreadystatechange = event;
809 }
810 else
811 {
812 alert('XML Sender OnReadyState event is not a function');
813 }
814
815 return false;
816}
817
818/**
819* Sends data
820*
821* @param string Destination URL
822* @param string Request Data
823*
824* @return mixed Return message
825*/
826vB_AJAX_Handler.prototype.send = function(desturl, datastream)
827{
828 if (!this.handler)
829 {
830 if (!this.init())
831 {
832 return false;
833 }
834 }
835 if (!this.not_ready())
836 {
837 this.handler.open('POST', desturl, this.async);
838 this.handler.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
839 this.handler.send(datastream + '&s=' + fetch_sessionhash());
840
841 if (!this.async && this.handler.readyState == 4 && this.handler.status == 200)
842 {
843 return true;
844 }
845 }
846 return false;
847}
848
849/**
850* Fetches the contents of an XML node
851*
852* @param object XML node
853*
854* @return string XML node contents
855*/
856vB_AJAX_Handler.prototype.fetch_data = function(xml_node)
857{
 
...

TEIL 6:

858 if (xml_node && xml_node.firstChild && xml_node.firstChild.nodeValue)
859 {
860 return PHP.unescape_cdata(xml_node.firstChild.nodeValue);
861 }
862 else
863 {
864 return '';
865 }
866}
867
868// we can check this variable to see if browser is AJAX compatible
869var AJAX_Compatible = vB_AJAX_Handler.prototype.is_compatible();
870
871// #############################################################################
872// vB_Hidden_Form
873// #############################################################################
874
875/**
876* Form Generator Class
877*
878* Builds a form filled with hidden fields for invisible submit via POST
879*
880* @param string Script (my_target_script.php)
881*/
882function vB_Hidden_Form(script)
883{
884 this.action = script;
885 this.variables = new Array();
886}
887
888// =============================================================================
889// vB_Hidden_Form methods
890
891/**
892* Adds a hidden input field to the form object
893*
894* @param string Name attribute
895* @param string Value attribute
896*/
897vB_Hidden_Form.prototype.add_variable = function(name, value)
898{
899 this.variables[this.variables.length] = new Array(name, value);
900};
901
902/**
903* Fetches all form elements inside an HTML element and performs 'add_input()' on them
904*
905* @param object HTML element to search
906*/
907vB_Hidden_Form.prototype.add_variables_from_object = function(obj)
908{
909 var inputs = fetch_tags(obj, 'input');
910 for (var i = 0; i < inputs.length; i++)
911 {
912 switch (inputs.type)
913 {
914 case 'checkbox':
915 case 'radio':
916 if (inputs.checked)
917 {
918 this.add_variable(inputs.name, inputs.value);
919 }
920 break;
921 case 'text':
922 case 'hidden':
923 case 'password':
924 this.add_variable(inputs.name, inputs.value);
925 break;
926 default:
927 continue;
928 }
929 }
930
931 var textareas = fetch_tags(obj, 'textarea');
932 for (var i = 0; i < textareas.length; i++)
933 {
934 this.add_variable(textareas.name, textareas.value);
935 }
936
937 var selects = fetch_tags(obj, 'select');
938 for (var i = 0; i < selects.length; i++)
939 {
940 if (selects.multiple)
941 {
942 for (var j = 0; j < selects.options.length; j++)
943 {
944 if (selects.options[j].selected)
945 {
946 this.add_variable(selects.name, selects.options[j].value);
947 }
948 }
949 }
950 else
951 {
952 this.add_variable(selects.name, selects.options[selects.selectedIndex].value);
953 }
954 }
955};
956
957/**
958* Fetches a variable value
959*
960* @param string Variable name
961*
962* @return mixed Variable value
963*/
964vB_Hidden_Form.prototype.fetch_variable = function(varname)
965{
966 for (var i = 0; i < this.variables.length; i++)
967 {
968 if (this.variables[0] == varname)
969 {
970 return this.variables[1];
971 }
972 }
973
974 return null;
975};
976
977/**
978* Submits the hidden form object
979*/
980vB_Hidden_Form.prototype.submit_form = function()
981{
982 this.form = document.createElement('form');
983 this.form.method = 'post';
984 this.form.action = this.action;
985
986 for (var i = 0; i < this.variables.length; i++)
987 {
988 var inputobj = document.createElement('input');
989
990 inputobj.type = 'hidden';
991 inputobj.name = this.variables[0];
992 inputobj.value = this.variables[1];
993
994 this.form.appendChild(inputobj);
995 }
996
997 document.body.appendChild(this.form).submit();
998};
999
1000/**
1001* Builds a URI query string from the given variables
1002*/
1003vB_Hidden_Form.prototype.build_query_string = function()
1004{
1005 var query_string = '';
1006
1007 for (var i = 0; i < this.variables.length; i++)
1008 {
1009 query_string += this.variables[0] + '=' + PHP.urlencode(this.variables[1]) + '&';
1010 }
1011
1012 return query_string;
1013}
1014
1015/**
1016* Legacy functions for backward compatability
1017*/
1018vB_Hidden_Form.prototype.add_input = vB_Hidden_Form.prototype.add_variable;
1019vB_Hidden_Form.prototype.add_inputs_from_object = vB_Hidden_Form.prototype.add_variables_from_object;
1020
1021// #############################################################################
1022// Window openers and instant messenger wrappers
1023
1024/**
1025* Opens a generic browser window
1026*
1027* @param string URL
1028* @param integer Width
1029* @param integer Height
1030* @param string Optional Window ID
1031*/
1032function openWindow(url, width, height, windowid)
1033{
1034 return window.open(
1035 url,
1036 (typeof windowid == 'undefined' ? 'vBPopup' : windowid),
1037 'statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes'
1038 + (typeof width != 'undefined' ? (',width=' + width) : '') + (typeof height != 'undefined' ? (',height=' + height) : '')
1039 );
1040}
1041
1042/**
1043* Opens control panel help window
1044*
1045* @param string Script name
1046* @param string Action type
1047* @param string Option value
1048*
1049* @return window
1050*/
1051function js_open_help(scriptname, actiontype, optionval)
1052{
1053 return openWindow(
1054 'help.php?s=' + SESSIONHASH + '&do=answer&page=' + scriptname + '&pageaction=' + actiontype + '&option=' + optionval,
1055 600, 450, 'helpwindow'
1056 );
1057}
1058
1059/**
1060* Opens a window to show a list of attachments in a thread (misc.php?do=showattachments)
1061*
1062* @param integer Thread ID
1063*
1064* @return window
1065*/
1066function attachments(threadid)
1067{
1068 return openWindow(
1069 'misc.php?' + SESSIONURL + 'do=showattachments&t=' + threadid,
1070 480, 300
1071 );
1072}
1073
1074/**
1075* Opens a window to show a list of posters in a thread (misc.php?do=whoposted)
1076*
1077* @param integer Thread ID
1078*
1079* @return window
1080*/
1081function who(threadid)
1082{
1083 return openWindow(
1084 'misc.php?' + SESSIONURL + 'do=whoposted&t=' + threadid,
1085 230, 300
1086 );
 
...

TEIL 7:

1087}
1088
1089/**
1090* Opens an IM Window
1091*
1092* @param string IM type
1093* @param integer User ID
1094* @param integer Width of window
1095* @param integer Height of window
1096*
1097* @return window
1098*/
1099function imwindow(imtype, userid, width, height)
1100{
1101 return openWindow(
1102 'sendmessage.php?' + SESSIONURL + 'do=im&type=' + imtype + '&u=' + userid,
1103 width, height
1104 );
1105}
1106
1107/**
1108* Sends an MSN message
1109*
1110* @param string Target MSN handle
1111*
1112* @return boolean false
1113*/
1114function SendMSNMessage(name)
1115{
1116 if (!is_ie)
1117 {
1118 alert(vbphrase['msn_functions_only_work_in_ie']);
1119 return false;
1120 }
1121 else
1122 {
1123 MsgrObj.InstantMessage(name);
1124 return false;
1125 }
1126}
1127
1128/**
1129* Adds an MSN Contact (requires MSN)
1130*
1131* @param string MSN handle
1132*
1133* @return boolean false
1134*/
1135function AddMSNContact(name)
1136{
1137 if (!is_ie)
1138 {
1139 alert(vbphrase['msn_functions_only_work_in_ie']);
1140 return false;
1141 }
1142 else
1143 {
1144 MsgrObj.AddContact(0, name);
1145 return false;
1146 }
1147}
1148
1149/**
1150* Detects Caps-Lock when a key is pressed
1151*
1152* @param event
1153*
1154* @return boolean True if Caps-Lock is on
1155*/
1156function detect_caps_lock(e)
1157{
1158 e = (e ? e : window.event);
1159
1160 var keycode = (e.which ? e.which : (e.keyCode ? e.keyCode : (e.charCode ? e.charCode : 0)));
1161 var shifted = (e.shiftKey || (e.modifiers && (e.modifiers & 4)));
1162 var ctrled = (e.ctrlKey || (e.modifiers && (e.modifiers & 2)));
1163
1164 // if characters are uppercase without shift, or lowercase with shift, caps-lock is on.
1165 return (keycode >= 65 && keycode <= 90 && !shifted && !ctrled) || (keycode >= 97 && keycode <= 122 && shifted);
1166}
1167
1168/**
1169* Confirms log-out request
1170*
1171* @param string Log-out confirmation message
1172*
1173* @return boolean
1174*/
1175function log_out(confirmation_message)
1176{
1177 var ht = document.getElementsByTagName("html")[0];
1178 ht.style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
1179 if (confirm(confirmation_message))
1180 {
1181 return true;
1182 }
1183 else
1184 {
1185 ht.style.filter = "";
1186 return false;
1187 }
1188}
1189
1190// #############################################################################
1191// Cookie handlers
1192
1193/**
1194* Sets a cookie
1195*
1196* @param string Cookie name
1197* @param string Cookie value
1198* @param date Cookie expiry date
1199*/
1200function set_cookie(name, value, expires)
1201{
1202 document.cookie = name + '=' + escape(value) + '; path=/' + (typeof expires != 'undefined' ? '; expires=' + expires.toGMTString() : '');
1203}
1204
1205/**
1206* Deletes a cookie
1207*
1208* @param string Cookie name
1209*/
1210function delete_cookie(name)
1211{
1212 document.cookie = name + '=' + '; expires=Thu, 01-Jan-70 00:00:01 GMT' + '; path=/';
1213}
1214
1215/**
1216* Fetches the value of a cookie
1217*
1218* @param string Cookie name
1219*
1220* @return string
1221*/
1222function fetch_cookie(name)
1223{
1224 cookie_name = name + '=';
1225 cookie_length = document.cookie.length;
1226 cookie_begin = 0;
1227 while (cookie_begin < cookie_length)
1228 {
1229 value_begin = cookie_begin + cookie_name.length;
1230 if (document.cookie.substring(cookie_begin, value_begin) == cookie_name)
1231 {
1232 var value_end = document.cookie.indexOf (';', value_begin);
1233 if (value_end == -1)
1234 {
1235 value_end = cookie_length;
1236 }
1237 return unescape(document.cookie.substring(value_begin, value_end));
1238 }
1239 cookie_begin = document.cookie.indexOf(' ', cookie_begin) + 1;
1240 if (cookie_begin == 0)
1241 {
1242 break;
1243 }
1244 }
1245 return null;
1246}
1247
1248// #############################################################################
1249// Form element managers (used for 'check all' type systems
1250
1251/**
1252* Sets all checkboxes, radio buttons or selects in a given form to a given state, with exceptions
1253*
1254* @param object Form object
1255* @param string Target element type (one of 'radio', 'select-one', 'checkbox')
1256* @param string Selected option in case of 'radio'
1257* @param array Array of element names to be excluded
1258* @param mixed Value to give to found elements
1259*/
1260function js_toggle_all(formobj, formtype, option, exclude, setto)
1261{
1262 for (var i =0; i < formobj.elements.length; i++)
1263 {
1264 var elm = formobj.elements;
1265 if (elm.type == formtype && PHP.in_array(elm.name, exclude, false) == -1)
1266 {
1267 switch (formtype)
1268 {
1269 case 'radio':
1270 if (elm.value == option) // option == '' evaluates true when option = 0
1271 {
1272 elm.checked = setto;
1273 }
1274 break;
1275 case 'select-one':
1276 elm.selectedIndex = setto;
1277 break;
1278 default:
1279 elm.checked = setto;
1280 break;
1281 }
1282 }
1283 }
1284}
1285
1286/**
1287* Sets all <select> elements to the selectedIndex specified by the 'selectall' element
1288*
1289* @param object Form object
1290*/
1291function js_select_all(formobj)
1292{
1293 exclude = new Array();
1294 exclude[0] = 'selectall';
1295 js_toggle_all(formobj, 'select-one', '', exclude, formobj.selectall.selectedIndex);
1296}
1297
1298/**
1299* Sets all <input type="checkbox" /> elements to have the same checked status as 'allbox'
1300*
1301* @param object Form object
1302*/
1303function js_check_all(formobj)
1304{
1305 exclude = new Array();
1306 exclude[0] = 'keepattachments';
1307 exclude[1] = 'allbox';
1308 exclude[2] = 'removeall';
1309 js_toggle_all(formobj, 'checkbox', '', exclude, formobj.allbox.checked);
1310}
1311
1312/**
1313* Sets all <input type="radio" /> groups to have a particular option checked
1314*
1315* @param object Form object
1316* @param mixed Selected option
1317*/
1318function js_check_all_option(formobj, option)
1319{
1320 exclude = new Array();
1321 exclude[0] = 'useusergroup';
1322 js_toggle_all(formobj, 'radio', option, exclude, true);
1323}
1324
1325/**
1326* Alias to js_check_all
1327*/
1328function checkall(formobj) { js_check_all(formobj); }
1329
1330/**
 
@Canomat
Meinst du nicht, es hätte gereicht, den Link zu Posten, statt 1300 Zeilen Code, die sich eh keiner anschauen wird? Jeder hier, der helfen will, ist auch in der Lage, sich den Code von einer Seite anzeigen zu lassen und die wichtigen Stellen zu erkennen. Aber sowas, noch dazu unformatiert, mit Zeilennummern und nicht in den Code-Tags des Forums (
Code:
) bringt garnichts.
 
Zurück
Oben