Author Topic: [TUT] Tooltip for Thumbnails  (Read 151953 times)

0 Members and 1 Guest are viewing this topic.

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [TUT] Tooltip for Thumbnails
« Reply #15 on: July 30, 2008, 06:34:06 PM »
... thanks ivan ... ;)
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 Omsky

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: [TUT] Tooltip for Thumbnails
« Reply #16 on: July 30, 2008, 06:55:58 PM »
word "Downloads:" showed earlier, on all languages - on index page.

lines
Code: [Select]
"lang_downloads" => $lang['downloads'],does not in page_header.php


my changed code in page_header.php
Code: [Select]
$site_template->register_vars(array(
  "lang_site_stats" => $lang['site_stats'],
  "lang_category" => $lang['category'],
  "lang_downloads" => $lang['downloads'], <---- it is added
   "lang_rating" => $lang['rating'],              <---- it is added
   "lang_votes" => $lang['votes'],               <---- it is added
  "lang_registered_user" => $lang['registered_user'],
  "lang_random_image" => $lang['random_image'],
  "lang_categories" => $lang['categories'],
  "lang_sub_categories" => $lang['sub_categories'],
  "lang_new_images" => $lang['new_images'],
  "lang_top_images" => $lang['top_images'],
  "lang_search" => $lang['search'],
  "lang_advanced_search" => $lang['advanced_search'],
  "lang_lightbox" => $lang['lightbox'],
  "lang_register" => $lang['register'],
  "lang_control_panel" => $lang['control_panel'],
  "lang_login" => $lang['login'],
  "lang_auto_login" => $lang['lang_auto_login'],
  "lang_logout" => $lang['logout'],
  "lang_lost_password" => $lang['lost_password'],
  "lang_user_name" => $lang['user_name'],
  "lang_password" => $lang['password'],
  "lang_go" => $lang['go'],
  "lang_images_per_page" => $lang['images_per_page'],
  "charset" => $lang['charset'],
  "direction" => $lang['direction']
));



not work

Offline Omsky

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: [TUT] Tooltip for Thumbnails
« Reply #17 on: July 30, 2008, 07:35:20 PM »
ohh... i sleep  :oops:

i change...
new code
in thumbnail_bit.html

Code: [Select]
<table width="1%" border="0" cellspacing="0" cellpadding="0" onmouseover="Tip('{image_name}<br><b>{lang_category}</b> {cat_name}<br> <b>{lang_file_size}</b> {image_file_size}<br> <b>{lang_hits}</b> {image_hits}<br><b>{lang_downloads}</b> {image_downloads}<br><b>{lang_votes}</b> {image_votes} <br> <b>{lang_rating}</b> {image_rating} <br> <b>{lang_comments}</b> {image_comments}')" onmouseout="UnTip()">
and add in page_header.php line
Code: [Select]
  "lang_file_size" => $lang['file_size'],
 "lang_hits" => $lang['hits'],

big thank you all

Offline Omsky

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: [TUT] Tooltip for Thumbnails
« Reply #18 on: August 09, 2008, 07:36:33 PM »
small bugs http://www.4homepages.de/forum/index.php?topic=18761.msg122116#msg122116

if there is a ' symbol in the picture's file names then IE determines an error and [TUT] Tooltip for Thumbnails stops working fot those pages.

how to fix this from happenings with '?

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [TUT] Tooltip for Thumbnails
« Reply #19 on: August 09, 2008, 07:55:00 PM »
@Omsky

... have a look at V@no's statement "Your site's name has an ' (apostrophe), its messes up the javascript" ...
... here : http://www.4homepages.de/forum/index.php?topic=22406.msg122263#msg122263 ...
... it is the same for ... picture's file names ...
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 sigma.

  • Full Member
  • ***
  • Posts: 148
  • cydonian.com/potd
    • View Profile
    • sigma's gallery
Re: [TUT] Tooltip for Thumbnails
« Reply #20 on: August 16, 2008, 10:24:04 PM »
love this. thanks for sharing!
I have one bug though.

It looks like any type of special character other than text (',",url,html,! and even spaces) cause the tooltip to not display, and sometimes mess up the thumbnail alignment in 4images.

Anyone know how to enable special characters in the tooltip?

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: [TUT] Tooltip for Thumbnails
« Reply #21 on: August 17, 2008, 12:19:29 AM »
Its not "special characters" that messing up on your site, but the new lines image descriptions.
use this instead:
Code: [Select]
onmouseover="Tip('<?=str_replace("'", "\\'", str_replace("\r", "", str_replace("\n", "\\n", "<b>{image_name}</b><br />{lang_description} {image_description}<br />__________<br />{lang_comments} {image_comments}")));?>')"
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 sigma.

  • Full Member
  • ***
  • Posts: 148
  • cydonian.com/potd
    • View Profile
    • sigma's gallery
Re: [TUT] Tooltip for Thumbnails
« Reply #22 on: August 17, 2008, 01:07:13 AM »
So should my thumbnail_bit.html look like this then?

Code: [Select]
<!-- you wish detail page in a small javascript open window, use {thumbnail_openwindow} -->
<table width="" border="0" cellspacing="0" cellpadding="" onmouseover="Tip('<?=str_replace("'", "\\'", str_replace("\r", "", str_replace("\n", "\\n", "<b>{image_name}</b><br />{lang_description} {image_description}<br />__________<br />{lang_comments} {image_comments}")));?>')" onmouseout="UnTip()">
  <tr>
    <td>{thumbnail}</td>
  </tr>
</table>
<font color="#FF0000">| </font> <b>{image_name}</b>
<br />
| <a href="{cat_url}">{cat_name}</a><br />

It works if I remove this:
Code: [Select]
onmouseout="UnTip()">
but then the tooltip doesnt go away. Where should I position the onmouseout call?
« Last Edit: August 17, 2008, 01:41:51 AM by sigma. »

Offline sigma.

  • Full Member
  • ***
  • Posts: 148
  • cydonian.com/potd
    • View Profile
    • sigma's gallery
Re: [TUT] Tooltip for Thumbnails
« Reply #23 on: August 17, 2008, 02:28:44 AM »
oh wait. i got it.

Code: [Select]
onmouseover="Tip('<?=str_replace("'", "\\'", str_replace("\r", "", str_replace("\n", "\\n", "<b>{image_name}</b><br />{lang_description} {image_description}<br />__________<br />{lang_comments} {image_comments}")));?>', BALLOON, true)"onmouseout="UnTip()">
thanks V.

now please.. what exactly did you do to get this to work? what does str_replace function do? string replace?

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: [TUT] Tooltip for Thumbnails
« Reply #24 on: August 17, 2008, 03:36:19 AM »
It creates javascript friendly string - escapes newlines and apostrophes
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 sigma.

  • Full Member
  • ***
  • Posts: 148
  • cydonian.com/potd
    • View Profile
    • sigma's gallery
Re: [TUT] Tooltip for Thumbnails
« Reply #25 on: August 17, 2008, 04:13:45 AM »
good to know. thanks again!

is there any way to make a word in "quotes" javascript friendly? I tried """, but that had a nasty effect.
« Last Edit: August 17, 2008, 04:29:50 AM by sigma. »

Offline Boemmel

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: [TUT] Tooltip for Thumbnails
« Reply #26 on: October 28, 2008, 09:07:44 AM »
wie bekomme ich den Mod zum Laufen ? bei mir tut sich nichts.

muß ich irrgendwas aktivieren, ich bin ratlos.
 :wink:

hat sich erledigt!
« Last Edit: October 28, 2008, 07:08:20 PM by Boemmel »
Gruß
Chris

Offline AKIN

  • Full Member
  • ***
  • Posts: 121
    • View Profile
    • Resim
Re: [TUT] Tooltip for Thumbnails
« Reply #27 on: October 28, 2008, 12:17:10 PM »
very nice.
it's work.thanks all..

Offline vitara

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: [TUT] Tooltip for Thumbnails
« Reply #28 on: March 04, 2009, 09:44:21 AM »
Sehr guter Mod, Danke

Nun möchte ich aber hier eine kleine Bildvorschau zeigen.
Ich schaffe das nicht ein das Bild in der grösse von 200px  einzufügen ohne kommentare und informationen, kannst Du mir weiterhelfen mit einem script?

Danke schon mal vorab.....

Offline vitara

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: [TUT] Tooltip for Thumbnails
« Reply #29 on: March 05, 2009, 11:46:44 AM »
Hi ivan

Das ginng aber flott, besten Dank das nenn ich Hilfe..... :D

Der Moid läuft jetzt wunderbar bei mir auf localhost nur zeigt er mit die gnze grösse des Bildes an, ich möcht aber nur 200 pixel, wie oder wo kann ich das nun einstellen?

Grossen Dank für deine Unterstützung

Vitara