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.
| 1. / 2. / ...
<?php
// ClanSphere 2008 - www.clansphere.net
// $Id: create.php 2007-08-01 17:00:00Z Drag0n $
$cs_lang = cs_translate('shoutbox');
$captcha = extension_loaded('gd') ? 1 : 0;
if(isset($_POST['submit'])) {
$opt = cs_sql_option(__FILE__,'shoutbox');
$cs_shout['shoutbox_ip'] = $_SERVER['REMOTE_ADDR'];
$cs_shout['shoutbox_name'] = trim($_POST['sh_nick']);
// edit by kangoo - START
//$cs_shout['shoutbox_text'] = !empty($_POST['sh_text']) ? $_POST['sh_text'] : '' ;
function BadwordFilter($check_Badwords)
{
$Badwords = array("arsch", "kack", "idiot", "wichser", "piss", "fuck", "viagra");
foreach($Badwords as $Badword)
{
$check_Badwords = str_replace($Badword, str_repeat("*", strlen($Badword)), $check_Badwords);
}
return $check_Badwords;
}
$check_Badwords =!empty($_POST['sh_text']) ? $_POST['sh_text'] : '' ;
$check_Badwords = BadwordFilter($check_Badwords);
$cs_shout['shoutbox_text'] = $check_Badwords;
// edit by kangoo - ENDE
$cs_shout['shoutbox_date'] = cs_time();
$uri = empty($_POST['uri']) ? '' : cs_secure($_POST['uri']);
if(!empty($_POST['sh_text2'])) {
$cs_shout['shoutbox_text'] = $_POST['sh_text2'];
}
$error = '';
if($cs_shout['shoutbox_name'] == 'Nick' OR empty($cs_shout['shoutbox_name'])) {
$error .= cs_html_br(1) . '- ' . $cs_lang['no_name'];
$cs_shout['shoutbox_name'] = '';
}
if(empty($cs_shout['shoutbox_text'])) {
$error .= cs_html_br(1) . ' ' . $cs_lang['no_text'];
}
if(strlen($cs_shout['shoutbox_text']) > $opt['max_text']) {
$signs = strlen($cs_shout['shoutbox_text']) - $opt['max_text'];
$error .= cs_html_br(1) . '- ' . sprintf($cs_lang['too_long'],$signs);
}
if(empty($account['users_id']) && !cs_captchacheck($_POST['captcha'],1)) {
$error .= cs_html_br(1) . ' ' . $cs_lang['captcha_false'] . cs_html_br(1);
}
$cond = 'shoutbox_ip = \'' . cs_sql_escape($cs_shout['shoutbox_ip']) . '\'';
$flood = cs_sql_select(__FILE__,'shoutbox','shoutbox_date',$cond,'shoutbox_date DESC');
$maxtime = $flood['shoutbox_date'] + $cs_main['def_flood'];
if($maxtime > cs_time()) {
$diff = $maxtime - cs_time();
$error .= cs_html_br(1) . '- ' . sprintf($cs_lang['flood'],$diff);
}
if(empty($account['users_id']) || $cs_shout['shoutbox_name'] != $account['users_nick']) {
$nick_valid = cs_sql_count(__FILE__,'users','users_nick = \''.$cs_shout['shoutbox_name'].'\'');
if(!empty($nick_valid)) {
$error .= cs_html_br(1) . '- ' . $cs_lang['user_exists'];
}
}
if(!empty($error)) {
$data['lang']['body'] = $cs_lang['errors'] . ' ' . $error;
$data['form']['url'] = cs_url('shoutbox','create');
$data['form']['name'] = $cs_shout['shoutbox_name'];
$data['form']['message'] = $cs_shout['shoutbox_text'];
if(!empty($captcha) && empty($account['users_id'])) {
$data['form']['captcha'] = cs_html_img('mods/captcha/generate.php?mini');
$data['form']['show'] = cs_subtemplate(__FILE__,$data,'shoutbox','captcha');
}
else {
$data['form']['show'] = '';
}
echo cs_subtemplate(__FILE__,$data,'shoutbox','create');
}
else {
$cells = array_keys($cs_shout);
$values = array_values($cs_shout);
cs_sql_insert(__FILE__,'shoutbox',$cells,$values);
if(!empty($_POST['uri'])) {
$data['shoutbox']['done'] = cs_html_link( cs_secure($_POST['uri']), $cs_lang['continue'],0);
}
echo cs_subtemplate(__FILE__,$data,'shoutbox','submit');
}
}
else {
$data['shoutbox']['no_submit'] = $cs_lang['no_submit'];
echo cs_subtemplate(__FILE__,$data,'shoutbox','no_submit');
}
?> |