4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started 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:
- Part 1 - last comments on home page (or any other pages)
- Part 2 - A separate page with list of all comments, with paging
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://-----------------------------------------------------
//--- 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&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&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:{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: <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.
-
-------- [ Part 2 ] --------
[MOD] All Comments (Alle Kommentare) (http://www.4homepages.de/forum/index.php?topic=10632.0)
-
:D :D brilliant that looks so good ,10 out of 10 v@no
thanks sooooooo much :D
-
very nice!
I'm eagerly waiting for part two :)
-
Me too,waiting for the part two :)
-
very nice!
I'm eagerly waiting for part two :)
waiting waiting waiting :)
-
{last_comments}
</tr> this you can delete :)
btw greate mod ;) waiting for part 2 :)
-
V@no,
Maybe possible to ask you, to show how to do some modifications?
If we put a admin links in these comments? :)
-
that will be avalable in part 2
-
i´m waiting for Part II too.
:)
b.o.fan
-
When you publish PART 2?
I want to integrate the Last Comments in a phpbb Forum.
-
Hi
Where can I see a working demo of this mod?
:)
Barb
"Xerraire"
http://www.xerraire.com
-
Hi
Where can I see a working demo of this mod?
:)
Barb
"Xerraire"
http://www.xerraire.com
On my Page ;)
-
very cool mod!!!!:!: :!: thx a lot!! :wink:
you can see it here: http://fotos.offroad4fun.at :wink:
greets from vienna
-
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?
-
(http://www.tsu-irnfritz.com/Bilder/Smiles/danke.gif)
Greetings from Austria
-
Can someone please let me know how to enable paging for the latest comments ?
Thanks, Martin
-
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
-
Very good job V@no :D
-
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?
-
V@no
any news about PART2 ?
-
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:
-
where is the part 2? did i miss something?
-
no you did not miss anything - as V@no wrote - Part 2 will come... well not soon, but later maybe ;)
-
Great mod. Works great.
Thanks.
-
Very great mod, thanks V@no !
How please show all comments ? :roll:
Waiting for PART 2 8)
-
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
-
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....
-
Hello
the {comment_date} showing the date and time
i would like to have the time removed how to do?
sincerly
vincent
-
In der index.php das hier
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $row['comment_date']),
gegen das ersetzen...
"comment_date" => format_date($config['date_format'].", $row['comment_date']),
Bin nicht sicher aber das müsste es sein.
-
thanks for the tip
"comment_date" => format_date($config['date_format'], $row['comment_date']),
this way it works you had a " for nothing
sincerly
vincent
-
OK :)
-
@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
-
??? Beispiel bitte. Ich weiß nicht unbedingt was du meinst....
-
@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
-
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 ...
{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
-
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}
mal testen ... :wink:
mawenzi
[/quote]
-
... und wenn du {if allow_comments} und {endif allow_comments} mal entfernst ... sind dann die Kommentare zu sehen ... ?
mawenzi
-
@mawenzi :cry:
immer noch nicht! :!: - habe jetzt die {if wieder eingefügt! :|
gruss
vincent
-
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!
-
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...
-
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
-
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
-
Oh, that´s clear that I see it as text :oops:
It´s Sunday morning :)
-
Waiting for Part 2
:P
-
great mod. thanks again vano
-
i have a page with 20 comments
http://www.foto-kocher.com/soldpubl.php
how do i a paging with 6 Comments page?
vincent
-
Heres a little template adjustment to the table. Not perfect just something i threw together for my needs.
<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/
-
HI
This Mod works perfect ... great !!!
Many thanks
coooool
Steffen
-
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.
-
oh cmon v@no :) share part 2 with us
-
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
-
Awesome script! THANKS!
-
Veno, can u please tell us if part 2 will be avaliable anytime soon.
Seems alot of people are looking for it.
-
fantastic MOD thanks for it .. it's working .. waiting the second one
-
how can I control the cells size ( width - height )
I tried myself but didn't changed
-
did you try to change last_comment_bit.html?
-
yes I did .. nothing changed :(
-
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...
-
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:
$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&".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)) ? "&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)) ? "&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()
));
-
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
-
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:
-
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
-
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: ORDER BY c.comment_date DESC
Insert above: 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.
-
thanks for the help man :D its working now .. yeah I noticed the difference .
-
Is Part 2 out yet?
Pretty interessted in it :)
-
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:
-
@ 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
-
@ 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
-
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 ..
<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"> <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>
-
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
-
Did you do any integrations?
-
hi V@no,
yes i have phpbb integration.
does it gives you any clue?
thanks,
pht3k
-
well, yes, this mod was not built to support integrations...
-
argh :|
-
Ok, can you confirm/deny if replacing in index.php
$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_name
with:$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
would fix it.
-
yessssssss
it'S working !!!!
its my first present for christmas this year :)
thanks a lot.
Have nice hollidays !!!
pht3k
-
what with comments like
"yeaaaaaaaaaaaaaaaaaaaaahhhhhhh...... "
can i wrap it ?
-
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 "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),
-
THX !
Its what I need. :)
-
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.
-
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: 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').")
-
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.
-
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?
-
Restore backups and try again.
Make sure you upload .php and .html files in ACSII mode and not in BINARY
-
is there is an option that says to the member you have XX comments on your images since last visit ?
-
thanks V@no
thank you very much!!!
I got this now
Steffen
-
how can I integrate this script to cut the last comments in a numbers of characters
I found this code
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);
-
very good mod, thankyou!!!!
-
@live@act:
look in the code from Step 1:$text_len = 200; //max lenght of the text to show (bbcode and html are counted too)
-
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?
-
@ 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
-
@ 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
-
Подскажите пожалста как можно сделать чтобы пользователь мог подписаться на новые сообщения т.е. мог следить за новыми коментариями с уведомлением по е-майл не только хозяин странички., а любой желающий, поставив галочку или введя свой е-mail.
-
:?: :D
-
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.
-
I solve my problem... If somebody is interested, I can explain it... PM me :D
-
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
-
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
-
covered in FAQ
-
beim klick auf "more comments" werde ich ins kontrollzentrum geleitet. mehr Kommentare werden aber nicht angezeigt. hab ich da auch nen fehler gemacht?
danke
-
hello 2all.
Somebody please tell me about compatibility this mod with version 1.7.3
Sanks.
-
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:
-
Great thx!
It's work perfect on my web: http://nusansifor.com/index2.php
-
hello 2all.
Somebody please tell me about compatibility this mod with version 1.7.3
Sanks.
Yes, yes, yes! It's work perfect..
-
and works also with 1.7.4
-
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?
-
@ desperate_housewif
... zu finden ... hier ... http://www.4homepages.de/forum/index.php?topic=10632.0
-
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
-
Hallo Ivan!
Auch ich habe Firefox 2.0 und es wird angezeigt... :?: komisch komisch - hat jemand noch einen Ansatz?
Vielen Dank, Grußß K
-
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?
/*
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&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&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!
-
merged with this MOD!
mod's to mod's... ;)
-
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 ! :-)
-
Hi
I like to exclude a image to be showed in the last comments
it could be possible?!?!
thanks for your help!
-
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 :
$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
-
How can I make it print out the last comment of the last commented picture ?
Try changing
ORDER BY c.comment_date DESC
to:
ORDER BY c.comment_date ASC
-
How can I make it print out the last comment of the last commented picture ?
Try changing
ORDER BY c.comment_date DESC
to:
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 ;)
-
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
-
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
-
thanks
I'l take a look at it toonight :P
-
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
-
If I new I would help, but I am still learning SQL stuff and not that great at it.
-
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
$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
$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
-
what about part 2?
-
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 ...
-
Thanks :) 100% ok!
-
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:
$templates_used = '
in the line add after:
last_comment,last_comment_bit,
search
$main_template = 'home';
replace to:
$main_template = 'last_comment';
Create a new template templates/<your template>/last_comment_bit.html with the folowing code:
<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:
<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
-
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?
-
@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 ...
-
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
ORDER BY c.comment_date DESC
LIMIT ".$num;
und ersetzen durch:
ORDER BY c.comment_date DESC
LIMIT 2";
thats all :wink:
Greetings darkness :mrgreen:
-
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 ?
-
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:
$templates_used = '
in the line add after:
last_comment,last_comment_bit,
search
$main_template = 'home';
replace to:
$main_template = 'last_comment';
Create a new template templates/<your template>/last_comment_bit.html with the folowing code:
<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:
<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.
-
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:
"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:
"comment_image_name" => stripslashes($row['image_name']),
search:
"image_user_name" => ($image_user_link) ? "<a href=\"".$image_user_link."\">".$image_user_name."</a>" : $image_user_name,
replace to:
"image_user_name" => $image_user_name,
Total comments i didnt tried it because i dont have time enough but try this
search
$bgcounter = 1;
while ($row = $site_db->fetch_array($result))
{
after add:
$sql = "SELECT COUNT(*) AS counter
FROM ".COMMENTS_TABLE."
WHERE image_id=".$row['image_id'])."";
$comments_count = $site_db->query_firstrow($sql);
search:
"comment_image" => ($view_image) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$row['image_id'])."\">".$thumb."</a>" : $thumb,
add after:
"comment_total" => (isset($comments_count['counter']) && $comments_count['counter']) ? $comments_count['counter'] : 0,
Good luck ;)
-
Thank you very much! Everything works fine, but I had to delete ")" in this code: ;)
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:
<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} • {comment_user_name}
</font>
<br>
{comment_text}
</td>
</tr>
Take care,
your Michinator.
-
Thank you very much! Everything works fine, but I had to delete ")" in this code:
WHERE image_id=".$row['image_id'];
Is good. ;)
-
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:
<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} • {comment_user_name}
</font>
<br>
{comment_text}
</td>
</tr>
Thank you in advance! :D
Take care,
your Michinator.
-
replace:
<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} • {comment_user_name}
</font>
<br>
{comment_text}
</td>
</tr>
with:
<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} • {comment_user_name}
</font>
<br>
{comment_text}
</td>
</tr>
-
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 :?:
-
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...
"comment_image" => ($view_image) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$row['image_id'])."\">".$thumb."</a>" : $thumb,
...to...
"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:
-
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.
-
Can you create a temp category where guests can post comments so I could see it in action?
-
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>
-
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.
-
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)
-
Sorry, can't help with template issues, probably an extra <td> or <tr> somewhere..
-
:mrgreen: nice mod... thanks
-
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
-
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:
-
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?
-
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 = "";
}
-
Excellent! Thank you!
-
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?
-
External
in index.php find
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $row['comment_date']),
and add after
"lang_author" => $lang['author'],
-
Yeah, its working now. Thanx
-
: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?
-
@ 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 ...
-
@ 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!
-
@ barkuras
für die Tabellenzeile sind die wechselnden Hintergrundfarben bereits definiert mit ...
<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 ...
.row1 {
background-color: #e1e1e1;
color: #004c75;
}
.row2 {
background-color: #efefef;
color: #004c75;
}
-
@ mawenzi
8O
Mit dieser Antwort hast du mir unendlich geholfen!
In meiner style.css waren "row1" und "row2" so bezeichnet:
.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:
-
hi !!!
It's very GoOd Mod ! :D
Thx :D
-
cool mod...
works on the first try.
http://batamphotoclub.co.cc
thanx..!!
-
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 ?
-
And how can you change the image thumb size
-
@AntiNSA2
$thumb_size = 48; //max dim of thumbnails in pixels
-
thanks!
dont know how I missed that one!
-
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.
-
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)
-
Replying to the correct thread...
how do we get the user flag to display on home.html wise one :)
-
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.
-
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.
-
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...
-
I'm sorry, put an extra comma at the end:
$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:
$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.
-
I still get blanks. Nothing shows up on the webpage when I try using the {comment_user_firstname} tag...
-
ok, I found what I did wrong. Re-do step 1 one more time. it should work now.
Sorry about that.
-
Perfect! Thank you so much! Your skills are unparalleled...
-
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.... :)
-
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 !!!
-
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?
-
re-do step 1 and use {comment_image_openwindow} and {comment_image_name_openwindow} tags in last_comment_bit.html template
-
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"?
-
ok, try again re-do step 1
-
*perfect*
-
thank you.Perfect mod.
Demo:www.elemegim.info
-
Hi All!
How to display {user_avatar_current}?
-
Thanx for this mod... Just this tiny question:
I've already added this part:
if (strlen($text) > $text_len)
{
$text = substr($text, 0, $text_len)."...";
}
with this one below...
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
<?
$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)
$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?
-
Hi V@no,
you should change the following part in the index.php
if (strlen($text) > $text_len)
{
$text = substr($text, 0, $text_len)." ...";
}
to this...
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.
-
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?
-
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
$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.
-
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
-
Hast Du denn den BBCode für Kommentare erlaubt?
-
Ja, in der Galerie selber geht es ja auch, nur auf der Startseite, wo die letzten Kommentare angezeigt werden, geht es nicht.
-
Dann hängt es mit der Textbegrenzung zusammen (siehe ein paar Beiträge vorher).
-
Danke genau das war es. Hatte bei mir Max. 100 Zeichen eingestellt...
-
kann ich dieses mod auch bei 4images 1.7.6 oder 1.7.7 installieren, was muss ich anders machen?
-
Ich habs gerade getestet in 1.7.7 funktioniert er auch
-
@v@no: I just ran your sql sentence and I get this result:
# 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?
-
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:
<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
-
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.
-
In the step 1 above
ORDER BY c.comment_date DESC
Insert this:
GROUP BY c.image_id
-
Fantastic, thanx a lot! :)
-
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:
//--- 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.
<?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?
-
something like this:
$comment_text = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_text']));
$comment_text = strtolower($comment_text);
-
No part 2 since 2005??? haha if so i do apologize if u have done it and i ahve missed it
-
part 2 -> here since 2005 -> http://www.4homepages.de/forum/index.php?topic=10632.0
-
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!!!
-
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:?
-
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
-
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
-
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
-
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!!!
-
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,
-
[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
-
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 ^^
-
I ask parcel version 1.7.10?