Variable in theme to print the signatures? (automatic add set to off)

Keyz - February 2, 2009 - 08:09
Project:Signatures for Forums
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi Liam -

In the settings it mentions switching off the "Automatically add signatures to content" setting so themers can position the signature in the template manually. After switching this setting off, I dug around trying variables and searching the issue queue as best I could but couldn't seem to find which variable to print in my node.tpl.php or comment.tpl.php in order to get the signatures to show up. Trying <?php print $signature ?> and other variations on the name didn't do the trick. I cleared my theme registry just to make sure that wasn't the cause. I could have sworn I read an issue (or forum post) where you talked about it, but can't seem to find it anymore. Tried reading the module's code but I'm not that good yet ;) I'm using core forum by the way (not AF).

Anyhow, if you could (when you have a moment) post the correct code to drop in my templates that'd be most excellent :D
Thanks in advance.

(my use for this in the theme will be a little "show original post" jQuery toggle widget at the top of forum sub-pages, and I am trying to get it so that nothing but the node body shows up)

- David

#1

Ledo2 - February 4, 2009 - 18:09

In the settings it mentions switching off the "Automatically add signatures to content" setting so themers can position the signature in the template manually.

Same here. I don't use advanced forum. I have core signatures enabled. I don't want my users to have pictures in the signatures (defoult input filter for al users uses bbcode img tags) so i installed this module to set some input filters just for the signature.

But it only works if i leave "Automatically add signatures to content" to ON. Then the signature is "attached" in the bottom of the comment.

But if i turn it off the signature is gone. If i input something under My account -> edit -> signature it doesn't show in my theme.

I use core template function in my comment.tpl.php layout:

<?php if ($signature): ?>
<?php print $signature ?>
<?php endif; ?>

So my question is. Does the "Signature for Forum" module work with core template function $signature if "Automatically add signatures to content" is set to OFF?

Thanks for replies!

#2

Liam McDermott - February 10, 2009 - 23:35
Version:6.x-1.0» 5.x-2.x-dev
Category:support request» bug report

Unfortunately, there isn't a variable. I'll need to investigate what Advanced Forum does, then create something similar which doesn't conflict. In the meantime, just do this to print the signature in your theme:

<?php
print signature_forum_get_signature($node);
?>

or if it's a comment:

<?php
print signature_forum_get_signature($comment);
?>

#3

Liam McDermott - February 10, 2009 - 23:38
Version:5.x-2.x-dev» 6.x-1.x-dev

#4

Keyz - February 11, 2009 - 01:20

Thanks Liam - in any case, works great for now :)

#5

Ledo2 - February 13, 2009 - 00:09

Thanks i will try this weekend.

Edit: I tried quickly now and manually input the suggested code snippet in my comment.tpl.php and after quick test it works fine. I made custom filter for signatures that doesn't output nothing but links. I tried to set maximum number of lines to 3 and it works fine.

So now i don't have to worry about images in the signature any more. (i have bbcode module with image support so this was a big problem).

Great module!

 
 

Drupal is a registered trademark of Dries Buytaert.