News:

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

Main Menu

Disable Signature in Post

Started by Rohan_, July 10, 2009, 04:34:51 PM

Previous topic - Next topic

catfished

Quote from: Kays on July 11, 2009, 09:52:26 PM
Check out this mod, I think it's what you're looking for.

http://custom.simplemachines.org/mods/index.php?mod=409

Thanks but unfortunately it's not like the ones in other forum software. I installed it in one of my 1.1.9 forums using the default theme. It allows you to check the box to include a sig but it can't be changed by modifying/editing the post. Also the sig is no longer automatically included in your posts. You have to tick the box to show the sig or else it defaults to no sig.
You use and like this forum software? Then show your appreciation and support by becoming a Charter Member.



CatfishEd.com

SoLoGHoST

#21
Quote from: Arantor on July 11, 2009, 08:15:39 PM
And where is that value stored for others to see/not see it? Yes, it's in the Post2 function that it would be stored - but it has to be stored somewhere so that Display.template.php can know not to do it.

So while it isn't a huge mod - you still have to store that value somewhere, which means you have to either attach it to the end of the post somehow, or you modify the schema to add a 'do not add signature to this post' flag.

you can use the same array that gets used for attachments in Display.php:  $message, and then do a foreach on $message where the signature gets put in Display.template.php:

foreach ($message['signature'] as $signature)
   if ($signature)
     // show it


You can use the output array from the Main function in Display.php, which gets returned to Load a SignatureContext from this, and either load the signature or return false...

For Example in Display.php (Display() Function):

// Compose the memory eat- I mean message array.
$output = array(
'attachment' => loadAttachmentContext($message['id_msg']),

Just Add...

'signature' => loadSignatureContext($message['id_msg']),


and then in the loadSignatureContext($id_msg) function that you will create, get the $user_info['id'] and determine if the signature should be displayed or not.  You can look at how the loadAttachmentContext() function does this, however, you will not need to make an array in this function since you are dealing with only 1 signature.  Attachments deal with 1 or more, so this is why it creates an array and applies a for each on the array in the loadAttachmentContext() function.

Anyways, I'm not trying to get involved with this MOD, as I said, I have my MASTERPIECE MOD almost complete!!  It's going to be a big hit for sure!

Good Luck!

Rohan_

so what now ?? tell me exactly what i need to do ?
Proud To Be An Indian

SoLoGHoST

Ok, my bad, just looked at it again, and you will not need this in Display.template.php

foreach ($message['signature'] as $signature)
   if ($signature)
     // show it

a simple if ($message['signature']) will do it or if (!empty($message['signature']))

You will need to define as $global variable in the following functions Post() <- may not need it here, Post2() <- may not need it here either, loadSignatureContext() <-- Definitely Need it here, and Display() <-- Definitely Need it here, as this is how the global $attachments is done.  Now look at what variable is used to show the signature currently, should be something like:  $message['member']['signature'] or something like this in Display.template.php.  Look for where this gets defined in Display.php (most likely in Display() function), use the same definition to define the global variable in loadSignatureContext() function.  Create a checkbox in Display.template.php (give it a name so you can access it and determine if it is set ( if (isset('checkbox_name'))) in the Post2() function).  Set $message['signature'] = loadSignatureContext($id_msg) again in the Post2() function if it is set, otherwise $message['signature'] = '';, or maybe just try:  $message['signature'] = true or false.  If you have your loadSignatureContext function working properly, you should be able to just set this to either true or false and it should do it just fine.

But like I said, not trying to get involved with exact code to give you, as this is something that you can do yourself, and I'm currently busy with a MOD on my hands, taking all of my time atm.

Just know that this is the way to do this!  Create a test board and have a go with it, try everything that I mentioned, and be persistent, you'll get it.

Cheers!

Rohan_

hey i am not a coder please tell me the exact replacements to do with my files
Proud To Be An Indian

[SiNaN]

The mod linked here does what you are trying to achieve:

Quote from: Kays on July 11, 2009, 09:52:26 PM
Check out this mod, I think it's what you're looking for.

http://custom.simplemachines.org/mods/index.php?mod=409

Quote from: catfished on July 11, 2009, 10:37:25 PM
Thanks but unfortunately it's not like the ones in other forum software. I installed it in one of my 1.1.9 forums using the default theme. It allows you to check the box to include a sig but it can't be changed by modifying/editing the post. Also the sig is no longer automatically included in your posts. You have to tick the box to show the sig or else it defaults to no sig.

There is an option to enable it by default in Admin > Features and Options > Layout > Show Signature Checked?.

For editing, you want to try requesting it from the mod author.
Former SMF Core Developer | My Mods | SimplePortal

Rohan_

ohh yeahh Sinan u have done it friend .. its solved .. its nothing and the people is taking too hard .. but my sources/display.php gave me a problem so i edited it manually :) thanks a lot everyone for help
Proud To Be An Indian

Advertisement: