ilch Forum » Ilch Clan 1.1 » Allgemein » shoutbox

Geschlossen
  1. #1
    User Pic
    pidy01013 Mitglied
    Registriert seit
    15.03.2006
    Beiträge
    17
    Beitragswertungen
    0 Beitragspunkte
    Hi,

    wie kann ich die Shoutbox einstllen bzw. ändern das nur bei unregistrierten Usern der Spamschutz Aktiv ist?

    Habe den Spammschutz vor längerer Zeit mal ganz rausgenommen.

    Hier noch die shoutbox.php:

    <?php 
    #   Copyright by Manuel Staechele
    #   Support www.ilch.de
    
    
    defined ('main') or die ( 'no direct access' );
    
      if ( loggedin() ) {
        $shoutbox_VALUE_name = $_SESSION['authname'];
      } else {
        $shoutbox_VALUE_name = 'Nickname';
      }
      if ( !empty($_POST['shoutbox_submit']) ) {
    		$shoutbox_nickname = escape($_POST['shoutbox_nickname'],'string');
        $shoutbox_nickname = substr($shoutbox_nickname, 0, 15);
    	  $shoutbox_textarea = escape($_POST['shoutbox_textarea'],'textarea');
    		$shoutbox_textarea = preg_replace("/\[.?(url|b|i|u|img|code|quote)[^\]]*?\]/i","",$shoutbox_textarea);
    		$shoutbox_textarea = strip_tags($shoutbox_textarea);
        if ( !empty($shoutbox_nickname) AND !empty($shoutbox_textarea) ) {
    	    db_query('INSERT INTO `prefix_shoutbox` VALUES ( "" , "'.$shoutbox_nickname.'" , "'.$shoutbox_textarea.'" ) ' );
    	  }
      }
      echo '<form action="index.php" method="POST">';
      echo '<input type="text" size="15" name="shoutbox_nickname" value="'.$shoutbox_VALUE_name.'" onFocus="if (value == \''.$shoutbox_VALUE_name.'\') {value = \'\'}" onBlur="if (value == \'\') {value = \''.$shoutbox_VALUE_name.'\'}" maxlength="15">';
      echo '<br /><textarea cols="15" rows="2" name="shoutbox_textarea"></textarea><br />';
      echo '<input type="submit" value="'.$lang['formsub'].'" name="shoutbox_submit">';
      echo '</form><table width="90%" class="border" cellpadding="2" cellspacing="1" border="0">';
      $erg = db_query('SELECT * FROM `prefix_shoutbox` ORDER BY id DESC LIMIT 5');
    	$class = 'Cnorm';
      while ($row = db_fetch_object($erg) ) { 
    	  $class = ( $class == 'Cmite' ? 'Cnorm' : 'Cmite' );
        echo '<tr class="'.$class.'"><td><b>'.$row->nickname.':</b> '.preg_replace( '/([^\s]{10})(?=[^\s])/', "$1\n", $row->textarea).'</td></tr>';
      }
      echo '</table><a class="box" href="index.php?shoutbox">'.$lang['archiv'].'</a>';
    
    ?>


    mfg pidy

    betroffene Homepage: x-tremefungamers.de
    Die Rechtschreibfehler sind Absicht!!!
    0 Mitglieder finden den Beitrag gut.
  2. #2
    User Pic
    Lord|Schirmer Administrator
    Registriert seit
    21.03.2007
    Beiträge
    7.680
    Beitragswertungen
    1217 Beitragspunkte
    Hau die einfach die Originale wieder drauf:

    <?php
    // Copyright by Manuel
    // Support www.ilch.de
    defined ('main') or die ('no direct access');
    
    if (loggedin()) {
        $shoutbox_VALUE_name = $_SESSION['authname'];
    } else {
        $shoutbox_VALUE_name = 'Nickname';
    }
    if (has_right($allgAr['sb_recht'])) {
        if (!empty($_POST['shoutbox_submit']) AND chk_antispam ('shoutbox')) {
            $shoutbox_nickname = escape($_POST['shoutbox_nickname'], 'string');
            $shoutbox_nickname = substr($shoutbox_nickname, 0, 15);
            $shoutbox_textarea = escape($_POST['shoutbox_textarea'], 'textarea');
            $shoutbox_textarea = preg_replace("/\[.?(url|b|i|u|img|code|quote)[^\]]*?\]/i", "", $shoutbox_textarea);
            $shoutbox_textarea = strip_tags($shoutbox_textarea);
            if (!empty($shoutbox_nickname) AND !empty($shoutbox_textarea)) {
                db_query('INSERT INTO `prefix_shoutbox` (`nickname`,`textarea`) VALUES ( "' . $shoutbox_nickname . '" , "' . $shoutbox_textarea . '" ) ');
            }
        }
        echo '<form action="index.php?' . $menu->get_complete() . '" method="POST">';
        echo '<input type="text" size="15" name="shoutbox_nickname" value="' . $shoutbox_VALUE_name . '" onFocus="if (value == \'' . $shoutbox_VALUE_name . '\') {value = \'\'}" onBlur="if (value == \'\') {value = \'' . $shoutbox_VALUE_name . '\'}" maxlength="15">';
        echo '<br /><textarea style="width: 80%" cols="15" rows="2" name="shoutbox_textarea"></textarea><br />';
        $antispam = get_antispam ('shoutbox', 0);
    	echo $antispam;
    	if (!empty($antispam)) {
    		echo '<br />';
    	}
        echo '<input type="submit" value="' . $lang['formsub'] . '" name="shoutbox_submit">';
        echo '</form>';
    }
    echo '<table width="90%" class="border" cellpadding="2" cellspacing="1" border="0">';
    $erg = db_query('SELECT * FROM `prefix_shoutbox` ORDER BY id DESC LIMIT ' . (is_numeric($allgAr['sb_limit'])?$allgAr['sb_limit']:5));
    $class = 'Cnorm';
    while ($row = db_fetch_object($erg)) {
        $class = ($class == 'Cmite' ? 'Cnorm' : 'Cmite');
        echo '<tr class="' . $class . '"><td><b>' . $row->nickname . ':</b> ' . preg_replace('/([^\s]{' . $allgAr['sb_maxwordlength'] . '})(?=[^\s])/', "$1\n", $row->textarea) . '</td></tr>';
    }
    echo '</table><a class="box" href="index.php?shoutbox">' . $lang['archiv'] . '</a>';
    
    ?>


    Spam Einstellungen im Adminbereich/Konfiguration
    rules :: doku :: faq :: linkus
    0 Mitglieder finden den Beitrag gut.
  3. #3
    User Pic
    pidy01013 Mitglied
    Registriert seit
    15.03.2006
    Beiträge
    17
    Beitragswertungen
    0 Beitragspunkte
    Super, danke für die schnelle Antwort. Wusste granicht das mann es einstellen kann^^

    mfg Pidy
    Die Rechtschreibfehler sind Absicht!!!
    0 Mitglieder finden den Beitrag gut.
Geschlossen

Zurück zu Allgemein

Optionen: Bei einer Antwort zu diesem Thema eine eMail erhalten