NiceTooltips

Started by digger, September 14, 2009, 06:24:52 AM

Previous topic - Next topic

roza

Thank you @digger for this useful mod. I just installed it and since my forum language is Persian I would like to make some changes to text style and layout of the tooltips. I tried to add some CSS properties in subs.php file but I just could make the text rtl and had no success in changing the font type to tahoma nor to increase the font size of the title of tooltip box. Would you please guide me how to effectively do these changes? This is the code I tried in subs.php:


// * NiceTooltips mod
function NiceTooltip($body, $caption='', $smileys=true, $cache_id='')
{
   global $context, $settings, $modSettings;


   // Is it disabled or empty? Check permission.
   if ((allowedTo('disable_nicetooltips') && empty($context['user']['is_admin'])) || empty($modSettings['NiceTooltips_lenght']) || empty($body)) return ' title="' . $caption . '" ';


   // Send overlib headers.
   if (empty($context['overlib_loaded']))
   {
     $context['html_headers'] .= '
   <style type="text/css">
   .nice_tooltip_fgclass {
   text-align: right;
        font-family: tahoma, Verdana;
   background-color: ' . $modSettings['NiceTooltips_FGCOLOR'] . ';
   opacity: ' . $modSettings['NiceTooltips_OPACITY'] / 100 . ';
   }
   .nice_tooltip_bgclass {
   background-color: ' . $modSettings['NiceTooltips_BGCOLOR'] . ';
        font-family: tahoma, Verdana;
        font-size: 1em;
   opacity: ' . $modSettings['NiceTooltips_OPACITY'] / 100 . ';
   }
   .nice_tooltip_bgclass img, .nice_tooltip_fgclass img{
   height:auto; max-width: 250px;
   }
   </style>';

Any advice or comment would be appreciated.

digger

Mod update

v1.16
Add option to set images width.
Drop SMF 1.1 support.
Add option to select first or last message show in tooltip.
Add post author nickname to the tooltip title.
Auto close unclosed [hide] tags it tooltips.
Minify js scripts.
Add text align by right for RTL languages.
Add option to enable/disable tooltips for mobile devices.
Fix permissions. Now there is two permissions, separate for groups and boards.

Tiribulus

#222
Thanks Digger for this cool mod. Works great and no visible problems with the operation of the site. However, after clearing the error log and like one touch of a topic link, and a dozen of these two errors show up.

Sometimes I can figure this stuff out, but this is not one of those times. Any help would be greatly appreciated.
Thanks

digger

Quote from: Tiribulus on November 01, 2016, 01:31:05 PM
Thanks Digger for this cool mod. Works great and no visible problems with the operation of the site. However, after clearing the error log and like one touch of a topic link, and a dozen of these two errors show up.
Sometimes I can figure this stuff out, but this is not one of those times. Any help would be greatly appreciated.
Thanks
Fixed in 1.17 version
https://github.com/realdigger/SMF-NiceTooltips/releases

Tiribulus

Thank YOU sir.  :)

BTW, yes, I'm stuck on an older version of PHP for now.

Burt

Thank you Digger... Huge improvement over my old one.... 8)


PS..


My dog name is Digger, as he was born on ANZAC day...
If you Sig. line is longer or higher than two line, you are just an attention seeker. Grow up!

Steve

DO NOT pm me for support!


Steve

DO NOT pm me for support!

Harvester

I am having a hard time performing the edits on the MessageIndex.php and the Recent.php   

It seems a mod of mine has modified these two files already and I can not determine where to place the edits..  its only the edits that require:

./Sources/MessageIndex.php
Find
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['first_subject'] . '</a>'

Replace with
// * NiceTooltips mod
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0"'  . $row['nice_tooltip_first_msg'] . ' >' . $row['first_subject'] . '</a>'


