Advanced search  

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

Pages: [1]   Go Down

Author Topic: Linebreaks in tooltip help  (Read 2570 times)

0 Members and 1 Guest are viewing this topic.

Nalco

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Posts: 6
Linebreaks in tooltip help
« 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!!
« Last Edit: June 23, 2013, 11:22:22 am by Nalco »
Logged

Niecher

  • LocalSupporter
  • Coppermine frequent poster
  • ***
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 191
Re: Linebreaks in tooltip help
« Reply #1 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
Logged

Nalco

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Posts: 6
Re: Linebreaks in tooltip help
« Reply #2 on: June 24, 2013, 12:46:50 am »

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

 
Logged

Niecher

  • LocalSupporter
  • Coppermine frequent poster
  • ***
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 191
Re: Linebreaks in tooltip help
« Reply #3 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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Linebreaks in tooltip help
« Reply #4 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.
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.