PDA

View Full Version : Auto Sig


TimberFloorAu
01-12-2009, 08:05 PM
How do we mimic the VB.org signature system.

ie. Installed in sig

Developer in sig

Etc etc , this is something I would like to adopt for our members, and moderator teams. I presume its a Usergroup permission thing, with automatic code added to their sig ( i dnt need the vb.org complex version )

Any help. Ste

UKBusinessLive
01-12-2009, 08:08 PM
You could use a condition and add an image to the postbit, not sure how though :confused:

TimberFloorAu
01-12-2009, 09:04 PM
Looking at the vb.org code, it appears to be in sig.

Bellardia
01-12-2009, 10:38 PM
Signature is parsed in the postbit. Display things here depending on certain conditions.

Any more specifics?

TimberFloorAu
01-12-2009, 10:47 PM
nope just wanted to know what the code would be for us to post an image of say:

Thread Starter in the signature of a user, who starts a thread.

Often as you go thru pages and pages of posts, you forget who started / created the thread. So similarly to VB.org where INSTALLEd or DEVELOPER is displayed in the postbit, we would like to replicate this

Ste

Bellardia
01-12-2009, 10:53 PM
My guess (Similar to the first post on all pages mod) is that you add an extra column to the thread table and store who created the thread inside it.

Edit - Silly me...thread starter is stored in the thread table...not sure if it can normally be accessed though, maybe globalize it and then use a conditional?

Access the variable inside the postbit with a conditional.

Edit again.. Solution!

Find in postbit

<!-- sig -->
<div>
__________________<br />
$post[signature]
</div>
<!-- / sig -->


Replace...change code to fit needs

<if condition="$post['signature'] OR $thread[postuserid] == $post[userid]">
<!-- sig -->
<div>
__________________<br />
<if condition="$thread[postuserid] == $post[userid]">
testing..
</if>
$post[signature]
</div>
<!-- / sig -->
</if>


The if conditions may seem redundant since there's two...but the catch is if the user doesn't have a signature it won't post him as the thread starter regardless of if he is or not.

TimberFloorAu
01-13-2009, 12:21 AM
So tell me, please.

If lets say we created a watermarked image , such as: below.

Would we code:


<if condition="$post['signature'] OR $thread[postuserid] == $post[userid]">
<!-- sig -->
<div>
__________________<br />
<if condition="$thread[postuserid] == $post[userid]">
<img src="http://mywebsite.com/forum/images/thread_starter.gif">
</if>
$post[signature]
</div>
<!-- / sig -->
</if>

Bellardia
01-13-2009, 12:24 AM
Yes, just make sure you add an alt attribute so it validates!

TimberFloorAu
01-13-2009, 12:35 AM
Yes, just make sure you add an alt attribute so it validates!

thanks will give it a go, now. Presumably we can just add align=left ? without it affecting users signature? or what do you think?

Bellardia
01-13-2009, 12:37 AM
Put it in a container if you want to style it such as a div, but since it's just an image it should be fine and align left to begin with.

Consider adding a line break after the image <br /> if you want to ensure it's on its own line.

TimberFloorAu
01-13-2009, 12:41 AM
Works a DREAM. May I use this code to release as a template hack ?

Bellardia
01-13-2009, 12:44 AM
I'd prefer code I release for free be left without a name attached, if that's ok :)

TimberFloorAu
01-13-2009, 12:45 AM
Ok only issue is.

LOL

I only want it to display the graphic in the users sig within the thread he started.

At the moment, it displays it under everyones sig, because I suppose all have started a thread at one point or another .

Any suggestions

Bellardia
01-13-2009, 12:47 AM
It should only display in threads started by the user in the users sig.
$thread[postuserid] holds the userid of the member who posted that thread...not sure why something else would be the case.

TimberFloorAu
01-13-2009, 12:48 AM
Yep you are right, it was in a speciality forum I noticed the issue. All standard forums work fine !!!

So will leave it to you if you want to share this hack, I think its excellent !

Sincerely appreciate your help AGAIN !