All pastes #994539 Raw Edit

shoutbox.php

public php v1 · immutable
#994539 ·published 2008-04-23 13:55 UTC
rendered paste body
	<?php#   Copyright by Manuel Staechele#   Support www.ilch.de#  Modifikation: ZSKingdefined ('main') or die ( 'no direct access' );$datum=date("j.n.Y");$zeit=date(" H:i ");  if ( loggedin() ) {    $shoutbox_VALUE_name = $_SESSION['authname'];  } else {    $shoutbox_VALUE_name = 'Gast';  }  if ( !empty($_POST['shoutbox_submit']) AND chk_antispam ('shoutbox')) {    $insert = true;    if (!loggedin()) {        $shoutbox_nickname = escape($_POST['shoutbox_nickname'],'string');        $shoutbox_nickname = substr($shoutbox_nickname, 0, 15);        if (db_count_query("SELECT COUNT(*) FROM prefix_user WHERE name LIKE '%$shoutbox_nickname%'") > 0) {            $insert = false;            echo 'Benutzen sie einen anderen Namen, dieser ist bereits vergeben.<br />';        }    } else {        $shoutbox_nickname = escape($_SESSION['authname'],'string');    }    $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) AND $insert) {      db_query('INSERT INTO `prefix_shoutbox` (`nickname`,`textarea`) VALUES ( "'.$shoutbox_nickname.''.'<br/>'.''."Am".''.$datum.''.'<br/>'.''."um".''.$zeit.''."Uhr".''.'<br/>'.'" , "'.$shoutbox_textarea.'" ) ' );      $anz = db_count_query('SELECT COUNT(id) FROM `prefix_shoutbox`');      $limit = 50; //Limit der Shoutbox      if ($anz > $limit) {        db_query('DELETE FROM `prefix_shoutbox` ORDER BY id LIMIT '.($anz-$limit));      }     }  }  echo '<div align="center">';  if (has_right($allgAr['sb_recht'])){      echo '<form action="index.php" method="POST">';      echo "<br>Uhrzeit: $zeit Uhr<br/>Datum: $datum";      echo '<br/>' ;      if (!loggedin()) {        echo '<input type="text" size="10" 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="10" rows="2" name="shoutbox_textarea"></textarea><br />';      echo get_antispam ('shoutbox', 0);      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 10');    $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]{20})(?=[^s])/', "$1n", BBcode($row->textarea)).'</td></tr>';  }  echo '</table><a class="box" href="index.php?shoutbox">'.$lang['archiv'].'</a></div>';?>