Linebreaks in tooltip help Linebreaks in tooltip help
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Linebreaks in tooltip help

Started by Nalco, June 23, 2013, 06:22:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nalco

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.

// 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!!

Niecher

Write it in this way, twice, also around the line 3266:


            $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

Nalco

Thanks for fixing my bad code insert, unfortunately it did not fix my linebreak issue.


Niecher

Try this:


            $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

ΑndrĂ©

Is there any documentation of that plugin, what it needs to detect a line break? It's better than just trial and error.