Kommentar Script

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • Kommentar Script

    Auf meiner Website setze ich ein Kommentar Script ein, dabei gibt es zwei Probleme.

    Erstes Problem, bei den Posts werden die die älteren Beiträge oben ausgegeben, was ich ändern wollte.

    Zweites Problem, die Beiträge werden alle auf der Website ausgegeben, was ab 20 Beiträgen zuviel für eine Seite ist, also würde ich mich freuen wenn jemand behilflich sein könnte das so zu ändern das immer 10 Beiträge auf einer Seite ausgegeben werden und dan per klick auf einen Link alle.

    Danke für eure Hilfe im Voraus !

    Hier das Script :
    PHP-Code:
    # if a message has been posted:

    if ($message)
    {        
    # clean up the message text

      
    $name strip_tags($name);
      
    $message strip_tags($message,"<a>,<b>,<i>,<p>,<br>");
      if (
    get_magic_quotes_gpc()) {
        
    $message stripslashes($message);
        
    $name stripslashes($name);
      }

            
    # deals with the name part of the form

      
    if (strlen($name) == 0) {
        
    $name "Gast";
      }

            
    # deals with email part of the form - replace text with image tag if you wish

      
    if ($email && strlen($email) > && stristr($email"@")) {
        
    $message "<a href=\"mailto:$email\" title=\"Email\">email</a> $message";
      }

            
    # deals with url part of the form - replace text with image tag if you wish

      
    if (strlen($url) > 7) {
        if (
    substr($url07) != "http://")
          
    $url "http://$url";
        
    $message "<a href=\"$url\" title=\"Home\">www</a> $message";
      }

            
    # formats the message in HTML, adds date

      
    $message ereg_replace("\r\n\r\n""</p>\n<p>"$message);
      
    $date date("[M j, H:i]");
      
    $message "<p class=\"message\"><strong>$date $name</strong> $message</p> <!-- comment -->";

            
    # writes the message to a file in the comments directory

            
    $path"c:/apache/htdocs/comments/" $comment ".comment";
      
    $fp fopen ("$path""a");
      
    fwrite ($fp$message "\n");
      
    fclose ($fp);
            
    // chmod ($path, 0664);
    }

    # reads the comment file

    @readfile(("c:/apache/htdocs/comments/" .$comment".comment")); 
    <div>
    <form method="post">
    <strong>Username : </strong><input type=hidden name="name" value="<?php if($couser) {echo $couser;} else {echo Gast;} ?>"><?php if($couser) {echo $couser;} else {echo Gast;} ?><!--<br />
    <strong>email:</strong><br /><input name="email" type="text" size="45" value="<?php echo $email; ?>">--><br/>
    <strong>Kommentar :</strong><br /><textarea name="message" rows="5" cols="30"></textarea><br />
    <br><input name="submit" type="submit" value="submit">
    </form>
    </div>
    Zuletzt geändert von yoshi; 01.12.2002, 09:41.

  • #2
    Hi!

    Ohne deinen Code gelesen zu haben (das ist mir zu viel).
    BTW: Wir haben sogenannte PHP-Tags, damit kannst du den Text ordentlich darstellen.

    1) ORDER BY datumsfeld DESC

    2) Dazu gibbet was unter den Code-Snippets oder in der Suche!!!

    PS: zu 1) hättest du in der Suche auch was gefunden.

    Kommentar

    Lädt...
    X