SPAM.. Coppermine Photo Gallery
Ik gebruik Coppermine Photo Gallery daar kunnen de mensen die ook niet ingelogd zijn een foto door sturen naar vrienden...
Mijn probleem is dat ik nu spam krijg....(er worden automatisch e-card gestuurd...SPAM denk ik)
Ik dacht wie een e-card wil sturen (niet ingelogde leden) dat ze dan een code van een plaatje kunnen over typpen.. dat is tegen spam dacht ik...Vb: gelijk dat bij rapidshare is...
Kunnen jullie mij helpen bij deze script te vinden of denk jullie aan een andere script...?
Danku wel
google -> capcha script (of scriptlib natuurlijk)
---------ecard.php---------
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
<?php
/*************************
Coppermine Photo Gallery
************************
Copyright (c) 2003-2006 Coppermine Dev Team
v1.1 originally written by Gregory DEMAR
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
********************************************
Coppermine version: 1.4.5
$Source: /cvsroot/coppermine/stable/ecard.php,v $
$Revision: 1.21 $
$Author: gaugau $
$Date: 2006/03/02 08:17:40 $
**********************************************/
define('IN_COPPERMINE', true);
define('ECARDS_PHP', true);
require('include/init.inc.php');
require('include/smilies.inc.php');
require('include/mailer.inc.php');
if (!USER_CAN_SEND_ECARDS) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
//print_r(get_defined_constants());
function get_post_var($name, $default = '')
{
return isset($_POST[$name]) ? $_POST[$name] : $default;
}
$pid = (int)$_GET['pid'];
$album = $_GET['album'];
$pos = (int)$_GET['pos'];
$sender_name = get_post_var('sender_name', USER_NAME ? USER_NAME : (isset($USER['name']) ? $USER['name'] : ''));
if (defined('UDB_INTEGRATION')AND USER_ID) $USER_DATA = array_merge($USER_DATA,$cpg_udb->get_user_infos(USER_ID));
if ($USER_DATA['user_email']){
$sender_email = $USER_DATA['user_email'];
$sender_box = $sender_email;
} else {
$sender_email = get_post_var('sender_email',$USER['email'] ? $USER['email'] : '');
$sender_box = "<input type=\"text\" class=\"textinput\" value=\"$sender_email\" name=\"sender_email\" style=\"width: 100%;\" />";
}
$recipient_name = get_post_var('recipient_name');
$recipient_email = get_post_var('recipient_email');
$greetings = get_post_var('greetings');
$message = get_post_var('message');
$sender_email_warning = '';
$recipient_email_warning = '';
// Get picture thumbnail url
$result = cpg_db_query("SELECT * from {$CONFIG['TABLE_PICTURES']} WHERE pid='$pid' $ALBUM_SET");
if (!mysql_num_rows($result)) cpg_die(ERROR, $lang_errors['non_exist_ap'], __FILE__, __LINE__);
$row = mysql_fetch_array($result);
$thumb_pic_url = get_pic_url($row, 'thumb');
$pic_title = $row['title'];
$pic_caption = bb_decode($row['caption']);
if (!is_image($row['filename'])) cpg_die(ERROR, $lang_ecard_php['error_not_image'], __FILE__, __LINE__);
// Check supplied email address
$valid_email_pattern = "^[_\.0-9a-z\-]+@([0-9a-z][0-9a-z-]*\.)+[a-z]{2,6}$";
$valid_sender_email = eregi($valid_email_pattern, $sender_email);
$valid_recipient_email = eregi($valid_email_pattern, $recipient_email);
$invalid_email = '<font size="1">' . $lang_ecard_php['invalid_email'] . ' (' . $recipient_email . ')</font>';
if (!$valid_sender_email && count($_POST) > 0) $sender_email_warning = $invalid_email;
if (!$valid_recipient_email && count($_POST) > 0) $recipient_email_warning = $invalid_email;
pageheader($lang_ecard_php['title']);
if (isset($_POST['submit'])) {
// Create and send the e-card
if (count($_POST) > 0 && $valid_sender_email && $valid_recipient_email) {
$gallery_url_prefix = $CONFIG['ecards_more_pic_target']. (substr($CONFIG['ecards_more_pic_target'], -1) == '/' ? '' : '/');
if ($CONFIG['make_intermediate'] && max($row['pwidth'], $row['pheight']) > $CONFIG['picture_width']) {
$n_picname = get_pic_url($row, 'normal');
} else {
$n_picname = get_pic_url($row, 'fullsize');
}
if (!stristr($n_picname, 'http:')) $n_picname = $gallery_url_prefix . $n_picname;
$msg_content = process_smilies($message, $gallery_url_prefix);
$data = array('rn' => $_POST['recipient_name'],
'sn' => $_POST['sender_name'],
'se' => $sender_email,
'p' => $n_picname,
'g' => $greetings,
'm' => $message,
'pid' => $pid,
'pt' => $pic_title,
'pc' => $pic_caption,
);
$encoded_data = urlencode(base64_encode(serialize($data)));
$params = array('{LANG_DIR}' => $lang_text_dir,
'{TITLE}' => sprintf($lang_ecard_php['ecard_title'], $sender_name),
'{CHARSET}' => $CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['charset'],
'{VIEW_ECARD_TGT}' => "{$gallery_url_prefix}displayecard.php?data=$encoded_data",
'{VIEW_ECARD_LNK}' => $lang_ecard_php['view_ecard'],
'{VIEW_ECARD_LNK_PLAINTEXT}' => $lang_ecard_php['view_ecard_plaintext'],
'{PIC_URL}' => $n_picname,
'{URL_PREFIX}' => $gallery_url_prefix,
'{GREETINGS}' => $greetings,
'{MESSAGE}' => bb_decode($msg_content),
'{PLAINTEXT_MESSAGE}' => $message,
'{SENDER_EMAIL}' => $sender_email,
'{SENDER_NAME}' => $sender_name,
'{VIEW_MORE_TGT}' => $CONFIG['ecards_more_pic_target'],
'{VIEW_MORE_LNK}' => $lang_ecard_php['view_more_pics'],
'{PID}' => $pid,
'{PIC_TITLE}' => $pic_title,
'{PIC_CAPTION}' => $pic_caption,
);
$message = template_eval($template_ecard, $params);
$plaintext_message = template_eval($template_ecard_plaintext, $params);
$tempTime = time();
$message .= sprintf($lang_ecard_php['ecards_footer'], $sender_name, $_SERVER['REMOTE_ADDR'], localised_date(-1,$comment_date_fmt));
$subject = sprintf($lang_ecard_php['ecard_title'], $sender_name);
$result = cpg_mail($recipient_email, $subject, $message, 'text/html', $sender_name, $sender_email, $plaintext_message);
//write ecard log
if ($CONFIG['log_ecards'] == 1) {
$result_log = cpg_db_query("INSERT INTO {$CONFIG['TABLE_ECARDS']} (sender_name, sender_email, recipient_name, recipient_email, link, date, sender_ip) VALUES ('$sender_name', '$sender_email', '$recipient_name', '$recipient_email', '$encoded_data', '$tempTime', '{$_SERVER["REMOTE_ADDR"]}')");
}
if (!USER_ID) {
$USER['name'] = $sender_name;
$USER['email'] = $sender_email;
}
if ($result) {
//pageheader($lang_ecard_php['title']);
msg_box($lang_cpg_die[INFORMATION], $lang_ecard_php['send_success'], $lang_continue, "displayimage.php?album=$album&pos=$pos");
echo '<br />';
starttable('100%', $lang_ecard_php['preview']);
echo '<tr><td>';
echo template_eval($template_ecard, $params);
echo '</td></tr>';
endtable();
pagefooter();
ob_end_flush();
exit;
} else {
cpg_die(ERROR, $lang_ecard_php['send_failed'], __FILE__, __LINE__);
}
}
}//submit
elseif (isset($_POST['preview'])) {
if ($CONFIG['make_intermediate'] && max($row['pwidth'], $row['pheight']) > $CONFIG['picture_width']) {
$n_picname = get_pic_url($row, 'normal');
} else {
$n_picname = get_pic_url($row, 'fullsize');
}
if (!stristr($n_picname, 'http:')) $n_picname = $gallery_url_prefix . $n_picname;
$msg_content = process_smilies($message, $gallery_url_prefix);
$data = array(
'sn' => $_POST['sender_name'],
'se' => $sender_email,
'p' => $n_picname,
'g' => $greetings,
'm' => $message,
'pid' => $pid,
'pt' => $pic_title,
'pc' => $pic_caption,
);
$params = array('{LANG_DIR}' => $lang_text_dir,
'{TITLE}' => sprintf($lang_ecard_php['ecard_title'], $sender_name),
'{CHARSET}' => $CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['charset'],
'{VIEW_ECARD_TGT}' => "{$gallery_url_prefix}displayecard.php?data=$encoded_data",
'{VIEW_ECARD_LNK}' => $lang_ecard_php['preview_view_ecard'],
'{PIC_URL}' => $n_picname,
'{URL_PREFIX}' => $gallery_url_prefix,
'{GREETINGS}' => $greetings,
'{MESSAGE}' => bb_decode($msg_content),
'{SENDER_EMAIL}' => $sender_email,
'{SENDER_NAME}' => $sender_name,
'{VIEW_MORE_TGT}' => $CONFIG['ecards_more_pic_target'],
'{VIEW_MORE_LNK}' => $lang_ecard_php['view_more_pics'],
'{PID}' => $pid,
'{PIC_TITLE}' => $pic_title,
'{PIC_CAPTION}' => $pic_caption,
);
starttable('100%', $lang_ecard_php['preview']);
echo '<tr><td>';
echo template_eval($template_ecard, $params);
echo '</td></tr>';
endtable();
echo '<br />';
}//preview
//pageheader($lang_ecard_php['title']);
//ecard form
if ($CONFIG['show_bbcode_help']) {$captionLabel = ' '. cpg_display_help('f=index.html&base=64&h='.urlencode(base64_encode(serialize($lang_bbcode_help_title))).'&t='.urlencode(base64_encode(serialize($lang_bbcode_help))),470,245);}
starttable("100%", $lang_ecard_php['title'], 3);
echo <<<EOT
<tr>
<td class="tableh2" colspan="2"><b>{$lang_ecard_php['from']}</b></td>
<td rowspan="6" align="center" valign="top" class="tableb">
<a href="displayimage.php?pos=-{$pid}">
<img src="$thumb_pic_url" alt="" vspace="8" border="0" class="image" /></a><br />
</td>
</tr>
<tr>
<td class="tableb" valign="top" width="40%">
<form method="post" name="post" action="{$_SERVER['PHP_SELF']}?album=$album&pid=$pid&pos=$pos">
{$lang_ecard_php['your_name']}<br />
</td>
<td valign="top" class="tableb" width="60%">
<input type="text" class="textinput" name="sender_name" value="$sender_name" style="width: 100%;" /><br />
</td>
</tr>
<tr>
<td class="tableb" valign="top" width="40%">
{$lang_ecard_php['your_email']}<br />
</td>
<td valign="top" class="tableb" width="60%">
{$sender_box}
{$sender_email_warning}
</td>
</tr>
<tr>
<td class="tableh2" colspan="2"><b>{$lang_ecard_php['to']}</b></td>
</tr>
<tr>
<td class="tableb" valign="top" width="40%">
{$lang_ecard_php['rcpt_name']}<br />
</td>
<td valign="top" class="tableb" width="60%">
<input type="text" class="textinput" name="recipient_name" value="$recipient_name" style="width: 100%;" /><br />
</td>
</tr>
<tr>
<td class="tableb" valign="top" width="40%">
{$lang_ecard_php['rcpt_email']}<br />
</td>
<td valign="top" class="tableb" width="60%">
<input type="text" class="textinput" name="recipient_email" value="$recipient_email" style="width: 100%;" /><br />
$recipient_email_warning
</td>
</tr>
<tr>
<td class="tableh2" colspan="3"><b>{$lang_ecard_php['greetings']}</b></td>
</tr>
<tr>
<td class="tableb" colspan="3">
<input type="text" class="textinput" name="greetings" value="$greetings" style="width: 100%;" /><br />
</td>
</tr>
<tr>
<td class="tableh2" colspan="3"><b>{$lang_ecard_php['message']}$captionLabel</b></td>
</tr>
<tr>
<td class="tableb" colspan="3" valign="top"><br />
<textarea name="message" class="textinput" rows="8" cols="40" onselect="storeCaret_post(this);" onclick="storeCaret_post(this);" onkeyup="storeCaret_post(this);" style="width: 100%;">$message</textarea><br /><br />
</td>
</tr>
<tr>
<td class="tableb" colspan="3" valign="top">
EOT;
echo generate_smilies();
echo <<<EOT
</td>
</tr>
<tr>
<td colspan="3" align="center" class="tablef">
<input type="submit" class="button" name="preview" title="{$lang_ecard_php['preview_button']}" value="{$lang_ecard_php['preview_button']}" />
<form method="post" action="write.php">
<input class="input" type="text" name="norobot">
<img src="captcha.php"><input type="submit" name="submit" value="Toevoegen" />
</form>
</td>
</tr>
EOT;
endtable();
pagefooter();
ob_end_flush();
?>
/*************************
Coppermine Photo Gallery
************************
Copyright (c) 2003-2006 Coppermine Dev Team
v1.1 originally written by Gregory DEMAR
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
********************************************
Coppermine version: 1.4.5
$Source: /cvsroot/coppermine/stable/ecard.php,v $
$Revision: 1.21 $
$Author: gaugau $
$Date: 2006/03/02 08:17:40 $
**********************************************/
define('IN_COPPERMINE', true);
define('ECARDS_PHP', true);
require('include/init.inc.php');
require('include/smilies.inc.php');
require('include/mailer.inc.php');
if (!USER_CAN_SEND_ECARDS) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
//print_r(get_defined_constants());
function get_post_var($name, $default = '')
{
return isset($_POST[$name]) ? $_POST[$name] : $default;
}
$pid = (int)$_GET['pid'];
$album = $_GET['album'];
$pos = (int)$_GET['pos'];
$sender_name = get_post_var('sender_name', USER_NAME ? USER_NAME : (isset($USER['name']) ? $USER['name'] : ''));
if (defined('UDB_INTEGRATION')AND USER_ID) $USER_DATA = array_merge($USER_DATA,$cpg_udb->get_user_infos(USER_ID));
if ($USER_DATA['user_email']){
$sender_email = $USER_DATA['user_email'];
$sender_box = $sender_email;
} else {
$sender_email = get_post_var('sender_email',$USER['email'] ? $USER['email'] : '');
$sender_box = "<input type=\"text\" class=\"textinput\" value=\"$sender_email\" name=\"sender_email\" style=\"width: 100%;\" />";
}
$recipient_name = get_post_var('recipient_name');
$recipient_email = get_post_var('recipient_email');
$greetings = get_post_var('greetings');
$message = get_post_var('message');
$sender_email_warning = '';
$recipient_email_warning = '';
// Get picture thumbnail url
$result = cpg_db_query("SELECT * from {$CONFIG['TABLE_PICTURES']} WHERE pid='$pid' $ALBUM_SET");
if (!mysql_num_rows($result)) cpg_die(ERROR, $lang_errors['non_exist_ap'], __FILE__, __LINE__);
$row = mysql_fetch_array($result);
$thumb_pic_url = get_pic_url($row, 'thumb');
$pic_title = $row['title'];
$pic_caption = bb_decode($row['caption']);
if (!is_image($row['filename'])) cpg_die(ERROR, $lang_ecard_php['error_not_image'], __FILE__, __LINE__);
// Check supplied email address
$valid_email_pattern = "^[_\.0-9a-z\-]+@([0-9a-z][0-9a-z-]*\.)+[a-z]{2,6}$";
$valid_sender_email = eregi($valid_email_pattern, $sender_email);
$valid_recipient_email = eregi($valid_email_pattern, $recipient_email);
$invalid_email = '<font size="1">' . $lang_ecard_php['invalid_email'] . ' (' . $recipient_email . ')</font>';
if (!$valid_sender_email && count($_POST) > 0) $sender_email_warning = $invalid_email;
if (!$valid_recipient_email && count($_POST) > 0) $recipient_email_warning = $invalid_email;
pageheader($lang_ecard_php['title']);
if (isset($_POST['submit'])) {
// Create and send the e-card
if (count($_POST) > 0 && $valid_sender_email && $valid_recipient_email) {
$gallery_url_prefix = $CONFIG['ecards_more_pic_target']. (substr($CONFIG['ecards_more_pic_target'], -1) == '/' ? '' : '/');
if ($CONFIG['make_intermediate'] && max($row['pwidth'], $row['pheight']) > $CONFIG['picture_width']) {
$n_picname = get_pic_url($row, 'normal');
} else {
$n_picname = get_pic_url($row, 'fullsize');
}
if (!stristr($n_picname, 'http:')) $n_picname = $gallery_url_prefix . $n_picname;
$msg_content = process_smilies($message, $gallery_url_prefix);
$data = array('rn' => $_POST['recipient_name'],
'sn' => $_POST['sender_name'],
'se' => $sender_email,
'p' => $n_picname,
'g' => $greetings,
'm' => $message,
'pid' => $pid,
'pt' => $pic_title,
'pc' => $pic_caption,
);
$encoded_data = urlencode(base64_encode(serialize($data)));
$params = array('{LANG_DIR}' => $lang_text_dir,
'{TITLE}' => sprintf($lang_ecard_php['ecard_title'], $sender_name),
'{CHARSET}' => $CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['charset'],
'{VIEW_ECARD_TGT}' => "{$gallery_url_prefix}displayecard.php?data=$encoded_data",
'{VIEW_ECARD_LNK}' => $lang_ecard_php['view_ecard'],
'{VIEW_ECARD_LNK_PLAINTEXT}' => $lang_ecard_php['view_ecard_plaintext'],
'{PIC_URL}' => $n_picname,
'{URL_PREFIX}' => $gallery_url_prefix,
'{GREETINGS}' => $greetings,
'{MESSAGE}' => bb_decode($msg_content),
'{PLAINTEXT_MESSAGE}' => $message,
'{SENDER_EMAIL}' => $sender_email,
'{SENDER_NAME}' => $sender_name,
'{VIEW_MORE_TGT}' => $CONFIG['ecards_more_pic_target'],
'{VIEW_MORE_LNK}' => $lang_ecard_php['view_more_pics'],
'{PID}' => $pid,
'{PIC_TITLE}' => $pic_title,
'{PIC_CAPTION}' => $pic_caption,
);
$message = template_eval($template_ecard, $params);
$plaintext_message = template_eval($template_ecard_plaintext, $params);
$tempTime = time();
$message .= sprintf($lang_ecard_php['ecards_footer'], $sender_name, $_SERVER['REMOTE_ADDR'], localised_date(-1,$comment_date_fmt));
$subject = sprintf($lang_ecard_php['ecard_title'], $sender_name);
$result = cpg_mail($recipient_email, $subject, $message, 'text/html', $sender_name, $sender_email, $plaintext_message);
//write ecard log
if ($CONFIG['log_ecards'] == 1) {
$result_log = cpg_db_query("INSERT INTO {$CONFIG['TABLE_ECARDS']} (sender_name, sender_email, recipient_name, recipient_email, link, date, sender_ip) VALUES ('$sender_name', '$sender_email', '$recipient_name', '$recipient_email', '$encoded_data', '$tempTime', '{$_SERVER["REMOTE_ADDR"]}')");
}
if (!USER_ID) {
$USER['name'] = $sender_name;
$USER['email'] = $sender_email;
}
if ($result) {
//pageheader($lang_ecard_php['title']);
msg_box($lang_cpg_die[INFORMATION], $lang_ecard_php['send_success'], $lang_continue, "displayimage.php?album=$album&pos=$pos");
echo '<br />';
starttable('100%', $lang_ecard_php['preview']);
echo '<tr><td>';
echo template_eval($template_ecard, $params);
echo '</td></tr>';
endtable();
pagefooter();
ob_end_flush();
exit;
} else {
cpg_die(ERROR, $lang_ecard_php['send_failed'], __FILE__, __LINE__);
}
}
}//submit
elseif (isset($_POST['preview'])) {
if ($CONFIG['make_intermediate'] && max($row['pwidth'], $row['pheight']) > $CONFIG['picture_width']) {
$n_picname = get_pic_url($row, 'normal');
} else {
$n_picname = get_pic_url($row, 'fullsize');
}
if (!stristr($n_picname, 'http:')) $n_picname = $gallery_url_prefix . $n_picname;
$msg_content = process_smilies($message, $gallery_url_prefix);
$data = array(
'sn' => $_POST['sender_name'],
'se' => $sender_email,
'p' => $n_picname,
'g' => $greetings,
'm' => $message,
'pid' => $pid,
'pt' => $pic_title,
'pc' => $pic_caption,
);
$params = array('{LANG_DIR}' => $lang_text_dir,
'{TITLE}' => sprintf($lang_ecard_php['ecard_title'], $sender_name),
'{CHARSET}' => $CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['charset'],
'{VIEW_ECARD_TGT}' => "{$gallery_url_prefix}displayecard.php?data=$encoded_data",
'{VIEW_ECARD_LNK}' => $lang_ecard_php['preview_view_ecard'],
'{PIC_URL}' => $n_picname,
'{URL_PREFIX}' => $gallery_url_prefix,
'{GREETINGS}' => $greetings,
'{MESSAGE}' => bb_decode($msg_content),
'{SENDER_EMAIL}' => $sender_email,
'{SENDER_NAME}' => $sender_name,
'{VIEW_MORE_TGT}' => $CONFIG['ecards_more_pic_target'],
'{VIEW_MORE_LNK}' => $lang_ecard_php['view_more_pics'],
'{PID}' => $pid,
'{PIC_TITLE}' => $pic_title,
'{PIC_CAPTION}' => $pic_caption,
);
starttable('100%', $lang_ecard_php['preview']);
echo '<tr><td>';
echo template_eval($template_ecard, $params);
echo '</td></tr>';
endtable();
echo '<br />';
}//preview
//pageheader($lang_ecard_php['title']);
//ecard form
if ($CONFIG['show_bbcode_help']) {$captionLabel = ' '. cpg_display_help('f=index.html&base=64&h='.urlencode(base64_encode(serialize($lang_bbcode_help_title))).'&t='.urlencode(base64_encode(serialize($lang_bbcode_help))),470,245);}
starttable("100%", $lang_ecard_php['title'], 3);
echo <<<EOT
<tr>
<td class="tableh2" colspan="2"><b>{$lang_ecard_php['from']}</b></td>
<td rowspan="6" align="center" valign="top" class="tableb">
<a href="displayimage.php?pos=-{$pid}">
<img src="$thumb_pic_url" alt="" vspace="8" border="0" class="image" /></a><br />
</td>
</tr>
<tr>
<td class="tableb" valign="top" width="40%">
<form method="post" name="post" action="{$_SERVER['PHP_SELF']}?album=$album&pid=$pid&pos=$pos">
{$lang_ecard_php['your_name']}<br />
</td>
<td valign="top" class="tableb" width="60%">
<input type="text" class="textinput" name="sender_name" value="$sender_name" style="width: 100%;" /><br />
</td>
</tr>
<tr>
<td class="tableb" valign="top" width="40%">
{$lang_ecard_php['your_email']}<br />
</td>
<td valign="top" class="tableb" width="60%">
{$sender_box}
{$sender_email_warning}
</td>
</tr>
<tr>
<td class="tableh2" colspan="2"><b>{$lang_ecard_php['to']}</b></td>
</tr>
<tr>
<td class="tableb" valign="top" width="40%">
{$lang_ecard_php['rcpt_name']}<br />
</td>
<td valign="top" class="tableb" width="60%">
<input type="text" class="textinput" name="recipient_name" value="$recipient_name" style="width: 100%;" /><br />
</td>
</tr>
<tr>
<td class="tableb" valign="top" width="40%">
{$lang_ecard_php['rcpt_email']}<br />
</td>
<td valign="top" class="tableb" width="60%">
<input type="text" class="textinput" name="recipient_email" value="$recipient_email" style="width: 100%;" /><br />
$recipient_email_warning
</td>
</tr>
<tr>
<td class="tableh2" colspan="3"><b>{$lang_ecard_php['greetings']}</b></td>
</tr>
<tr>
<td class="tableb" colspan="3">
<input type="text" class="textinput" name="greetings" value="$greetings" style="width: 100%;" /><br />
</td>
</tr>
<tr>
<td class="tableh2" colspan="3"><b>{$lang_ecard_php['message']}$captionLabel</b></td>
</tr>
<tr>
<td class="tableb" colspan="3" valign="top"><br />
<textarea name="message" class="textinput" rows="8" cols="40" onselect="storeCaret_post(this);" onclick="storeCaret_post(this);" onkeyup="storeCaret_post(this);" style="width: 100%;">$message</textarea><br /><br />
</td>
</tr>
<tr>
<td class="tableb" colspan="3" valign="top">
EOT;
echo generate_smilies();
echo <<<EOT
</td>
</tr>
<tr>
<td colspan="3" align="center" class="tablef">
<input type="submit" class="button" name="preview" title="{$lang_ecard_php['preview_button']}" value="{$lang_ecard_php['preview_button']}" />
<form method="post" action="write.php">
<input class="input" type="text" name="norobot">
<img src="captcha.php"><input type="submit" name="submit" value="Toevoegen" />
</form>
</td>
</tr>
EOT;
endtable();
pagefooter();
ob_end_flush();
?>
--------ecard.php--------
--------captcha.php--------
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
// het random nr. aanmaken en gecodeerd opslaan in php sessie
session_start();
$randomnr = rand(1000, 9999);
$_SESSION['randomnr2'] = md5($randomnr);
// captcha plaatje met nummer maken - afmetingen kun je aanpassen gebruikte font
$im = imagecreatetruecolor(200, 50);
// Kleurenbepaling
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
// zwarte rechthoek tekenen - afmetingen kun je aanpassen aan verschillende fonts
imagefilledrectangle($im, 0, 0, 200, 35, $black);
// hier - font.ttf' vervangen met de locatie van je eigen font bestand
$font = 'font.ttf';
// schaduw toevoegen
imagettftext($im, 35, 0, 22, 24, $grey, $font, $randomnr);
// randomnr. toevoegen
imagettftext($im, 35, 0, 15, 26, $white, $font, $randomnr);
// voorkomen dat afbeelding ge-cached wordt
header("Expires: Wed, 1 Jan 1997 00:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
// plaatje verzenden naar browser
header ("Content-type: image/gif");
imagegif($im);
imagedestroy($im);
?>
// het random nr. aanmaken en gecodeerd opslaan in php sessie
session_start();
$randomnr = rand(1000, 9999);
$_SESSION['randomnr2'] = md5($randomnr);
// captcha plaatje met nummer maken - afmetingen kun je aanpassen gebruikte font
$im = imagecreatetruecolor(200, 50);
// Kleurenbepaling
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
// zwarte rechthoek tekenen - afmetingen kun je aanpassen aan verschillende fonts
imagefilledrectangle($im, 0, 0, 200, 35, $black);
// hier - font.ttf' vervangen met de locatie van je eigen font bestand
$font = 'font.ttf';
// schaduw toevoegen
imagettftext($im, 35, 0, 22, 24, $grey, $font, $randomnr);
// randomnr. toevoegen
imagettftext($im, 35, 0, 15, 26, $white, $font, $randomnr);
// voorkomen dat afbeelding ge-cached wordt
header("Expires: Wed, 1 Jan 1997 00:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
// plaatje verzenden naar browser
header ("Content-type: image/gif");
imagegif($im);
imagedestroy($im);
?>
--------captcha.php--------
--------write.php--------
Code (php)
--------write.php--------
Waar zou de fout zijn...
Ik kan dus nog altijd fotos sturen zonder dat ik de code moet intyppen....
Danku