Advanced Signature

Started by emanuele, January 31, 2011, 02:46:04 PM

Previous topic - Next topic

emanuele

The mod distributed on this site may be outdated.
The latest version of this mod can always be found at the following address:

https://github.com/emanuele45/Advanced-Signature/releases/


This mod provides few new features to the signature mechanism.

With this mod active it is possible to have multiple signatures per user (the maximum number can be defined by the admin panel), choose a different signatures per each post or personal message, choose to use a random signature (for each single post/PM, from the post page, or for all the posts/PMs, from the profile page) or to not show signature at all (for each single post/PM, from the post page, or for all the posts/PMs, from the profile page). Admins can define a default signature for all the users without one.

SMF 2.0 only
Possibility to show/hide signatures on a per board and/or per topic level.


Uninstall instructions for SMF 2.0
Before uninstall the mod please go to Admin > Configuration > Features and Options > Signatures, set the maximum number of signature to 1 and use SMF tool to apply rules to all existing signatures.

Uninstall instructions for SMF 1.1.x
Before uninstall the mod use the maintenance action provided by the mod to reset all the signatures for all the users to the SMF-original single signature per user in: admin > forum maitenance and then select Reset to single signature per user.
Additionally, to completely remove any trace of the mod (including database entries), please use the uninstall script provided. Please before use the uninstall script, uninstall the mod as usual and delete the package from the server, then upload the uninstall script and run it.

Change log

  • 0.3.0 - beta several things including a bit of redesign, removed useless queries, moved from implode/explode to un/serialize, added license, other
  • 0.2.0:

    • stopped development for SMF 1.1.x series, all new features available only for SMF 2.0
    • added support for hiding signatures at board level
    • added support for show/hide signatures at topic level
    • added permission to allow show/hide signatures in topics
    • logging of action hide/show signatures in topics
    • possibility to disable logging
  • 0.1.10: fixed utf8 files
  • 0.1.9:
    • updated version compatibility (SMF 1.1.14 and 2.0)
    • added UTF8 translations...hope they work
  • 0.1.8: fixed an error log in SMF 2
  • 0.1.7:
    • bug fixed - reported by Kcmartz, the characters remaining was not working properly in SMF 2.0
    • fixed a php syntax error in Admin.php for SMF 1.1.x
  • 0.1.6: added a couple of notes during the uninstall to remind about maintenance.
  • 0.1.5: several improvements (thanks to the Customizer Team for the suggestions!)
  • 0.1.4:
    • bug fixed - reported by Kindred (thanks!) it was possible to use HTML in signatures.
    • fixed several errors reported in the log reported in the same post by Kindred
  • 0.1.3:
    • fixed some errors in the log a couple reported by Kindred few others found by myself
    • drop down box for the signature choice not showed on new topics
    • the signatures were not shown at all in personal messages
    • BBC not parsed (reported by warezjasz)
  • 0.1.2: added support for default signature (in case the user doesn't set one) and update to SMF 1.1.13 and SMF 2.0 RC5
  • 0.1.1: bug fixed - reported by DownloadPs3 (thanks Arantor) Call to undefined function in the profile page
  • 0.1.0: initial release.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

DownloadPs3

Please help.

If i try to update my profile and dont have something in the signature box it takes me to a white page and says:

Fatal error: Call to undefined function preparsecode() in /home/a5104797/public_html/Sources/Profile.php on line 705

line 704:

   $_POST['signature'] = strtr($_POST['signature'], array('"' => '\\"', ''' => '\\'', ''' => '\\''));

line 705:

   preparsecode($_POST['signature']);



Is it possible to make is so by defult a users signature is their user name untill they change it?
Check Out My Site At myfreespeach.co.cc

DownloadPs3

I am also getting this error:

Admin    Today at 05:02:47 AM
IP address xx.xx.xxx.xxx      session 607cf3af46dbeb860c551315ad2c0924
URL http://myfreespeach.co.cc/index.php?topic=7.0
8: Undefined offset: 0
File: /home/a5104797/public_html/Sources/Subs.php
Line: 3840
Check Out My Site At myfreespeach.co.cc

Arantor

Quote from: DownloadPs3 on February 09, 2011, 08:16:42 PM
Fatal error: Call to undefined function preparsecode() in /home/a5104797/public_html/Sources/Profile.php on line 705

line 704:

   $_POST['signature'] = strtr($_POST['signature'], array('"' => '\\"', ''' => '\\'', ''' => '\\''));

line 705:

   preparsecode($_POST['signature']);

Add this line before line 705:
require_once($GLOBALS['sourcedir'] . '/Subs-Post.php');

QuoteIs it possible to make is so by defult a users signature is their user name untill they change it?

Not easily, but you might try looking at the Signature Prompt mod which will do basically the same thing.
Holder of controversial views, all of which my own.


DownloadPs3

Quote from: Arantor on February 10, 2011, 05:42:31 AM
Quote from: DownloadPs3 on February 09, 2011, 08:16:42 PM
Fatal error: Call to undefined function preparsecode() in /home/a5104797/public_html/Sources/Profile.php on line 705

line 704:

   $_POST['signature'] = strtr($_POST['signature'], array('"' => '\\"', ''' => '\\'', ''' => '\\''));

line 705:

   preparsecode($_POST['signature']);

Add this line before line 705:
require_once($GLOBALS['sourcedir'] . '/Subs-Post.php');

QuoteIs it possible to make is so by defult a users signature is their user name untill they change it?

Not easily, but you might try looking at the Signature Prompt mod which will do basically the same thing.

Thank You for your help that did fix the error. Do you have any idea about this part:

Quote from: DownloadPs3 on February 10, 2011, 05:10:39 AM
I am also getting this error:

Admin    Today at 05:02:47 AM
IP address xx.xx.xxx.xxx      session 607cf3af46dbeb860c551315ad2c0924
URL http://myfreespeach.co.cc/index.php?topic=7.0
8: Undefined offset: 0
File: /home/a5104797/public_html/Sources/Subs.php
Line: 3840
Check Out My Site At myfreespeach.co.cc

Arantor

I have no idea about that, but that's probably because Subs.php has now been so modified, I have no idea what's on line 3840.
Holder of controversial views, all of which my own.


warezjasz

#6
Hi everyone!

I installed Advanced Signature, and some mods more, and now Advanced Signature not working, and I can't reinstal it, becouse /Themes/default/languages/Modifications.english.php file fail to uninstall.

What to do? :)


EDIT

Okej, got it, all I had to do was add :
$txt['max_numberofSignatures'] = 'Maximum allowed signatures per user<div class="smalltext">(not less than 1)<br />Please use the option in <a href="' . $boardurl . '/index.php?action=admin;area=maintain;sa=members">members\' maintenance page</a> to reset to 1 signature per user before uninstall</div>';

To the modifications.english

Now its work all fine, and reinstall is not nessesery.

DownloadPs3

Quote from: warezjasz on February 10, 2011, 06:06:19 AM
Hi everyone!

I installed Advanced Signature, and some mods more, and now Advanced Signature not working, and I can't reinstal it, becouse /Themes/default/languages/Modifications.english.php file fail to uninstall.

What to do? :)


EDIT

Okej, got it, all I had to do was add :
$txt['max_numberofSignatures'] = 'Maximum allowed signatures per user<div class="smalltext">(not less than 1)<br />Please use the option in <a href="' . $boardurl . '/index.php?action=admin;area=maintain;sa=members">members\' maintenance page</a> to reset to 1 signature per user before uninstall</div>';

To the modifications.english

Now its work all fine, and reinstall is not nessesery.

Are you getting an error message in your error log? something like the one here:

Quote from: DownloadPs3 on February 10, 2011, 05:10:39 AM

Admin    Today at 05:02:47 AM
IP address xx.xx.xxx.xxx      session 607cf3af46dbeb860c551315ad2c0924
URL http://myfreespeach.co.cc/index.php?topic=7.0
8: Undefined offset: 0
File: /home/a5104797/public_html/Sources/Subs.php
Line: 3840

If not could you attach public_html/Sources/Subs.php
Check Out My Site At myfreespeach.co.cc

emanuele

Quote from: Arantor on February 10, 2011, 05:42:31 AM
Quote from: DownloadPs3 on February 09, 2011, 08:16:42 PM
Fatal error: Call to undefined function preparsecode() in /home/a5104797/public_html/Sources/Profile.php on line 705

line 704:

   $_POST['signature'] = strtr($_POST['signature'], array('&quot;' => '\\&quot;', ''' => '\\'', ''' => '\\''));

line 705:

   preparsecode($_POST['signature']);

Add this line before line 705:
require_once($GLOBALS['sourcedir'] . '/Subs-Post.php');
Thanks DownloadPs3 for report and thanks Arantor for solve that. :)

Updated the mod to fix my silly error (now that I've seen it, it's a pretty obvious mistake... :P).


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

DownloadPs3

Quote from: emanuele on February 11, 2011, 02:59:12 PM
Quote from: Arantor on February 10, 2011, 05:42:31 AM
Quote from: DownloadPs3 on February 09, 2011, 08:16:42 PM
Fatal error: Call to undefined function preparsecode() in /home/a5104797/public_html/Sources/Profile.php on line 705

line 704:

   $_POST['signature'] = strtr($_POST['signature'], array('&quot;' => '\\&quot;', ''' => '\\'', ''' => '\\''));

line 705:

   preparsecode($_POST['signature']);

Add this line before line 705:
require_once($GLOBALS['sourcedir'] . '/Subs-Post.php');
Thanks DownloadPs3 for report and thanks Arantor for solve that. :)

Updated the mod to fix my silly error (now that I've seen it, it's a pretty obvious mistake... :P).


I dont know if this is common with alot of people using this mod but everytime someone viewed a post a error was placed in the error log about an unidentified index


  • I got the fix from another forum and here it is:

    In Sources/Subs:

    Find
    } else {
            return $signs[0];
        } 


    and change to
    } elseif (isset($signs[0])) {
            return $signs[0];
        }
Check Out My Site At myfreespeach.co.cc

emanuele

#10
Quote from: DownloadPs3 on February 13, 2011, 01:38:46 AM
I dont know if this is common with alot of people using this mod but everytime someone viewed a post a error was placed in the error log about an unidentified index

Yes it was... :-[

Please use the version I uploaded yesterday (0.1.2) I've called it a beta, but in fact it should work better than the previous one! :P


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

DownloadPs3

Quote from: emanuele on February 13, 2011, 04:07:22 AM
Quote from: DownloadPs3 on February 13, 2011, 01:38:46 AM
I dont know if this is common with alot of people using this mod but everytime someone viewed a post a error was placed in the error log about an unidentified index

Yes it was... :-[

Please use the version I uploaded yesterday (0.1.2) I've called it a beta, but in fact it should work better than the previous one! :P

I got it fixed someone from a different forum looked at it for me. i posted the fix above
Check Out My Site At myfreespeach.co.cc

DownloadPs3

How do i uninstall this mod on 1.12? I dont think this mod is really needed on my forum anymore. Where is that maintenance thing you need to run?

I get these errors:

1.    Execute Modification    ./Sources/ModSettings.php    Test successful
2.    Execute Modification    ./Sources/Load.php    Test successful
3.    Execute Modification    ./Sources/Subs.php    Test failed
4.    Execute Modification    ./Sources/Display.php    Test successful
5.    Execute Modification    ./Sources/Profile.php    Test failed
6.    Execute Modification    ./Themes/default/Profile.template.php    Test successful
7.    Execute Modification    ./Sources/Post.php    Test successful
8.    Execute Modification    ./Themes/default/Post.template.php    Test successful
9.    Execute Modification    ./Sources/Subs-Post.php    Test successful
10.    Execute Modification    ./index.php    Test successful
11.    Execute Modification    ./Sources/Admin.php    Test successful
12.    Execute Modification    ./Themes/default/Admin.template.php    Test successful
13.    Execute Modification    ./Sources/PersonalMessage.php    Test successful
14.    Execute Modification    ./Themes/default/PersonalMessage.template.php    Test successful
15.    Execute Modification    ./Themes/default/languages/Modifications.italian.php    Skipping file
16.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful
17.    Execute Modification    ./Themes/default/languages/Modifications.italian.php    Skipping file
18.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful
Check Out My Site At myfreespeach.co.cc

emanuele

#13
In admin -> forum maitenance
The link should be a link "Reset to single signature per user".

I know, it's a rather silly mod, that's why I like it, but I don't use it! :P


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

DownloadPs3

Quote from: emanuele on February 16, 2011, 03:06:19 AM
In admin -> forum maitenance
The link should be a link "Reset to single signature per user".

I know, it a rather silly mod, that's why I like it, but I don't use it! :P

I did that and im still getting those errors. Could it be because i had to modify those files to get the addon to work? If so how do i fix it?
Check Out My Site At myfreespeach.co.cc

emanuele

Of course that error is because the code found in the file is different from the one in the package.
You can simply revert the changes you did and uninstall the mod, or in alternative you can uninstall the mod and then remove manually the parts of code left in subs.php and profile.php ;)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Kindred


8: Undefined index: stored_signature
File: /....../Themes/default/Post.template.php
Line: 532

8: Undefined index: show_avail_signatures
File: /....../Themes/default/Post.template.php
Line: 515


the affected lines?


514: // Show the available signatures for the user...unless it's not the post's author
515: if($context['show_avail_signatures']){
516: echo '
517: <dl id="multiplesignatures">
518: <dt>' . $txt['signature'] . ':</dt>
519: <dd>
520: <select name="multiplesignatures">';
521: foreach($context['avail_signatures'] as $sign){
522: echo '
523: <option value="' . $sign['name'] . '"' . (($sign['selected']) ? '  selected="selected"' : '') . '>' . $sign['label'] . '</option>';
524: }
525: echo '
526: </select>
527: </dd>
528: </dl>';
529: } else {
530: echo '
531: <dd>
532: <input type="hidden" name="stored_signature" value="', $context['stored_signature'], '" />
533: </dd>';
534: }


It seems that the context value is not actually being set....   and you're not checking to see if it exists before calling it.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

emanuele

#17
Even worst: the real bug is in post.php...but there are in fact multiple bugs.

New version uploaded: correcting this bad behaviour and few other things I found in the meantime... :-[


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

warezjasz

Hello, you made great job with this mod, but i got one little problem.

Why links not working with it? I mean signatures works okey, but links in not working, even when I put that in BBC its showing whole code, not a link, and when I turn down Adv Sig mode, it's working okey. (I mean links in signature ofc)

Please help :)

emanuele

Please install the new 0.1.3 version.
I fixed many bug, including that one (thanks for reporting!).


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Advertisement: