Changeset 15

User picture

Author: Frans93136

(2008/02/08 21:34) Over 4 years ago

Added user_message, tested mysql some more (works nice now)

Affected files

Updated trunk/includes/constants.php Download diff

1415
6
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
6
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
7
 */
7
 */
8
8
9
// Predefined Vars
10
define ('USER_INFO',    1);
11
define ('USER_WARNING', 2);
12
define ('USER_NOTICE',  3);
13
define ('USER_ERROR',   4);
14
9
// Paths
15
// Paths
10
define('STYLES_PATH', ROOT_PATH . 'styles/default/');
16
define('STYLES_PATH', ROOT_PATH . 'styles/default/');
11
17

Updated trunk/includes/functions.php Download diff

1415
21
	}
21
	}
22
}
22
}
23
23
24
/**
25
 * Our own message handler function
26
 *
27
 */
28
function user_message($msgtype, $msgstr)
29
{
30
    global $tpl;
31
	switch ($msgtype)
32
	{
33
		case USER_INFO:
34
			$errortype = 'info';
35
			$msg_title = "<strong>Information</strong>";
36
		break;
37
		case USER_NOTICE:
38
			$errortype = 'notice';
39
			$msg_title = "<strong>NOTICE</strong>";
40
		break;
24
41
42
		case USER_WARNING:
43
			$errortype = 'warning';
44
			$msg_title = "<strong>WARNING</strong>";
45
		break;
46
47
		case USER_ERROR:
48
			$errortype = 'error';
49
			$msg_title = "<strong>ERROR</strong>";
50
		break;
51
52
		default:
53
			$errortype = 'info';
54
			$msg_title = "<strong>Information</strong>";
55
		break;
56
	}
57
58
	$message = '<div class="'.$errortype.'"><strong>' . $msg_title.'</strong><br />'. $msgstr . '</div>';
59
60
	$tpl->assign_vars(array(
61
		'USER_MESSAGE'	=> $message,
62
	));
63
64
	return true;
65
}
66
25
/**
67
/**
26
 * Our own error handler function
68
 * Our own error handler function
27
 *
69
 *
...
...
30
{
72
{
31
    global $tpl;
73
    global $tpl;
32
74
33
	switch ($errno) 
75
	switch ($errno)
34
	{
76
	{
35
		case E_USER_ERROR:
77
		case E_USER_ERROR:
36
			$errortype = 'error';
78
			$errortype = 'error';

Updated trunk/index.php Download diff

1415
12
12
13
include ROOT_PATH . 'common.' . phpEx;
13
include ROOT_PATH . 'common.' . phpEx;
14
14
15
$error = true;
15
user_message(USER_INFO, 'This is an informative user message.<br />You can use all sorts, USER_INFO (blue), USER_NOTICE(green), USER_WARNING(orange) and USER_ERROR(red).<br />Beware, these message have NO influence on the running of the (any) script, so it will continue.&nbsp;Use it for feedback, not error_handling!');
16
$error = false;
16
17
17
if ($error)
18
if ($error)
18
{
19
{

Updated trunk/styles/default/css/default.css Download diff

1415
2
body {
2
body {
3
  background: #E1E1FF;
3
  background: #E1E1FF;
4
  font-family: Verdana, Arial, Helvetica, sans-serif;
4
  font-family: Verdana, Arial, Helvetica, sans-serif;
5
  font-size: 1.0em;
5
  font-size: 0.8em;
6
}
6
}
7
div.info {
8
			border: #004080 solid 2px	;
9
			padding: 3px;
10
			background: #9BCDFF;
11
			color: #000000;
12
}
13
div.notice {
14
			border: #008000 solid 2px	;
15
			padding: 3px;
16
			background: #99CC00;
17
			color: #000000;
18
}
19
20
div.warning {
21
			border: #DA6311 solid 2px	;
22
			padding: 3px;
23
			background: #FFCC66;
24
			color: #000000;
25
}
26
27
div.error {
28
			background: #FFCCFF;
29
			padding: 3px;
30
			border: #FF0000 solid 2px ;
31
			color: #000000;
32
}

Updated trunk/styles/default/html/error_header.html Download diff

1415
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml">
3
<html xmlns="http://www.w3.org/1999/xhtml">
4
	<head>
4
	<head>
5
		<title></title>
5
		<title>OSCP &bull; Error</title>
6
		<style type="text/css">
6
	</head>
7
		/*<![CDATA[*/
8
		body {
9
			background: #E1E1FF;
10
		}
11
12
		div.notice {
13
			border: #008000 solid 2px	;
14
			padding: 3px;
15
			background: #99CC00;
16
			color: #000000;
17
		}
18
19
		div.warning {
20
			border: #DA6311 solid 2px	;
21
			padding: 3px;
22
			background: #FFCC66;
23
			color: #000000;
24
		}
25
26
		div.error {
27
			background: #FFCCFF;
28
			padding: 3px;
29
			border: #FF0000 solid 2px ;
30
			color: #000000;
31
		}
32
		/*]]>*/
33
		</style>
34
	</head>
35
	<body>
7
	<body>

Updated trunk/styles/default/html/index_body.html Download diff

1415
1
<!-- INCLUDE overall_header.html -->
1
<!-- INCLUDE overall_header.html -->
2
2
<h1>{SHORT_DESC}</h1>{LONG_DESC}
3
<h1>{SHORT_DESC}</h1>{LONG_DESC}
3
<br />
4
<br />
4
{STATUS}<br />
5
{STATUS}<br />

Updated trunk/styles/default/html/overall_header.html Download diff

1415
5
		<link rel="stylesheet" href="{STYLES_PATH}css/default.css" type="text/css">
5
		<link rel="stylesheet" href="{STYLES_PATH}css/default.css" type="text/css">
6
		<title>{TITLE} &bull; CP Test</title>
6
		<title>{TITLE} &bull; CP Test</title>
7
	</head>
7
	</head>
8
	<body>
8
	<body>
9
    {USER_MESSAGE}