phpbuddy.eu
-


Hinweise


Antwort
 
LinkBack Themen-Optionen Thema durchsuchen Thema bewerten
Alt 04.01.2006, 21:59   #1
mmm
TP-Member
 
Registriert seit: Jul 2003
mmm macht alles soweit korrekt

Anpassung Comment Script


Hallo,

habe folgendes Comment Script ein wenig abgeändert: http://www.scriptsmill.com/comments.html

Nun wollte ich gerne neben dem Author, Text und Datum die ID mit anzeigen!

Dachte es mir so:

1. template

PHP-Code:
 if ($comments_count) {
  for(
$i=0$i<$comments_count$i++) {
   if (
$dont_show_email[$i] != '1' && $email != '') { $author[$i] = "<a href=\"mailto:{$email[$i]}\">{$author[$i]}</a>"; }
   
$text[$i] = str_replace(chr(13), '<br />'$text[$i]);
   
   print<<<EOF
 <div class="commentbody">
  <strong>
{$author[$i]} - [color="Red"]{$ID[$i]}[/color]</strong><br />
  <small>
{$time[$i]}</small>
  <div class="text">
  
{$text[$i]}
  </div>
 </div>
EOF;
  
  }
 }
 else {
   print<<<EOF
 <div class="note">
  <div class="text">
  
{$COM_LANG['no_comments_yet']}
  </div>
 </div>
EOF;
 } 
2. comments.php ergänzt im Teil function view:

PHP-Code:
function view() {

    global 
$comments_db_link$COM_CONF$COM_LANG;

    
$request_uri mysql_escape_string($_SERVER['REQUEST_URI']);
    
$result mysql_query("select ID, time, text, author, email, dont_show_email from {$COM_CONF['dbmaintable']} where href='$request_uri' order by time {$COM_CONF['sort_order']}"$comments_db_link);

    
$comments_count=0;
    
$ID=$time=$text=$author=$email=$dont_show_email=array();
    while (list([
color="Red"]$ID[comments_count],[/color$time[$comments_count], $text[$comments_count], $author[$comments_count], $email[$comments_count], $dont_show_email[$comments_count])=mysql_fetch_array($result)) {
        
$time[$comments_count] = format_date($time[$comments_count]);
        
$comments_count++;
    }

    require(
"./alben/01/comments/templates/{$COM_CONF['template']}.php");


Aber er zeigt sie mir nicht an - daneben wollte ich noch neben den Feldern Author, E-Mail ein weiteres Feld Website hinzufügen (ist im Script gar nicht vorgehesen - aber wenn das Abfragen aus der DB der ID schon nicht einwandfrei funktioniert - es liegt an mir und nicht am Script ;-) - dann nehme ich das erst gar nicht in Angriff!

Danke & Gruß

Wollte die zwei Punkte mit der ID ot hervorheben... geht irgendwie nicht!
mmm ist offline   Mit Zitat antworten


Antwort

  Aktuelles Thema
  TP Hilfe Forum > Web-Editoren & Coding > Traum-Dynamik
Anpassung Comment Script Anpassung Comment Script
« Include und Funktionen | SQL-Datenbank mit Frontpage anbinden bzw. ändern »

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu


Alle Zeitangaben in WEZ +1. Es ist jetzt 05:38 Uhr.

Powered by: vBulletin Version 3.7 (Deutsch)
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd. / Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.
Traum-Projekt.com | Suchen | Archiv | Impressum | Kontakt | | | Nach oben |



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

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