• [MOD] Last comments v1.2.0 4 0 5 1
Currently:  

Author Topic: [MOD] Last comments v1.2.0  (Read 250721 times)

0 Members and 1 Guest are viewing this topic.

Offline sigma

  • Full Member
  • ***
  • Posts: 127
    • View Profile
    • http://cydonian.com
Re: [MOD] Last comments v1
« Reply #45 on: September 17, 2005, 04:22:07 PM »
great mod. thanks again vano

Offline Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
Re: [MOD] Last comments v1
« Reply #46 on: September 17, 2005, 08:09:36 PM »
i have a page with 20 comments
http://www.foto-kocher.com/soldpubl.php
how do i a paging with 6 Comments page?
vincent
Beati pauperi spiritus

4images 1.7 // My Installed Mods


Offline sigma

  • Full Member
  • ***
  • Posts: 127
    • View Profile
    • http://cydonian.com
Re: [MOD] Last comments v1
« Reply #47 on: September 18, 2005, 10:42:49 PM »
Heres a little template adjustment to the table. Not perfect just something i threw together for my needs.

Code: [Select]
<tr>
    <td width="50" class="row2">Photo</td>
    <td width="70" class="row2">Title</td>
    <td width="95" class="row2">Category</td>
    <td width="110" class="row2">User</td>
    <td class="row2">Comment</td>
  </tr>
  <tr>
    <td colspan="4">
  <TR class="row1">
    <TD width="50" height="15" align="center" rowspan="2"> {comment_image} </TD>
    <TD width="70" rowspan="2">{comment_image_name}</TD>
    <TD width="95" rowspan="2" >[{image_cat_name}]</TD>
    <td rowspan="2" nowrap> By: {comment_user_name}{if comment_guest} ({comment_guest}){endif
      comment_guest}<br />
      {comment_date} </td>
    <TD>{comment_headline}</TD>
  </tr>
  <tr class="row1">
    <TD>{comment_text}</TD>
  </TR>

Theres probably a better way of doing it, but hey, Im a newb
Example here http://cydonian.com/photos/

Offline IWS_steffen

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Kreuzfahrtschiffe gestern und heute
Re: [MOD] Last comments v1
« Reply #48 on: September 25, 2005, 03:35:03 AM »
HI

This Mod works perfect ... great !!! 

Many thanks   

coooool

Steffen

Offline darkcurves

  • Full Member
  • ***
  • Posts: 114
    • View Profile
    • KTM Railway Fan Club - Gallery
Re: [MOD] Last comments v1
« Reply #49 on: October 03, 2005, 07:05:48 PM »
Is this part 2? http://gallery.vano.org/en/showcomments


Cant wait, i will upgrade to 1.7.1 immediately after the release of part 2. Hehe.

Offline universal

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://www.funny.lt
Re: [MOD] Last comments v1
« Reply #50 on: October 04, 2005, 08:10:17 AM »
oh cmon v@no :) share part 2 with us
Again this addres?!
http://www.funny.lt

Offline WoD

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: [MOD] Last comments v1
« Reply #51 on: October 05, 2005, 05:41:58 PM »
Wow, this mod is what I've been locking for! :)

But Part2 sounds a lot more interessting, so I would be very thankful for any stamements of the author when Part2 is supposed to be released?! :)

Greetz
WoD

Offline Rowsdower

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: [MOD] Last comments v1
« Reply #52 on: October 10, 2005, 04:05:45 PM »
Awesome script! THANKS!

Offline impss

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Cusstom.net
Re: [MOD] Last comments v1
« Reply #53 on: October 23, 2005, 06:09:18 AM »
Veno, can u please tell us if part 2 will be avaliable anytime soon.

Seems alot of people are looking for it.

Offline Nasser

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Re: [MOD] Last comments v1
« Reply #54 on: October 27, 2005, 11:30:50 AM »
fantastic MOD thanks for it .. it's working .. waiting the second one

Offline Nasser

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Re: [MOD] Last comments v1
« Reply #55 on: October 31, 2005, 11:00:56 PM »
how can I control the cells size ( width - height )
I tried myself but didn't changed

Offline martrix

  • Hero Member
  • *****
  • Posts: 755
    • View Profile
    • overlord.cz
Re: [MOD] Last comments v1
« Reply #56 on: November 02, 2005, 08:54:37 PM »
did you try to change last_comment_bit.html?
MAяTRIX


Offline Nasser

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Re: [MOD] Last comments v1
« Reply #57 on: November 02, 2005, 11:36:47 PM »
yes I did .. nothing changed :(

Offline martrix

  • Hero Member
  • *****
  • Posts: 755
    • View Profile
    • overlord.cz
Re: [MOD] Last comments v1
« Reply #58 on: November 03, 2005, 12:13:23 AM »
That's strange - because any change on my last_comment_bit.html does change the design of the latest-comments on my page after refresh... check if you're changing that in the right template :|
and/or re-do step 3 and 4 of V@no's first post of this thread...
MAяTRIX


Offline dosensteck

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: [MOD] Last comments v1
« Reply #59 on: November 03, 2005, 01:22:01 AM »
i dont have the code from vano, i use this only on my beta gallery

http://beta.hobby-fotografen.com/kategorien.php?page=1

this is my code:

Code: [Select]
$sql2 = "SELECT comment_id
         FROM ".COMMENTS_TABLE."
 ";
$result2 = $site_db->query($sql2);
$num_rows2 = $site_db->get_numrows($result2);

include(ROOT_PATH.'includes/paging.php');
$getpaging = new Paging($page, $perpage, $num_rows2, $link_arg);
$offset = $getpaging->get_offset();

 $sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_date".get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_lastaction").get_user_table_field(", u.", "user_comments").$additional_sql."
         FROM ".COMMENTS_TABLE." c
         LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
         ORDER BY c.comment_date DESC
  LIMIT $offset, $perpage";

 $result = $site_db->query($sql);
 $comment_row = array();
 while ($row = $site_db->fetch_array($result)) {
   $comment_row[] = $row;
 }
 $site_db->free_result($result);
 $num_comments = sizeof($comment_row);
 if (!$num_comments) {
   $comments_short = "<tr><td class=\"commentrow1\" colspan=\"2\">".$lang['no_comments']."</td></tr>";
 }
 else {
   $comments_short = "";
   for ($i = 0; $i < $num_comments; $i++) {
$image_id = $comment_row[$i]['image_id'];
$sql = "SELECT i.image_id, i.cat_id, i.image_name, c.cat_name, i.image_media_file, i.image_thumb_file
FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_id = $image_id AND c.cat_id = i.cat_id";
$image_row = $site_db->query_firstrow($sql);
$cat_id = (isset($image_row['cat_id'])) ? $image_row['cat_id'] : 0;
 if (check_permission("auth_readcomment", $cat_id)){
$comment_user_name = htmlspecialchars($comment_row[$i]['comment_user_name']);
$comment_user_info = $lang['userlevel_guest'];
$comment_user_id = $comment_row[$i]['user_id'];
$user_row_comment = get_user_info($comment_user_id);
$comment_user_profile_link = "";
$comment_user_info = $lang['userlevel_guest'];
       if (!isset($comment_row[$i][$user_table_fields['user_level']]) || (isset($comment_row[$i][$user_table_fields['user_level']]) && $comment_row[$i][$user_table_fields['user_level']] == USER)) {
         $comment_user_info = $lang['userlevel_user'];
       }
       elseif ($comment_row[$i][$user_table_fields['user_level']] == ADMIN) {
         $comment_user_info = $lang['userlevel_admin'];
       }
if (isset($comment_row[$i][$user_table_fields['user_name']]) && $comment_user_id != GUEST) {
 $comment_user_name = htmlspecialchars($comment_row[$i][$user_table_fields['user_name']]);
 $comment_user_profile_link = !empty($url_show_profile) ? $site_sess->url(preg_replace("/{user_id}/", $comment_user_id, $url_show_profile)) : $site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$comment_user_id);
}
 $comment_user_profile_link = ($comment_user_profile_link) ? "<a href=\"".$comment_user_profile_link."\">".$comment_user_name."</a>" : $comment_user_name;
if (!get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 0)) {
       $thumb_file = ICON_PATH."/".get_file_extension($image_row['image_media_file']).".gif";
     }else {
       $thumb_file = get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 1);
     }
     $thumb_info = @getimagesize($thumb_file);
     $width = $thumb_info[0];
     $height = $thumb_info[1];
     $dimension = 80;
     $ratio = $width / $height;
     if ($ratio > 1) {
       $new_width = $dimension;
       $new_height = floor(($dimension/$width) * $height);
     }else {
       $new_width = floor(($dimension/$height) * $width);
       $new_height = $dimension;
     }
     $site_template->register_vars(array(
      "comment_image_thumb" => (!check_permission("auth_viewcat", $cat_id) || !check_permission("auth_viewimage", $cat_id)) ? "<img src=\"".$thumb_file."\" width=\"".$new_width."\" height=\"".$new_height."\" onClick=\"alert('".$lang['members_only']."');\" border=\"".$config['image_border']."\">" : "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row[$i]['image_id'].((!empty($mode)) ? "&amp;mode=".$mode : ""))."\"><img src=\"".$thumb_file."\" width=\"".$new_width."\" height=\"".$new_height."\" border=\"".$config['image_border']."\"></a>",
       "comment_image_name" => (!check_permission("auth_viewcat", $cat_id) || !check_permission("auth_viewimage", $cat_id)) ? $image_row['image_name'] : "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row[$i]['image_id'].((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$image_row['image_name']."</a>", "comment_cat_name" => (!check_permission("auth_viewcat", $cat_id)) ? $image_row['cat_name'] : "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id)."\">".$image_row['cat_name']."</a>",
 "comment_user_name" => $comment_user_profile_link,
 "comment_user_info" => $comment_user_info,
 "comment_headline" => format_text($comment_row[$i]['comment_headline'], 0, $config['wordwrap_comments'], 0, 0),
 "comment_text" => format_text($comment_row[$i]['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),
 "comment_date" => format_date($config['date_format']." ".$config['time_format'], $comment_row[$i]['comment_date']),
));
$comments_short .= $site_template->parse_template("comment_short_bit2");
 }
   } // end while
 } //end else
 $site_template->register_vars("comments_short", $comments_short);
 unset($comments_short);

$site_template->register_vars(array(
  "paging" => $getpaging->get_paging(),
  "paging_stats" => $getpaging->get_paging_stats()
));