forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: Nalco on June 23, 2013, 06:22:18 am

Title: Linebreaks in tooltip help
Post by: Nalco on June 23, 2013, 06:22:18 am
I am running Coppermine 1.5.24.

I have installed Style-my-tooltips jQuery plugin. The scripts works perfectly, except for the fact that is does not recognize the "$LINEBREAK" in the code.

I have found the code I need to edit, but am not sure how to insert a linebreak that the script will acknowledge

The code that controls the tooltip for the thumbnails that I want to edit is in functions.inc.php at around line 2990.

Code: [Select]
// My Edit To Add Title To Tooltips
            $pic_title = $lang_common['title'] . '=' . $row['title'] . $LINEBREAK .
// End My Edit To Add Title To Tooltips           
            $pic_title = $lang_common['filename'] . '=' . $row['filename'] . $LINEBREAK .               
                $lang_common['filesize'] . '=' . ($row['filesize'] >> 10) . $lang_byte_units[1] . $LINEBREAK .
                $lang_display_thumbnails['dimensions'] . $row['pwidth'] . "x" . $row['pheight'] . $LINEBREAK .
                $lang_display_thumbnails['date_added'] . localised_date($row['ctime'], $lang_date['album']);

As you can see, I have already edited the tooltips to include the title of a photo with success.

Without the script, my browsers acknowledge the line break, and display the tooltips correctly:

Title=This is the title
Filename-=This is the filename
Filesize=250k

If I install the script, the line breaks are removed, and everything is displayed on one line:

Title=This is the title Filename-=This is the filename Filesize=250k

I realize this is a limitation of the script itself, but I would like to try and edit the code in functions.inc.php to manually enter breaks that the script can handle, and this is where I cannot figure out if it is possible.

So, is it possible to somehow replace "$LINEBREAK" with either a "<br>", or  "&#013", or add them in such a way that a linebreak will occur ?

Naturally I have played with the code with no success, so I thought I would check here, to see if someone knows how to this without breaking the script.


Any ideas??

Thanks!!
Title: Re: Linebreaks in tooltip help
Post by: Niecher on June 23, 2013, 02:10:53 pm
Write it in this way, twice, also around the line 3266:

Code: [Select]
            $pic_title = $lang_common['title'] . '=' . $row['title'] . $LINEBREAK .
                $lang_common['filename'] . '=' . $row['filename'] . $LINEBREAK .
                $lang_common['filesize'] . '=' . ($row['filesize'] >> 10) . $lang_byte_units[1] . $LINEBREAK .
                $lang_display_thumbnails['dimensions'] . $row['pwidth'] . "x" . $row['pheight'] . $LINEBREAK .
                $lang_display_thumbnails['date_added'] . localised_date($row['ctime'], $lang_date['album']);

Best Regards
Title: Re: Linebreaks in tooltip help
Post by: Nalco on June 24, 2013, 12:46:50 am
Thanks for fixing my bad code insert, unfortunately it did not fix my linebreak issue.

 
Title: Re: Linebreaks in tooltip help
Post by: Niecher on June 24, 2013, 02:36:32 am
Try this:

Code: [Select]
            $pic_title = $lang_common['title'] . '=' . $row['title'] . "\n" .
                $lang_common['filename'] . '=' . $row['filename'] . "\n" .
                $lang_common['filesize'] . '=' . ($row['filesize'] >> 10) . $lang_byte_units[1] . "\n" .
                $lang_display_thumbnails['dimensions'] . $row['pwidth'] . "x" . $row['pheight'] . "\n" .
                $lang_display_thumbnails['date_added'] . localised_date($row['ctime'], $lang_date['album']);

Best Regards
Title: Re: Linebreaks in tooltip help
Post by: Αndré on August 28, 2013, 11:37:37 am
Is there any documentation of that plugin, what it needs to detect a line break? It's better than just trial and error.