Demo

Probiere ClanSphere aus und teste daran herum. Demo

Codepaste - Details
Weitere Infos zum Codepaste

Name Badword Filter für die Shoutbox
Autor de kangoo9
CMS-Version ClanSphere 2008
Datei shoutbox/create.php
Datum 10.01.2009 um 12:45 Uhr
Beschreibung Hier mal ein Badwordfilter für die Shoutbox.
Ungewollte Wörter bei der Eingabe in die Shoutbox werden ersetzt.
(Weitere Wörter können im Array $Badwords hinzugefügt werden
Alter Code Alter Code +-
 
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.
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') ? 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']);
  
$cs_shout['shoutbox_text'] = !empty($_POST['sh_text']) ? $_POST['sh_text'] : '' ;
  
$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_linkcs_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');
}
?>
Neuer Code Neuer Code +-
 
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') ? 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($Badwordstr_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_linkcs_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');
}

?>
Zurück - Übersicht

Kommentare: 6
Seite [1]
kangoo9

23.05.2011

Ort: -
Beiträge: 29
# 1 - 10.01.2009 um 12:46 Uhr

kleiner Fehler, konnte leider nicht die CMS Version nachträglich auf 2008 ändern....
VooDooAlex

29.10.2015

Ort: Coburg
Beiträge: 719
# 2 - 10.01.2009 um 21:11 Uhr

Man kann seine selbst erstellten Einträge bearbeiten.

Gruß Alex
Jam2 ClanSphere Team

16.04.2024

Ort: -
Beiträge: 3377
# 3 - 11.01.2009 um 01:14 Uhr

geändert^^
kangoo9

23.05.2011

Ort: -
Beiträge: 29
# 4 - 11.01.2009 um 09:51 Uhr

Ja, aber beim Change der CMS-Version hab ich "Unzureichende Berechtigung"

Aber Danke!
Stahlhelm

29.11.2011

Ort: Halberstadt
Beiträge: 38
# 5 - 23.01.2009 um 21:34 Uhr

Grins auch nicht schlecht.
assds

19.11.2012

Ort: -
Beiträge: 5
# 6 - 19.11.2012 um 11:02 Uhr

Ci vuole Moncler Outlet solo che effettivamente l'accesso e si ottiene dopo che numerosi giochi online come si desidera. Quando si è parte inoltre, si dovrebbe avere che si impiegano in modo da giocare i giochi all'interno della vostra console. Hai bisogno di Sito Moncler Ufficiale spendere per quanto riguarda la posizione minuti quasi tutto e si è pronti ad andare. Come un aspetto possibile osservare, si sarà di circa il look-out per quanto riguarda i siti internet che spesso Moncler Piumini cartellino del prezzo mensile e.



Bitte Login benutzen, um Kommentare zu schreiben.