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

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

0 Members and 1 Guest are viewing this topic.

Offline 0uistyty

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [MOD] Last comments v1
« Reply #120 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

Offline CeJay

  • Sr. Member
  • ****
  • Posts: 425
    • View Profile
Re: [MOD] Last comments v1
« Reply #121 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.

Offline 0uistyty

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [MOD] Last comments v1
« Reply #122 on: January 21, 2007, 05:51:10 PM »
OK, It's now resolved !!!

Thanks to r937 from sitepoint forum 

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

Offline son_gokou

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Re: [MOD] Last comments v1
« Reply #123 on: April 19, 2007, 02:19:29 PM »
what about part 2?

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Last comments v1
« Reply #124 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 ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

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

Offline son_gokou

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Re: [MOD] Last comments v1
« Reply #125 on: April 20, 2007, 02:05:17 AM »
Thanks :) 100% ok!

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [MOD] Last comments v1
« Reply #126 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
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline Schmidti

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: [MOD] Last comments v1
« Reply #127 on: May 19, 2007, 01:25:00 PM »
Hi... i have few questions to this mod:


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"?




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?


Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Last comments v1
« Reply #128 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 ...

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

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

Offline Darkness2001

  • Full Member
  • ***
  • Posts: 151
    • View Profile
    • photo-galerie-online
Re: [MOD] Last comments v1
« Reply #129 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:

Offline Mr_LovaLove

  • Full Member
  • ***
  • Posts: 233
  • Unkown
    • View Profile
Re: [MOD] Last comments v1
« Reply #130 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 ?
English Please :@

Offline Michinator

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Re: [MOD] Last comments v1
« Reply #131 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:

Thank you in advance!

Take care,
your Michinator.
Never be afraid to try something new. Remember that amateurs built the Ark. Professionals built the Titanic.

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [MOD] Last comments v1
« Reply #132 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:

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 ;)
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline Michinator

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Re: [MOD] Last comments v1
« Reply #133 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.



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.
Never be afraid to try something new. Remember that amateurs built the Ark. Professionals built the Titanic.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Last comments v1
« Reply #134 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. ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?