Comment Page

Is there any way we can make a link to view all comment for the Stopdesign Theme?

Comments

  • Dax-

    You could hack this function to show everything I would imagine:

    `function show_latest_comments($number) {

    echo '
    ';

    echo '
      ';
      $comments = query_full_array("SELECT c.id, i.title, i.filename, a.folder, a.title AS albumtitle, c.name, c.website,"
      . " c.date, c.comment FROM ".prefix('comments')." AS c, ".prefix('images')." AS i, ".prefix('albums')." AS a "
      . " WHERE c.imageid = i.id AND i.albumid = a.id ORDER BY c.id DESC LIMIT $number");
      $thiscomment = 'odd';
      foreach ($comments as $comment) {
      $author = $comment['name'];
      $album = $comment['folder'];
      $image = $comment['filename'];
      $albumtitle = $comment['albumtitle'];
      if ($comment['title'] == "") {
      $title = $image;
      } else {
      $title = $comment['title'];
      }
      $website = $comment['website'];
      $comment = truncate_string($comment['comment'], 123);
      $link = $albumtitle.' / '.$title ;
      $short_link = my_truncate_string($link, 20);
      echo "
    • image
      $comment
    • ";
      if('odd'==$thiscomment) { $thiscomment = 'even'; } else { $thiscomment = 'odd'; }
      }
      echo '
    ';

    echo '
    ';

    }`
  • The key would be removing the LIMIT from the SQL query I think.
  • But how? :(

    because i have a comments link on my page yet you can only view it if you log in as an admin. :(
  • Dax-

    All you have to do is place the code above in your custom functions file, and then call it wherever you want to display all your comments.

    thus, <?php show_latest_comments() ?> would display the latest comments anywhere on your page you want.
  • Thanks a Lot TD! i'll try to test this. :D
Sign In or Register to comment.