News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

[MOD] Smiley align to display a nice text

Started by spirulez, July 19, 2005, 11:05:52 AM

Previous topic - Next topic

spirulez

(french translation)

Hi!

Undoubtedly you noticed that smileys cause sometimes shifts in messages.
Why? Quite simply because images are posted by default on the text's base line. How to cure it? Simple.

We will define two new CSS classes. First of all, edit your style.css contained in your topic directory $SMFDir/Theme/<your_theme>/style.css (that can be done in the admin interface).

Add where you want in this file the classes message and smiley.

/* modif : SmileysAlign */
.smiley
{
vertical-align: middle;
border: 0;
}

.message
{
line-height: 165%;
overflow: auto;
width: 100%;
}
/* modif : SmileysAlign */

Save your file.
Quote Notice that this case is given for smileys with 18 pixels high maximum. You can reduce these 165% if your pack installed is smaller. On the other hand, if you increase this %, the effect will not be pretty visually: leading out must be in a reasonable fork.
18 px: a good boy this smiley ;)
38 px: definitely to high!

Open now: $SMFDir/Sources/Subs.php
Search:
$smileytocache[] = '<img src="' . $modSettings['smileys_url'] . '/' . $user_info['smiley_set'] . '/' . $smileysto[$i] . '" alt="' . htmlspecialchars($smileysdescs[$i]) . '" border="0" />';

And remplace by:
$smileytocache[] = '<img src="' . $modSettings['smileys_url'] . '/' . $user_info['smiley_set'] . '/' . $smileysto[$i] . '" alt="' . htmlspecialchars($smileysdescs[$i]) . '" class="smiley" />';
Save your file.

Now open finally: $SMFDir/Sources/Subs.php
Search:
<div style="overflow: auto; width: 100%;">', $message['body'], '</div>

And remplace by:
<div class="message">', $message['body'], '</div>
Save your file again.

That's just it. If somebody has a little ftp space, I could add a preview of this modification. Good code;)

Oh, if you appreciated this small modification, thanks to have a look at my sign, I need your help ;)

[EDIT: See image attached - Meriadoc]
Do you undestrand something about SMF's variables? | Vous comprenez quelque chose aux variables sous SMF ?
Some help please? | Un peu d'aide svp ?
Thanks a lot | Merci beaucoup

Advertisement: