Uutiset:

Wondering if this will always be free?  See why free is better.

Main Menu
Advertisement:

How to disable signature?

Aloittaja Hayek, tammikuu 24, 2006, 07:36:24 IP

« edellinen - seuraava »

Hayek


Elmacik

If you mean to remove signature option from the profile, open Profile template.php
Find and remove:

// Show the signature box.
echo '
<tr>
<td width="40%" valign="top">
<b>', $txt[85], ':</b>
<div class="smalltext">', $txt[606], '</div><br />
<br />';

if ($context['show_spellchecking'])
echo '
<input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'creator\', \'signature\');" />';

echo '
</td>
<td>
<textarea class="editor" onkeyup="calcCharLeft();" name="signature" rows="5" cols="50">', $context['member']['signature'], '</textarea><br />';

// If there is a limit at all!
if (!empty($context['max_signature_length']))
echo '
<span class="smalltext">', $txt[664], ' <span id="signatureLeft">', $context['max_signature_length'], '</span></span>';

// Load the spell checker?
if ($context['show_spellchecking'])
echo '
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/spellcheck.js"></script>';

// Some javascript used to count how many characters have been used so far in the signature.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function tick()
{
if (typeof(document.forms.creator) != "undefined")
{
calcCharLeft();
setTimeout("tick()", 1000);
}
else
setTimeout("tick()", 800);
}

function calcCharLeft()
{
var maxLength = ', $context['max_signature_length'], ';
var oldSignature = "", currentSignature = document.forms.creator.signature.value;

if (!document.getElementById("signatureLeft"))
return;

if (oldSignature != currentSignature)
{
oldSignature = currentSignature;

if (currentSignature.replace(/\r/, "").length > maxLength)
document.forms.creator.signature.value = currentSignature.replace(/\r/, "").substring(0, maxLength);
currentSignature = document.forms.creator.signature.value.replace(/\r/, "");
}

setInnerHTML(document.getElementById("signatureLeft"), maxLength - currentSignature.length);
}

setTimeout("tick()", 800);
// ]]></script>
</td>
</tr>';
Home of Elmacik

Sverre

I don't know what theme you are using, so I can't give you an exact answer, but I'll use Core/New Default Theme from 1.1 RC2 as an example of what I reckon to be the best, most reliable and easiest way to do this. If you use another theme, the procedure should be very similar, but the code might be slightly different so you won't find an exact match in your template file.

Find and remove from Display.template.php:


echo '
<hr width="100%" size="1" class="hrcolor" />
<div class="signature">', $message['member']['signature'], '</div>';



This modification will still allow your users to have a signature, but it will only be visible in their profile. If you want to, you can of course remove it there as well. Another option would be to remove the signature input box from Profile.template.php (as explained by Elmacik), but this will be problematic if your users already have signatures... Setting maximum allowed characters in signatures to 1 (Admin > Features and Options) can also be used as a quick fix, although not without flaws.

Elmacik

Sverre,
I wrote that before, but changed my opinion since it will still let miserable users to set a signature :P
If you want to find a shorter way, just open style.css find .signature, clear everything in it and just put:display: none; :)
But what I gave above is to remove signature section from profile.
___
But there was still something I didnt think. The current signtures were going to show up.
So he might be willing to do both what me and you said :)
Home of Elmacik

Sverre

Hehe, I actually thought about the CSS option too while posting :P but I chose the template modification because I imagine it to be faster (by a tenth of a millisecond maybe), and it also removes the display in profile. If I was to completely remove signatures myself, I would definitely edit both the Display and Profile templates. From my own experience, it's usually in Display view signatures get annoying though.

Advertisement: