News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Signature Option

Started by SMFHacks.com Team, August 04, 2006, 08:26:51 PM

Previous topic - Next topic

Tick

thanks friend.  It definitely is working now .  thanks again

kappayaki

Hi, i've got a problem with this mod: i managed to install it correctly, and it works if i make a new post (if i deselect the "Show signature" checkbox, the signature won't show), but if i try to edit a post which already has a signature, deselecting the option and saving, the post keeps the signature no matter what, and if i retry to modify it the checkbox is back ticked...

I'm using the default theme, the mod installation went ok (no errors), and SMF's version is 1.1.1...

Any idea on what i can doto resolve this "bug"?

Kays

Hi, I like this mod also, but the fact that you can't edit your selection is a major drawback. Since I do wish to use it I decided to look into it getting this to work. In the end there weren't too many changes required to get it fully functional.

The only change to the mod it's self is with the check box. Since I like Laibeus Lord's idea of placing that next to the announcement checkbox.

in Post.template.php find and delete this:


<tr>
<td class="smalltext" colspan="2"><label for="check_sig"><input type="checkbox" name="showsig" id="check_sig"' . (!empty($modSettings['sig_topic']) ? ' checked="checked"' : '') . ' value="1" class="check" /> ' . $txt['show_sig'] . '</label></td>
</tr>


Right under that find:


<tr>
<td class="smalltext"><label for="check_smileys"><input type="checkbox" name="ns" id="check_smileys"', $context['use_smileys'] ? '' : ' checked="checked"', ' value="NS" class="check" /> ', $txt[277], '</label></td>', '
<td class="smalltext">', $context['can_move'] ? '<input type="hidden" name="move" value="0" /><label for="check_move"><input type="checkbox" name="move" id="check_move" value="1" class="check" /> ' . $txt['move_after2'] . '</label>' : '', '</td>
</tr>', $context['can_announce'] && $context['is_first_post'] ? '
<tr>
<td class="smalltext"><label for="check_announce"><input type="checkbox" name="announce_topic" id="check_announce" value="1" class="check" /> ' . $txt['announce_topic'] . '</label></td>
<td class="smalltext"></td>
</tr>' : '', '


And replace with:

<tr>
<td class="smalltext"><label for="check_smileys"><input type="checkbox" name="ns" id="check_smileys"', $context['use_smileys'] ? '' : ' checked="checked"', ' value="NS" class="check" /> ', $txt[277], '</label></td>', '
<td class="smalltext">', $context['can_move'] ? '<input type="hidden" name="move" value="0" /><label for="check_move"><input type="checkbox" name="move" id="check_move" value="1" class="check" /> ' . $txt['move_after2'] . '</label>' : '', '</td>
</tr>
<tr>
<td class="smalltext"><label for="check_sig"><input type="checkbox" name="showsig" id="check_sig"' . (!empty($context['show_sig']) ? ' checked="checked"' : '') . ' value="1" class="check" />' . $txt['show_sig'] . '</label></td>
<td class="smalltext">', $context['can_announce'] && $context['is_first_post'] ? '<label for="check_announce"><input type="checkbox" name="announce_topic" id="check_announce" value="1" class="check" /> ' . $txt['announce_topic'] . '</label>' : '', '</td>
</tr>


The rest is just additions which need to be made

In Sources/Post.php

find:


// Get the existing message.
$request = db_query("
SELECT
m.ID_MEMBER, m.modifiedTime, m.smileysEnabled, m.body,


Replace with:


// Get the existing message.
$request = db_query("
SELECT
m.showSIG, m.ID_MEMBER, m.modifiedTime, m.smileysEnabled, m.body,



Find:


// Check the boxes that should be checked.
$context['use_smileys'] = !empty($row['smileysEnabled']);


After it add:


$context['show_sig'] = !empty($row['showSIG']);


Find:


// By default....
$context['use_smileys'] = true;


After it add:


$context['show_sig'] = $modSettings['sig_topic'];


in Sources/Subs-Post.php

Find:


if (isset($msgOptions['smileys_enabled']))
$messages_columns[] = "smileysEnabled = " . (empty($msgOptions['smileys_enabled']) ? '0' : '1');


After it add:


$messages_columns[] = "showSIG = '$msgOptions[sig_enabled]'";


I hope I didn't miss anything.  :o

Just a couple of notes for people installing this mod.

If you are using the signature options mod, you will get an error in Display.template.php. This is because that mod changes the same line. you will need to edit that manually so you end up with this:

if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $message['showSIG'] == 1 && $context['signature_enabled'])


For people using the Arcade with the stats in sig mod. On installing this mod you probably won't get an error for Dispaly.template.php, but the mod won't work. This is because that line is commented out. What you need to do is to open Sources/ArcadeSigStats.php, find and edit that line in two spots. Use the above code if you have the Signature options mod installed or the following if you don't.

if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $message['showSIG'] == 1)



I hope that this of some help.
Kays :)

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Kays

#43
It looks like I did miss something.

If you unchecked the Show Sigs check box in quick reply, it didn't carry over if you went to preview your post.

To fix that in Post.php find:

// Set up the checkboxes.
$context['notify'] = !empty($_REQUEST['notify']);


and under it add:

$context['show_sig'] = $_REQUEST['showsig'];

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

ragots

#44
Kays,

I followed your instructions, but even when I have the Show Signature box checked, signature is not showing.
I had to revert back to the Signature Option Mod which works fine, except for the fact that one cannot change the signature option by modifying the post.  

Krysia

vbgamer45,

Would you be willing (and able?) to adapt this mod to also work for avatars, so that a poster may decide to turn their avatar on or off per post?

:)
Krysia



vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Krysia




Krysia

Der. Nevermind. I just saw the text that said you must be a member.

It's been a long day. LOL...



Krysia

Posted in the mod tracker request.

Thank you. :)



Trashcan

#50
ccc

GhostRose

I see this mod was updated to reflect 1.1.5, however when I try to install it, the Display.template.php fails the test.  It seems it cannot find:

<textarea cols="75" rows="7" style="width: 95%; height: 100px;" name="message" tabindex="1"></textarea>

in the file.  I cannot find it either.  Any thoughts on what the fix might be?

Nice mod, BTW :)

Thanks!

vbgamer45

Quote from: GhostRose on May 08, 2008, 04:00:16 PM
I see this mod was updated to reflect 1.1.5, however when I try to install it, the Display.template.php fails the test.  It seems it cannot find:

<textarea cols="75" rows="7" style="width: 95%; height: 100px;" name="message" tabindex="1"></textarea>

in the file.  I cannot find it either.  Any thoughts on what the fix might be?

Nice mod, BTW :)

Thanks!
I checked the latest SMF 1.1.5 Display.template and looks like it would pass all the edits from the mod.

Do you have any others applied to your site that would affect it?
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

GhostRose

Quote from: vbgamer45 on May 09, 2008, 12:09:56 AM
Quote from: GhostRose on May 08, 2008, 04:00:16 PM
I see this mod was updated to reflect 1.1.5, however when I try to install it, the Display.template.php fails the test.  It seems it cannot find:

<textarea cols="75" rows="7" style="width: 95%; height: 100px;" name="message" tabindex="1"></textarea>

in the file.  I cannot find it either.  Any thoughts on what the fix might be?

Nice mod, BTW :)

Thanks!
I checked the latest SMF 1.1.5 Display.template and looks like it would pass all the edits from the mod.

Do you have any others applied to your site that would affect it?

Erg, yeah, it seems the Enhanced Quick Reply 2.0 ate the code that Sig Option was looking for in Display.template.  Anyone have any luck getting this mod working with the Quick Reply mod installed?  Any insight would be appreciated. :)

Thanks :)

vbgamer45

You would need to install the mod then make the changes manually to that textarea
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Citizen Erased

Quote from: kappayaki on February 09, 2007, 11:24:45 AM
Hi, i've got a problem with this mod: i managed to install it correctly, and it works if i make a new post (if i deselect the "Show signature" checkbox, the signature won't show), but if i try to edit a post which already has a signature, deselecting the option and saving, the post keeps the signature no matter what, and if i retry to modify it the checkbox is back ticked...

I'm using the default theme, the mod installation went ok (no errors), and SMF's version is 1.1.1...

Any idea on what i can doto resolve this "bug"?

Well... Two years and no one knows the answer *sigh*.

I kinda fixed it in my forum.

Find this (in Sources/Subs-Post.php):
// Change the post.
db_query("
UPDATE {$db_prefix}messages
SET " . implode(', ', $messages_columns) . "
WHERE ID_MSG = $msgOptions[id]
LIMIT 1", __FILE__, __LINE__);
if(isset($_POST['changeposterid']) && $context['user']['is_admin'])
{


And add before it:
$messages_columns[] = "showSIG = '$msgOptions[sig_enabled]'";

It's not a perfect fix but allows you to hide or show the signature when you edit the post. The problem is that when you edit a post without signature, the signature will appear again unless you hide it again.

I hope this could help other with the same problem as me and kappayaki.

Bye.

Eclipse16V

I worked with:
SMF 2 in German

Shop:
SID Giessen

vbgamer45

Maybe requires some work will see
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Eclipse16V

I worked with:
SMF 2 in German

Shop:
SID Giessen

Advertisement: