Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: emanuele on January 31, 2011, 02:46:04 PM

Title: Advanced Signature
Post by: emanuele on January 31, 2011, 02:46:04 PM
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
Title: Re: Advanced Signature
Post by: DownloadPs3 on February 09, 2011, 08:16:42 PM
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?
Title: Re: Advanced Signature
Post by: 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
Title: Re: Advanced Signature
Post by: 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.
Title: Re: Advanced Signature
Post by: DownloadPs3 on February 10, 2011, 05:59:25 AM
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
Title: Re: Advanced Signature
Post by: Arantor on February 10, 2011, 06:05:31 AM
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.
Title: Re: Advanced Signature
Post by: 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.
Title: Re: Advanced Signature
Post by: DownloadPs3 on February 10, 2011, 06:38:58 AM
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
Title: Re: Advanced Signature
Post by: 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).
Title: Re: Advanced Signature
Post by: DownloadPs3 on February 13, 2011, 01:38:46 AM
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
Title: Re: Advanced Signature
Post by: 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
Title: Re: Advanced Signature
Post by: DownloadPs3 on February 16, 2011, 01:52:50 AM
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
Title: Re: Advanced Signature
Post by: DownloadPs3 on February 16, 2011, 03:00:49 AM
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
Title: Re: Advanced Signature
Post by: 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's a rather silly mod, that's why I like it, but I don't use it! :P
Title: Re: Advanced Signature
Post by: DownloadPs3 on February 16, 2011, 03:40:10 AM
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?
Title: Re: Advanced Signature
Post by: emanuele on February 16, 2011, 05:23:03 AM
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 ;)
Title: Re: Advanced Signature
Post by: Kindred on February 23, 2011, 12:57:03 PM

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.
Title: Re: Advanced Signature
Post by: emanuele on February 23, 2011, 01:35:29 PM
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... :-[
Title: Re: Advanced Signature
Post by: warezjasz on February 23, 2011, 03:47:31 PM
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 :)
Title: Re: Advanced Signature
Post by: emanuele on February 23, 2011, 04:29:06 PM
Please install the new 0.1.3 version.
I fixed many bug, including that one (thanks for reporting!).
Title: Re: Advanced Signature
Post by: drjman on February 24, 2011, 01:38:52 PM
Hi,
So i am having a little issue. I installed this mod again and it looks like it wasn't removed properly from the previous install. Once i installed it again i am now getting an error when i try to go to the SMF admin section.

Here is the error i am getting:
Fatal error: Cannot redeclare template_restore_signatures() (previously declared in /home/jordanrobbins/fsu-clan.com/Sources/Load.php(2213) : eval()'d code:2174) in /home/jordanrobbins/fsu-clan.com/Sources/Load.php(2213) : eval()'d code on line 2190

I tried looking in the load.php file, but i can't find anything that pertains to the error message. i am basically locked out of my admin stuff, so any help is appreciated.
Title: Re: Advanced Signature
Post by: Arantor on February 24, 2011, 01:41:58 PM
It won't be in Load.php; the only reason the error shows in Load.php is that's because that's where the template loader is. The duplicate is in Admin.template.php at the end of the file.
Title: Re: Advanced Signature
Post by: drjman on February 24, 2011, 01:52:13 PM
Awesome.
That did it!

thanks for the quick reply. I appreciate the help.
Title: Re: Advanced Signature
Post by: Kindred on March 08, 2011, 09:16:45 AM
uh oh...

I have a possible glitch here...

Installed the Advanced Signature mod.

I am getting errors filling my error log because the mod does not ncheck to see if the variable is filled before trying to assign it to another variable


8: Undefined index: website
File: /...../Sources/Subs.php

I have several pages of errors related to website, href, username, randomsignature, etc etc etc
many of them from this block of code


function mod_getSignatureByID($ID, $member = false){
global $modav_member;
if(!empty($member)){
$modav_member['username'] = $member['username'];
$modav_member['name'] = $member['name'];
$modav_member['href'] = $member['href'];
$modav_member['website']['url'] = $member['website']['url'];
$modav_member['website']['title'] = $member['website']['title'];
}



Even more concerning...   a user was able to post actual HTML in his signature! (which broke the layout for the rest of the thread, since he didn't close the html tag correctly.

lastly, when I attempted to run the maintenance to reset the users back to a single signature and remove the mod:

Fatal error: Cannot use string offset as an array in /....../Sources/Subs.php on line 4712
Title: Re: Advanced Signature
Post by: KensonPlays on June 06, 2011, 11:28:25 AM
I installed this mod, set it to 2 signatures. I tried it on myself (and "applied the changes" yes) but the char. count won't go down. I set it for 100 but it stays at 100, I don't know if it is actually counting it. I had to do 3 manual edits.
Title: Re: Advanced Signature
Post by: emanuele on June 06, 2011, 03:11:22 PM
ops...you've found a bug.
I'm checking it.

Sorry, there is more than one bug and I also did a wrong copy&paste wiping out all the corrections I did... :'(

Okay, everything should be fine now. :)
Title: Re: Advanced Signature
Post by: KensonPlays on June 06, 2011, 04:18:45 PM
Thanks, installing the update :)
Title: Re: Advanced Signature
Post by: npiccoli on July 13, 2011, 05:06:54 PM
I am using this mod in conjunction with SMF 2.0 and the laGusta theme by Dzinerstudio. I was wondering if there would be a way where administrators can disable everyone's signature on an entire topic with just the push of one button, compared to going through and modifying each users post one by one.

Thanks for the modification by the way, it does wonders. :)
Title: Re: Advanced Signature
Post by: emanuele on July 13, 2011, 07:18:54 PM
No, never though about a similar "admin tool".
It could be interesting, but would the users be able to change again the signature after an admin has removed it?
Title: Re: Advanced Signature
Post by: npiccoli on July 13, 2011, 10:07:02 PM
Quote from: emanuele on July 13, 2011, 07:18:54 PM
No, never though about a similar "admin tool".
It could be interesting, but would the users be able to change again the signature after an admin has removed it?

