ZenphotoCMS Forum
Comment Page - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Comment Page (/thread-1043.html)



Comment Page - Daxeno - 2007-01-04

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




Comment Page - thinkdreams - 2007-01-04

Dax-

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

`function show_latest_comments($number) {

      echo '';

      echo '[list]';

      $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 "$author commented on $short_link:$comment";              

        if('odd'==$thiscomment) { $thiscomment = 'even'; } else { $thiscomment = 'odd'; }  

      }

      echo '[/list]';

      echo '';

  }`



Comment Page - thinkdreams - 2007-01-04

The key would be removing the LIMIT from the SQL query I think.




Comment Page - Daxeno - 2007-01-04

But how?

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




Comment Page - thinkdreams - 2007-01-04

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, would display the latest comments anywhere on your page you want.




Comment Page - Daxeno - 2007-01-05

Thanks a Lot TD! i'll try to test this.