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

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

0 Members and 1 Guest are viewing this topic.

Offline qpatrick

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: [MOD] Last comments v1
« Reply #105 on: November 01, 2006, 12:05:50 PM »
and works also with 1.7.4

Offline desperate_housewif

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Re: [MOD] Last comments v1
« Reply #106 on: November 12, 2006, 06:32:22 PM »
Ist "Part 2" schon veröffentlich worden, oder habe ich was überlesen?
Ich benötige für meine Eingangsseite einen Abschnitt "Letzter Kommentar" mit nur 1 Kommentar und möchte dann über einen Link "weitere Kommentare" auf eine Seite verlinken, wo die letzten Kommentare stehen und ich mehr Platz habe.
Auf der Startseite habe ich dies bereits eingerichtet, es wird der letzte Kommentar angezeigt und es funktioniert super. Aber:
Ist esmöglich, nun auf auf eine weitere Seite mit mehreren Kommentaren zu verlinken, da ich in der index.php mit

[qcode]//Settings
$num = 1; //how many comments to show[/qcode]

schon für die Startseite auf 1 Kommentar begrenzt habe?


Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Last comments v1
« Reply #107 on: November 13, 2006, 09:33:54 AM »
@ desperate_housewif

... zu finden ... hier ... http://www.4homepages.de/forum/index.php?topic=10632.0
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline koikonut

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
    • http://www.konradin.net
"Last Comments" shown in Firefox but not in Internet Explorer! (deutsch/english)
« Reply #108 on: November 27, 2006, 11:44:37 PM »
Hello!

if you take a look on my site www.konradin.net/galerie you can see "Letzte Kommentare" or "Last Comments" on the bottom. You should see the last 15 commented immages with small thumbnails and the comment text - so you do with the firefox. But if you look at the site with the internet explorer, you don't see anything neither something is written in the code. What could be the reason for that??

Thank you for helping me! :-)

Greetings


Hallo!

wenn ihr meine Seiten www.konradin.net/galerie anschaut, sehr ihr unten auf der Startseite "Letzte Kommentare" wo eigentlich die letzten 15 Kommentare erscheinen müssten. Das geschieht bei der Betrachtung durch Firefox auch einwandfrei. Mit Internet Explorer erscheint unter der Überschrift allerdings gar nichts! Was ist denn da los? Es ist auch nichts im Quelltext von den letzten Kommentaren, was beim Firefox aber schon so ist... Das ist mir wirklich ein Rätsel.

Vielen Dank für Eure Hilfe!!

Grüße und gute Nacht

Konradin

Offline koikonut

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
    • http://www.konradin.net
Re: "Last Comments" shown in Firefox but not in Internet Explorer! (deutsch/engl
« Reply #109 on: November 28, 2006, 10:31:39 PM »
Hallo Ivan!

Auch ich habe Firefox 2.0 und es wird angezeigt...  :?: komisch komisch - hat jemand noch einen Ansatz?

Vielen Dank, Grußß K

Offline koikonut

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
    • http://www.konradin.net
Re: "Last Comments" shown in Firefox but not in Internet Explorer! (deutsch/engl
« Reply #110 on: November 28, 2006, 10:46:46 PM »
Ich habe einene neuen Aspekt entdeckt! Und zwar sieht man die letzten Kommentare, wenn man eingeloggt ist - es liegt also daran, dass die rechte nicht vorhanden sind die Comments zu sehen nehme ich an... Allerdings ist bei allen Kategorien gesetzt "Kommentare lesen: alle". Ist mein Last Comments Code falsch?

Code: [Select]
/*
  MOD LAST COMMENTS
  START INSERT
*/
//Settings
$num = 15; //how many comments to show
$thumb_size = 48; //max dim of thumbnails in pixels
$text_len = 250; //max lenght of the text to show (bbcode and html are counted too)
//End settings

$last_comments = "<table>";
$sql = "SELECT c.image_id, c.comment_id, c.user_id as comment_user_id, c.user_name as guest_user_name, c.comment_headline, c.comment_text, c.comment_date, i.cat_id, i.user_id, i.image_name, i.image_media_file, i.image_thumb_file".get_user_table_field(", u.", "user_name")." as user_name".get_user_table_field(", s.", "user_name")." as comment_user_name
        FROM ".COMMENTS_TABLE." c
        LEFT JOIN ".IMAGES_TABLE." i ON i.image_id = c.image_id
        LEFT JOIN ".USERS_TABLE." u ON ".get_user_table_field("u.", "user_id")." = i.user_id
        LEFT JOIN ".USERS_TABLE." s ON ".get_user_table_field("s.", "user_id")." = c.user_id
        WHERE i.image_active = 1 AND i.image_allow_comments = 1 AND i.cat_id NOT IN (".get_auth_cat_sql('auth_readcomment', 'NOTIN').") AND i.cat_id NOT IN (".get_auth_cat_sql('auth_viewcat', 'NOTIN').") AND i.cat_id NOT IN (".get_auth_cat_sql('auth_viewimage', 'NOTIN').")
        ORDER BY c.comment_date DESC
        LIMIT ".$num;
$result = $site_db->query($sql);
$bgcounter = 0;

while ($row = $site_db->fetch_array($result))
{
  $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
  if (empty($row['image_thumb_file']))
  {
    $thumb_file = ICON_PATH."/".get_file_extension($row['image_media_file']).".gif";
  }
  else
  {
    $thumb_file = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$row['cat_id']."/".$row['image_thumb_file'];
  }
  $thumb_info = @getimagesize($thumb_file);
  $width = ($thumb_info[0]) ? $thumb_info[0] : $thumb_size;
  $height = ($thumb_info[1]) ? $thumb_info[1] : $thumb_size;
  if ($width > $thumb_size && $height > $thumb_size)
  {
    $ratio = $width / $height;
    if ($ratio > 1) {
      $new_width = $thumb_size;
      $new_height = round(($thumb_size/$width) * $height);
    }else {
      $new_width = round(($thumb_size/$height) * $width);
      $new_height = $thumb_size;
    }
  }
  else
  {
    $new_width = $width;
    $new_height = $height;
  }
  $view_image = true;
  $thumb = "<img src=\"".$thumb_file."\" class=\"small_image\" onmouseover=\"showTooltip('lctt_".$row['image_id']."')\" onmouseout=\"hideTooltip()\" border=\"".$config['image_border']."\" width=\"".$new_width."\" height=\"".$new_height."\" alt=\"".$row['image_name']."\" />";
/*
  $view_image = check_permission('auth_viewcat', $row['cat_id']);
  $thumb = "<img src=\"".$thumb_file."\"".(($view_image) ? "" : " onClick=\"alert('".(($lang['auth_alert'][$cat_id]) ? $lang['auth_alert'][$cat_id] : $lang['auth_alert']['default'])."');\"")." border=\"".$config['image_border']."\" width=\"".$new_width."\" height=\"".$new_height."\" alt=\"".$row['image_name']."\" />";
*/
  $image_user_name = ($row['user_id'] != GUEST) ? $row['user_name'] : $lang['userlevel_guest'];
  $image_user_link = ($row['user_id'] != GUEST) ? $site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;user_id=".$row['user_id']) : "";
  $comment_user_name = ($row['comment_user_id'] == GUEST) ? ((empty($row['guest_user_name'])) ? $lang['userlevel_guest'] : $row['guest_user_name']) : $row['comment_user_name'];
  $comment_user_link = ($row['comment_user_id'] != GUEST) ? $site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;user_id=".$row['comment_user_id']) : "";
  $text = $row['comment_text'];
  if (strlen($text) > $text_len) {
    $text = substr($text, 0, $text_len)." ...";
  }
  $site_template->register_vars(array(
    "last_comments_more" => "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showcomments", "&")."\">".$lang['last_comments_more']."</a>",
    "comment_image" => ($view_image) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$row['image_id'])."\">".$thumb."</a>" : $thumb,
    "comment_guest" => ($row['comment_user_id'] == GUEST && !empty($row['guest_user_name'])) ? $lang['userlevel_guest'] : "",
    "comment_image_name" => ($view_image) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$row['image_id'])."\">".stripslashes($row['image_name'])."</a>" : stripslashes($row['image_name']),
    "image_cat_name" => (check_permission('auth_viewcat', $row['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$row['cat_id'])."\">".$cat_cache[$row['cat_id']]['cat_name']."</a>" : $cat_cache[$row['cat_id']]['cat_name'],
    "image_user_name" =>   ($image_user_link) ? "<a href=\"".$image_user_link."\">".$image_user_name."</a>" : $image_user_name,
    "comment_user_name" => ($comment_user_link) ? "<a href=\"".$comment_user_link."\">".$comment_user_name."</a>" : $comment_user_name,
    "comment_user_id" => $row['comment_user_id'],
    "comment_headline" => format_text($row['comment_headline'], 0, $config['wordwrap_comments'], $config['bb_comments'], 0, 1),
    "comment_text" => format_text($text, $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments'], 1, 0),
    "comment_date" => format_date($config['date_format']." ".$config['time_format'], $row['comment_date']),
    "row_bg_number" => $row_bg_number,
"comment_image_id" => $row['image_id']
  ));
  $last_comments .= $site_template->parse_template("last_comment_bit");
}
$last_comments .= "</table>";

/*
if (empty($last_comments))
{
  $last_comments = $lang['no_comments'];
}
*/
$site_template->register_vars(array(
  "lang_last_comments" => $lang['last_comments'],
  "last_comments" => $last_comments
));
/*
  MOD LAST COMMENTS
  END INSERT
*/

Vielen dank für die Hilfe!

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [MOD] Last comments v1
« Reply #111 on: November 28, 2006, 10:56:35 PM »
merged with this MOD!

mod's to mod's... ;)
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline koikonut

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
    • http://www.konradin.net
Re: [MOD] Last comments v1
« Reply #112 on: November 28, 2006, 11:04:23 PM »
Ahh thank you! Do you know why I cannot see a random image on my page? I worked some time ago but suddenly no image appears anymore... The code above is the one I use. Thank you ! :-)

Offline live@ct

  • Sr. Member
  • ****
  • Posts: 348
    • View Profile
Re: [MOD] Last comments v1
« Reply #113 on: January 17, 2007, 08:33:59 AM »
Hi

I like to exclude a image to be showed in the last comments

it could be possible?!?!

thanks for your help!
Existen 10 tipos de personas, los que entienden el codigo binario y los que no.

Offline 0uistyty

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [MOD] Last comments v1
« Reply #114 on: January 19, 2007, 09:32:59 PM »
Hi, thank you for this great mod !
Shurly one of the must usefull for us.

I made it work on the first try.
but when grouping the comments by picture, it is the first comment of the picture that is shown.
How can I make it print out the last comment of the last commented picture ?

Here's my SQL Query code :
Code: [Select]
$last_comments = "";
$sql = "SELECT c.image_id, c.comment_id, c.user_id as comment_user_id, c.user_name as guest_user_name, c.comment_headline, c.comment_text, c.comment_date, i.cat_id, i.user_id, i.image_name, i.image_media_file, i.image_thumb_file".get_user_table_field(", u.", "user_name")." as user_name".get_user_table_field(", s.", "user_name")." as comment_user_name
        FROM ".COMMENTS_TABLE." c
        LEFT JOIN ".IMAGES_TABLE." i ON i.image_id = c.image_id
        LEFT JOIN ".USERS_TABLE." u ON ".get_user_table_field("u.", "user_id")." = i.user_id
        LEFT JOIN ".USERS_TABLE." s ON ".get_user_table_field("s.", "user_id")." = c.user_id
        WHERE i.image_active = 1 AND i.image_allow_comments = 1 AND i.cat_id NOT IN (".get_auth_cat_sql('auth_readcomment', 'NOTIN').") AND i.cat_id NOT IN (".get_auth_cat_sql('auth_viewcat', 'NOTIN').") AND i.cat_id NOT IN (".get_auth_cat_sql('auth_viewimage', 'NOTIN').")
        GROUP BY c.image_id
        ORDER BY c.comment_date DESC
        LIMIT ".$num;
$result = $site_db->query($sql);

Regards.

0uistyty

Offline CeJay

  • Sr. Member
  • ****
  • Posts: 425
    • View Profile
Re: [MOD] Last comments v1
« Reply #115 on: January 19, 2007, 09:44:41 PM »
Quote
How can I make it print out the last comment of the last commented picture ?

Try changing
Code: [Select]
ORDER BY c.comment_date DESC
to:
Code: [Select]
ORDER BY c.comment_date ASC

Offline 0uistyty

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [MOD] Last comments v1
« Reply #116 on: January 19, 2007, 10:00:53 PM »
Quote
How can I make it print out the last comment of the last commented picture ?

Try changing
Code: [Select]
ORDER BY c.comment_date DESC
to:
Code: [Select]
ORDER BY c.comment_date ASC
It was to easy to be this...
Now it show up the oldest commented picture first... with again, the firts comment of it...

Edit : I forgot to say Thanks for the try ;)

Offline CeJay

  • Sr. Member
  • ****
  • Posts: 425
    • View Profile
Re: [MOD] Last comments v1
« Reply #117 on: January 20, 2007, 12:56:46 AM »
Quote
It was to easy to be this...
Now it show up the oldest commented picture first... with again, the firts comment of it...

Edit : I forgot to say Thanks for the try ;)


Sorry, only idea I had

Offline CeJay

  • Sr. Member
  • ****
  • Posts: 425
    • View Profile
Re: [MOD] Last comments v1
« Reply #118 on: January 20, 2007, 09:57:01 AM »
Look at this page and see if it gives you an idea on what can be used there: http://www.sitepoint.com/forums/showthread.php?p=3238460

Offline 0uistyty

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [MOD] Last comments v1
« Reply #119 on: January 20, 2007, 11:52:52 AM »
thanks
I'l take a look at it toonight  :P