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

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

0 Members and 1 Guest are viewing this topic.

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
Re: [MOD] Last comments v1.2.0
« Reply #195 on: February 01, 2010, 08:03:36 AM »
@v@no: I just ran your sql sentence and I get this result:

Code: [Select]
# Query_time: 9  Lock_time: 0  Rows_sent: 10  Rows_examined: 730943
SELECT c.image_id, c.comment_id, c.user_id as comment_user_id, c.user_name as guest_user_name, c.comment_headline, c.comment_text, c.comment_date, i.cat_id, i.user_id, i.image_name, i.image_media_file, i.image_thumb_file, u.user_name as user_name, s.user_name as comment_user_name
        FROM 4images_comments c
        LEFT JOIN 4images_images i ON i.image_id = c.image_id
        LEFT JOIN 4images_users u ON u.user_id = i.user_id
        LEFT JOIN 4images_users s ON s.user_id = c.user_id
        WHERE i.image_active = 1 AND i.image_allow_comments = 1 AND i.cat_id NOT IN (0) AND i.cat_id NOT IN (0) AND i.cat_id NOT IN (0)
        ORDER BY c.comment_date DESC
        LIMIT 0, 10;

What bothers me? Rows_examined: 730943

Do you have any solution for this kind of problem?


Offline surferboy

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: [MOD] Last comments v1.2.0
« Reply #196 on: April 22, 2010, 01:44:48 AM »
Hi -

I'm using v1.7.7

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

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

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

Yikes! What a disaster.

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

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

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

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

Thanks

- Brian

Offline Sebas Bonito

  • Sr. Member
  • ****
  • Posts: 271
  • Sebas Bonito
    • View Profile
Re: [MOD] Last comments v1.2.0
« Reply #197 on: June 04, 2010, 11:36:39 PM »
How to avoid showing the same picture on the main page?
It's not an exception, that there is more then one comment for each image.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Last comments v1.2.0
« Reply #198 on: June 05, 2010, 02:37:26 AM »
In the step 1 above
Code: [Select]
        ORDER BY c.comment_date DESC
Insert this:
Code: [Select]
        GROUP BY c.image_id
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Sebas Bonito

  • Sr. Member
  • ****
  • Posts: 271
  • Sebas Bonito
    • View Profile
Re: [MOD] Last comments v1.2.0
« Reply #199 on: June 05, 2010, 10:35:31 AM »
Fantastic, thanx a lot!  :)

Offline kunik1962

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: [MOD] Last comments v1.2.0
« Reply #200 on: August 27, 2010, 05:58:03 AM »
Question?  I have a user that continues to post all his comments in CAPS and I was wondering if you could point me in the right direction where I could add the php string function strtolower, ucwords, or something similar?  It should convert all CAPS in a comment if the $str value is passed to the function if I am not mistaken.  While I am not a php programmer the example code in the PHP manual makes sense and it seems like an idea worth pursuing.  I just need help finding the file I should look  for in 4Images for making this small change.  I suspect its located in the details.php file and the "Save Comments" section.  Again if I am an idiot I am sorry   :roll:

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

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

    // Flood Check
  

I added
$comment_text = strtolower ($comment_text);    

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

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

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

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


Umm I wonder if this should be moved to its own topic or some other place since it does not apply just to this great mod?
« Last Edit: August 27, 2010, 06:41:16 AM by kunik1962 »

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Last comments v1.2.0
« Reply #201 on: August 27, 2010, 06:44:15 AM »
something like this:
    $comment_text un_htmlspecialchars(trim($HTTP_POST_VARS['comment_text']));
    
$comment_text strtolower($comment_text);
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: [MOD] Last comments v1.2.0
« Reply #202 on: August 28, 2010, 06:44:18 PM »
No part 2 since 2005??? haha if so i do apologize if u have done it and i ahve missed it

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Last comments v1.2.0
« Reply #203 on: August 28, 2010, 08:50:10 PM »
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 CodeMan

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • ArabGlobe.com
Re: [MOD] Last comments v1.2.0
« Reply #204 on: October 26, 2010, 09:30:01 PM »
Great and very easy MOD.
Works really great!!!

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

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

Thanx again!!!

Offline CodeMan

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • ArabGlobe.com
Re: [MOD] Last comments v1.2.0
« Reply #205 on: November 03, 2010, 08:10:25 PM »
Hello,

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

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

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

Offline surferboy

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: [MOD] Last comments v1.2.0
« Reply #206 on: November 03, 2010, 08:21:17 PM »
I have asked before but hopefully the powers that be won't be mad if I ask again:

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

Thanks,

Brian

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Last comments v1.2.0
« Reply #207 on: November 04, 2010, 12:25:42 AM »
Hello,

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

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

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

Do the changes you need in the code from step 4


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

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

Thanks,

Brian
You got to be more specific what code you are referring to and if you tried it, what/how exactly it didn't work
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline surferboy

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: [MOD] Last comments v1.2.0
« Reply #208 on: November 04, 2010, 02:56:49 AM »
Hi -

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

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

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

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

Thanks,

Brian

Offline CodeMan

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • ArabGlobe.com
Re: [MOD] Last comments v1.2.0
« Reply #209 on: November 07, 2010, 02:03:23 PM »
V@no, thanks for your helpful reply.

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

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

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

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

Thanks again V@no!!!
« Last Edit: November 07, 2010, 06:50:20 PM by CodeMan »