4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: V@no on May 09, 2005, 07:38:44 AM

Title: [MOD] Last comments v1.2.0
Post by: V@no on May 09, 2005, 07:38:44 AM
This mod will show last comments.
I've split this mod on two parts:
Works with 4images v1.7/1.7.1


-------- [ Part 1 ] --------

---------- [ Changed files ] ----------

index.php
lang/<your language>/main.php
templates/<your template>/home.html



---------- [ New file ] ----------

templates/<your template>/last_comment_bit.html

---------- [ Installation ] ----------

Step 1
Open index.php
Find:
Code: [Select]
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------

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

$last_comments = "";
$additional_sql = "";
if (!empty($additional_image_fields))
{
  foreach ($additional_image_fields as $key => $val)
  {
    $additional_sql .= ", i.".$key;
  }
}
if (!empty($additional_user_fields))
{
  foreach ($additional_user_fields as $key => $val)
  {
    $additional_sql .= ", s.".$key." as comment_".$key.", u.".$key." as image_user_".$key;
  }
}
$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 $additional_sql
        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 = 1;
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."\" 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_url = ($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_url = ($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?".URL_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_url) ? "<a href=\"".$image_user_url."\">".$image_user_name."</a>" : $image_user_name,
    "image_user_url" => $image_user_url,
    "image_user_id" => $row['user_id'],
    "comment_user_name" => ($comment_user_url) ? "<a href=\"".$comment_user_url."\">".$comment_user_name."</a>" : $comment_user_name,
    "comment_user_url" => $comment_user_url,
    "comment_user_id" => $row['comment_user_id'],
    "comment_headline" => format_text($row['comment_headline'], 0, $config['wordwrap_comments'], 0, 0),
    "comment_text" => format_text($text, $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),
    "comment_date" => format_date($config['date_format']." ".$config['time_format'], $row['comment_date']),
    "comment_image_openwindow" => ($view_image) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$row['image_id'])."\"  onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>" : $thumb,
    "comment_image_name_openwindow" => ($view_image) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$row['image_id'])."\"  onclick=\"opendetailwindow()\" target=\"detailwindow\">".stripslashes($row['image_name'])."</a>" : stripslashes($row['image_name']),
    "row_bg_number" => $row_bg_number
  ));
  $additional_field_array = array();
  if (!empty($additional_image_fields))
  {
    foreach ($additional_image_fields as $key => $val)
    {
      $additional_field_array[$key] = (!empty($row[$key])) ? format_text($row[$key], 1) : REPLACE_EMPTY;
      $additional_field_array['lang_'.$key] = $val[0];
    }
  }
  if (!empty($additional_user_fields))
  {
    foreach ($additional_user_fields as $key => $val)
    {
      $additional_field_array["comment_".$key] = (!empty($row["comment_".$key])) ? format_text($row["comment_".$key], 1) : REPLACE_EMPTY;
      $additional_field_array["image_user_".$key] = (!empty($row["image_user_".$key])) ? format_text($row["image_user_".$key], 1) : REPLACE_EMPTY;
      $additional_field_array['lang_user_'.$key] = $val[0];
    }
  }
  if (!empty($additional_field_array))
  {
    $site_template->register_vars($additional_field_array);
  }
  $last_comments .= $site_template->parse_template("last_comment_bit");
}
/*
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
  START INSERT
*/
(edit settings on top of the inserted code)


Step 2
Open lang/<your language>/main.php
At the end, above closing ?> insert:$lang['last_comments'] = "Last comments";
$lang['last_comments_more'] = "More comments";


Step 3
Open templates/<your template>/home.html
Insert in the place where you want to show last comments:
Code: (template) [Select]
{if last_comments}
                  <table width="450" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td class="head1">
                        <table width="100%" border="0" cellspacing="0" cellpadding="3">
                          <tr>
                            <td class="head1" valign="top" colspan="5">{lang_last_comments}</td>
                          </tr>
                          {last_comments}
                        </table>
                      </td>
                    </tr>
                  </table>
                  <br />
{endif last_comments}
(this is just an example based on default template)


Step 4
Create a new template templates/<your template>/last_comment_bit.html with the folowing code:
Code: (template) [Select]
              <TR class="row{row_bg_number}">
                <TD width="50" height="50" align="center" rowspan="2">
                  {comment_image}
                </TD>
                <TD rowspan="2" >{comment_image_name}</TD>
                <TD 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="row{row_bg_number}">
                <TD>{comment_text}</TD>
              </TR>
(this is just an example based on default template)



----------- [ Customization ] ------------

The following new tags are avalable to use in templates/<your template>/home.html template:

{lang_last_comments} - text "Last comments"
{last_comments} - list of last comments
{last_comments_more} - link "More comments" (required Part 2)


The following tags are avalable to use in templates/<your template>/last_comment_bit.html template:

{comment_image} - thumbnail of the image
{comment_guest} - text "Guest" if comment by a guest with entered name
{comment_image_name} - name of the image
{image_cat_name} - name of the category where the image is
{image_user_name} - username of the image
{comment_user_name} - username who posted the comment
{comment_user_id} - userid who posted the comment
{comment_headline} - headline of the comment
{comment_text} - the comment text
{comment_date} - the date when comment was posted
{row_bg_number} - number 1 or 2, needed for comment class style

New since v1.1.0:

{comment_user_url} - address to user profile for comment user
{image_user_url} - address to user profile for image user
{image_user_id} - image user ID
{lang_additionalImageFieldName} - text for additional image field
{additionalImageFieldName} - text for additional image field
{lang_user_additionalUserFieldName} - text for additional user field
{comment_additionalUserFieldName} - additional user field for comment user
{image_user_additionaUserFieldName} - additional user field for image user

New since v1.2.0:

{comment_image_openwindow} - thumbnail of the image with a link opens in new window
{comment_image_name_openwindow} - name of the image with a link opens in new window.
Title: [MOD] Last comments v1 Part 2
Post by: V@no on May 09, 2005, 07:39:43 AM
-------- [ Part 2 ] --------
[MOD] All Comments (Alle Kommentare) (http://www.4homepages.de/forum/index.php?topic=10632.0)
Title: Re: [MOD] Last comments v1
Post by: artpics on May 09, 2005, 09:47:12 AM
 :D :D brilliant that looks so good ,10 out of 10  v@no

thanks sooooooo much   :D

Title: Re: [MOD] Last comments v1
Post by: martrix on May 09, 2005, 05:10:30 PM
very nice!

I'm eagerly waiting for part two  :)



Title: Re: [MOD] Last comments v1
Post by: ascanio on May 09, 2005, 05:16:32 PM
Me too,waiting for the part two :)
Title: Re: [MOD] Last comments v1
Post by: waleed on May 09, 2005, 06:33:16 PM
Quote
very nice!

I'm eagerly waiting for part two   :)

waiting waiting waiting :)
Title: Re: [MOD] Last comments v1
Post by: universal on May 10, 2005, 01:21:01 PM
{last_comments}
</tr> this you can delete :)

btw greate mod ;) waiting for part 2 :)
Title: Re: [MOD] Last comments v1
Post by: universal on May 10, 2005, 03:09:57 PM
V@no,
Maybe possible to ask you, to show how to do some modifications?
If we put a admin links in these comments? :)
Title: Re: [MOD] Last comments v1
Post by: V@no on May 10, 2005, 03:16:42 PM
that will be avalable in part 2
Title: Re: [MOD] Last comments v1
Post by: b.o.fan on May 11, 2005, 05:53:41 PM
i´m waiting for Part II too.

:)


b.o.fan
Title: Re: [MOD] Last comments v1
Post by: fotograf74 on June 15, 2005, 04:50:40 PM
When you publish PART 2?
I want to integrate the Last Comments in a phpbb Forum.
Title: Re: [MOD] Last comments v1
Post by: xerraire on June 15, 2005, 08:25:31 PM
Hi
Where can I see a working demo of this mod?

:)
Barb

"Xerraire"
http://www.xerraire.com
Title: Re: [MOD] Last comments v1
Post by: JensF on June 15, 2005, 08:30:05 PM
Hi
Where can I see a working demo of this mod?

:)
Barb

"Xerraire"
http://www.xerraire.com

On my Page ;)
Title: Re: [MOD] Last comments v1
Post by: offroad4fun on June 16, 2005, 10:07:55 AM
very cool mod!!!!:!: :!:  thx a lot!!  :wink:

you can see it here:  http://fotos.offroad4fun.at  :wink:

greets from vienna
Title: Re: [MOD] Last comments v1
Post by: Deven316 on June 19, 2005, 07:11:47 AM
Quick question...

If i installed this mod, could I show the latest comments on a non-4image gallery page such as the main page of my website which is in PHP?
Title: Re: [MOD] Last comments v1
Post by: Pizi on June 22, 2005, 06:46:09 PM
(http://www.tsu-irnfritz.com/Bilder/Smiles/danke.gif)

 Greetings from Austria
Title: Re: [MOD] Last comments v1
Post by: maziggy on June 26, 2005, 12:32:28 PM
Can someone please let me know how to enable paging for the latest comments ?

Thanks, Martin
Title: Re: [MOD] Last comments v1
Post by: maziggy on June 27, 2005, 09:16:29 PM
S.O.S ;-)

I need get the paging to work for the latest coments. Can someone please point me into the right direction ?

Please !

Thanks, Martin
Title: Re: [MOD] Last comments v1
Post by: karimun on June 28, 2005, 12:09:59 AM
Very good job V@no  :D
Title: Re: [MOD] Last comments v1
Post by: Pitt on June 28, 2005, 10:32:05 AM
Ich würde gern bei der Mailbenachrichtung den Usernamen des Kommentators sowie den Kommentar selbst mit drin haben.
Das eintragen der Variablen {comment_user_name} und {comment_text} ins Template comment_email funktioniert nicht...

Kann jemand helfen?
Title: Re: [MOD] Last comments v1
Post by: waleed on June 29, 2005, 07:04:50 AM
V@no
any news about PART2 ?
Title: Re: [MOD] Last comments v1
Post by: Markus1979 on July 02, 2005, 09:45:18 PM
Also erstmal ein herzliches Dankeschön an den machen  :D


Was muß ich denn ändern, damit sich bei klick auf dem Thumbnail das Bild im neuen Fenster öffnet und nicht im selben.

Im Template thumbnail_bit.html {thumbnail} durch {thumbnail_openwindow} ersetzen habe ich ja, aber irgendwie funktioniert das nur bei der "Tabelle" Neue Bilder und nicht bei den Kommentaren.

Ursprüglich wollte ich in Englisch schreiben, aber dann würden alle hier Bauchschmerzen bekommen  :lol:
Title: Re: [MOD] Last comments v1
Post by: ascanio on July 04, 2005, 07:02:19 PM
where is the part 2? did i miss something?
Title: Re: [MOD] Last comments v1
Post by: martrix on July 04, 2005, 08:24:25 PM
no you did not miss anything - as V@no wrote - Part 2 will come... well not soon, but later maybe ;)
Title: Re: [MOD] Last comments v1
Post by: MustardGT on July 17, 2005, 03:58:16 AM
Great mod. Works great.

Thanks.
Title: Re: [MOD] Last comments v1
Post by: zoolmann on July 17, 2005, 12:02:30 PM
Very great mod, thanks V@no !

How please show all comments ?  :roll:

Waiting for PART 2  8)
Title: Re: [MOD] Last comments v1
Post by: Vincent on August 01, 2005, 01:35:33 PM
yes great Mod
i have missused as a last sold Picture but still it works  :wink:
the problem i have is:
as soon i finished to add this MOD i was testing it - but now the newest comment is not showing up!?
why?
Because i had the wrong rights on the categorie

if i log in as admin - i see all the comments on the frontpage and also the newes on top!
Because i had the wrong rights on the categorie

and maybe a basic stupid question - but where do i delete some comments?
cool it the adminPanel

sincerly
vincent
Title: Re: [MOD] Last comments v1
Post by: JensF on August 01, 2005, 01:57:26 PM
Hi Vincent,

hab es bei mir jetzt eingebaut (hatte noch nen anderen Last Comment Mod drin) und er funktioniert......egal ob ich als Gast oder Admin drin bin die Kommentare werden angezeigt auf der Startseite.

Muss das ganze jetzt nur noch anpassen....
Title: Re: [MOD] Last comments v1
Post by: Vincent on August 01, 2005, 03:19:24 PM
Hello

the {comment_date} showing the date and time
i would like to have the time removed how to do?

sincerly
vincent
Title: Re: [MOD] Last comments v1
Post by: JensF on August 01, 2005, 03:41:49 PM
In der index.php das hier

Code: [Select]
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $row['comment_date']),
gegen das ersetzen...

Code: [Select]
"comment_date" => format_date($config['date_format'].", $row['comment_date']),
Bin nicht sicher aber das müsste es sein.
Title: Re: [MOD] Last comments v1
Post by: Vincent on August 01, 2005, 04:03:29 PM
thanks for the tip

Code: [Select]
    "comment_date" => format_date($config['date_format'], $row['comment_date']),
this way it works you had a " for nothing

sincerly
vincent
Title: Re: [MOD] Last comments v1
Post by: JensF on August 01, 2005, 05:39:53 PM
OK :)
Title: Re: [MOD] Last comments v1
Post by: Vincent on August 01, 2005, 06:05:52 PM
@jensF
wenn ich bei dir schaue dann hast du bei den kommentierten Bilder - im Detail - unten die Kommentar schön aufgelistet!
was für einen Code muss ich dort eingeben?

bei mir steht nur Auto:         Kommentar:

aber sonst leer?

gruss
vincent
Title: Re: [MOD] Last comments v1
Post by: JensF on August 01, 2005, 06:48:05 PM
??? Beispiel bitte. Ich weiß nicht unbedingt was du meinst....
Title: Re: [MOD] Last comments v1
Post by: Vincent on August 01, 2005, 10:43:12 PM
@jensF

ein Beispiel:
http://www.foto-kocher.com/details.php?image_id=1842

ganz unten sollte ein eintrag stehen
hier ist der artikel mit dem kommentar an 2ter stelle
http://www.foto-kocher.com/soldpubl.php

gruss
vincent
Title: Re: [MOD] Last comments v1
Post by: mawenzi on August 02, 2005, 12:00:20 AM
hallo Vincent,

habe versucht auf einer Detailseite ein Kommentar zu posten ... aber der wird auch nicht angezeigt ...  :?
Ich nehme mal an, dass dir beim Editieren der detail.html etwas Code abhanden gekommen ist .
Überhalb von {comment_form} sollte noch folgendes in etwa stehen ...

Code: [Select]
{if allow_comments}
<br />
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="head1" valign="top">
<table width="100%" border="0" cellpadding="3" cellspacing="1">
<tr>
<td valign="top" class="head1">{lang_author}</td>
<td valign="top" class="head1">{lang_comment}</td>
</tr>
{comments}
</table>
</td>
</tr>
</table>
<br />
{endif allow_comments}

mal testen ...  :wink:

mawenzi
Title: Re: [MOD] Last comments v1
Post by: Vincent on August 02, 2005, 08:23:34 PM
Ich hab es angeschaut - all die Befehle sind drin!
wenn es keinen kommentar hat dann steht auch keinen Kommentar - aber wenn ein Kommentar drinn steht dann ist nichts!

gruss
vincent

{comment_form} {if allow_comments}
{lang_author} {lang_comment}
{comments}
{endif allow_comments}
Code: [Select]

mal testen ...  :wink:

mawenzi
[/quote]
Title: Re: [MOD] Last comments v1
Post by: mawenzi on August 02, 2005, 08:53:41 PM
... und wenn du {if allow_comments} und {endif allow_comments} mal entfernst ... sind dann die Kommentare zu sehen  ... ?

mawenzi

Title: Re: [MOD] Last comments v1
Post by: Vincent on August 02, 2005, 09:07:53 PM
@mawenzi  :cry:

immer noch nicht!  :!:  - habe jetzt die {if   wieder eingefügt!  :|

gruss
vincent
Title: Re: [MOD] Last comments v1
Post by: Vincent on August 03, 2005, 10:37:38 AM
V@no
it works perfect - Thanks a LOT   - i also build a new php code with only this scirpt and it still working - what i am missing now
i would like to say if more the 12 Comments make a new page!
i missused this code to show which picture i have been selling in the past!
on the frontpage - the newest
with more picture - you will see this new php code!

sincerly
vincent

Fehler gefunden die Datei comment_bit.html war leer - danke Mawenzi für den Code!
Title: Re: [MOD] Last comments v1
Post by: Gulper on August 04, 2005, 03:16:49 PM
How can I also set a maximum thumb hight.... right now it only checks maximum width... I have some very thin images in my gallery... and it would be great if I can restrict the hight of the thumbnails as well as their width....

Thanx in advance...
Title: Re: [MOD] Last comments v1
Post by: Flo2005 on August 21, 2005, 11:48:21 AM
When I add this mod to my home.html with {if last_comments} & {endif last_comments} I always see this tags in my Browser! But Why?

THX by Flo2005
Title: Re: [MOD] Last comments v1
Post by: Vincent on August 21, 2005, 01:40:47 PM
i had this problem sometimes. you are using a Wysiwyg Editor - and you add the code as text and not as code - try to change the MOD to see the code and add it there!

vincent
Title: Re: [MOD] Last comments v1
Post by: Flo2005 on August 21, 2005, 03:05:56 PM
Oh, that´s clear that I see it as text :oops:

It´s Sunday morning  :)
Title: Re: [MOD] Last comments v1
Post by: impss on August 28, 2005, 09:41:47 PM
Waiting for Part 2

 :P
Title: Re: [MOD] Last comments v1
Post by: sigma on September 17, 2005, 04:22:07 PM
great mod. thanks again vano
Title: Re: [MOD] Last comments v1
Post by: Vincent 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
Title: Re: [MOD] Last comments v1
Post by: sigma 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/
Title: Re: [MOD] Last comments v1
Post by: IWS_steffen on September 25, 2005, 03:35:03 AM
HI

This Mod works perfect ... great !!! 

Many thanks   

coooool

Steffen
Title: Re: [MOD] Last comments v1
Post by: darkcurves 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.
Title: Re: [MOD] Last comments v1
Post by: universal on October 04, 2005, 08:10:17 AM
oh cmon v@no :) share part 2 with us
Title: Re: [MOD] Last comments v1
Post by: WoD 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
Title: Re: [MOD] Last comments v1
Post by: Rowsdower on October 10, 2005, 04:05:45 PM
Awesome script! THANKS!
Title: Re: [MOD] Last comments v1
Post by: impss 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.
Title: Re: [MOD] Last comments v1
Post by: Nasser on October 27, 2005, 11:30:50 AM
fantastic MOD thanks for it .. it's working .. waiting the second one
Title: Re: [MOD] Last comments v1
Post by: Nasser on October 31, 2005, 11:00:56 PM
how can I control the cells size ( width - height )
I tried myself but didn't changed
Title: Re: [MOD] Last comments v1
Post by: martrix on November 02, 2005, 08:54:37 PM
did you try to change last_comment_bit.html?
Title: Re: [MOD] Last comments v1
Post by: Nasser on November 02, 2005, 11:36:47 PM
yes I did .. nothing changed :(
Title: Re: [MOD] Last comments v1
Post by: martrix 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...
Title: Re: [MOD] Last comments v1
Post by: dosensteck 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()
));
Title: Re: [MOD] Last comments v1
Post by: V@no on November 03, 2005, 02:43:50 AM
i dont have the code from vano, i use this only on my beta gallery
People keep me wonder with such statements...
Then what does your question has to do with this mod???? 8O
Title: Re: [MOD] Last comments v1
Post by: dosensteck on November 03, 2005, 01:34:25 PM
i dont have the code from vano, i use this only on my beta gallery
People keep me wonder with such statements...
Then what does your question has to do with this mod???? 8O

you dont understand me (ok, my english is not god :D)

its your mod - but the people want paging. with the code that i have posted is paging included....

i only wrote thats is not from you, because iam a php noob - and the soloution is not so god... (but it works :D) - i dont want that people think thats your code (you are better)

and sorry for my english  :oops:

Title: Re: [MOD] Last comments v1
Post by: Nasser on November 08, 2005, 01:40:18 AM
is there is a way to modify the output of this MOD so the commneted page listed once a time not each time it commented in the same list ?
means .. when an image commented .. and after 2 days some one else commented the same image .. both comments are listed with the same image twice ..
can you change this please .. so it can be listed onec only in the same list
Title: Re: [MOD] Last comments v1
Post by: V@no on November 08, 2005, 01:47:44 AM
This mod is for listing comments not for listing images with last comments...see the difference? ;)

[EDIT]
Ok, here is what you can do:
in index.php (in the code you've added) find:
Code: [Select]
        ORDER BY c.comment_date DESCInsert above:
Code: [Select]
        GROUP BY c.image_id
It will filter our comments that followed after "first" last comment...meaning if there are two comments on the same image one was 2 days ago and second was 1 day ago, it will show only the one that was 2 days ago.
Title: Re: [MOD] Last comments v1
Post by: Nasser on November 08, 2005, 05:05:52 PM
thanks for the help man :D its working now .. yeah I noticed the difference .
Title: Re: [MOD] Last comments v1
Post by: WoD on December 01, 2005, 12:09:58 PM
Is Part 2 out yet?
Pretty interessted in it :)
Title: Re: [MOD] Last comments v1
Post by: Acidgod on December 01, 2005, 06:00:33 PM
it easy to make a site wiht the last 25 or 30 or 35 Comments without paging...

When you are interest, i will tell you how to make it... (o:
Title: Re: [MOD] Last comments v1
Post by: mawenzi on December 01, 2005, 11:42:57 PM
@ WoD  and all who are interested ...

it is not the Part 2 of V@no's MOD Last Comments V.1 ... but I think it is similar ...  :wink:

[MOD] All Comments (Alle Kommentare) V.1.0   to finde here :
http://www.4homepages.de/forum/index.php?topic=10632.0

mawenzi
Title: Re: [MOD] Last comments v1
Post by: impss on December 09, 2005, 04:22:45 AM
@ WoD  and all who are interested ...

it is not the Part 2 of V@no's MOD Last Comments V.1 ... but I think it is similar ...  :wink:

[MOD] All Comments (Alle Kommentare) V.1.0   to finde here :
http://www.4homepages.de/forum/index.php?topic=10632.0

mawenzi

Great work mawenzi !!!

This Is what I'm sure most of us have been waiting for
Title: Re: [MOD] Last comments v1
Post by: aymanati on December 11, 2005, 07:44:04 AM
Hi V@no ..
Great mod .. just as usual ..

I have an idea to enhance the display of the mod ..

It's a small JavaScript that let you Show/Hide the displayed comments .. just like how Gmail displays the replies inside each email :) ..
Imagine if these are the comments :) ..
It works ..
But there is a little problem ..
The script shows/Hides tables or <td> with static IDs ..
However, we have only one table in last_comment_bit.htm ..
So there has to be a small php modification that can handle this ..


Got my point?

here is the JavaScript and HTML .. try it please so you will understand ..

Code: [Select]
<html>
<head>

<!-- START show hide -->
<SCRIPT LANGUAGE="JavaScript">
function open_close_item(num) {
x='c'+num+'_sub'

if(document.getElementById(x).style.display=='none'){

document['c'+num+'_folder'].src='templates/lqta/images/minus.gif'
document.getElementById(x).style.display=''

}
else{
document.getElementById(x).style.display='none'
document['c'+num+'_folder'].src='templates/lqta/images/plus.gif'
}
}
</SCRIPT>
<!-- END show hide -->

</head>
<body>

<p align="right"><font size="2" face="Tahoma">&nbsp;<img name="c0_folder" border="0" src="http://www.lqta.com/gallery/templates/lqta/templates/default-arabic/images/minus.gif" style="cursor:hand" onclick="javascript:open_close_item(0)" width="9" height="9"> </font> 



<table id="c8_sub" border="1" width="100%" id="table1">
<tr>
<td>Cpntent</td>
</tr>
</table>



</body>
</html>
Title: Re: [MOD] Last comments v1
Post by: pht3k on December 24, 2005, 07:52:50 AM
hi,

this MOD is exactly what i was looking for.  Thanks a lot for the code.
but there is one little thing that doesn't work :
the {image_user_name} tag simply output nothing.

some1 know how to fix this bug ?

thanks,
pht3k
Title: Re: [MOD] Last comments v1
Post by: V@no on December 24, 2005, 01:25:03 PM
Did you do any integrations?
Title: Re: [MOD] Last comments v1
Post by: pht3k on December 24, 2005, 04:09:34 PM
hi V@no,

yes i have phpbb integration.
does it gives you any clue?

thanks,
pht3k
Title: Re: [MOD] Last comments v1
Post by: V@no on December 24, 2005, 06:34:43 PM
well, yes, this mod was not built to support integrations...
Title: Re: [MOD] Last comments v1
Post by: pht3k on December 24, 2005, 07:05:27 PM
argh  :|
Title: Re: [MOD] Last comments v1
Post by: V@no on December 24, 2005, 07:38:43 PM
Ok, can you confirm/deny if replacing in index.php
Code: [Select]
$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").get_user_table_field(", s.", "user_name")." as comment_user_namewith:
Code: [Select]
$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_namewould fix it.
Title: Re: [MOD] Last comments v1
Post by: pht3k on December 24, 2005, 10:37:59 PM
yessssssss

it'S working !!!!

its my first present for christmas this year :)
thanks a lot. 

Have nice hollidays !!!
pht3k


Title: Re: [MOD] Last comments v1
Post by: Zyga on December 27, 2005, 10:51:17 PM
what with comments like

"yeaaaaaaaaaaaaaaaaaaaaahhhhhhh...... "

can i wrap it ?
Title: Re: [MOD] Last comments v1
Post by: V@no on December 28, 2005, 01:31:50 AM
what with comments like

"yeaaaaaaaaaaaaaaaaaaaaahhhhhhh...... "

can i wrap it ?
mmm...actualy this mod is using word wrap settings from your 4images settings...
if you want make it independent from the rest of the comments, replace $config['wordwrap_comments'] with the number of characters per line you wish in these two lines from Step 1
Code: [Select]
    "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),
Title: Re: [MOD] Last comments v1
Post by: Zyga on December 28, 2005, 05:22:56 PM
THX !
Its what I need.  :)
Title: Re: [MOD] Last comments v1
Post by: chip on January 15, 2006, 10:32:16 PM
Hi everyone,

Thanks V@no for this one  :).


I have a problem with not logged in visitors. My entire "last comments box" shows up for visitors only on one condition, if I give all the right to view image details in the category settings of ACP.

I actually don't want to give visitors the right to view image details, but still want to display the last comments with thumbs on my home.html page.

So my question: is the mod supposed to work like this (not showing up for visitors without the right to look at details), or did I miss something in the installation?


Thanks.
Title: Re: [MOD] Last comments v1
Post by: V@no on January 15, 2006, 10:44:52 PM
Yes, it supposed to work like that, because if you think about it, how guest would possible read the comments if they have no access to the image?
but surely you can change that by removing this code in red:
Quote
        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').")
Title: Re: [MOD] Last comments v1
Post by: chip on January 16, 2006, 01:31:33 AM
again, thanks V@no


I'll remove the code you recommended, because if visitors can view details there is no advantage of registering at my site.

Title: Re: [MOD] Last comments v1
Post by: anderitor on February 22, 2006, 09:40:09 PM
When I install this mode, I get an error:

Parse error: parse error, unexpected '<' in /usr/export/www/vhosts/funnetwork/hosting/kl102/Bilder/images/includes/template.php(101) : eval()'d code on line 99

What can I do?
Title: Re: [MOD] Last comments v1
Post by: V@no on February 23, 2006, 12:59:16 AM
Restore backups and try again.
Make sure you upload .php and .html files in ACSII mode and not in BINARY
Title: Re: [MOD] Last comments v1
Post by: Nasser on April 18, 2006, 07:11:09 PM
is there is an option that says to the member you have XX comments on your images since last visit ?
Title: Re: [MOD] Last comments v1
Post by: IWS_steffen on April 18, 2006, 09:21:00 PM
thanks V@no

thank you very much!!!

I got this now

Steffen
Title: Re: [MOD] Last comments v1
Post by: live@ct on May 10, 2006, 04:08:36 AM
how can I integrate this script to cut the last comments in a numbers of characters

I found this code

Code: [Select]
function limit_string($cadena,$limite)
{
    $cadena=explode('<rup> ',wordwrap( $cadena, $limite,'<rup>'));
    return $cadena[0]."...";
}

$cadena="Este es un texto de prueba para ver el funcionamiento de la funcion
de cortar el texto sin cortar las palabras";

echo limit_string($cadena,50);
Title: Re: [MOD] Last comments v1
Post by: Buspilotin on June 04, 2006, 05:37:00 PM
very good mod, thankyou!!!!
Title: Re: [MOD] Last comments v1
Post by: V@no on June 04, 2006, 08:15:08 PM
@live@act:
look in the code from Step 1:
Code: [Select]
$text_len = 200; //max lenght of the text to show (bbcode and html are counted too)
Title: Re: [MOD] Last comments v1
Post by: b.o.fan on June 29, 2006, 10:37:52 PM
hello @ all.

i've installed this great Mod. i've got the Version 1.72 of 4images.

one of my users said: Hey, admin, i can see only the "actual" comments!
when he click on the other pages [1], [2] or something like this... he see only the first page.  :? :(

you want see?

look @

http://www.wartenaufden15.de/member.php?action=showcomments&user_id=1

and

http://www.wartenaufden15.de/member.php?action=showcomments&user_id=1&page=44

too login:
user = test
password = test

can somebody help?
Title: Re: [MOD] Last comments v1
Post by: mawenzi on June 29, 2006, 10:53:47 PM
@ b.o.fan

... das ist wohl nicht der richtige MOD ...
... ich denke dieser hier : http://www.4homepages.de/forum/index.php?topic=4131.msg16839#msg16839
Title: Re: [MOD] Last comments v1
Post by: b.o.fan on June 30, 2006, 10:12:32 AM
@ b.o.fan

... das ist wohl nicht der richtige MOD ...
... ich denke dieser hier : http://www.4homepages.de/forum/index.php?topic=4131.msg16839#msg16839
ohh ja stimmt. sry. werd ich da ma probieren :D
Title: Re: [MOD] Last comments v1
Post by: Alex_Ok on July 03, 2006, 05:35:36 PM
Подскажите пожалста как можно сделать чтобы пользователь мог подписаться на новые сообщения т.е. мог следить за новыми коментариями с уведомлением по е-майл  не только хозяин странички., а любой желающий, поставив галочку или введя свой е-mail.
Title: Re: [MOD] Last comments v1
Post by: Alex_Ok on July 10, 2006, 08:41:12 PM
 :?: :D
Title: How to create a link form home.html to new page (.html)?
Post by: nubits on July 15, 2006, 05:06:20 PM
Hi everybody... I just installed the V@no's MOD Last Comments v1.0. It works great, but I dont want to see it in home.html. I want to put a link in user_logininfo.html above "logout" for example and to open other page (with the same template layout and design) with the last comments. The same result as in the home.html, but in other page. I tryed, but the new page shows only text and {...} functions?!? Please Help me... I searched the forum, but didnt find solution.
Title: Re: [MOD] Last comments v1
Post by: nubits on July 15, 2006, 10:55:21 PM
I solve my problem... If somebody is interested, I can explain it... PM me :D
Title: Re: [MOD] Last comments v1
Post by: sy4k4 on July 26, 2006, 12:59:03 AM
Last Comments v1 not show & no error  :( in my homepage
i use 4images 1.7.2
i  put mod in member.html
please help me.....  :(

thank's before
Title: Re: [MOD] Last comments v1
Post by: heart_hacker on August 02, 2006, 04:00:27 PM
I installed Last comment mod but still i have got this  Warning messages Some one plz help me  as you can see last comment mod appear but has got  blue background some one plz help me tanx alot  http://www.afghanpanah.com/cards/

$lang['last_comments'] = "Last comments"; $lang['last_comments_more'] = "More comments";$lang['last_comments'] = "Last comments"; $lang['last_comments_more'] = "More comments";
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /customers/afghanpanah.com/afghanpanah.com/httpd.www/cards/lang/english/main.php:373) in /customers/afghanpanah.com/afghanpanah.com/httpd.www/cards/includes/sessions.php on line 86

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /customers/afghanpanah.com/afghanpanah.com/httpd.www/cards/lang/english/main.php:373) in /customers/afghanpanah.com/afghanpanah.com/httpd.www/cards/includes/sessions.php on line 86

Warning: Cannot modify header information - headers already sent by (output started at /customers/afghanpanah.com/afghanpanah.com/httpd.www/cards/lang/english/main.php:373) in /customers/afghanpanah.com/afghanpanah.com/httpd.www/cards/includes/sessions.php on line 94

Warning: Cannot modify header information - headers already sent by (output started at /customers/afghanpanah.com/afghanpanah.com/httpd.www/cards/lang/english/main.php:373) in /customers/afghanpanah.com/afghanpanah.com/httpd.www/cards/includes/sessions.php on line 94
Title: Re: [MOD] Last comments v1
Post by: V@no on August 02, 2006, 06:49:29 PM
covered in FAQ
Title: Re: [MOD] Last comments v1
Post by: Fryz on August 03, 2006, 11:11:14 AM
beim klick auf "more comments" werde ich ins kontrollzentrum geleitet. mehr Kommentare werden aber nicht angezeigt. hab ich da auch nen fehler gemacht?

danke
Title: Re: [MOD] Last comments v1
Post by: anephew on August 03, 2006, 08:29:39 PM
hello 2all.
Somebody please tell me about compatibility this mod with version 1.7.3
Sanks.
Title: Re: [MOD] Last comments v1
Post by: luener on August 21, 2006, 06:27:17 PM
Great,  :D
thx for this Mod.

It works in my Categorys at  :arrow:www.luener-design.de.vu (http://www.luener-design.de.vu)

Greets
RALF :flag-de:
Title: Re: [MOD] Last comments v1
Post by: JinYoshi on September 15, 2006, 03:31:54 PM
Great thx!
It's work perfect on my web: http://nusansifor.com/index2.php
Title: Re: [MOD] Last comments v1
Post by: JinYoshi on September 15, 2006, 03:33:04 PM
hello 2all.
Somebody please tell me about compatibility this mod with version 1.7.3
Sanks.

Yes, yes, yes! It's work perfect..
Title: Re: [MOD] Last comments v1
Post by: qpatrick on November 01, 2006, 12:05:50 PM
and works also with 1.7.4
Title: Re: [MOD] Last comments v1
Post by: desperate_housewif 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?

Title: Re: [MOD] Last comments v1
Post by: mawenzi on November 13, 2006, 09:33:54 AM
@ desperate_housewif

... zu finden ... hier ... http://www.4homepages.de/forum/index.php?topic=10632.0
Title: "Last Comments" shown in Firefox but not in Internet Explorer! (deutsch/english)
Post by: koikonut 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
Title: Re: "Last Comments" shown in Firefox but not in Internet Explorer! (deutsch/engl
Post by: koikonut 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
Title: Re: "Last Comments" shown in Firefox but not in Internet Explorer! (deutsch/engl
Post by: koikonut 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!
Title: Re: [MOD] Last comments v1
Post by: Nicky on November 28, 2006, 10:56:35 PM
merged with this MOD!

mod's to mod's... ;)
Title: Re: [MOD] Last comments v1
Post by: koikonut 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 ! :-)
Title: Re: [MOD] Last comments v1
Post by: live@ct 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!
Title: Re: [MOD] Last comments v1
Post by: 0uistyty 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
Title: Re: [MOD] Last comments v1
Post by: CeJay 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
Title: Re: [MOD] Last comments v1
Post by: 0uistyty 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 ;)
Title: Re: [MOD] Last comments v1
Post by: CeJay 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
Title: Re: [MOD] Last comments v1
Post by: CeJay 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
Title: Re: [MOD] Last comments v1
Post by: 0uistyty on January 20, 2007, 11:52:52 AM
thanks
I'l take a look at it toonight  :P
Title: Re: [MOD] Last comments v1
Post by: 0uistyty on January 20, 2007, 11:27:07 PM
well. I'm not smart anough in SQL Query and php...

I ask them how can I modify it... to get the result I want...

I'll will keep trying. but I expect nothing from my brain at this time  :?

Thanks for the link.

/0uistyty
Title: Re: [MOD] Last comments v1
Post by: CeJay on January 21, 2007, 07:10:28 AM
If I new I would help, but I am still learning SQL stuff and not that great at it.
Title: Re: [MOD] Last comments v1
Post by: 0uistyty on January 21, 2007, 05:51:10 PM
OK, It's now resolved !!!

Thanks to r937  (http://www.sitepoint.com/forums/member.php?u=19900) from sitepoint forum (http://www.sitepoint.com/forums) 

Here's the code to show the 5 last media that have been commented.
Replace
Code: [Select]
$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;

By
Code: [Select]
$sql = "select i.cat_id, i.user_id, i.image_name, i.image_media_file, i.image_thumb_file, u.user_name as user_name, 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, s.user_name as comment_user_name
         from ".IMAGES_TABLE." as i
        inner
         join ".USERS_TABLE." as u
          on u.user_id  = i.user_id
        inner
         join ".COMMENTS_TABLE." as  c
          on c.image_id = i.image_id
         and c.comment_date =
            ( select max(comment_date)
                from ".COMMENTS_TABLE."
              where image_id = i.image_id )
        inner
         join ".USERS_TABLE." as s
           on 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;

Best regards.

/0uistyty
Title: Re: [MOD] Last comments v1
Post by: son_gokou on April 19, 2007, 02:19:29 PM
what about part 2?
Title: Re: [MOD] Last comments v1
Post by: mawenzi on April 19, 2007, 05:08:58 PM
what about part 2?

... Part 2 - A separate page with list of all comments, with paging ...
... [MOD] All Comments (Alle Kommentare) V.1.3 ...
... http://www.4homepages.de/forum/index.php?topic=10632.0 ...
Title: Re: [MOD] Last comments v1
Post by: son_gokou on April 20, 2007, 02:05:17 AM
Thanks :) 100% ok!
Title: Re: [MOD] Last comments v1
Post by: ccsakuweb on May 10, 2007, 05:02:11 PM
I added a new page to last comments not in home.

With Vano's modifications please copy index.php and rename to lastcomments.php

delete Vano's modifications from index.php and home.html and delete last_comment_bit.html

search in lastcomments.php:
Code: [Select]
$templates_used = 'in the line add after:
Code: [Select]
last_comment,last_comment_bit,
search
Code: [Select]
$main_template = 'home';
replace to:
Code: [Select]
$main_template = 'last_comment';
Create a new template templates/<your template>/last_comment_bit.html with the folowing code:
Code: [Select]
              <TR class="row{row_bg_number}">
                <TD align="center" valign="top" nowrap="nowrap">
                  <b>{comment_image_name}</b> <br>{comment_image}<br>Categoria: {image_cat_name}<br><br>Por: {comment_user_name}{if comment_guest} ({comment_guest}){endif comment_guest}<br />
                  {comment_date}
                </TD>
               <TD>{comment_headline}<hr>{comment_text}</TD>
              </tr>

Create a new template templates/<your template>/last_comment.html (edit error.html in example) and where you want add:
Code: [Select]
<span class="title">{lang_last_comments}:</span>
  <br><br>{if last_comments}
                  <table width="450" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td class="head1">
                        <table width="100%" border="0" cellspacing="0" cellpadding="3">
                          <tr>
                            <td class="head1" valign="top" colspan="5">{lang_last_comments}</td>
                          </tr>
                          {last_comments}
                        </table>
                      </td>
                    </tr>
                  </table>
                  <br />
{endif last_comments}


Now you could see last comments in http://www.yoursite.com/lastcomments.php

Demo: http://www.myart.es/lastcomments.php
Title: Re: [MOD] Last comments v1
Post by: Schmidti on May 19, 2007, 01:25:00 PM
Hi... i have few questions to this mod:

(http://www.world-party.de/privat/bilder/kommentare.jpg)
1.

Is it possible to show only Pages like: "1,2,3,..." and if you click on "..." --> "... 3, 4, 5, 6 ..."
Because i dont like to show 46 links at one time...

Ist es möglich die Anzeige so zu ändern: "1, 2, 3,..." und wenn man nun auf "..." klickt --> "... 3, 4, 5, 6, ..."
Denn ich möchte keine 46 Links auf einmal anzeigen

2.
At my style links are shown as blue. But is possible to show them only here yellow like "Alle Kommentare"?

In meinem Style werden Links immer blau angezeigt. Ist es jedoch möglich die Links nur here auch gelb anzeigen zu lassen, wie "Alle Kommentare"?


(http://www.world-party.de/privat/bilder/kommentare2.jpg)

3. With the Internet Exploer you see the new Comments like this screenshot. At the Nameplace the space is to large. Can i change this?

 Im Internet Explorer werden die neuen Kommentare so angezeigt. Bei den Namen ist der Platz jedoch zu groß. Kann man das ändern?

Title: Re: [MOD] Last comments v1
Post by: mawenzi on June 17, 2007, 02:13:10 PM
@Schmidti

... dieser MOD ist eigentlich nur für eine begrenzte Anzahl der letzten Kommentare auf der Index-Seite ...
... wenn du alle Kommentare deiner Website incl. einem korrekten Paging zeigen willst ...
... dann solltest du diesen MOD verwenden ...
... [MOD] All Comments (Alle Kommentare) V.1.3 ...
... http://www.4homepages.de/forum/index.php?topic=10632.0 ...

Title: Re: [MOD] Last comments v1
Post by: Darkness2001 on August 02, 2007, 01:54:14 AM
Hi @ all,

also wer nur bestimmte Anzahl an "last comments" auf der startseite sehen will kann das einfach hiermit machen...

Part 1.

index.php
find this

Code: [Select]
ORDER BY c.comment_date DESC
LIMIT ".$num;

und ersetzen durch:


Code: [Select]
ORDER BY c.comment_date DESC
LIMIT 2";

thats all  :wink:

Greetings darkness  :mrgreen:
Title: Re: [MOD] Last comments v1
Post by: Mr_LovaLove on August 26, 2007, 06:18:43 PM
well, its really good MOD !

but was wondering ! why the owner of the image is not included !?

and how can we added !

my site is running and worry to play with the code !

coz im not at home !

also, the code shows 7 comments ! can we make a dropdown list so the user can show how many images can be showed in the main page ( im not using part 2 )

for ex: min is 7 and max is 15 comments !

---------------------

can someone trans the above msg ^

LIMIT 2 << its for wht ?
Title: Re: [MOD] Last comments v1
Post by: Michinator on September 06, 2007, 03:52:35 PM
I added a new page to last comments not in home.

With Vano's modifications please copy index.php and rename to lastcomments.php

delete Vano's modifications from index.php and home.html and delete last_comment_bit.html

search in lastcomments.php:
Code: [Select]
$templates_used = 'in the line add after:
Code: [Select]
last_comment,last_comment_bit,
search
Code: [Select]
$main_template = 'home';
replace to:
Code: [Select]
$main_template = 'last_comment';
Create a new template templates/<your template>/last_comment_bit.html with the folowing code:
Code: [Select]
              <TR class="row{row_bg_number}">
                <TD align="center" valign="top" nowrap="nowrap">
                  <b>{comment_image_name}</b> <br>{comment_image}<br>Categoria: {image_cat_name}<br><br>Por: {comment_user_name}{if comment_guest} ({comment_guest}){endif comment_guest}<br />
                  {comment_date}
                </TD>
               <TD>{comment_headline}<hr>{comment_text}</TD>
              </tr>

Create a new template templates/<your template>/last_comment.html (edit error.html in example) and where you want add:
Code: [Select]
<span class="title">{lang_last_comments}:</span>
  <br><br>{if last_comments}
                  <table width="450" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td class="head1">
                        <table width="100%" border="0" cellspacing="0" cellpadding="3">
                          <tr>
                            <td class="head1" valign="top" colspan="5">{lang_last_comments}</td>
                          </tr>
                          {last_comments}
                        </table>
                      </td>
                    </tr>
                  </table>
                  <br />
{endif last_comments}


Now you could see last comments in http://www.yoursite.com/lastcomments.php

Demo: http://www.myart.es/lastcomments.php


It works perfect. Thank you! But I have two questions:

1. Is it possible to delete the link from photo name and username so that photo name (e. g. r1000) and username are being displayed without link?
2. Is it possible to show how many comments have been posted to a photo? ("Kommentare: 6")

It could look like this: (http://i9.tinypic.com/534ospz.jpg)

Thank you in advance!

Take care,
your Michinator.
Title: Re: [MOD] Last comments v1
Post by: ccsakuweb on September 10, 2007, 09:00:14 AM

It works perfect. Thank you! But I have two questions:

1. Is it possible to delete the link from photo name and username so that photo name (e. g. r1000) and username are being displayed without link?
2. Is it possible to show how many comments have been posted to a photo? ("Kommentare: 6")

It could look like this: (http://i9.tinypic.com/534ospz.jpg)

Thank you in advance!

Take care,
your Michinator.
1.
Search in lastcomments.php:
Code: [Select]
"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']),
   

Replace to:
Code: [Select]
"comment_image_name" => stripslashes($row['image_name']),
   

search:
Code: [Select]
"image_user_name" =>   ($image_user_link) ? "<a href=\"".$image_user_link."\">".$image_user_name."</a>" : $image_user_name,
   
replace to:
Code: [Select]
"image_user_name" =>   $image_user_name,
   

Total comments i didnt tried it because i dont have time enough but try this
search
Code: [Select]
$bgcounter = 1;
while ($row = $site_db->fetch_array($result))
{
after add:
Code: [Select]
$sql = "SELECT COUNT(*) AS counter
        FROM ".COMMENTS_TABLE."
        WHERE image_id=".$row['image_id'])."";
       
$comments_count = $site_db->query_firstrow($sql);

search:
Code: [Select]
    "comment_image" => ($view_image) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$row['image_id'])."\">".$thumb."</a>" : $thumb,add after:
Code: [Select]
    "comment_total" => (isset($comments_count['counter']) && $comments_count['counter']) ? $comments_count['counter'] : 0,
Good luck ;)
Title: Re: [MOD] Last comments v1
Post by: Michinator on September 10, 2007, 12:00:54 PM
Thank you very much! Everything works fine, but I had to delete ")" in this code: ;)

Code: [Select]
WHERE image_id=".$row['image_id'])."";

Also one question: How can I enlarge the space between the content of the cell and the cell wall? (look at the yellow lines) I tried it with cellpadding or cellspacing, but it's not working.

(http://i5.tinypic.com/5xzynna.jpg)

The code of "lastcomments_bit.html" is:

Code: [Select]
<tr class="row{row_bg_number}">
<td valign="top" align="left" height="80" width="90">
{comment_image}
<br>
<b>{comment_image_name}</b>
<br>
{image_cat_name}
<br>
Kommentare: {comment_total}
</td>
<td valign="top" align="left">
<font color="#FFFFE5">
{comment_date} &#x95; {comment_user_name}
</font>
<br>
{comment_text}
</td>
</tr>

Take care,
your Michinator.
Title: Re: [MOD] Last comments v1
Post by: thunderstrike on September 10, 2007, 12:46:49 PM
Quote
Thank you very much! Everything works fine, but I had to delete ")" in this code:

Code: [Select]
WHERE image_id=".$row['image_id'];

Is good. ;)
Title: Re: [MOD] Last comments v1
Post by: Michinator on September 18, 2007, 10:31:05 PM
Huhu, nobody there who can help me?  :lol:

How can I enlarge the space between the content of the cell and the cell wall? (look at the yellow lines) I tried it with cellpadding or cellspacing, but it's not working.

(http://i5.tinypic.com/5xzynna.jpg)

The code of "lastcomments_bit.html" is:

Code: [Select]
<tr class="row{row_bg_number}">
<td valign="top" align="left" height="80" width="90">
{comment_image}
<br>
<b>{comment_image_name}</b>
<br>
{image_cat_name}
<br>
Kommentare: {comment_total}
</td>
<td valign="top" align="left">
<font color="#FFFFE5">
{comment_date} &#x95; {comment_user_name}
</font>
<br>
{comment_text}
</td>
</tr>

Thank you in advance!  :D

Take care,
your Michinator.
Title: Re: [MOD] Last comments v1
Post by: thunderstrike on September 19, 2007, 01:05:16 AM
replace:

Quote
<tr class="row{row_bg_number}">
<td valign="top" align="left" height="80" width="90">
{comment_image}
<br>
<b>{comment_image_name}</b>
<br>
{image_cat_name}
<br>
Kommentare: {comment_total}
</td>
<td valign="top" align="left">
<font color="#FFFFE5">
{comment_date} &#x95; {comment_user_name}
</font>
<br>
{comment_text}
</td>
</tr>

with:

Code: [Select]
<tr class="row{row_bg_number}">
<td valign="top" align="left" height="80" width="90">
<img src="{template_url}/images/spacer.gif" width="8" height="8" alt="" />
{comment_image}
<br>
<b>{comment_image_name}</b>
<br>
{image_cat_name}
<br>
Kommentare: {comment_total}
</td>
<td valign="top" align="left">
<img src="{template_url}/images/spacer.gif" width="8" height="8" alt="" />
<font color="#FFFFE5">
{comment_date} &#x95; {comment_user_name}
</font>
<br>
{comment_text}
</td>
</tr>
Title: Re: [MOD] Last comments v1
Post by: Tino23 on October 15, 2007, 06:49:10 PM
Die Frage wurde zwar einige Postings zu vor schon mal gestellt, aber ich hab da noch keine Antwort gefunden in der main.php wird ein Eintrag gemacht $lang['last_comments_more'] = "More comments"; der nirgends mit eingebaut ist, im besagtem Teil2 dieses Mods All Comments (Alle Kommentare) V_1_3 kommt für diese Funktion ein neuer Eintrag $lang['all_comments'] = "Alle Kommentare"; so das doch er vorherige Eintrag "Sinnloß" ist und doch gelöscht werden könnte oder sehe ich das falsch?

9.12.2007  :?:
Title: Re: [MOD] Last comments v1
Post by: NetRebel on July 20, 2008, 03:24:44 PM
Really Excellent MOD, thanks a lot! One tiny little remark/correction though...

I am using 4images for a (PSP) UMD movie list with info. Therefore I changed the image_id tag to umd_id in constants.php. (That way the URLs look nicer for a UMD specific site.) Because of this I had to change the line...

Code: [Select]
"comment_image" => ($view_image) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$row['image_id'])."\">".$thumb."</a>" : $thumb,
...to...

Code: [Select]
"comment_image" => ($view_image) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?umd_id=".$row['image_id'])."\">".$thumb."</a>" : $thumb,
Wouldn't it be better and more correct following the 4images structure to have this part in the code follow the settings in constants.php? That way your mod will work for anyone who also changed the image_id to something else.

For the rest, great mod, I like it a lot and it was very easy to implement. Thanks again!  :thumbup:
Title: Re: [MOD] Last comments v1
Post by: Boatswain on September 04, 2008, 06:42:02 PM
Just installed this mod and it seems to work fine  :wink:
Only one problem, the captcha/image verification image doesn't show up anymore on the comment page. You can only see a x there were the image is supposed to be.
Version 1.7.4
I hope you can help me.
Title: Re: [MOD] Last comments v1
Post by: V@no on September 05, 2008, 12:28:05 AM
Can you create a temp category where guests can post comments so I could see it in action?
Title: Re: [MOD] Last comments v1
Post by: Boatswain on September 05, 2008, 10:15:58 AM
Can you create a temp category where guests can post comments so I could see it in action?


I just created a category called Temp with 5 images and comments for all.
When I upload the unedited files the captcha image is back again.
I'm using Old Style as template and English as language.

This is how the created last_comment_bit.html looks like:

              <TR class="row{row_bg_number}">
                <TD width="50" height="30" align="center" rowspan="2">
                  {comment_image}
                </TD>
                <TD rowspan="2" >{comment_image_name}</TD>
                <TD 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="row{row_bg_number}">
                <TD>{comment_text}</TD>
              </TR>
Title: Re: [MOD] Last comments v1
Post by: V@no on September 05, 2008, 03:15:58 PM
If you save your files in UTF8/UTF16 (Unicode) encoding, you must make sure that the editor doesn't add so called BOM (http://unicode.org/faq/utf_bom.html#BOM) to the file. If editor doesn't have such feature add or not "BOM", then change the editor ;)
There is no need save php files in other encoding then ACSII unless its a language file.

Your captcha image generated with three extra bytes at the beginning (EF BB BF) which is BOM for UTF8 encoding (in fact all your pages generated with these three extra bytes). Save all php files that you have edited with that editor in ACSII encoding and it should fix the problem.
Title: Re: [MOD] Last comments v1
Post by: Boatswain on September 05, 2008, 06:11:27 PM
If you save your files in UTF8/UTF16 (Unicode) encoding, you must make sure that the editor doesn't add so called BOM (http://unicode.org/faq/utf_bom.html#BOM) to the file. If editor doesn't have such feature add or not "BOM", then change the editor ;)
There is no need save php files in other encoding then ACSII unless its a language file.

Your captcha image generated with three extra bytes at the beginning (EF BB BF) which is BOM for UTF8 encoding (in fact all your pages generated with these three extra bytes). Save all php files that you have edited with that editor in ACSII encoding and it should fix the problem.

At least I know now were to look for  :wink:
I used another editor and the captcha image is showing up again  :D Thanks !!
Now I have a different problem and can't figure it out what's causing it.
On top of the last comments it creates extra tables, the more number of last comments the more tables.
See picture here:  http://www.boatswain.nl/pictures/picture.jpg (http://www.boatswain.nl/pictures/picture.jpg)


Title: Re: [MOD] Last comments v1
Post by: V@no on September 06, 2008, 12:26:44 AM
Sorry, can't help with template issues, probably an extra <td> or <tr> somewhere..
Title: Re: [MOD] Last comments v1
Post by: Hello-world on September 07, 2008, 04:50:49 PM
 :mrgreen: nice mod... thanks
Title: Re: [MOD] Last comments v1
Post by: Boatswain on September 08, 2008, 03:06:54 PM
Sorry, can't help with template issues, probably an extra <td> or <tr> somewhere..

I can't find the problem either so I removed the mod, allthought the mod itself works great !!
Thanks for your help anyway, it's realy appreciated  :D
Title: Re: [MOD] Last comments v1
Post by: Boatswain on September 09, 2008, 04:11:31 PM
V@no

After one more try (because I wanted this mod so bad !!) I finally succeeded, no more extra rows/tables  :D
Thanks again for your support and this great mod  :thumbup:
Title: Re: [MOD] Last comments v1
Post by: alekinna on September 24, 2008, 01:11:02 PM
Hi, V@no!
Thank you for this great mod! It's work perfect, however as all your mods.
My question is about "image_cat_name"  :
how can I get parametre cat_parent_id from category table to display the parent category name?
Title: Re: [MOD] Last comments v1
Post by: V@no on September 24, 2008, 01:53:44 PM
will this kind of answer make any sense to you?
if ($cat_cache[$row['cat_id']]['cat_parent_id']) //make sure the category is a child and has parent category
{
  $cat_parent_name = $cat_cache[$cat_cache[$row['cat_id']]['cat_parent_id']]['cat_name'];
}
else
{
  $cat_parent_name = "";
}
Title: Re: [MOD] Last comments v1
Post by: alekinna on September 24, 2008, 08:07:04 PM
Excellent! Thank you!
Title: Re: [MOD] Last comments v1 - lang support
Post by: External on October 27, 2008, 07:26:09 PM
I tried to modificate the By: and replaced it with {lang_author} in the last_comment_bit.php (to be able to display the right expression in each language), but now it is not showing anything. Any suggestion?
Title: Re: [MOD] Last comments v1
Post by: alekinna on October 28, 2008, 02:36:56 AM
External
in index.php find
Code: [Select]
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $row['comment_date']),
and add after
Code: [Select]
"lang_author" => $lang['author'],
Title: Re: [MOD] Last comments v1
Post by: External on October 28, 2008, 12:33:44 PM
Yeah, its working now. Thanx
Title: Re: [MOD] Last comments v1
Post by: barkuras on January 05, 2009, 03:22:23 PM
:flag-de: Gibt es eine Möglichkeit diese Tabelle mit Linien zu versehen, weil bei mir damit ein besserer Überblick wäre?

:flag-en: Is it possible to make some borders around or in between?
Title: Re: [MOD] Last comments v1
Post by: mawenzi on January 05, 2009, 11:16:25 PM
@ barkuras

... dazu musst du nur die Tabelle in home.html entsprechend deinen Vorstellungen bearbeiten ...
... z.B. ... border="1" ... oder ... cellspacing="1" ... oder ...
... wichtig wäre auch, dass "row1" und "row2" in der style.css für dein Template unterschiedlich definiert sind ...
... nur so setzen sich die einzelnen Zeilen ( in der last_comment_bit.html ) farblich voneinander ab ...
Title: Re: [MOD] Last comments v1
Post by: barkuras on January 06, 2009, 06:20:17 PM
@ mawenzi

Vielen Dank für deine Hilfe!
Leider bekomme ich das nicht hin, denn wenn es mal komplizierter wird oder es Probleme gibt, dann reicht mein spärliches Wissen nicht mehr.
Ich wollte das einfach "elegant" über die style.css lösen und die einzelnen Zeilen farblich voneinander absetzen. Also jede zweite Zeile vielleicht leicht grau unterlegen. Leider habe ich keine Ahnung wie ich das machen soll. :?
Naja egal, muss das eben so leicht unübersichtlich bleiben.  :roll:

Jedenfalls noch mal Danke für deine Mühe mawenzi!
Title: Re: [MOD] Last comments v1
Post by: mawenzi on January 06, 2009, 07:01:28 PM
@ barkuras

für die Tabellenzeile sind die wechselnden Hintergrundfarben bereits definiert mit ...
Code: [Select]
<TR class="row{row_bg_number}">
deswegen sagte ich bereits, dass in deiner style.css einfach nur "row1" und "row2" mit jeweils unterschiedlichen Hintergrundfarben definiert sein müssen. Problem 1 : kein URL zu deiner Seite, um sich das Problem anzusehen. Problem 2 : ich weiß nicht, welches Template du verwendest. Im default Template sieht die style.css für "row1" und "row2" so aus ...
Code: [Select]
.row1 {
  background-color: #e1e1e1;
  color: #004c75;
}

.row2 {
  background-color: #efefef;
  color: #004c75;
}
Title: Re: [MOD] Last comments v1
Post by: barkuras on January 06, 2009, 07:37:40 PM
@ mawenzi

 8O
Mit dieser Antwort hast du mir unendlich geholfen!
In meiner style.css waren "row1" und "row2" so bezeichnet:

Code: [Select]
.row1 {
  color: #FFFFFF;
}

.row2 {
  color: #3F3F3F;
}

Also kein "background-color" drin! Darauf wäre ich selbst nie gekommen!  :oops:
Nun habe ich das eingefügt und es sieht genauso aus wie ich mir das vorgestellt habe!  :)

Noch mal: Vielen Dank mawenzi! :thumbup:
Title: Re: [MOD] Last comments v1
Post by: _AsX_ on February 09, 2009, 09:10:50 AM
hi !!!

It's very GoOd Mod ! :D

Thx :D
Title: Re: [MOD] Last comments v1
Post by: d1eter on February 20, 2009, 05:45:00 AM
cool mod...
works on the first try.


http://batamphotoclub.co.cc


thanx..!!
Title: Re: [MOD] Last comments v1
Post by: AntiNSA2 on March 01, 2009, 02:57:33 PM
Hey.... its soo good to be back. My question... I forgot how I did this before. I have the mod to show user flag in comment bit, and I can show users flag of people online on home and in control panel...

How can I show user flag in recent comment list on this mod ?
Title: Re: [MOD] Last comments v1
Post by: AntiNSA2 on March 04, 2009, 05:29:13 PM
And how can you change the image thumb size
Title: Re: [MOD] Last comments v1
Post by: mawenzi on March 04, 2009, 10:00:25 PM
@AntiNSA2

Code: [Select]
$thumb_size = 48; //max dim of thumbnails in pixels
Title: Re: [MOD] Last comments v1
Post by: AntiNSA2 on March 05, 2009, 06:02:15 AM
thanks!

dont know how I missed that one!
Title: Re: [MOD] Last comments v1
Post by: ucladidas on March 11, 2009, 10:57:30 AM
Is there a way to display the user first and last name instead of user name?  I have the additional custom db fields of user_firstname and user_lastname.  How can I have these show up instead of the username.

Thanks.
Title: Re: [MOD] Last comments v1
Post by: V@no on March 11, 2009, 02:25:40 PM
Re-do step 1 and customize your template to your needs (the list of new tags you can find at the bottom of first post)
Title: Re: [MOD] Last comments v1.1.0
Post by: AntiNSA2 on March 11, 2009, 03:24:55 PM
Replying to the correct thread...

how do we get the user flag to display on home.html wise one :)
Title: Re: [MOD] Last comments v1.1.0
Post by: ucladidas on March 12, 2009, 02:02:17 AM
V@no,

Thank you for your quick reply and posting a new code.  The {comment_additionalUserFieldName} and {image_user_additionaUserFieldName} don't seem to be working.  I just get blanks.  The additional field name I use (which is inputted in registration page and subsequently does show up in member profile pages) are user_firstname and user_lastname.  When I try using those tags (i.e., {comment_user_firstname} and even {comment_firstname}) nothing shows up on the webpage.

Do you have any ideas what might be going on?  Thank you for your help.
Title: Re: [MOD] Last comments v1.1.0
Post by: V@no on March 12, 2009, 03:07:59 AM
hmmm strangely not all changes I've made in my editor endup here...sorry about that,
Re-do step 1 again.
In your case {comment_user_firstname} is what you are looking for.

P.S.
I did not test the changes myself, hopefully I didn't mess it up.
Title: Re: [MOD] Last comments v1.1.0
Post by: ucladidas on March 13, 2009, 10:44:00 PM
Hi V@no,

I tried re-pasting your changes, but now I get a "DB error", saying that there is an error in my SQL syntax...
Title: Re: [MOD] Last comments v1.1.0
Post by: V@no on March 14, 2009, 01:15:08 AM
I'm sorry, put an extra comma at the end:
Code: [Select]
$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, $additional_sql

Correct line is:
Code: [Select]
$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 $additional_sql

I've updated the original post with the correct line.
Title: Re: [MOD] Last comments v1.1.0
Post by: ucladidas on March 16, 2009, 08:41:18 AM
I still get blanks.  Nothing shows up on the webpage when I try using the {comment_user_firstname} tag...
Title: Re: [MOD] Last comments v1.1.0
Post by: V@no on March 16, 2009, 01:26:23 PM
ok, I found what I did wrong. Re-do step 1 one more time. it should work now.
Sorry about that.

Title: Re: [MOD] Last comments v1.1.0
Post by: ucladidas on March 16, 2009, 07:04:56 PM
Perfect!  Thank you so much!  Your skills are unparalleled...
Title: Re: [MOD] Last comments v1.1.0
Post by: AntiNSA2 on April 01, 2009, 03:12:16 PM
Greetigns...

Two questions

1) I tried to get user flags to work with this mod, but they always show the lan.gif.... even though the user flags mods works in the other comment areas...

And...

how can you get the google Ajax translation from this thread http://www.4homepages.de/forum/index.php?topic=24018.new#new

to work on this? I tried to change the code by replacing this in

<div id="translate_comment_{comment_id}">{comment_text}</div>


last_comment_bit.html

and I added this

<p>View this Comment in: <a href="javascript:google_translate('en','comment',{comment_id});"><img src="{template_url}/images/gb.png" border="0"></a> <a href="javascript:google_translate('de','comment',{comment_id});"><img src="{template_url}/images/de.png" border="0"></a> <a href="javascript:google_translate('fr','comment',{comment_id});"><img src="{template_url}/images/fr.png" border="0"></a></p>

I can see the flags but it doesnt translate....

however the mod does work fine in the normal comment_bit template....



Thanks great master for your input.... :)
Title: Re: [MOD] Last comments v1.1.0
Post by: 4ella on April 18, 2009, 04:00:43 PM
Gotta say compliments to the authors of this Mod , works perfectly , easy 5 minuts instalation . Thought that most Mods here are only till 1.7.2 - 1.7.4 because I see mostly very old posts , but maybe I was wrong . Wanted to ask the people who create those Mods (authors) : Are you always trying the update the original (first )posts? I'm new here and I like many MOds here , but I'm forced to read all the pages from the year 2002 till 2009 if the Mod is also working in latest  1.7.6 version ,  Thanks again !!!
Title: Re: [MOD] Last comments v1.1.0
Post by: rescue911 on April 19, 2009, 01:12:52 PM
i already have this mod installed for a while and it works just perfectly.
however today i switched over to "thumbnail_openwindow" which also works ok. however i had to modify the top.html to make it work there.

but my problem now is that when i click on the pictures or text links from the last comments, it does not open a pop-up but opens directly in the same window.
so my question: what do i need to modify there?
Title: Re: [MOD] Last comments v1.1.0
Post by: V@no on April 19, 2009, 09:03:00 PM
re-do step 1 and use {comment_image_openwindow} and {comment_image_name_openwindow} tags in last_comment_bit.html template
Title: Re: [MOD] Last comments v1.2.0
Post by: rescue911 on April 19, 2009, 09:57:09 PM
ok now it does not open anymore in the same window. i now get it in a new tab of my browser.
but...how to make to get it as a pop-up, just like the details pages with "thumbnail_openwindow"?
Title: Re: [MOD] Last comments v1.2.0
Post by: V@no on April 19, 2009, 10:12:34 PM
ok, try again re-do step 1
Title: Re: [MOD] Last comments v1.2.0
Post by: rescue911 on April 19, 2009, 10:36:30 PM
*perfect*
Title: Re: [MOD] Last comments v1.2.0
Post by: sanko86 on June 14, 2009, 10:51:18 AM
thank you.Perfect mod.

Demo:www.elemegim.info
Title: Re: [MOD] Last comments v1.2.0
Post by: daymos on July 05, 2009, 04:07:33 PM
Hi All!
How to display {user_avatar_current}?
Title: Re: [MOD] Last comments v1.2.0
Post by: Sebas Bonito on July 10, 2009, 12:13:52 AM
Thanx for this mod... Just this tiny question:

I've already added this part:
Code: [Select]
 if (strlen($text) > $text_len)
  {
    $text = substr($text, 0, $text_len)."...";
  }

with this one below...

Code: [Select]
 if (strlen($row['image_name']) > 19)
  {
    $row['image_name'] = substr($row['image_name'], 0, 19)."...";
  }

With that, the image-title is not so long (in this case 19) and fits to the size of my thumb.

Update: I guess it's not the best version, but I've found a solution. Open thumbnail_bit.html in the template-order and replace {image_name} with
Code: [Select]
<?
    $shortname = "{image_name}";
  if (strlen($shortname) > 19)
  {
    $shortname = substr($shortname, 0, 19)."...";
  }
  echo $shortname;
?>
...to limit it to 19 signs.



But still need support with:

NOW I'd like to delete the <br /> which are included sometimes, if an user made a
"word wrap". But the following code doesn't work (Below line 77 in the index.php, where
$text = $row['comment_text']; is shown)

Code: [Select]
$text = str_replace("<br />","",$text);
Any ideas, what I made wrong?  :(



Something else: How to avoid double-posts? So that max. one thumb appears (in the home.html), when 2 or more comments are in one photo?
Title: Re: [MOD] Last comments v1.2.0
Post by: Sebas Bonito on July 12, 2009, 01:30:14 PM
Hi V@no,

you should change the following part in the index.php
Code: [Select]
  if (strlen($text) > $text_len)
  {
    $text = substr($text, 0, $text_len)." ...";
  }
to this...
Code: [Select]
  if (strlen($text) > $text_len)
  { $text = strip_tags($text);
    $text = substr($text, 0, $text_len)." ...";
  }
...in case you've allowed your users to write comments in HTML.
Otherwise (and with $text_len) it will destroy your layout.
Title: Re: [MOD] Last comments v1.2.0
Post by: Tino23 on July 18, 2009, 11:31:15 AM
Hi, der Mod läuft bei mir schon seit einiger Zeit super. Hab bloß leztens mal bemerkt, das der BBCode in den Kommentaren nicht richtig angezeigt wird... Gibts da eine Möglichkeit sich den BBCODe auch in der Übersicht der letzten Kommentare richtig anzeigen zu lassen?
Title: Re: [MOD] Last comments v1.2.0
Post by: Sebas Bonito on July 19, 2009, 03:43:44 AM
Hi, der Mod läuft bei mir schon seit einiger Zeit super. Hab bloß leztens mal bemerkt, das der BBCode in den Kommentaren nicht richtig angezeigt wird... Gibts da eine Möglichkeit sich den BBCODe auch in der Übersicht der letzten Kommentare richtig anzeigen zu lassen?
Wie meinst Du das, "nicht richtig"? Manchmal ja, manchmal nein?
Meines Erachtens liegt nämlich das Hauptproblem in der Variable
Code: [Select]
$text_len = 200; //max lenght of the text to show (bbcode and html are counted too)Die Textlänge bezieht sich auf alles, also auch auf den BBCode und schneidet dann stumpf ab.
Title: Re: [MOD] Last comments v1.2.0
Post by: Tino23 on July 25, 2009, 10:42:22 AM
Na wenn ich unter den Bildern ein Kommentar Schreibe, welches BBD Code enthält zum Beispiel, wenn ich einen Link angeben ähnlich in HTML <a href="home.html">Link</a> wird mit dann unter Nachrichten ja Link angezeigt unt darunter ferbirgt sich dann die eigentliche URL. In dem Fenster letzte Nachrichten wird mir aber nur die eigentliche URL angezeigt und nicht wie gewollt dort auch nur der Schriftzug Link
Title: Re: [MOD] Last comments v1.2.0
Post by: Sebas Bonito on July 25, 2009, 06:10:25 PM
Hast Du denn den BBCode für Kommentare erlaubt?
Title: Re: [MOD] Last comments v1.2.0
Post by: Tino23 on July 26, 2009, 10:53:03 AM
Ja, in der Galerie selber geht es ja auch, nur auf der Startseite, wo die letzten Kommentare angezeigt werden, geht es nicht.
Title: Re: [MOD] Last comments v1.2.0
Post by: Sebas Bonito on July 26, 2009, 03:54:48 PM
Dann hängt es mit der Textbegrenzung zusammen (siehe ein paar Beiträge vorher).
Title: Re: [MOD] Last comments v1.2.0
Post by: Tino23 on July 30, 2009, 08:04:34 PM
Danke genau das war es. Hatte bei mir Max. 100 Zeichen eingestellt...
Title: Re: [MOD] Last comments v1.2.0
Post by: sterroa on August 22, 2009, 10:11:38 PM
kann ich dieses mod auch bei 4images 1.7.6 oder 1.7.7 installieren, was muss ich anders machen?

Title: Re: [MOD] Last comments v1.2.0
Post by: CorFie on October 15, 2009, 11:20:51 AM
Ich habs gerade getestet in 1.7.7 funktioniert er auch
Title: Re: [MOD] Last comments v1.2.0
Post by: Lucifix on February 01, 2010, 08:03:36 AM
@v@no: I just ran your sql sentence and I get this result:

Code: [Select]
# Query_time: 9  Lock_time: 0  Rows_sent: 10  Rows_examined: 730943
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, u.user_name as user_name, s.user_name as comment_user_name
        FROM 4images_comments c
        LEFT JOIN 4images_images i ON i.image_id = c.image_id
        LEFT JOIN 4images_users u ON u.user_id = i.user_id
        LEFT JOIN 4images_users s ON s.user_id = c.user_id
        WHERE i.image_active = 1 AND i.image_allow_comments = 1 AND i.cat_id NOT IN (0) AND i.cat_id NOT IN (0) AND i.cat_id NOT IN (0)
        ORDER BY c.comment_date DESC
        LIMIT 0, 10;

What bothers me? Rows_examined: 730943

Do you have any solution for this kind of problem?

Title: Re: [MOD] Last comments v1.2.0
Post by: surferboy on April 22, 2010, 01:44:48 AM
Hi -

I'm using v1.7.7

I just installed the Tooltip for Thumbnails MOD and love its preview capabilities.

I tried adding the code to the last_comment_bit.html, so that the same preview could happen:

Quote
<table width="1%" border="0" cellspacing="0" cellpadding="0" onmouseover="Tip('{image_tip}<br />{image_name}<br />{lang_category} {cat_name}<br />{lang_comments} {image_comments}')" onmouseout="UnTip()">
  <tr>
    <td>{thumbnail}</td>
  </tr>
</table>

Yikes! What a disaster.

Does anyone know if it can be added? I had a look at the Tooltip MOD and read through the german -> english translation and couldn't find anything except a remark  by Manwenzi here:

http://www.4homepages.de/forum/index.php?topic=22030.msg139389#msg139389

Thanks for any ideas. I'd love to use the same principle on the other MOD Show Received Comments V.2.

I'll post this on the Tooltip for Thumbnails topic as well.

Thanks

- Brian
Title: Re: [MOD] Last comments v1.2.0
Post by: Sebas Bonito on June 04, 2010, 11:36:39 PM
How to avoid showing the same picture on the main page?
It's not an exception, that there is more then one comment for each image.
Title: Re: [MOD] Last comments v1.2.0
Post by: V@no on June 05, 2010, 02:37:26 AM
In the step 1 above
Code: [Select]
        ORDER BY c.comment_date DESC
Insert this:
Code: [Select]
        GROUP BY c.image_id
Title: Re: [MOD] Last comments v1.2.0
Post by: Sebas Bonito on June 05, 2010, 10:35:31 AM
Fantastic, thanx a lot!  :)
Title: Re: [MOD] Last comments v1.2.0
Post by: kunik1962 on August 27, 2010, 05:58:03 AM
Question?  I have a user that continues to post all his comments in CAPS and I was wondering if you could point me in the right direction where I could add the php string function strtolower, ucwords, or something similar?  It should convert all CAPS in a comment if the $str value is passed to the function if I am not mistaken.  While I am not a php programmer the example code in the PHP manual makes sense and it seems like an idea worth pursuing.  I just need help finding the file I should look  for in 4Images for making this small change.  I suspect its located in the details.php file and the "Save Comments" section.  Again if I am an idiot I am sorry   :roll:

Code: [Select]
//--- Save Comment ------------------------------------
//-----------------------------------------------------
$error = 0;
if ($action == "postcomment" && isset($HTTP_POST_VARS[URL_ID])) {
  $id = intval($HTTP_POST_VARS[URL_ID]);
  $sql = "SELECT cat_id, image_allow_comments
          FROM ".IMAGES_TABLE."
          WHERE image_id = $id";
  $row = $site_db->query_firstrow($sql);

  if ($row['image_allow_comments'] == 0 || !check_permission("auth_postcomment", $row['cat_id']) || !$row) {
    $msg = $lang['comments_deactivated'];
  }
  else {
    $user_name = un_htmlspecialchars(trim($HTTP_POST_VARS['user_name']));
    $comment_headline = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_headline']));
    $comment_text = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_text']));
  
    $captcha = (isset($HTTP_POST_VARS['captcha'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['captcha'])) : "";

    // Flood Check
  

I added
$comment_text = strtolower ($comment_text);    

just above the line that starts with $captcha and it appears to be helping but it turns everything to lower case (which I guess could be an improvement.  

Here is what I am referencing:
http://php.net/manual/en/function.strtolower.php (http://php.net/manual/en/function.strtolower.php)

Now this code was listed in the comments by someone named "ALEX" as a way to "normalize a sentence" that might work but now I show my ignorance.  I am not sure where to put this function in the code or how to properly call it to modify the $comment_text string.

Code: [Select]
<?php
function sentenceNormalizer($sentence_split) {
    
$sentence_split preg_replace(array('/[!]+/','/[?]+/','/[.]+/'),
                                   array(
'!','?','.'),$sentence_split);        
    
    
$textbad preg_split("/(\!|\.|\?|\n)/"$sentence_split,-1,PREG_SPLIT_DELIM_CAPTURE);
    
$newtext = array();
    
$count sizeof($textbad);
    
    foreach(
$textbad as $key => $string) {
        if (!empty(
$string)) {
            
$text trim($string' ');
            
$size strlen($text);
            
            if (
$size 1){     
                
$newtext[] = ucfirst(strtolower($text));
            }
                elseif (
$size == 1) {
                    
$newtext[] = ($text == "\n") ? $text $text ' ';
                }      
        }
    }
    
    return 
implode($newtext);
}
?>


Umm I wonder if this should be moved to its own topic or some other place since it does not apply just to this great mod?
Title: Re: [MOD] Last comments v1.2.0
Post by: V@no on August 27, 2010, 06:44:15 AM
something like this:
    $comment_text = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_text']));
    $comment_text = strtolower($comment_text);
Title: Re: [MOD] Last comments v1.2.0
Post by: zakaria666 on August 28, 2010, 06:44:18 PM
No part 2 since 2005??? haha if so i do apologize if u have done it and i ahve missed it
Title: Re: [MOD] Last comments v1.2.0
Post by: mawenzi on August 28, 2010, 08:50:10 PM
part 2 -> here since 2005 -> http://www.4homepages.de/forum/index.php?topic=10632.0
Title: Re: [MOD] Last comments v1.2.0
Post by: CodeMan on October 26, 2010, 09:30:01 PM
Great and very easy MOD.
Works really great!!!

How can I change the style of {comment_text}, {comment_date}, {comment_image_name}, etc.
Just to make more eye catching...

I have tried to use class="........" but that didn't work.
I also tried to use <font color="#................."> and that didn't work either.

Thanx again!!!
Title: Re: [MOD] Last comments v1.2.0
Post by: CodeMan on November 03, 2010, 08:10:25 PM
Hello,

would be great if someone could help to change the font color and size of {comment_text}, {comment_date}, {comment_image_name}, etc.

I tried to add some html-codes in the template but that did't work (see my previous post).

Does anyone know how to do it or isn't it possible at all  :roll:?
Title: Re: [MOD] Last comments v1.2.0
Post by: surferboy on November 03, 2010, 08:21:17 PM
I have asked before but hopefully the powers that be won't be mad if I ask again:

anyway to make the Walter Zorn tooltip work with the comments feature so when our members mouseover the image, it provides a pop up like the rest of the 'recent images' function?

Thanks,

Brian
Title: Re: [MOD] Last comments v1.2.0
Post by: V@no on November 04, 2010, 12:25:42 AM
Hello,

would be great if someone could help to change the font color and size of {comment_text}, {comment_date}, {comment_image_name}, etc.

I tried to add some html-codes in the template but that did't work (see my previous post).

Does anyone know how to do it or isn't it possible at all  :roll:?

Do the changes you need in the code from step 4


I have asked before but hopefully the powers that be won't be mad if I ask again:

anyway to make the Walter Zorn tooltip work with the comments feature so when our members mouseover the image, it provides a pop up like the rest of the 'recent images' function?

Thanks,

Brian
You got to be more specific what code you are referring to and if you tried it, what/how exactly it didn't work
Title: Re: [MOD] Last comments v1.2.0
Post by: surferboy on November 04, 2010, 02:56:49 AM
Hi -

Here is the link to the post I made in topic TUT Tooltip for Thumbnails

http://www.4homepages.de/forum/index.php?topic=22030.msg147139#msg147139

It is hard to describe exactly what went wrong but the best summation might be that the entire screen/display went hugely vertically, meaning one image then a comment then another image.

My goal is to have the same functionality when you mouse over an image in the comment box to preview it that you have when you use the TUT Tooltip for Thumbnails on say the the most recent images uploaded section.  Please PM me or hit me back if you want me to import the post I made in the other section here. Glad to do it.

Thanks,

Brian
Title: Re: [MOD] Last comments v1.2.0
Post by: CodeMan on November 07, 2010, 02:03:23 PM
V@no, thanks for your helpful reply.

I finally managed to change the style of my commentcodes.
What I noticed was this:

The commentcodes that have no links <a href=.........> cannot be changed in the HTML-template (step 4) by a class="...." or by <font color="........">.
Only the commentcodes like {comment_text}, {comment_date} and {comment_headline} can be changed in the HTML-template (step 4) by a class="...."or by <font color="........">.
 
So to change the other commentcodes that do have a link (like {comment_imagename}, {comment_user_name}, etc.) I needed to add the "class-funtion" in the php-code of step 1.

For example:
"comment_image_name" => ($view_image) ? "<a class=\"commentimagename\" href=\""..................
And of course this new class-type should be added in the stylesheet.

And all this together worked great. Now it really lookes better.

Thanks again V@no!!!
Title: Re: [MOD] Last comments v1.2.0
Post by: [TR]AHMET on March 06, 2011, 04:04:18 PM
Hello,

This is great mod but i'want Last Comments button in home page like a New Photos button. When i click to button it should open new page. http://www.turkmilitary.com/ this is my page i want Last Comments button near to New Photos button.  How can i do this ? I've tried, but did not.

Thanks,
Title: Re: [MOD] Last comments v1.2.0
Post by: biker007 on July 25, 2011, 02:38:02 AM
[MOD] Last comments v1.2.0 & 1.7.10

bei mir Fuzzt alles ausser das die neusten Kommentare in echtzeit angezeigt werden wo liegt der Fehler

hier mal der Link zu meiner Galerie " http://www.fotoschleuder.de/amateurfotografen/dieamateurfotografen/ "

LG Achim
Title: Re: [MOD] Last comments v1.2.0
Post by: Haeretik on December 07, 2011, 10:07:40 PM
hat jemand ne idee wie ich die kommentare "abschneiden" kann. damit nicht der ganze text angezeigt wird sondern nur die ersten 20 zeichen oder so :)
und auserdem würd ich die anzeige gerne auf die letzen 3-5 kommentare beschränken.

weiß wer wie man das im groben umsetzt?

lg,
haeretik

ok habs gefunden in dem ich die augen mal eöffnet hab. hab dann folgendes gefunden ^^,

//Settings
$num = 7; //how many comments to show
$thumb_size = 48; //max dim of thumbnails in pixels
$text_len = 200; //max lenght of the text to show (bbcode and html are counted too)
//End settings


5--10 zeile in der geänderten indes.php ^^
Title: Re: [MOD] Last comments v1.2.0
Post by: Pawel_el on February 06, 2013, 01:19:57 AM
I ask parcel version 1.7.10?