Administrators would only be removing signatures from a topic, not the entire forum. Users would not be able to add a signature to their post again. Once an administrator removes all signatures from a topic, then having signature on the topic would be disabled for the life of the topic- unless re-enabled, then signatures would be set back to the default ones.
Title: Re: Advanced Signature
Post by: Kindred on July 13, 2011, 11:05:35 PM
That introdcues a whole new functionality to SMF...  In other words, this mod won't do that... And doing that would require some major changes to SMF itself.
Title: Re: Advanced Signature
Post by: npiccoli on July 14, 2011, 01:01:39 AM
Quote from: Kindred on July 13, 2011, 11:05:35 PM
That introdcues a whole new functionality to SMF...  In other words, this mod won't do that... And doing that would require some major changes to SMF itself.

I thought it would be much simpler to do with this modification because it has the ability to select "no signature" before posting. Wouldn't that selected option be saved somewhere? If yes, then couldn't you just change the saved information to "no signature?" Perhaps there would be a way where each thread is saved somewhere in the database, with an extra field (i.e. signatures?), then another button could be added. If an administrator clicks that button, all existing signatures will be removed and then the ability to add a signature will always default to "no signature" for that particular thread.

That can't be TOO difficult, can it?
Title: Re: Advanced Signature
Post by: emanuele on July 14, 2011, 04:10:13 AM
Quote from: npiccoli on July 13, 2011, 10:07:02 PM
Administrators would only be removing signatures from a topic, not the entire forum.
Never mentioned the entire forum. ;)

Quote from: npiccoli on July 13, 2011, 10:07:02 PM
Users would not be able to add a signature to their post again. Once an administrator removes all signatures from a topic, then having signature on the topic would be disabled for the life of the topic- unless re-enabled, then signatures would be set back to the default ones.
On that part I have to agree with Kindred: since it would be a completely reversible disabling of the signature for a topic, I'd see it as a different mod.

Quote from: npiccoli on July 14, 2011, 01:01:39 AM
I thought it would be much simpler to do with this modification because it has the ability to select "no signature" before posting. Wouldn't that selected option be saved somewhere? If yes, then couldn't you just change the saved information to "no signature?" Perhaps there would be a way where each thread is saved somewhere in the database, with an extra field (i.e. signatures?), then another button could be added. If an administrator clicks that button, all existing signatures will be removed and then the ability to add a signature will always default to "no signature" for that particular thread.

That can't be TOO difficult, can it?
It's not THAT easy do it with this mod and more than that, yes, there is a "no signature" option, but it's post-based (i.e. it's saved alongside each post) while you are describing something topic-based, so is not that logical introduce such a feature in this mod because the two things would be saved in different places. ;)

Quote from: Kindred on July 13, 2011, 11:05:35 PM
That introdcues a whole new functionality to SMF...  In other words, this mod won't do that... And doing that would require some major changes to SMF itself.
It depends on whay you mean with "major".
I think a new column in {db_prefix}topics, a new permission (hide_topic_signatures for example) and (if you are lazy like I am) simply a new button next to "move topic" for example would be enough (all of them are possible using only hooks), plus of course a couple of changes to display.php. While if you want to be super-good you can put also an option in the post page in the additional options area...okay, let me see if I can do it today or tomorrow. :P
Title: Re: Advanced Signature
Post by: npiccoli on July 14, 2011, 10:27:29 AM
Quote from: emanuele on July 14, 2011, 04:10:13 AMIt depends on whay you mean with "major".
I think a new column in {db_prefix}topics, a new permission (hide_topic_signatures for example) and (if you are lazy like I am) simply a new button next to "move topic" for example would be enough (all of them are possible using only hooks), plus of course a couple of changes to display.php. While if you want to be super-good you can put also an option in the post page in the additional options area...okay, let me see if I can do it today or tomorrow. :P

I'm unaware of how Simple Machines is coded (therefore I don't code modifications), but that seems like it could be something which would work well. :)
Title: Re: Advanced Signature
Post by: emanuele on August 16, 2011, 06:05:22 PM
At the end I decided to add the feature to this mod, additionally I also provided an option to hide signatures in an entire board.

So with this mod you can decide to:
1) enable signatures in your forum,
2) select on which board you want to hide/display signatures,
3) hide signatures on a per-topic basis,
4) decide to show (which one)/not show signatures on a per-post/PM basis.

Did I miss something? :P
Title: Re: Advanced Signature
Post by: Stigmartyr on October 23, 2011, 12:55:23 AM
Does not work with 2.0.1

--Screenshot Attached--
^see for errors.
Title: Re: Advanced Signature
Post by: emanuele on October 23, 2011, 11:49:04 AM
The errors are due to other mods you have on your forum. ;)

Please have a look at Manual Installation of Mods (http://wiki.simplemachines.org/smf/Manual_installation_of_mods).
Title: Re: Advanced Signature
Post by: Stigmartyr on October 23, 2011, 01:06:34 PM
Ok thanks - I'll slog through it... =\
Title: Re: Advanced Signature
Post by: nw on November 09, 2011, 07:36:58 PM
Hi there.

First of all, great, fun mod! :)

It installed fine on SMF 2.0. I have a quick question. Is it possible for user to select their signature instead of leaving it as "Random signature"?


Cheers.
Title: Re: Advanced Signature
Post by: emanuele on November 11, 2011, 09:46:50 AM
Each member can select for each post what signature he wants to show. Additionally, in their profile each member can select if he wants it random or not (or no signature at all).

What I still have to do (and I forgot I have it to do) is to give a way to select a default signature.
Title: Re: Advanced Signature
Post by: nw on November 11, 2011, 06:27:03 PM
Hi emanuele,

Thanks for the reply. I can select "Signature 1", "Signature 2", etc, and I can see that some of my members can do the same. However, some of them only have the choice of "No Signature" and "Random Signature".

Is there a particular setting that I've missed out?

Thanks.
Title: Re: Advanced Signature
Post by: emanuele on November 11, 2011, 06:47:24 PM
I think that only if a member doesn't have a signature at all then he can see only no and random...I'd call it a bug.
Title: Re: Advanced Signature
Post by: nw on November 13, 2011, 05:37:50 PM
Hm... But the member does have a signature. Any idea on what to do on this? Maybe it's something to do with permissions?

Thanks.
Title: Re: Advanced Signature
Post by: emanuele on November 14, 2011, 07:12:45 PM
I've to check. Don't know when though...
Title: Re: Advanced Signature
Post by: Quexinos on January 03, 2012, 06:12:18 AM
I'm having a similar problem.  Some of my members will set their signature to "random" or "Signature 1" in their profile, but when they post, it doesn't show their signature.  It's only when they select it under the "attachments and other options" that it shows up.

Any ideas why?
Title: Re: Advanced Signature
Post by: The Wizard on August 27, 2012, 04:21:02 PM
Hello Emanuele:

I have installed your mod on my new 2.0.2 board and have gone live with it so to speak. Most of my users are female and love to make graphic signatures. I'm not having a problem with text signatures but some of my users are experiencing the only one signature option available. I think I know what the problem is - the format of the graphic - IE jpg, png, etc.. what format can the image signatures be in?
Title: Re: Advanced Signature
Post by: emanuele on September 01, 2012, 08:32:12 AM
Quote from: Quexinos on January 03, 2012, 06:12:18 AM
I'm having a similar problem.  Some of my members will set their signature to "random" or "Signature 1" in their profile, but when they post, it doesn't show their signature.  It's only when they select it under the "attachments and other options" that it shows up.
That would sound like a bug, except I can't reproduce it.
Can you try to find out exactly the step to reproduce it?
I set a maximum of 3 signatures per user, took a board where signatures are allowed, I set in my profile "random", created a topic (where signatures are visible) and posted without change anything in the "attachments and other options". I tested it also from the quick reply and in both cases the post in the topic has a random signature.

Quote from: The Wizard on August 27, 2012, 04:21:02 PM
I think I know what the problem is - the format of the graphic - IE jpg, png, etc.. what format can the image signatures be in?
Any, the content of the signature doesn't make any difference.
Title: Re: Advanced Signature
Post by: Skaty on December 26, 2012, 12:41:48 PM
any sign for 2.0.3 ?

i emulated to 2.0.2 but can't install it
Title: Re: Advanced Signature
Post by: emanuele on December 26, 2012, 12:50:25 PM
It should work with 2.0.3 without problems.
Try emulating 2.0
Title: Re: Advanced Signature
Post by: Skaty on December 26, 2012, 03:36:37 PM
i'm trying now but in profile template have some problems. there is a lot of other mods here, can't edit as appropriate.

Here is the files can you help me about that ?

Title: Re: Advanced Signature
Post by: emanuele on December 29, 2012, 07:58:20 AM
That one has the change that fails applied (you have to apply all the others by yourself), I'm not sore if it works because of the other mod you have there.
Title: Re: Advanced Signature
Post by: Skaty on December 29, 2012, 01:42:27 PM
Quote from: emanuele on December 29, 2012, 07:58:20 AM
That one has the change that fails applied (you have to apply all the others by yourself), I'm not sore if it works because of the other mod you have there.

Works perfectly thank you so much.
Title: Re: Advanced Signature
Post by: Skaty on December 30, 2012, 07:26:13 AM
One more thing. Members can make 3 signatures now, but when someone make a 2 signatures with a random opt. system show 2 signatures and 1 empty signature. Can i fix this ?
Title: Re: Advanced Signature
Post by: emanuele on January 01, 2013, 08:38:56 AM
Where?
Title: Re: Advanced Signature
Post by: Skaty on January 01, 2013, 08:09:28 PM
Quote from: emanuele on January 01, 2013, 08:38:56 AM
Where?

i mean it is show empty signatures.
Title: Re: Advanced Signature
Post by: emanuele on January 06, 2013, 05:37:08 AM
Sorry, but I cannot reproduce the issue here...though I'm using an updated version compared to the one on the mod site, a version that I never finished to test...
If you want to try:
https://github.com/emanuele45/Advanced-Signature/archive/master.zip
Since the method used to store the signatures is changed (and I did the work quite a bit of time ago) I don't remember if it is backward compatible with the current method.
Title: Re: Advanced Signature
Post by: Skaty on January 13, 2013, 12:09:15 AM
hi, i don't wanna use signature function in personal messages what should i do ?


(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FBzWIC.png&hash=a46b3d6d8c538d42b3e0ba8d3b84ea2a9e786bd8)
Title: Re: Advanced Signature
Post by: emanuele on January 13, 2013, 04:00:05 AM
There is no option to handle signatures in PMs and posts differently.
If you don't want to use it, you can set it to "none" each time. At the moment it's the only way.
Title: Re: Advanced Signature
Post by: emanuele on January 14, 2013, 01:19:44 PM
I uploaded a new package called "beta" that should fix the "empty signature" Skaty reported.
Let me know if it works.
Title: Re: Advanced Signature
Post by: Skaty on January 14, 2013, 01:47:32 PM
i try to install it but there is to much manuel editing data, can't uninstall old one and install the new one. can you give me just the codes ?
Title: Re: Advanced Signature
Post by: Skaty on January 15, 2013, 03:36:37 PM
also i have logs like this:

8: Undefined index: 499 (also 1694,277,2165)    .......    /Sources/Subs-AdvancedSignature.php
Line: 97


do you have any idea for fix ?
Title: Re: Advanced Signature
Post by: emanuele on January 15, 2013, 04:26:04 PM
The code I wrote is quite ugly... ::)

I think I have an idea, but it doesn't make sense with the old code... ::)

Simple fix should be to replace:
return count($context['user_avail_signatures'][$member]);
with:
return isset($context['user_avail_signatures'][$member]) ? count($context['user_avail_signatures'][$member]) : 0;
doesn't make sense, but let try.
Title: Re: Advanced Signature
Post by: Skaty on January 15, 2013, 06:49:37 PM
:)

didn't work. but i can give more clue for problem. it's mostly gave it when pm is received or send.

and it is point from this -->> index.php?pretty;action=pm   

to this file's --> Sources/PersonalMessage.php   

line -->  (1058) if($memberContext[$message['id_member_from']]['random_signature']==-2){     
and     (1060)    elseif($memberContext[$message['id_member_from']]['random_signature']==-1 && $message['signature_id']!=-2){
Title: Re: Advanced Signature
Post by: emanuele on January 18, 2013, 04:36:48 PM
Replace the block:
if($memberContext[$message['id_member']]['random_signature']==-2){
$message['signature_id']=-2;}
elseif($memberContext[$message['id_member']]['random_signature']==-1 && $message['signature_id']!=-2){
$message['signature_id']=-1;}

with:
if(!empty($memberContext[$message['id_member']]['random_signature']) && $memberContext[$message['id_member']]['random_signature']==-2){
$message['signature_id']=-2;}
elseif(!empty($memberContext[$message['id_member']]['random_signature']) && $memberContext[$message['id_member']]['random_signature']==-1 && $message['signature_id']!=-2){
$message['signature_id']=-1;}

Should work at least for a while...
Title: Re: Advanced Signature
Post by: Skaty on January 24, 2013, 12:34:25 PM
Finally installed the beta version of mod. And it is working correctly. Thank you.
Title: Re: Advanced Signature
Post by: Skaty on January 24, 2013, 03:49:28 PM
Except, some signatures of some members don't appear in some topics :D
Title: Re: Advanced Signature
Post by: Skaty on January 27, 2013, 02:06:10 PM
i think i'm gonna uninstall it again :D
Title: Re: Advanced Signature
Post by: Cat McFarlane on September 25, 2013, 01:42:44 PM
Hiya :-)

Have been told to post here, as Subs-AdvancedSignature.php, although the mod isn't installed or on the system anymore is throwing up an error ...

8: Undefined index: hide_sign
File: /home/dsdetllb/public_html/Themes/freshlooks/index.template.php
Line: 614

about various topics/messages.

I noticed this error began after Buddy Page error showed, but also upgraded Aeva Media around the same time ... I see one line of text at the top of the site, I believe when someone is looking at their Buddy Page. Had posted, but it got lost/was really busy. No direct editing of subs.php done recently, but had the Buddy Page error and also installed 'related topics', 'simple ads', 'enhancements to purge inactive members' (which doesn't really need to be there now), plus I upgraded Aeva Media to 2.10).

Found a hide-sign in Subs-AdvancedSignature.php, but don't know what to replace it with. Or can I just removed the php file entirely, as the mod isn't there any more?

Thanks, Cat
Title: Re: Advanced Signature
Post by: Kindred on September 25, 2013, 02:36:44 PM
Well, your error suggests that the missing index is being called in index.template.php

this means that there is some left over code - if you uninstalled the advanced signature mod, it probably thew some errors during the uninstall but you ignored them and did it anyway - leading to some bits of code which were not correctly removed.


If you have code/text at the top of the screen on a page, that indicates that you have bade code somewhere (usually in one of the language files)
Title: Re: Advanced Signature
Post by: Cat McFarlane on September 25, 2013, 06:05:20 PM
Quote from: Kindred on September 25, 2013, 02:36:44 PM
Well, your error suggests that the missing index is being called in index.template.php

this means that there is some left over code - if you uninstalled the advanced signature mod, it probably thew some errors during the uninstall but you ignored them and did it anyway - leading to some bits of code which were not correctly removed.


If you have code/text at the top of the screen on a page, that indicates that you have bade code somewhere (usually in one of the language files)

Thanks Kindred.  :) Sorry, I have no idea what code to change in files, unless I post them individually to ask.
Title: Re: Advanced Signature
Post by: NekoJonez on February 02, 2014, 10:50:04 AM
I get this error when somebody sends a pm:

http://www.arpegi.be/index.php?action=pm;f=inbox;l=-1;done=sent
8: Undefined index: random_signature
/customers/b/f/a/arpegi.be/httpd.www/Sources/PersonalMessage.php
Line: 1022


Or on line 1024.

What can I do about this?
Title: Re: Advanced Signature
Post by: NekoJonez on February 11, 2014, 10:18:54 AM
Most of the times, when I put three different images for signatures, one of them goes duplicate.

So, image that I have image X in sig 1
image Y in sig 2
and image Z in sig 3.

In the forum posting, it will switch between image X,Y and Z. But on my profile, Image Y is displayed on sig 2 and 3 .
Title: Re: Advanced Signature
Post by: emanuele on February 12, 2014, 03:14:52 PM
Code (find) Select

if ($memberContext[$message['id_member']]['random_signature'] == -2)
$message['signature_id'] = -2;
elseif ($memberContext[$message['id_member']]['random_signature'] == -1 && $message['signature_id'] != -2)
$message['signature_id'] = -1;

Code (replace with) Select

if (!empty($memberContext[$message['id_member']]['random_signature']) && $memberContext[$message['id_member']]['random_signature'] == -2)
$message['signature_id'] = -2;
elseif (!empty($memberContext[$message['id_member']]['random_signature']) && $memberContext[$message['id_member']]['random_signature'] == -1 && $message['signature_id'] != -2)
$message['signature_id'] = -1;


Quote from: NekoJonez on February 11, 2014, 10:18:54 AM
In the forum posting, it will switch between image X,Y and Z. But on my profile, Image Y is displayed on sig 2 and 3 .
Are you sure you don't have "random signature" set somewhere?
Title: Re: Advanced Signature
Post by: kamili34 on February 12, 2014, 04:16:30 PM
Polish translation

$txt['random_signature'] = 'U&#380;yj przypadkowej sygnatury';
$txt['signature'] = isset($txt['signature']) ? $txt['signature'] : 'Sygnatura';
$txt['signature_numb'] = 'Sygnatura %1$s';
$txt['nosignature'] = 'Brak sygnatury';
$txt['randomsignature'] = 'Przypadkowa sygnatura';
$txt['restoresignatures'] = 'Resetuj do pojedy&#324;czej sygnatury dla u&#380;ytkownika';
$txt['choose_signature'] = 'Wybierz, kt&#243;r&#261; opcj&#281; sygnatury chcesz u&#380;y&#263;';
$txt['normal_signature'] = 'Normalna sygnatura';
$txt['signatures_still_missing'] = 'Przepraszamy nadal s&#261; [MISSING_SIGNATURES] sygnatury do zatwierdzenia.<br />Akcja zosta&#322;a przerwana w celu odci&#261;&#380;enia serwera.';
$txt['signature_continue'] = 'Kontynuuj';
$txt['signatures_restored'] = 'Wszystkich u&#380;ytkownik&#243;w sygnatury zosta&#322;y ustawione do pojedy&#324;czej';
$txt['default_signature'] = 'Standardowa sygnatura (zostanie ustawiona je&#347;li u&#380;ytkownik nie ma swojej ustawionej).<div class="smalltext">Pomoc na pliku zast&#281;pczym. BBCode jest wspierane.</div>';
$txt['max_numberofSignatures'] = 'Maksymalne dozwolone sygnatury dla u&#380;ytkownika<div class="smalltext">(nie mniej ni&#380; 1)<br />Prosz&#281; u&#380;y&#263; opcji <a href="' . $boardurl . '/index.php?action=admin;area=maintain;sa=members">Strona zarz&#261;dzania u&#380;ytkownika</a> aby zresetowa&#263; ustawienie do 1 sygnatury przed odinstalowaniem.</div>';
$txt['permissionname_hide_topic_signatures'] = 'Ukryj sygnatury u&#380;ytkownik&#243;w w tematach';
$txt['hide_sign'] = 'Ukryj sygnatury';
$txt['unhide_sign'] = 'Poka&#380; sygnatury';
$txt['modlog_ac_hide_sign'] = 'Ukryj sygnatury &quot;{topic}&quot;';
$txt['modlog_ac_unhide_sign'] = 'Odkryj sygnatury &quot;{topic}&quot;';
$txt['disable_log_hide_signature'] = 'Wy&#322;&#261;cz logowanie dla ukrytch syngatur';
$txt['mboards_disabled_signatures'] = 'Wy&#322;&#261;cz sygnatury';
$txt['mboards_disabled_signatures_desc'] = 'Nie pokazuj sygnatur u&#380;ytkownik&#243; dla tych dzia&#322;&#243;w';
Title: Re: Advanced Signature
Post by: NekoJonez on February 13, 2014, 08:21:17 AM
Quote from: emanuele on February 12, 2014, 03:14:52 PM
Code (find) Select

if ($memberContext[$message['id_member']]['random_signature'] == -2)
$message['signature_id'] = -2;
elseif ($memberContext[$message['id_member']]['random_signature'] == -1 && $message['signature_id'] != -2)
$message['signature_id'] = -1;

Code (replace with) Select

if (!empty($memberContext[$message['id_member']]['random_signature']) && $memberContext[$message['id_member']]['random_signature'] == -2)
$message['signature_id'] = -2;
elseif (!empty($memberContext[$message['id_member']]['random_signature']) && $memberContext[$message['id_member']]['random_signature'] == -1 && $message['signature_id'] != -2)
$message['signature_id'] = -1;


Quote from: NekoJonez on February 11, 2014, 10:18:54 AM
In the forum posting, it will switch between image X,Y and Z. But on my profile, Image Y is displayed on sig 2 and 3 .
Are you sure you don't have "random signature" set somewhere?

I'll apply your fix now. To your question, yes, I have random signature set, but it shouldn't randomize it in the profile display?
Title: Re: Advanced Signature
Post by: NekoJonez on February 13, 2014, 08:45:55 AM
http://www.arpegi.be/index.php?action=pm;pmid=9276;kstart;f=inbox;start=1000;sort=date;
8: Undefined index: id_memberApply Filter: Only show the errors from this file File: /customers/b/f/a/arpegi.be/httpd.www/Sources/PersonalMessage.php
Line: 1024


This happens if I apply the code change by just opening my pm's.
Title: Re: Advanced Signature
Post by: emanuele on February 14, 2014, 05:46:04 PM
@kamili34 Thanks! ;D

Quote from: NekoJonez on February 13, 2014, 08:21:17 AM
I'll apply your fix now. To your question, yes, I have random signature set, but it shouldn't randomize it in the profile display?
Good question... no idea... LOL
I seem to remember in profile should show all of them, but I'm not sure.

Quote from: NekoJonez on February 13, 2014, 08:45:55 AM
This happens if I apply the code change by just opening my pm's.
Right, right PMs not display...
In the changed code, replace id_member with id_member_from
Title: Re: Advanced Signature
Post by: NekoJonez on February 15, 2014, 11:39:30 AM
Quote from: emanuele on February 14, 2014, 05:46:04 PM
@kamili34 Thanks! ;D

Quote from: NekoJonez on February 13, 2014, 08:21:17 AM
I'll apply your fix now. To your question, yes, I have random signature set, but it shouldn't randomize it in the profile display?
Good question... no idea... LOL
I seem to remember in profile should show all of them, but I'm not sure.

Quote from: NekoJonez on February 13, 2014, 08:45:55 AM
This happens if I apply the code change by just opening my pm's.
Right, right PMs not display...
In the changed code, replace id_member with id_member_from

Alright. So, how to fix that issue with the profile view?
Title: Re: Advanced Signature
Post by: NekoJonez on March 02, 2014, 08:11:58 AM
Here is another bug.

If you load the profile editor, it always gives max characters.

Max characters: 600; characters remaining: 600 => Even when you have stuff inside the boxes.
Title: Re: Advanced Signature
Post by: rower on March 02, 2014, 03:37:15 PM
How to ad admin akcept sygnature mode? And, how off sugnature to member group?

Thanks for reply.
Title: Re: Advanced Signature
Post by: emanuele on March 05, 2014, 06:55:10 PM
Too many bugs, not enough time to fix them...
QuoteAlright. So, how to fix that issue with the profile view?
Which one is that?

Quote from: rower on March 02, 2014, 03:37:15 PM
How to ad admin akcept sygnature mode? And, how off sugnature to member group?
As far as I remember there is no way at the moment (and I'm not working on the code, but since it's opensource if anyone wants to work on it, the code is at github).
Title: Re: Advanced Signature
Post by: NekoJonez on March 06, 2014, 07:29:20 AM
I'm having the same signature displayed twice.

I have three different signatures, they all show up randomly like it's intended but... on my profile I see only two of them.