Hallo,
danke nochmal für den 1A Support.
Ich habe vor langer Zeit die Editer- und Löschfunktion herausgenommen. Zumindest die Ausgabe.
Der Anlass zu meiner Frage:
In Suchmaschinen erscheinen Links wie
example.org/seite/index.php?action=massdel
Diese Variable bewirkt ja normalerweise das (Massen)Löschen von Einträgen.
Nun, wenn jemand meine Seite bei Google anklickt (zum Beispiel so einen Link mit solch einer Variable am Ende), dann sieht man die Shoutbox nicht mehr.
Im Script sind noch Zeilen, die für das Editieren und Löschen notwendig sind.
Bevor ich zu viel oder zu wenig lösche, wollte ich lieber hier fragen, welche Zeilen problemlos herausgenommen werden können, um das Problem zu beheben.
Auf den ersten Blick sehe ich da JS.
- <?PHP
- // ...
- $errorC = TRUE;
- if($PHP_SELF == ""){ $filename = $_SERVER['PHP_SELF']; }else{ $filename = $PHP_SELF; }
- //Funktion zum Ersetzen der Smilie-Codes
- function shout01_smilies(&$text)
- {
- global $picpf;
- $text = str_replace(":)", "<img src=\"".$picpf."/1.gif\" alt=\"Smilie\" width=\"15\" height=\"15\">", $text);
- $text = str_replace(":D", "<img src=\"".$picpf."/2.gif\" alt=\"Smilie\" width=\"15\" height=\"15\">", $text);
- $text = str_replace("8)", "<img src=\"".$picpf."/3.gif\" alt=\"Smilie\" width=\"15\" height=\"15\">", $text);
- $text = str_replace(":eek:", "<img src=\"".$picpf."/4.gif\" alt=\"Smilie\" width=\"15\" height=\"15\">", $text);
- $text = str_replace(":p", "<img src=\"".$picpf."/5.gif\" alt=\"Smilie\" width=\"15\" height=\"15\">", $text);
- $text = str_replace(":(", "<img src=\"".$picpf."/6.gif\" alt=\"Smilie\" width=\"15\" height=\"15\">", $text);
- $text = str_replace(":x", "<img src=\"".$picpf."/7.gif\" alt=\"Smilie\" width=\"15\" height=\"15\">", $text);
- $text = str_replace(":oX:", "<img src=\"".$picpf."/8.gif\" alt=\"Smilie\" width=\"15\" height=\"15\">", $text);
- $text = str_replace(":roll", "<img src=\"".$picpf."/9.gif\" alt=\"Smilie\" width=\"15\" height=\"15\">", $text);
- $text = str_replace(";)", "<img src=\"".$picpf."/10.gif\" alt=\"Smilie\" width=\"15\" height=\"15\">", $text);
- return $text;
- }
- //Connect to MySQL-DB
- $db = @mysql_connect($host, $user, $passw)
- or die ("Verbindungsaufnahme mit der MySQL-Server war <b>nicht</b> erfolgreich!<br>Bitte gehen Sie nochmals zurück.<br>Sollte weiterhin keine Verbindung zum MySQL-Server zu Stande kommen wenden Sie sich an den technischen Ansprechparnter");
- @mysql_select_db($database, $db)
- or die ("Verbindungsaufnahme mit Datenbank war <b>nicht</b> erfolgreich!<br>Bitte gehen Sie nochmals zurück.<br>Sollte weiterhin keine Verbindung zur MySQL-Datenbank zu Stande kommen wenden Sie sich an den technischen Ansprechparnter");
- //Connect!!ED!! to MySQL-DB
- //MySQL-Tabelle anlegen, wenn sie noch nicht existiert:
- $result = mysql_list_tables($database,$db);
- $menge = mysql_num_rows($result);
- for($x = 0; $x < $menge; $x++)
- {
- if(mysql_tablename($result, $x) == $shouttabelle) $check = 1;
- }
- if(!isset($check) OR isset($check) && $check != 1)
- {
- $install_query = "CREATE TABLE ".$shouttabelle." (
- `id` int(10) NOT NULL auto_increment,
- `username` varchar(50) NOT NULL default '',
- `nachricht` text NOT NULL default '',
- `time` int(20) NOT NULL default '0',
- `ip` varchar(20) default NULL,
- `uid` varchar(32) NOT NULL default '',
- PRIMARY KEY (`id`)
- ) TYPE=MyISAM AUTO_INCREMENT=1;";
- if(mysql_query($install_query)) echo "MySQL-Tabelle '".$shouttabelle."' wurde erfolgreich angelegt";
- else echo "Beim Anlegen der MySQL-Tabelle '".$shouttabelle."' trat ein Fehler auf. Die Tabelle konnte nicht angelegt werden";
- }
- //Seiten-Funktion:
- $mengequery = mysql_query("SELECT id FROM ".$shouttabelle."");
- $menge = mysql_num_rows($mengequery);
- if(isset($_GET['action']) && $_GET['action'] == "massdel") $limit = 25;
- $maxsites = ceil($menge/$limit);
- if(isset($_GET['site']) && $_GET['site'] != "" && $_GET['site'] != 0)
- {
- $l1 = $_GET['site']*$limit;
- $l1 = $l1-$limit;
- $mysqllimit = " LIMIT ".$l1.",".$limit."";
- if($_GET['site'] > 1){ $zl = $_GET['site']-1; }
- if($_GET['site'] < $maxsites){ $vl = $_GET['site']+1; }
- }
- else
- {
- $mysqllimit = " LIMIT ".$limit."";
- $zl = 0;
- if($menge > $limit){ $vl = 2; }
- }
- $postquery = "SELECT * FROM ".$shouttabelle." ORDER BY time DESC".$mysqllimit."";
- //Eintragen von neuen Posts
- if(isset($_POST['send']) && $_POST['send'] == 1 && isset($_POST['post']) && !empty($_POST['post']) && isset($_POST['name']) && !empty($_POST['name']) && $_POST['name'] != "Name")
- {
- //Spamschutz
- if(!empty($_POST))
- {
- if(!isset($_SESSION['secCheck'])) $errorC = TRUE;
- if($_SESSION['secCheck'] != md5($_POST['secCheck'])) $errorC = TRUE;
- else $errorC = FALSE;
- }
- //Überprüfung der Spammtime & IP & UID
- $aktime = time()-$spamm;
- $checkentry = mysql_query("SELECT * FROM ".$shouttabelle." WHERE uid='".mysql_real_escape_string($_POST['uid'])."' OR time>='".$aktime."' AND ip='".mysql_real_escape_string($_SERVER['REMOTE_ADDR'])."'");
- $checkentry2 = mysql_num_rows($checkentry);
- if($checkentry2 < 1 && !$errorC && $spam_schutz == 1 OR $checkentry2 < 1 && $spam_schutz == 0)
- {
- $sql_insert = "INSERT INTO ".$shouttabelle." (username,nachricht,time,ip,uid) VALUES ('".mysql_real_escape_string($_POST['name'])."', '".mysql_real_escape_string($_POST['post'])."', '".time()."', '".$_SERVER['REMOTE_ADDR']."', '".mysql_real_escape_string($_POST['uid'])."')";
- $result = mysql_query($sql_insert, $db);
- //
- }
- else
- {
- $spammtime = 1;
- }
- }
- ?>
- <!-- 01-Shoutbox powered by 01-Scripts.de | Script (c) by Michael Lorer | www.01-scripts.de | info@01-scripts.de -->
- <script type="text/javascript">
- function popup(id, action) {
- window.open('<?PHP echo basename($filename); ?>?id='+id+'&action='+action+'','_blank','width=250,height=200,scrollbars=yes,resizable=yes,status=no,toolbar=no,left=200,top=150');
- }
- function smilie_sb(text)
- {
- eval("document.shoutbox.post.value += \""+text+"\"");
- }
- //JS-Funktion mit freundlicher Unterstützung von "Berni*" (http://www.bernis-board.de/)
- function clearField(field)
- {
- if(field.value == field.defaultValue)
- {
- field.value = "";
- }
- }
- //JS-Funktion mit freundlicher Unterstützung von "Berni*" (http://www.bernis-board.de/)
- function checkField(field)
- {
- if(field.value == "")
- {
- field.value = field.defaultValue;
- }
- }
- </script>
- <!--Ausgabe der Beiträge-->
- <?PHP
- if(!isset($_GET['action']) && !isset($_POST['action'])){
- ?>
- <form name="shoutbox" action="<?PHP echo $_SERVER['../../../PHP_SELF']; ?>" method="post">
- <table>
- <!--Ausgabe des Formulars-->
- <tr>
- <td><b>Kommentar hinterlassen:</b></td></tr>
- <tr>
- <td><input type="text" name="name" value="<?PHP if(isset($_POST['name']) && !empty($_POST['name'])){ echo $_POST['name']; }else{ echo "Name"; } ?>" size="20" onFocus="clearField(this);" onBlur="checkField(this);" <?PHP echo $css1; ?>></td>
- </tr>
- <tr>
- <td><div class="elf">Deine Nachricht:</div> <textarea name="post" cols="50" rows="4" <?PHP echo $css1; ?>></textarea></td>
- </tr>
- <?PHP if($smilies == 1){ ?>
- <tr>
- <td class="left" colspan="4">
- <a href="javascript:smilie_sb(' :) ');"><img src="<?PHP echo $picpf; ?>/1.gif" alt="Smilie :)" width="15" height="15"></a>
- <a href="javascript:smilie_sb(' :D ');"><img src="<?PHP echo $picpf; ?>/2.gif" alt="Smilie :D" width="15" height="15"></a>
- <a href="javascript:smilie_sb(' 8) ');"><img src="<?PHP echo $picpf; ?>/3.gif" alt="Smilie 8)" width="15" height="15"></a>
- <a href="javascript:smilie_sb(' :eek: ');"><img src="<?PHP echo $picpf; ?>/4.gif" alt="Smilie :eek:" width="15" height="15"></a>
- <a href="javascript:smilie_sb(' :p ');"><img src="<?PHP echo $picpf; ?>/5.gif" alt="Smilie :p" width="15" height="15"></a>
- <a href="javascript:smilie_sb(' :( ');"><img src="<?PHP echo $picpf; ?>/6.gif" alt="Smilie :(" width="15" height="15"></a>
- <a href="javascript:smilie_sb(' :x ');"><img src="<?PHP echo $picpf; ?>/7.gif" alt="Smilie :x" width="15" height="15"></a>
- <a href="javascript:smilie_sb(' :oX: ');"><img src="<?PHP echo $picpf; ?>/8.gif" alt="Smilie :oX:" width="15" height="15"></a>
- <a href="javascript:smilie_sb(' :roll ');"><img src="<?PHP echo $picpf; ?>/9.gif" alt="Smilie :roll" width="15" height="15"></a>
- <a href="javascript:smilie_sb(' ;) ');"><img src="<?PHP echo $picpf; ?>/10.gif" alt="Smilie ;)" width="15" height="15"></a></td>
- </tr>
- <?PHP } ?>
- <?PHP
- if($spam_schutz == 1)
- {
- //Spamschutz
- mt_srand((double)microtime() * 1000000);
- $oprand = mt_rand(1,3);
- switch($oprand)
- {
- case 1:
- $gl1 = mt_rand(1,20);
- $op = " & ";
- $gl2 = mt_rand(1,10);
- $loesungmd5 = md5($gl1+$gl2);
- break;
- case 2:
- $gl1 = mt_rand(10,30);
- $op = " m|nus ";
- $gl2 = mt_rand(1,$gl1);
- $loesungmd5 = md5($gl1-$gl2);
- break;
- case 3:
- $gl1 = mt_rand(2,10);
- $op = " m@l ";
- $gl2 = mt_rand(2,6);
- $loesungmd5 = md5($gl1*$gl2);
- break;
- }
- $_SESSION['secCheck'] = $loesungmd5;
- ?>
- <tr>
- <td colspan="4"><?PHP echo $gl1.$op.$gl2; ?> =
- <input type="text" value="? Spamschutz" name="secCheck" size="11" onFocus="clearField(this);"></td>
- </tr>
- <?PHP
- }//Ende: Spamschutz
- ?>
- <tr>
- <td class="left" colspan="4"><input type="submit" value="Abschicken">
- <input type="hidden" name="send" value="1">
- <?PHP
- mt_srand((double)microtime() * 1000000);
- $uidzufall = mt_rand(1,9999);
- ?>
- <input type="hidden" name="uid" value="<? echo md5($_SERVER['REMOTE_ADDR'].time().$uidzufall); ?>"></td>
- </tr>
- <tr>
- <th><br></th></tr>
- <tr>
- <td colspan="4"><?PHP
- //Ausgabe der Meldung, wenn die Spammtime noch nicht abgelaufen ist:
- if(isset($spammtime))
- {
- echo "<b>Spamschutz: Bitte die Gleichung berechnen!<br>
- Es kann nur alle ".$spamm." Sekunden ein Beitrag erstellt werden!</b><br><br>";
- }
- $posts = mysql_query($postquery);
- while($rowp = mysql_fetch_array($posts))
- {
- $datum = date("d.m.y",$rowp['time']);
- $uhrzeit = date("H:i",$rowp['time']);
- $string = stripslashes($rowp['nachricht']);
- $string = wordwrap($string , $break , "<br>" , 1);
- $string = preg_replace('"( |^)(www.[-a-zA-Z0-9@:%_\+.~#?&//=]+)"i','\\1<a href="http://\2" target="_blank">\\2</a>', $string);
- if($smilies == 1) $string = shout01_smilies($string);
- $nbreak = wordwrap($rowp['username'] , $break , "-<br>" , 1);
- $shouti++;
- print ($shouti % 2) ? '<div class="gbdiva">' : '<div class="gbdivb">';
- echo "<b>".$nbreak."</b> am <b>".$datum." um ".$uhrzeit." Uhr</b>:<br>".$string."<br>";
- echo "</div>";
- }
- ?></td>
- </tr>
- <tr>
- <td class="left" width="25%"><?PHP if($_GET['site'] > 1){ echo "<a href=\"".$_SERVER['PHP_SELF']."?site=1\"><b>« 1</b></a>"; }else{ echo " "; } ?></td>
- <td class="center" width="25%">
- <?PHP if($zl > 0){ echo "<a href=\"".$_SERVER['PHP_SELF']."?site=".$zl."\"><b>< ".$zl."</b></a>"; } ?></td>
- <td class="center" width="25%"><?PHP if(isset($vl) && $vl <= $maxsites){ echo "<a href=\"".$_SERVER['PHP_SELF']."?site=".$vl."\"><b>".$vl." ></b></a>"; } ?>
- </td>
- <td class="right" width="25%"><?PHP if(isset($_GET['site']) && $_GET['site'] < $maxsites OR $vl == 2){ echo "<a href=\"".$_SERVER['PHP_SELF']."?site=".$maxsites."\"><b>".$maxsites." »</b></a>"; }else{ echo " "; } ?></td>
- </tr>
- </table>
- </form>
- <!--Ausgabe des Formulars ENDE-->
- <?PHP
- }//Ende: Abfrage !$_GET['action']
- ?>
- <!-- 01-Shoutbox powered by 01-Scripts.de | Script (c) by Michael Lorer | www.01-scripts.de | info@01-scripts.de -->
Danke.
Edit: Da sind auch solche Link: index.php?action=del&id=2