I have:
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . ($user_info['is_guest'] ? ('.' . (!empty($options['view_newest_first']) ? 0 : ((int) (($row['num_replies']) / $context['pageindex_multiplier'])) * $context['pageindex_multiplier']) . '#msg' . $row['id_last_msg']) : (($row['num_replies'] == 0 ? '.0' : '.msg' . $row['id_last_msg']) . '#new')) . '" ' . ($row['num_replies'] == 0 ? '' : 'rel="nofollow"') . '>' . $row['last_subject'] . '</a>'
),


and in Recent.php

Find
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0;topicseen">' . $row['first_subject'] . '</a>'

Replace with
    // * NiceTooltips mod
    'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0"'  . $row['nice_tooltip_first_msg'] . ' >' . $row['first_subject'] . '</a>'


I cant even find what I need to find in this file..

can i get some help with these edits please? Id like to use this mod.

I attached the two files.

Harvester

Can anyone please help me with this?

Kinsman

Thanks for 1.1.8, that fixed a white page on portal with pretty url's installed for me.

Any chance I could get an index defined?


Apply Filter: Only show the error messages of this URL
http://www.clan-botm.com/index.php?action=enotify [nofollow]
Apply Filter: Only show the errors with the same message
8: Undefined index: nice_tooltip_first_msg
Apply Filter: Only show the errors from this file
File: /home/bikesnst/public_html/clan-botm.com/Sources/Recent.php
Line: 1248

Steve

Quote from: Harvester on February 25, 2017, 12:25:34 PM
Can anyone please help me with this?

I've asked to get you some help on this. Hopefully someone can do that.
DO NOT pm me for support!

Harvester

Quote from: Steve on February 25, 2017, 04:29:53 PM
Quote from: Harvester on February 25, 2017, 12:25:34 PM
Can anyone please help me with this?

I've asked to get you some help on this. Hopefully someone can do that.

Awesome! I appreciate that so much Steve! Thank you!

Kinsman

Those edits are easy peasy, just do a partial search in recent.php for
Quote' . $row['first_subject'] . '</a>'
So on my file that's line 1249

and another partial search in message index for
Quote' . $row['first_subject'] . '</a>'
that's line 524 for me.

Do the edits, job done.


Harvester

Quote from: Kinsman on February 26, 2017, 01:31:43 AM
Those edits are easy peasy, just do a partial search in recent.php for
Quote' . $row['first_subject'] . '</a>'
So on my file that's line 1249

and another partial search in message index for
Quote' . $row['first_subject'] . '</a>'
that's line 524 for me.

Do the edits, job done.

I can just insert the edits at that point wthout breaking any other mods?

Steve

Make copies of those files. Then try it on the copies and upload them. If it doesn't work correctly, you can replace those edited files with the originals you've kept. ;)
DO NOT pm me for support!

SaltedWeb

#237
The mod installed great, I can see the settings and no errors.
But where is the area to edit what is in a tooltip pop up?
I have what looks like a default now , but not sure where thats edited.
Thanks
Knowing your limitations makes you human, exceeding these limitations makes you worthy of being human.

lurkalot

Quote from: SaltedWeb on November 29, 2017, 02:29:11 PM
The mod installed great, I can see the settings and no errors.
But where is the area to edit what is in a tooltop pop up?
I have no pop ups now so presuming I must enable or add something to make it show up.

Thanks

Admin > Configuration > Modification Settings > Miscellaneous.

[NiceTooltips] Number of characters to display in the tooltip (0 = disable)

SaltedWeb

So
Quote from: lurkalot on November 29, 2017, 02:36:21 PM
Quote from: SaltedWeb on November 29, 2017, 02:29:11 PM
The mod installed great, I can see the settings and no errors.
But where is the area to edit what is in a tooltop pop up?
I have no pop ups now so presuming I must enable or add something to make it show up.

Thanks

Admin > Configuration > Modification Settings > Miscellaneous.



[NiceTooltips] Number of characters to display in the tooltip (0 = disable)


Sorry should have specified that was changed already and there is some kinda default message but where is that edited ?
Knowing your limitations makes you human, exceeding these limitations makes you worthy of being human.

Advertisement: