annotate msite.inc.php @ 745:7ac6d1fdc078

Add two new fields to compoModeData.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 20 Nov 2014 07:55:57 +0200
parents 66e415b69c75
children 8fe56276fa4f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 <?
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 //
571
ce11ea112a65 Change the header blurb a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 570
diff changeset
3 // FAPWeb - Simple Web-based Demoparty Management System
33
5bf22431176c Modularize.
Matti Hamalainen <ccr@tnsp.org>
parents: 32
diff changeset
4 // Generic and miscellaneous site support code
565
ed2247111fdd Bump copyright years.
Matti Hamalainen <ccr@tnsp.org>
parents: 558
diff changeset
5 // (C) Copyright 2012-2014 Tecnic Software productions (TNSP)
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 //
175
8df523e6326a User require_once instead of require.
Matti Hamalainen <ccr@tnsp.org>
parents: 172
diff changeset
7 require_once "msitegen.inc.php";
51
7bdf89601ba0 Work on session stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
8
184
1b30c2107e5b Add function for validating input with different definable conditions. Use
Matti Hamalainen <ccr@tnsp.org>
parents: 176
diff changeset
9 // Define modes of party information display system
410
298822ed0420 Change display mode constant values.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
10 define("SMODE_DISABLED", 0);
298822ed0420 Change display mode constant values.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
11 define("SMODE_ROTATE", 1);
298822ed0420 Change display mode constant values.
Matti Hamalainen <ccr@tnsp.org>
parents: 407
diff changeset
12 define("SMODE_COMPO", 2);
139
75cf14ee99a7 More work on party information system.
Matti Hamalainen <ccr@tnsp.org>
parents: 135
diff changeset
13
8
4c5f651aa107 Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 7
diff changeset
14
184
1b30c2107e5b Add function for validating input with different definable conditions. Use
Matti Hamalainen <ccr@tnsp.org>
parents: 176
diff changeset
15 // Define sizes of database fields, see createdb.php
1b30c2107e5b Add function for validating input with different definable conditions. Use
Matti Hamalainen <ccr@tnsp.org>
parents: 176
diff changeset
16 // and also the places where input is validated.
1b30c2107e5b Add function for validating input with different definable conditions. Use
Matti Hamalainen <ccr@tnsp.org>
parents: 176
diff changeset
17 define("SET_LEN_USERNAME", 32);
1b30c2107e5b Add function for validating input with different definable conditions. Use
Matti Hamalainen <ccr@tnsp.org>
parents: 176
diff changeset
18 define("SET_LEN_GROUPS", 64);
1b30c2107e5b Add function for validating input with different definable conditions. Use
Matti Hamalainen <ccr@tnsp.org>
parents: 176
diff changeset
19 define("SET_LEN_ONELINER", 64);
1b30c2107e5b Add function for validating input with different definable conditions. Use
Matti Hamalainen <ccr@tnsp.org>
parents: 176
diff changeset
20 define("SET_LEN_EMAIL", 80);
716
e7fbcf4190e6 Add registration host.
Matti Hamalainen <ccr@tnsp.org>
parents: 703
diff changeset
21 define("SET_LEN_REGHOST", 128);
184
1b30c2107e5b Add function for validating input with different definable conditions. Use
Matti Hamalainen <ccr@tnsp.org>
parents: 176
diff changeset
22
1b30c2107e5b Add function for validating input with different definable conditions. Use
Matti Hamalainen <ccr@tnsp.org>
parents: 176
diff changeset
23 define("SET_LEN_NEWS_TITLE", 128);
1b30c2107e5b Add function for validating input with different definable conditions. Use
Matti Hamalainen <ccr@tnsp.org>
parents: 176
diff changeset
24 define("SET_LEN_NEWS_TEXT", 4096);
1b30c2107e5b Add function for validating input with different definable conditions. Use
Matti Hamalainen <ccr@tnsp.org>
parents: 176
diff changeset
25 define("SET_LEN_NEWS_AUTHOR", 64);
1b30c2107e5b Add function for validating input with different definable conditions. Use
Matti Hamalainen <ccr@tnsp.org>
parents: 176
diff changeset
26
1b30c2107e5b Add function for validating input with different definable conditions. Use
Matti Hamalainen <ccr@tnsp.org>
parents: 176
diff changeset
27 define("SET_LEN_COMPO_NAME", 128);
1b30c2107e5b Add function for validating input with different definable conditions. Use
Matti Hamalainen <ccr@tnsp.org>
parents: 176
diff changeset
28 define("SET_LEN_COMPO_DESC", 4096);
533
f872843ae396 Add file path to compo data.
Matti Hamalainen <ccr@tnsp.org>
parents: 531
diff changeset
29 define("SET_LEN_COMPO_PATH", 128);
184
1b30c2107e5b Add function for validating input with different definable conditions. Use
Matti Hamalainen <ccr@tnsp.org>
parents: 176
diff changeset
30
1b30c2107e5b Add function for validating input with different definable conditions. Use
Matti Hamalainen <ccr@tnsp.org>
parents: 176
diff changeset
31 define("SET_LEN_ENTRY_NAME", 64);
1b30c2107e5b Add function for validating input with different definable conditions. Use
Matti Hamalainen <ccr@tnsp.org>
parents: 176
diff changeset
32 define("SET_LEN_ENTRY_AUTHOR", 64);
526
e074775d853e Make filename field shorter.
Matti Hamalainen <ccr@tnsp.org>
parents: 512
diff changeset
33 define("SET_LEN_ENTRY_FILENAME", 128);
506
d29166d97b46 Change some database field sizes.
Matti Hamalainen <ccr@tnsp.org>
parents: 503
diff changeset
34 define("SET_LEN_ENTRY_INFO", 1024);
527
d6726a4883a6 Add "notes" field for entries, to contain notes private to organizers.
Matti Hamalainen <ccr@tnsp.org>
parents: 526
diff changeset
35 define("SET_LEN_ENTRY_NOTES", 1024);
528
dd5c5577c495 Add preview file and file type fields for entry, for screenshots etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 527
diff changeset
36 define("SET_LEN_ENTRY_PREVIEW_FILE", 128);
184
1b30c2107e5b Add function for validating input with different definable conditions. Use
Matti Hamalainen <ccr@tnsp.org>
parents: 176
diff changeset
37
506
d29166d97b46 Change some database field sizes.
Matti Hamalainen <ccr@tnsp.org>
parents: 503
diff changeset
38 define("SET_LEN_DISP_SLIDE_TITLE", 64);
420
e9f6e242c4b9 Define some more SQL field lengths.
Matti Hamalainen <ccr@tnsp.org>
parents: 410
diff changeset
39 define("SET_LEN_DISP_SLIDE_TEXT", 4096);
e9f6e242c4b9 Define some more SQL field lengths.
Matti Hamalainen <ccr@tnsp.org>
parents: 410
diff changeset
40 define("SET_LEN_ROT_LIST_NAME", 128);
184
1b30c2107e5b Add function for validating input with different definable conditions. Use
Matti Hamalainen <ccr@tnsp.org>
parents: 176
diff changeset
41
503
3232f682f0d2 Change how table schemas are defined, in preparation for future database
Matti Hamalainen <ccr@tnsp.org>
parents: 491
diff changeset
42 define("SET_LEN_VOTEKEY", 64);
508
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
43
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
44
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
45 //
702
c527b42a7857 Comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 700
diff changeset
46 // Entry preview type (value)
508
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
47 //
700
d0418af28559 Add EPREV_NONE define.
Matti Hamalainen <ccr@tnsp.org>
parents: 699
diff changeset
48 define("EPREV_NONE", 0); // No preview
528
dd5c5577c495 Add preview file and file type fields for entry, for screenshots etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 527
diff changeset
49 define("EPREV_IMAGE", 1); // Preview is image (PNG, JPEG)
700
d0418af28559 Add EPREV_NONE define.
Matti Hamalainen <ccr@tnsp.org>
parents: 699
diff changeset
50 define("EPREV_AUDIO", 2); // Preview is audio (Vorbis, MP3)
528
dd5c5577c495 Add preview file and file type fields for entry, for screenshots etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 527
diff changeset
51
703
242cb053fbb2 Add array/list of preview types and descriptions for them.
Matti Hamalainen <ccr@tnsp.org>
parents: 702
diff changeset
52 $previewTypeList = array(
242cb053fbb2 Add array/list of preview types and descriptions for them.
Matti Hamalainen <ccr@tnsp.org>
parents: 702
diff changeset
53 EPREV_NONE => "No previews",
242cb053fbb2 Add array/list of preview types and descriptions for them.
Matti Hamalainen <ccr@tnsp.org>
parents: 702
diff changeset
54 EPREV_IMAGE => "Image file",
242cb053fbb2 Add array/list of preview types and descriptions for them.
Matti Hamalainen <ccr@tnsp.org>
parents: 702
diff changeset
55 EPREV_AUDIO => "Audio file",
242cb053fbb2 Add array/list of preview types and descriptions for them.
Matti Hamalainen <ccr@tnsp.org>
parents: 702
diff changeset
56 );
242cb053fbb2 Add array/list of preview types and descriptions for them.
Matti Hamalainen <ccr@tnsp.org>
parents: 702
diff changeset
57
242cb053fbb2 Add array/list of preview types and descriptions for them.
Matti Hamalainen <ccr@tnsp.org>
parents: 702
diff changeset
58
702
c527b42a7857 Comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 700
diff changeset
59 //
c527b42a7857 Comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 700
diff changeset
60 // Entry flags (bitfield)
c527b42a7857 Comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 700
diff changeset
61 //
508
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
62 define("EFLAG_DISQUALIFIED", 1); // Entry is disqualified
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
63 define("EFLAG_PROBLEMS", 2); // Has some problems
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
64
690
bad79296eb34 Cleanups, rename variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 680
diff changeset
65 $entryFlagsList = array(
bad79296eb34 Cleanups, rename variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 680
diff changeset
66 EFLAG_DISQUALIFIED => array("Disqualified", "img/disqualified.png"),
bad79296eb34 Cleanups, rename variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 680
diff changeset
67 EFLAG_PROBLEMS => array("Has problems", "img/problems.png"),
bad79296eb34 Cleanups, rename variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 680
diff changeset
68 );
bad79296eb34 Cleanups, rename variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 680
diff changeset
69
508
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
70
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
71 //
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
72 // Competition types
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
73 //
606
3d2b70fbeb78 Slight cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 605
diff changeset
74 define("COMPO_NORMAL", 0); // Normal voting compo, points determine placement
3d2b70fbeb78 Slight cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 605
diff changeset
75 define("COMPO_POINTS", 1); // Assigned points, points determines placement (no voting)
508
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
76 define("COMPO_ASSIGN", 2); // Assigned places (no voting)
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
77
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
78
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
79 $compoModeData = array(
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
80 COMPO_NORMAL => array("Normal",
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
81 "Normal voting compo.",
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
82 ),
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
83 COMPO_POINTS => array("Points",
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
84 "Assigned points (no voting).",
745
7ac6d1fdc078 Add two new fields to compoModeData.
Matti Hamalainen <ccr@tnsp.org>
parents: 742
diff changeset
85 "Points",
508
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
86 ),
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
87 COMPO_ASSIGN => array("Assigned",
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
88 "Assigned places (no points, no voting).",
745
7ac6d1fdc078 Add two new fields to compoModeData.
Matti Hamalainen <ccr@tnsp.org>
parents: 742
diff changeset
89 "Place",
508
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
90 ),
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
91 );
b6fe46c86ff3 Add definitions for entry flags and compo types. Not used yet (though the
Matti Hamalainen <ccr@tnsp.org>
parents: 506
diff changeset
92
641
1a123c6c2241 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 640
diff changeset
93
94
6edd7d623eab Start adding votekey modes code.
Matti Hamalainen <ccr@tnsp.org>
parents: 87
diff changeset
94 //
6edd7d623eab Start adding votekey modes code.
Matti Hamalainen <ccr@tnsp.org>
parents: 87
diff changeset
95 // Different voting modes
6edd7d623eab Start adding votekey modes code.
Matti Hamalainen <ccr@tnsp.org>
parents: 87
diff changeset
96 //
6edd7d623eab Start adding votekey modes code.
Matti Hamalainen <ccr@tnsp.org>
parents: 87
diff changeset
97 define("VOTE_FREELY", 0);
274
81507072f25d Add explanations of the different voting modes.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
98 define("VOTE_ACTIVATE", 1);
81507072f25d Add explanations of the different voting modes.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
99 define("VOTE_ASSIGN", 2);
94
6edd7d623eab Start adding votekey modes code.
Matti Hamalainen <ccr@tnsp.org>
parents: 87
diff changeset
100
274
81507072f25d Add explanations of the different voting modes.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
101 $voteModeData = array(
81507072f25d Add explanations of the different voting modes.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
102 VOTE_FREELY => array("Freeform voting",
282
50e52dc43916 Add missing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents: 274
diff changeset
103 "Vote keys are not tied to attendees, and do not need to be activated. ".
274
81507072f25d Add explanations of the different voting modes.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
104 "Take one printed key slip, give it to attendee."
81507072f25d Add explanations of the different voting modes.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
105 ),
81507072f25d Add explanations of the different voting modes.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
106 VOTE_ACTIVATE => array("Key activation",
81507072f25d Add explanations of the different voting modes.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
107 "Vote keys are not tied to attendees, but require manual activation. ".
81507072f25d Add explanations of the different voting modes.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
108 "Take one printed key slip, find it by the index number in the list below, set to activated. ".
81507072f25d Add explanations of the different voting modes.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
109 "Give key slip to attendee."
81507072f25d Add explanations of the different voting modes.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
110 ),
81507072f25d Add explanations of the different voting modes.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
111 VOTE_ASSIGN => array("Assigned keys",
307
c0d573a5de5b Add procedure description to assigned keys mode.
Matti Hamalainen <ccr@tnsp.org>
parents: 282
diff changeset
112 "Votekeys are tied to attendees, activated by assigning the key to attendee. ".
c0d573a5de5b Add procedure description to assigned keys mode.
Matti Hamalainen <ccr@tnsp.org>
parents: 282
diff changeset
113 "Take one printed key slip, find attendee in the list below, enter key ID number, assign, check. ".
c0d573a5de5b Add procedure description to assigned keys mode.
Matti Hamalainen <ccr@tnsp.org>
parents: 282
diff changeset
114 "Give key slip to attendee."
274
81507072f25d Add explanations of the different voting modes.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
115 ),
81507072f25d Add explanations of the different voting modes.
Matti Hamalainen <ccr@tnsp.org>
parents: 261
diff changeset
116 );
94
6edd7d623eab Start adding votekey modes code.
Matti Hamalainen <ccr@tnsp.org>
parents: 87
diff changeset
117
6edd7d623eab Start adding votekey modes code.
Matti Hamalainen <ccr@tnsp.org>
parents: 87
diff changeset
118
535
88c048f3b9e1 Add comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 533
diff changeset
119 //
88c048f3b9e1 Add comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 533
diff changeset
120 // Party infromation system data/variables handling
88c048f3b9e1 Add comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 533
diff changeset
121 //
143
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
122 function stReloadDisplayVars()
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
123 {
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
124 global $displayVars, $displayVarsChanged;
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
125
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
126 $displayVars = array();
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
127 $displayVarsChanged = array();
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
128
542
8c1a53532be0 Rename various database tables and column names for better SQL compatibility.
Matti Hamalainen <ccr@tnsp.org>
parents: 535
diff changeset
129 if (($res = stExecSQL("SELECT * FROM display_vars")) !== FALSE)
143
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
130 {
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
131 foreach ($res as $row)
354
1dd598221874 Simplify code by reusing functions from site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 307
diff changeset
132 $displayVars[$row["key"]] = stGetSQLSettingData($row);
143
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
133 }
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
134 }
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
135
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
136
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
137 function stSaveDisplayVars()
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
138 {
144
c030c3cf0d80 More work on display system.
Matti Hamalainen <ccr@tnsp.org>
parents: 143
diff changeset
139 global $db, $displayVars, $displayVarsChanged;
143
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
140
542
8c1a53532be0 Rename various database tables and column names for better SQL compatibility.
Matti Hamalainen <ccr@tnsp.org>
parents: 535
diff changeset
141 foreach (stExecSQL("SELECT * FROM display_vars") as $item)
143
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
142 if (isset($displayVarsChanged[$item["key"]]))
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
143 {
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
144 $val = $displayVars[$item["key"]];
354
1dd598221874 Simplify code by reusing functions from site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 307
diff changeset
145 stExecSQL(
542
8c1a53532be0 Rename various database tables and column names for better SQL compatibility.
Matti Hamalainen <ccr@tnsp.org>
parents: 535
diff changeset
146 "UPDATE display_vars SET ".stGetSettingSQL($item, $val).
354
1dd598221874 Simplify code by reusing functions from site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 307
diff changeset
147 " WHERE key=".$db->quote($item["key"]));
143
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
148 }
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
149 }
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
150
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
151
407
eaea1ae2bc3d Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
152 function stDisplayUpdated()
eaea1ae2bc3d Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
153 {
eaea1ae2bc3d Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
154 stSetDisplayVar("lastUpdate", time());
eaea1ae2bc3d Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
155 }
eaea1ae2bc3d Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
156
eaea1ae2bc3d Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
157
454
ea7fc4e9f602 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 447
diff changeset
158 function stSetDisplayVarUpd($name, $value)
ea7fc4e9f602 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 447
diff changeset
159 {
ea7fc4e9f602 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 447
diff changeset
160 if (stGetDisplayVar($name) != $value)
ea7fc4e9f602 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 447
diff changeset
161 {
ea7fc4e9f602 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 447
diff changeset
162 stSetDisplayVar($name, $value);
ea7fc4e9f602 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 447
diff changeset
163 stDisplayUpdated();
ea7fc4e9f602 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 447
diff changeset
164 return TRUE;
ea7fc4e9f602 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 447
diff changeset
165 }
ea7fc4e9f602 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 447
diff changeset
166 else
ea7fc4e9f602 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 447
diff changeset
167 return FALSE;
ea7fc4e9f602 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 447
diff changeset
168 }
ea7fc4e9f602 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 447
diff changeset
169
ea7fc4e9f602 Moar work.
Matti Hamalainen <ccr@tnsp.org>
parents: 447
diff changeset
170
143
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
171 function stGetDisplayVar($name)
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
172 {
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
173 global $displayVars;
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
174 if (isset($displayVars[$name]))
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
175 return $displayVars[$name];
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
176 else
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
177 die("No display var for '".$name."'.\n");
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
178 }
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
179
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
180
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
181 function stSetDisplayVar($name, $value)
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
182 {
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
183 global $displayVars, $displayVarsChanged;
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
184 if (isset($displayVars[$name]))
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
185 {
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
186 $displayVars[$name] = $value;
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
187 $displayVarsChanged[$name] = true;
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
188 }
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
189 else
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
190 die("No display var for '".$name."'.\n");
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
191 }
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
192
20893a5442b7 Move some functions to site module, and use them.
Matti Hamalainen <ccr@tnsp.org>
parents: 139
diff changeset
193
484
c8591a8fadbc Move stExecSQLCond() to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
194 function stExecSQLCond($sql, $msg = FALSE)
c8591a8fadbc Move stExecSQLCond() to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
195 {
c8591a8fadbc Move stExecSQLCond() to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
196 global $db;
c8591a8fadbc Move stExecSQLCond() to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
197 if (($res = stDBExecSQL($db, $sql)) !== FALSE)
c8591a8fadbc Move stExecSQLCond() to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
198 {
c8591a8fadbc Move stExecSQLCond() to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
199 if ($msg !== FALSE)
c8591a8fadbc Move stExecSQLCond() to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
200 stSetStatus(200, $msg);
c8591a8fadbc Move stExecSQLCond() to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
201 return $res;
c8591a8fadbc Move stExecSQLCond() to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
202 }
c8591a8fadbc Move stExecSQLCond() to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
203 else
c8591a8fadbc Move stExecSQLCond() to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
204 {
c8591a8fadbc Move stExecSQLCond() to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
205 stSetStatus(902, "Error in SQL execution.");
c8591a8fadbc Move stExecSQLCond() to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
206 return FALSE;
c8591a8fadbc Move stExecSQLCond() to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
207 }
c8591a8fadbc Move stExecSQLCond() to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
208 }
c8591a8fadbc Move stExecSQLCond() to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
209
c8591a8fadbc Move stExecSQLCond() to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
210
205
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 184
diff changeset
211 function stPrintAttendee($item, $row, $tr, $full, $edit, $eclass = "")
37
238c73840b61 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
212 {
238c73840b61 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
213 $id = $item["id"];
238c73840b61 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
214 $prefix = "at";
677
64d80a7f7e26 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 674
diff changeset
215
205
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 184
diff changeset
216 if ($tr)
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 184
diff changeset
217 {
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 184
diff changeset
218 echo
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 184
diff changeset
219 " <tr class=\"".($row % 2 == 1 ? "rodd" : "reven").$eclass.
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 184
diff changeset
220 "\" id=\"attendee".$id."\" ".($full ? "onClick=\"activateAttendee(".$id.")\"" : "").">";
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 184
diff changeset
221 }
677
64d80a7f7e26 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 674
diff changeset
222
71
d74fb8cf0062 Adjust attendee output again, we're separating vote keys from there once more. Durr.
Matti Hamalainen <ccr@tnsp.org>
parents: 70
diff changeset
223 echo
679
cbb66cb60930 Rename a function.
Matti Hamalainen <ccr@tnsp.org>
parents: 677
diff changeset
224 stGetTDFormTextInput($edit, 20, SET_LEN_USERNAME, "name", $id, $prefix, $item["name"]).
cbb66cb60930 Rename a function.
Matti Hamalainen <ccr@tnsp.org>
parents: 677
diff changeset
225 stGetTDFormTextInput($edit, 20, SET_LEN_GROUPS, "groups", $id, $prefix, $item["groups"]).
71
d74fb8cf0062 Adjust attendee output again, we're separating vote keys from there once more. Durr.
Matti Hamalainen <ccr@tnsp.org>
parents: 70
diff changeset
226 "<td class=\"regtime\">".date("d.m. H:i", $item["regtime"])."</td>".
679
cbb66cb60930 Rename a function.
Matti Hamalainen <ccr@tnsp.org>
parents: 677
diff changeset
227 stGetTDFormTextInput($edit, 30, SET_LEN_ONELINER, "oneliner", $id, $prefix, $item["oneliner"], "autocomplete=\"off\"");
37
238c73840b61 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
228
205
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 184
diff changeset
229 if ($full)
37
238c73840b61 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
230 {
238c73840b61 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
231 echo
716
e7fbcf4190e6 Add registration host.
Matti Hamalainen <ccr@tnsp.org>
parents: 703
diff changeset
232 stGetTDFormTextInput($edit, 15, SET_LEN_EMAIL, "email", $id, $prefix, $item["email"], "autocomplete=\"off\"").
e7fbcf4190e6 Add registration host.
Matti Hamalainen <ccr@tnsp.org>
parents: 703
diff changeset
233 stGetTDFormTextInput($edit, 15, SET_LEN_REGHOST, "reghost", $id, $prefix, $item["reghost"], "autocomplete=\"off\"");
205
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 184
diff changeset
234
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 184
diff changeset
235 if ($edit)
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 184
diff changeset
236 {
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 184
diff changeset
237 echo
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 184
diff changeset
238 "<td>".
680
c9b96a7b9dc4 Add new helper function and use it.
Matti Hamalainen <ccr@tnsp.org>
parents: 679
diff changeset
239 stGetFormButtonElement($prefix."upd".$id, "","", "Upd", "updateAttendee(".$id.")").
c9b96a7b9dc4 Add new helper function and use it.
Matti Hamalainen <ccr@tnsp.org>
parents: 679
diff changeset
240 stGetFormButtonElement($prefix."del".$id, "","", "Del", "deleteAttendee(".$id.")").
205
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 184
diff changeset
241 "</td>";
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 184
diff changeset
242 }
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 184
diff changeset
243 else
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 184
diff changeset
244 echo "<td></td>";
37
238c73840b61 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
245 }
205
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 184
diff changeset
246
77d33161f8be More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents: 184
diff changeset
247 if ($tr)
674
3e37a29468bf Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 665
diff changeset
248 echo "</tr>\n";
37
238c73840b61 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
249 }
238c73840b61 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
250
238c73840b61 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
251
222
b236b4d8d7a9 Remove useless code.
Matti Hamalainen <ccr@tnsp.org>
parents: 207
diff changeset
252 function stPrintNewsItem($item)
37
238c73840b61 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
253 {
238c73840b61 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
254 echo
592
642df17214f6 Improve news item DOM IDs.
Matti Hamalainen <ccr@tnsp.org>
parents: 585
diff changeset
255 "<div class=\"newsItem\" id=\"news".$item["id"]."\">\n".
37
238c73840b61 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
256 " <h2>".chentities($item["title"])."</h2>\n".
592
642df17214f6 Improve news item DOM IDs.
Matti Hamalainen <ccr@tnsp.org>
parents: 585
diff changeset
257 " <div class=\"newsText\">".dhentities($item["text"])."</div>\n".
593
3cceb9f13762 And some more tweaking.
Matti Hamalainen <ccr@tnsp.org>
parents: 592
diff changeset
258 " <div class=\"newsAuthor\"><span class=\"newsSig\">-- ".chentities($item["author"])."</span>".
3cceb9f13762 And some more tweaking.
Matti Hamalainen <ccr@tnsp.org>
parents: 592
diff changeset
259 "<span class=\"newsDate\">".date("d M Y / H:i", $item["utime"])."</span></div>\n".
37
238c73840b61 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
260 "</div>\n";
238c73840b61 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
261 }
238c73840b61 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
262
238c73840b61 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 35
diff changeset
263
69
30a4420e85ab stGenerateUserKey() simply returns a generated key now (string) or FALSE if
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
264 function stGenerateUserKey()
65
72b22729ae7e Add function for generating vote keys into site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 53
diff changeset
265 {
69
30a4420e85ab stGenerateUserKey() simply returns a generated key now (string) or FALSE if
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
266 global $db;
99
2169c3177f47 Limit the vote key character space even more.
Matti Hamalainen <ccr@tnsp.org>
parents: 94
diff changeset
267 $keyChars = "abdefghjkmnpqrstwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789";
65
72b22729ae7e Add function for generating vote keys into site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 53
diff changeset
268
72b22729ae7e Add function for generating vote keys into site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 53
diff changeset
269 while (TRUE)
72b22729ae7e Add function for generating vote keys into site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 53
diff changeset
270 {
69
30a4420e85ab stGenerateUserKey() simply returns a generated key now (string) or FALSE if
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
271 // Generate one randomized keycode
65
72b22729ae7e Add function for generating vote keys into site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 53
diff changeset
272 $key = "";
72b22729ae7e Add function for generating vote keys into site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 53
diff changeset
273 for ($n = 0; $n < stGetSetting("userKeyLength"); $n++)
72b22729ae7e Add function for generating vote keys into site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 53
diff changeset
274 $key .= $keyChars[rand() % strlen($keyChars)];
72b22729ae7e Add function for generating vote keys into site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 53
diff changeset
275
72b22729ae7e Add function for generating vote keys into site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 53
diff changeset
276 // Check if it already exists, to avoid duplicates
69
30a4420e85ab stGenerateUserKey() simply returns a generated key now (string) or FALSE if
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
277 // We need custom query code here, because stFetchSQLColumn()
30a4420e85ab stGenerateUserKey() simply returns a generated key now (string) or FALSE if
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
278 // won't work due to it returning FALSE in error cases.
87
3da47d3e6a3c Remove a function, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 72
diff changeset
279 $sql = stPrepareSQL("SELECT * FROM votekeys WHERE key=%s", $key);
65
72b22729ae7e Add function for generating vote keys into site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 53
diff changeset
280 if (($res = @$db->query($sql)) !== FALSE)
72b22729ae7e Add function for generating vote keys into site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 53
diff changeset
281 {
69
30a4420e85ab stGenerateUserKey() simply returns a generated key now (string) or FALSE if
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
282 // Did we get results?
65
72b22729ae7e Add function for generating vote keys into site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 53
diff changeset
283 if ($res->fetchColumn() === FALSE)
72b22729ae7e Add function for generating vote keys into site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 53
diff changeset
284 {
69
30a4420e85ab stGenerateUserKey() simply returns a generated key now (string) or FALSE if
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
285 // Nope, return key
30a4420e85ab stGenerateUserKey() simply returns a generated key now (string) or FALSE if
Matti Hamalainen <ccr@tnsp.org>
parents: 66
diff changeset
286 return $key;
65
72b22729ae7e Add function for generating vote keys into site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 53
diff changeset
287 }
72b22729ae7e Add function for generating vote keys into site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 53
diff changeset
288 }
72b22729ae7e Add function for generating vote keys into site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 53
diff changeset
289 else
72b22729ae7e Add function for generating vote keys into site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 53
diff changeset
290 {
72b22729ae7e Add function for generating vote keys into site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 53
diff changeset
291 stLogSQLError($sql);
72b22729ae7e Add function for generating vote keys into site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 53
diff changeset
292 return FALSE;
72b22729ae7e Add function for generating vote keys into site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 53
diff changeset
293 }
72b22729ae7e Add function for generating vote keys into site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 53
diff changeset
294 }
72b22729ae7e Add function for generating vote keys into site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 53
diff changeset
295 }
66
230aacc22cb4 Move some functions to site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
296
230aacc22cb4 Move some functions to site lib.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
297
103
c6b9041078ec Add hard limit option for attendees, and add feature of using "0" to disable
Matti Hamalainen <ccr@tnsp.org>
parents: 99
diff changeset
298 function stCheckRegistrationAvailable()
c6b9041078ec Add hard limit option for attendees, and add feature of using "0" to disable
Matti Hamalainen <ccr@tnsp.org>
parents: 99
diff changeset
299 {
c6b9041078ec Add hard limit option for attendees, and add feature of using "0" to disable
Matti Hamalainen <ccr@tnsp.org>
parents: 99
diff changeset
300 global $maxAttendeesHard, $maxAttendeesSoft, $numAttendees;
c6b9041078ec Add hard limit option for attendees, and add feature of using "0" to disable
Matti Hamalainen <ccr@tnsp.org>
parents: 99
diff changeset
301
c6b9041078ec Add hard limit option for attendees, and add feature of using "0" to disable
Matti Hamalainen <ccr@tnsp.org>
parents: 99
diff changeset
302 $maxAttendeesHard = stGetSetting("maxAttendeesHard");
c6b9041078ec Add hard limit option for attendees, and add feature of using "0" to disable
Matti Hamalainen <ccr@tnsp.org>
parents: 99
diff changeset
303 $maxAttendeesSoft = stGetSetting("maxAttendeesSoft");
c6b9041078ec Add hard limit option for attendees, and add feature of using "0" to disable
Matti Hamalainen <ccr@tnsp.org>
parents: 99
diff changeset
304 if (($numAttendees = stFetchSQLColumn("SELECT COUNT(*) FROM attendees")) === FALSE)
c6b9041078ec Add hard limit option for attendees, and add feature of using "0" to disable
Matti Hamalainen <ccr@tnsp.org>
parents: 99
diff changeset
305 $numAttendees = 0;
c6b9041078ec Add hard limit option for attendees, and add feature of using "0" to disable
Matti Hamalainen <ccr@tnsp.org>
parents: 99
diff changeset
306
c6b9041078ec Add hard limit option for attendees, and add feature of using "0" to disable
Matti Hamalainen <ccr@tnsp.org>
parents: 99
diff changeset
307 return stChkSetting("allowRegister") && ($maxAttendeesHard <= 0 || $numAttendees < $maxAttendeesHard);
c6b9041078ec Add hard limit option for attendees, and add feature of using "0" to disable
Matti Hamalainen <ccr@tnsp.org>
parents: 99
diff changeset
308 }
135
eecac02579c4 Move stChop() to site module and rename it to stStrChop().
Matti Hamalainen <ccr@tnsp.org>
parents: 121
diff changeset
309
eecac02579c4 Move stChop() to site module and rename it to stStrChop().
Matti Hamalainen <ccr@tnsp.org>
parents: 121
diff changeset
310
646
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
311 function stValidateRequestUserData($admin, $id = FALSE)
207
e31c42a9b574 Slowly work on input validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
312 {
646
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
313 $res = TRUE;
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
314 $chk = 0;
207
e31c42a9b574 Slowly work on input validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
315
646
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
316 if (stChkRequestItem("name", $name,
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
317 array(CHK_ISGT, VT_STR, 0, "Handle / name not given."),
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
318 array(CHK_LTEQ, VT_STR, SET_LEN_USERNAME, "Handle / name is too long, should be less than ".SET_LEN_USERNAME." characters.")))
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
319 $chk++;
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
320 else
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
321 $res = FALSE;
207
e31c42a9b574 Slowly work on input validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
322
646
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
323 if (stChkRequestItem("groups", $groups,
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
324 array(CHK_LTEQ, VT_STR, SET_LEN_GROUPS, "Groups are too long, should be less than ".SET_LEN_GROUPS." characters.")))
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
325 $chk++;
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
326 else
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
327 $res = FALSE;
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
328
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
329 if (!stChkRequestItem("oneliner", $oneliner,
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
330 array(CHK_LTEQ, VT_STR, SET_LEN_ONELINER, "Oneliner is too long, should be less than ".SET_LEN_ONELINER." characters.")))
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
331 $res = FALSE;
207
e31c42a9b574 Slowly work on input validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
332
e31c42a9b574 Slowly work on input validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
333 $email = stGetRequestItem("email");
e31c42a9b574 Slowly work on input validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
334 if (!$admin && stGetSetting("requireEMail") && strlen($email) < 4)
e31c42a9b574 Slowly work on input validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
335 {
e31c42a9b574 Slowly work on input validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
336 stError("E-mail address not given, or it is too short.");
646
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
337 $res = FALSE;
207
e31c42a9b574 Slowly work on input validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
338 }
e31c42a9b574 Slowly work on input validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
339
605
f928b0a6e1af Better validation for e-mail addresses.
Matti Hamalainen <ccr@tnsp.org>
parents: 598
diff changeset
340 if (strlen($email) > 0 && preg_match("/^[a-z0-9][a-z0-9\+\-\.\%_]*@[a-z0-9.-]+\.[a-z]{2,4}$/i", $email) != 1)
207
e31c42a9b574 Slowly work on input validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
341 {
e31c42a9b574 Slowly work on input validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
342 stError("E-mail address not in proper format.");
646
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
343 $res = FALSE;
207
e31c42a9b574 Slowly work on input validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
344 }
e31c42a9b574 Slowly work on input validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
345
e31c42a9b574 Slowly work on input validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
346 if (strlen($email) > SET_LEN_EMAIL)
e31c42a9b574 Slowly work on input validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
347 {
e31c42a9b574 Slowly work on input validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
348 stError("E-mail address too long, max ".SET_LEN_EMAIL." characters.");
646
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
349 $res = FALSE;
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
350 }
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
351
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
352 // Check if another user already exists
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
353 if ($chk >= 2)
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
354 {
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
355 if ($id !== false)
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
356 // By another ID, if we are updating an entry
647
60b51ab059da Oops, forgot an AND from one SQL clause.
Matti Hamalainen <ccr@tnsp.org>
parents: 646
diff changeset
357 $sql = stPrepareSQL("SELECT * FROM attendees WHERE id<>%d AND name=%s AND groups=%s", $id, $name, $groups);
646
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
358 else
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
359 // Or just exists, if adding
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
360 $sql = stPrepareSQL("SELECT * FROM attendees WHERE name=%s AND groups=%s", $name, $groups);
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
361
648
9e4b8df65879 Oops, fix a 10L.
Matti Hamalainen <ccr@tnsp.org>
parents: 647
diff changeset
362 if (($data = stFetchSQL($sql)) !== false)
646
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
363 {
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
364 stError("Someone with the same name and groups is already registered.");
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
365 $res = FALSE;
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
366 }
207
e31c42a9b574 Slowly work on input validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
367 }
646
2eeca16e9c96 Improve attendee adding/updating data validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 641
diff changeset
368 return $res;
648
9e4b8df65879 Oops, fix a 10L.
Matti Hamalainen <ccr@tnsp.org>
parents: 647
diff changeset
369
207
e31c42a9b574 Slowly work on input validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
370 }
e31c42a9b574 Slowly work on input validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
371
e31c42a9b574 Slowly work on input validation.
Matti Hamalainen <ccr@tnsp.org>
parents: 205
diff changeset
372
679
cbb66cb60930 Rename a function.
Matti Hamalainen <ccr@tnsp.org>
parents: 677
diff changeset
373 function stGetTDFormTextInput($edit, $size, $len, $name, $id, $prefix, $value, $extra = "")
437
cefa64c8be63 Move some functions to msite.
Matti Hamalainen <ccr@tnsp.org>
parents: 420
diff changeset
374 {
cefa64c8be63 Move some functions to msite.
Matti Hamalainen <ccr@tnsp.org>
parents: 420
diff changeset
375 return
637
a376521c7bd1 Move some code around, for more appropriate placement in the modules.
Matti Hamalainen <ccr@tnsp.org>
parents: 623
diff changeset
376 "<td class=\"".$name."\">".
a376521c7bd1 Move some code around, for more appropriate placement in the modules.
Matti Hamalainen <ccr@tnsp.org>
parents: 623
diff changeset
377 ($edit ? stGetFormTextInput($size, $len, $name, $id, $prefix, $value, $extra) : chentities($value)).
a376521c7bd1 Move some code around, for more appropriate placement in the modules.
Matti Hamalainen <ccr@tnsp.org>
parents: 623
diff changeset
378 "</td>";
437
cefa64c8be63 Move some functions to msite.
Matti Hamalainen <ccr@tnsp.org>
parents: 420
diff changeset
379 }
cefa64c8be63 Move some functions to msite.
Matti Hamalainen <ccr@tnsp.org>
parents: 420
diff changeset
380
cefa64c8be63 Move some functions to msite.
Matti Hamalainen <ccr@tnsp.org>
parents: 420
diff changeset
381
488
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
382 function stConvSwitchMode(&$str, &$mode, $newMode)
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
383 {
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
384 if ($newMode != $mode)
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
385 {
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
386 if ($mode != "")
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
387 $str .= "\n</".$mode.">\n";
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
388
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
389 $mode = $newMode;
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
390
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
391 if ($mode != "")
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
392 $str .= "<".$mode.">\n";
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
393 }
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
394 }
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
395
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
396
491
c360fb50221c Add entity handling to stConvertCommonDesc().
Matti Hamalainen <ccr@tnsp.org>
parents: 488
diff changeset
397 function stConvertCommonDesc($desc, $chent)
488
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
398 {
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
399 $str = "";
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
400 $mode = "";
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
401
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
402 foreach (explode("\n", $desc) as $line)
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
403 {
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
404 if (preg_match("/^\s*\s*\*(.+)$/", $line, $m))
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
405 {
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
406 stConvSwitchMode($str, $mode, "ol");
491
c360fb50221c Add entity handling to stConvertCommonDesc().
Matti Hamalainen <ccr@tnsp.org>
parents: 488
diff changeset
407 $str .= "<li>".($chent ? chentities($m[1]) : $m[1])."</li>\n";
488
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
408 }
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
409 else
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
410 if (preg_match("/^\s*-\s*(.+)$/", $line, $m))
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
411 {
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
412 stConvSwitchMode($str, $mode, "ul");
491
c360fb50221c Add entity handling to stConvertCommonDesc().
Matti Hamalainen <ccr@tnsp.org>
parents: 488
diff changeset
413 $str .= "<li>".($chent ? chentities($m[1]) : $m[1])."</li>\n";
488
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
414 }
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
415 else
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
416 {
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
417 stConvSwitchMode($str, $mode, "p");
491
c360fb50221c Add entity handling to stConvertCommonDesc().
Matti Hamalainen <ccr@tnsp.org>
parents: 488
diff changeset
418 $str .= ($chent ? chentities($line) : $line);
488
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
419 }
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
420 }
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
421
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
422 stConvSwitchMode($str, $mode, "");
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
423
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
424 return $str;
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
425 }
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
426
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
427
511
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
428 function stGetNumberSuffix($val)
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
429 {
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
430 switch ($val)
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
431 {
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
432 case 1: return "st";
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
433 case 2: return "nd";
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
434 case 3: return "rd";
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
435 case 4: case 5: case 6:
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
436 case 7: case 8: case 9: return "th";
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
437 default: return "th";
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
438 }
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
439 }
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
440
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
441
606
3d2b70fbeb78 Slight cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 605
diff changeset
442 function stGetCompoResultsSQL($mode, $compo)
531
ec30ad303bd1 Modularize.
Matti Hamalainen <ccr@tnsp.org>
parents: 528
diff changeset
443 {
623
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
444 //
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
445 // Act based on competition type
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
446 //
640
c78e11aa3162 Rename a database field, so that it does not conflict with AJAX request item
Matti Hamalainen <ccr@tnsp.org>
parents: 637
diff changeset
447 switch ($compo["ctype"])
531
ec30ad303bd1 Modularize.
Matti Hamalainen <ccr@tnsp.org>
parents: 528
diff changeset
448 {
623
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
449 case COMPO_NORMAL:
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
450 //
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
451 // "Normal" competition, where results are somehow
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
452 // based on points / voting.
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
453 //
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
454 switch ($mode)
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
455 {
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
456 case VOTE_FREELY:
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
457 $sql =
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
458 "SELECT entries.*,SUM(votes.value) AS votesum ".
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
459 "FROM entries ".
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
460 "LEFT JOIN votes ON votes.entry_id=entries.id";
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
461 break;
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
462
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
463 case VOTE_ACTIVATE:
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
464 $sql =
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
465 "SELECT entries.*, ".
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
466 "(SELECT SUM(votes.value) FROM votes ".
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
467 "LEFT JOIN votekeys ON votes.key_id=votekeys.id ".
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
468 "WHERE votes.entry_id=entries.id AND votekeys.active<>0) ".
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
469 "AS votesum ".
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
470 "FROM entries";
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
471 break;
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
472
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
473 case VOTE_ASSIGN:
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
474 $sql =
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
475 "SELECT entries.*, ".
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
476 "(SELECT SUM(votes.value) FROM votes ".
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
477 "LEFT JOIN votekeys ON votes.key_id=votekeys.id ".
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
478 "LEFT JOIN attendees ON votekeys.id=attendees.key_id ".
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
479 "WHERE votes.entry_id=entries.id AND attendees.key_id<>0) ".
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
480 "AS votesum ".
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
481 "FROM entries";
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
482 break;
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
483 }
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
484
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
485 $extra =
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
486 "GROUP BY entries.id ".
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
487 "ORDER BY votesum DESC";
531
ec30ad303bd1 Modularize.
Matti Hamalainen <ccr@tnsp.org>
parents: 528
diff changeset
488 break;
ec30ad303bd1 Modularize.
Matti Hamalainen <ccr@tnsp.org>
parents: 528
diff changeset
489
623
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
490 case COMPO_POINTS:
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
491 //
695
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
492 // Points ..
623
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
493 //
724
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
494 $sql = "SELECT entries.*,entries.evalue AS votesum FROM entries";
623
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
495 $extra = "ORDER BY entries.evalue DESC";
531
ec30ad303bd1 Modularize.
Matti Hamalainen <ccr@tnsp.org>
parents: 528
diff changeset
496 break;
695
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
497
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
498 case COMPO_ASSIGN:
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
499 //
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
500 // Ascending
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
501 //
724
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
502 $sql = "SELECT entries.*,entries.evalue AS votesum FROM entries";
695
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
503 $extra = "ORDER BY entries.evalue ASC";
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
504 break;
531
ec30ad303bd1 Modularize.
Matti Hamalainen <ccr@tnsp.org>
parents: 528
diff changeset
505 }
ec30ad303bd1 Modularize.
Matti Hamalainen <ccr@tnsp.org>
parents: 528
diff changeset
506
623
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
507 return $sql." ".
606
3d2b70fbeb78 Slight cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 605
diff changeset
508 "WHERE entries.compo_id=".$compo["id"]." ".
570
27c64c5ad1a8 Remove the now useless stStrKludge() function and its use.
Matti Hamalainen <ccr@tnsp.org>
parents: 568
diff changeset
509 "AND (entries.flags & ".EFLAG_DISQUALIFIED.")=0 ".
623
8e6331d7870d Some work on compo type handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 606
diff changeset
510 $extra;
531
ec30ad303bd1 Modularize.
Matti Hamalainen <ccr@tnsp.org>
parents: 528
diff changeset
511 }
ec30ad303bd1 Modularize.
Matti Hamalainen <ccr@tnsp.org>
parents: 528
diff changeset
512
ec30ad303bd1 Modularize.
Matti Hamalainen <ccr@tnsp.org>
parents: 528
diff changeset
513
724
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
514 function stGetCompoResults()
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
515 {
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
516 $voteKeyMode = stGetSetting("voteKeyMode");
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
517 $out = array();
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
518 $sql = "SELECT * FROM compos WHERE visible<>0 ORDER BY name DESC";
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
519 if (($res = stExecSQL($sql)) === false)
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
520 return $out;
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
521
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
522 // For each compo that has been set visible
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
523 foreach ($res as $compo)
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
524 {
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
525 // Check if there are any entries for it
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
526 $sql =
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
527 "SELECT COUNT(*) FROM entries ".
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
528 "WHERE compo_id=".$compo["id"]." ".
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
529 "AND (entries.flags & ".EFLAG_DISQUALIFIED.")=0";
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
530
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
531 if (($nentries = stFetchSQLColumn($sql)) !== FALSE && $nentries > 0)
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
532 {
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
533 // Get voting results by mode
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
534 $sql = stGetCompoResultsSQL($voteKeyMode, $compo);
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
535
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
536 $out[$compo["id"]] = $compo;
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
537 $out[$compo["id"]]["results"] = array();
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
538 $prev = FALSE;
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
539 $index = 0;
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
540
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
541 foreach (stExecSQL($sql) as $entry)
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
542 {
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
543 if ($entry["votesum"] !== $prev)
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
544 $index++;
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
545
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
546 $entry["position"] = $index;
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
547 $out[$compo["id"]]["results"][] = $entry;
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
548
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
549 $prev = $entry["votesum"];
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
550 }
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
551 }
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
552 }
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
553
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
554 return $out;
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
555 }
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
556
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
557
695
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
558 function stGetCompoResultLine($html, $entry, $points, $showAuthor)
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
559 {
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
560 $name = stStrChopPad($entry["name"], 30);
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
561 $author = stStrChopPad($entry["author"], 30);
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
562
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
563 $out = sprintf(" %s", $html ? chentities($name) : $name);
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
564
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
565 if ($showAuthor)
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
566 $out .= sprintf(" by %s", $html ? chentities($author) : $author);
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
567
698
3f322be347d6 Fix the results display.
Matti Hamalainen <ccr@tnsp.org>
parents: 697
diff changeset
568 if ($points !== FALSE)
695
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
569 $out .= sprintf(" (%d pts)", $points);
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
570
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
571 return $out."\n";
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
572 }
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
573
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
574
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
575 function stGetCompoResultsASCIIStr($html)
511
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
576 {
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
577 $out = "";
724
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
578 foreach (stGetCompoResults() as $compo)
511
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
579 {
724
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
580 // Output compo title / header
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
581 if ($html)
511
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
582 {
724
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
583 $out .=
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
584 "<pre>\n".
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
585 "<b> ".chentities($compo["name"])." </b>\n".
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
586 str_repeat("=", strlen($compo["name"]) + 2)."-- - .\n\n";
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
587 }
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
588 else
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
589 {
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
590 $out .=
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
591 " ".$compo["name"]."\n".
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
592 str_repeat("=", strlen($compo["name"]) + 2)."-- - .\n\n";
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
593 }
511
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
594
724
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
595 // List results for this compo
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
596 $prev = FALSE;
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
597 foreach ($compo["results"] as $entry)
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
598 {
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
599 if ($entry["position"] !== $prev)
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
600 $out .= sprintf("%3d%s.", $entry["position"], stGetNumberSuffix($entry["position"]));
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
601 else
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
602 $out .= " -''-";
511
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
603
724
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
604 $out .= stGetCompoResultLine($html, $entry,
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
605 ($compo["ctype"] != COMPO_ASSIGN) ? $entry["votesum"] : FALSE,
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
606 ($compo["ctype"] != COMPO_NORMAL) ? $compo["show_authors"] : TRUE);
511
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
607
724
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
608 $prev = $entry["position"];
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
609 }
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
610 $out .= "\n\n".($html ? "</pre>\n" : "");
fd84eb4d8b74 Refactor compo results code for modularity.
Matti Hamalainen <ccr@tnsp.org>
parents: 721
diff changeset
611 }
695
dff9b125f774 Work on results printing and remove "show authors" option as it is rather
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
612
511
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
613 return $out;
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
614 }
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
615
6fe66ea0e954 Move most of the results code to site module, remove the support for HTML
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
616
459
Matti Hamalainen <ccr@tnsp.org>
parents: 454
diff changeset
617 function stNormalizeListSlideOrder($list_id)
Matti Hamalainen <ccr@tnsp.org>
parents: 454
diff changeset
618 {
Matti Hamalainen <ccr@tnsp.org>
parents: 454
diff changeset
619 }
Matti Hamalainen <ccr@tnsp.org>
parents: 454
diff changeset
620
488
532cebd9c9f2 Move some functions to site module.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
621
716
e7fbcf4190e6 Add registration host.
Matti Hamalainen <ccr@tnsp.org>
parents: 703
diff changeset
622 function stGetAttendeeRegistrationSQL()
e7fbcf4190e6 Add registration host.
Matti Hamalainen <ccr@tnsp.org>
parents: 703
diff changeset
623 {
e7fbcf4190e6 Add registration host.
Matti Hamalainen <ccr@tnsp.org>
parents: 703
diff changeset
624 return stPrepareSQL(
e7fbcf4190e6 Add registration host.
Matti Hamalainen <ccr@tnsp.org>
parents: 703
diff changeset
625 "INSERT INTO attendees (regtime,name,groups,oneliner,email,reghost) VALUES (%d,%S,%S,%S,%S,%s)",
e7fbcf4190e6 Add registration host.
Matti Hamalainen <ccr@tnsp.org>
parents: 703
diff changeset
626 time(), "name", "groups", "oneliner", "email", $_SERVER["REMOTE_ADDR"]);
e7fbcf4190e6 Add registration host.
Matti Hamalainen <ccr@tnsp.org>
parents: 703
diff changeset
627 }
e7fbcf4190e6 Add registration host.
Matti Hamalainen <ccr@tnsp.org>
parents: 703
diff changeset
628
e7fbcf4190e6 Add registration host.
Matti Hamalainen <ccr@tnsp.org>
parents: 703
diff changeset
629
721
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
630 function stMakePath($isURL, $repExt, $components)
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
631 {
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
632 return implode("/", $components);
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
633 }
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
634
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
635
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
636 function stGetEntryPreviewData($compo, $entry, $probePreview, $fullData)
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
637 {
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
638 $res = array();
742
66e415b69c75 Rename some variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 734
diff changeset
639 $entryPath = stGetSetting("entryPath");
66e415b69c75 Rename some variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 734
diff changeset
640 $previewPath = stGetSetting("previewPath");
66e415b69c75 Rename some variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 734
diff changeset
641 $previewURL = stGetSetting("previewURL");
721
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
642 $thumbDir = stGetSetting("thumbnailSubDir");
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
643
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
644 // Data for the actual entry file
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
645 $res["previewType"] = ($entry["preview_type"] != EPREV_NONE) ? $entry["preview_type"] : $compo["preview_type"];
742
66e415b69c75 Rename some variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 734
diff changeset
646 $res["entryFile"] = stMakePath(FALSE, FALSE, array($entryPath, $compo["cpath"], $entry["filename"]));
721
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
647 if ($fullData)
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
648 {
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
649 $res["entrySize"] = @filesize($res["entryFile"]);
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
650 }
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
651
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
652 // Based on preview type, set some basics
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
653 switch ($res["previewType"])
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
654 {
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
655 case EPREV_IMAGE:
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
656 $res["fileBase"] = stMakePath(FALSE, "_sshot", array($entry["filename"]));
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
657 $res["preferType"] = "PNG";
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
658 $fileTypeList = array(
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
659 "PNG" => array(".png", ".PNG"),
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
660 "GIF" => array(".gif", ".GIF"),
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
661 "JPEG" => array(".jpg", ".JPG"),
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
662 );
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
663 break;
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
664
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
665 case EPREV_AUDIO:
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
666 $res["fileBase"] = stMakePath(FALSE, "_sample", array($entry["filename"]));
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
667 $res["preferType"] = "PNG";
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
668 $fileTypeList = array(
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
669 "MP3" => array(".mp3", ".MP3"),
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
670 "OGG" => array(".ogg", ".OGG", ".oga", ".OGA"),
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
671 );
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
672 break;
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
673
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
674 default:
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
675 return FALSE;
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
676 }
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
677
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
678 // Find the preview file(s)
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
679 foreach ($fileTypeList as $ftype => $fexts)
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
680 {
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
681 foreach ($fexts as $fext)
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
682 {
742
66e415b69c75 Rename some variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 734
diff changeset
683 $filename = stMakePath(FALSE, $fext, array($previewPath, $compo["cpath"], $res["fileBase"]));
721
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
684 if ($probePreview == FALSE || file_exists($filename))
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
685 {
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
686 $res["previewFileType"] = $ftype;
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
687 $res["previewPath"] = $filename;
742
66e415b69c75 Rename some variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 734
diff changeset
688 $res["previewURL"] = stMakePath(TRUE, $fext, array($previewURL, $compo["cpath"], $res["fileBase"]));
721
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
689
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
690 if ($res["previewType"] == EPREV_IMAGE)
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
691 {
742
66e415b69c75 Rename some variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 734
diff changeset
692 $res["thumbPath"] = stMakePath(TRUE, $fext, array($previewPath, $compo["cpath"], $thumbDir, $res["fileBase"]));
66e415b69c75 Rename some variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 734
diff changeset
693 $res["thumbURL"] = stMakePath(TRUE, $fext, array($previewURL, $compo["cpath"], $thumbDir, $res["fileBase"]));
721
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
694 }
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
695
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
696 if ($fullData)
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
697 {
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
698 $res["previewSize"] = @filesize($res["previewPath"]);
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
699 $res["thumbSize"] = @filesize($res["thumbPath"]);
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
700 }
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
701
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
702 return $res;
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
703 }
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
704 }
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
705 }
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
706
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
707 return FALSE;
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
708 }
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
709
69a829f687a9 Preliminary work for entry previews.
Matti Hamalainen <ccr@tnsp.org>
parents: 716
diff changeset
710
585
cec36fd24d21 Clean up the menu and HTML somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
711 // Get link helper function
cec36fd24d21 Clean up the menu and HTML somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
712 function stGetMainPageLink($id, $name, $show = TRUE)
cec36fd24d21 Clean up the menu and HTML somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
713 {
699
9a948144dcc9 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 698
diff changeset
714 global $pageName;
585
cec36fd24d21 Clean up the menu and HTML somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
715 if ($show)
699
9a948144dcc9 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 698
diff changeset
716 return " <a class=\"".($id == $pageName ? "active" : "inactive")."\" href=\"".$id."\">".$name."</a>\n";
585
cec36fd24d21 Clean up the menu and HTML somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
717 else
cec36fd24d21 Clean up the menu and HTML somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
718 return "";
cec36fd24d21 Clean up the menu and HTML somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
719 }
cec36fd24d21 Clean up the menu and HTML somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
720
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
721 ?>