Topic: Sig once per topic

One feature on my current forum members love is Sig once per topic. If someone has an image in their Sig it really cleans up the topic. This possible with PunBB?

Matt

2

Re: Sig once per topic

Agreed. Thats a very good idea. How to go about implementing it is another matter altogether.

Re: Sig once per topic

It's quite easy actually. Just set a flag when the sig has been displayed the first time.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Sig once per topic

Then I think it would be like Sig once per page right?

5

Re: Sig once per topic

Thats what I was thinking. I think the suggestion was one sig per poster per topic. Wouldn't that require an array of flags keyed on member name/id.

6 (edited by chacmool 2003-10-04 12:03)

Re: Sig once per topic

Good idea!. I usually disable images in the signatures, but with this it might be better smile One signature / user / page:

#
#---------[ 1. OPEN ]---------------------------------------------------------
#

    viewtopic.php

#
#---------[ 2. FIND (line: 323) ]---------------------------------------------
#

    if ($cur_post['signature'] != '' && $cur_user['show_sig'] != '0')
        $signature = '<br><br>_______________________________________<br>'.parse_signature($cur_post['signature']).'<br><br>';
    else
        $signature = NULL;

#
#---------[ 3. REPLACE ]------------------------------------------------------
#

    if ($cur_post['signature'] != '' && $cur_user['show_sig'] != '0' && !isset($signatures[$cur_post['poster_id']])){
        $signature = '<br><br>_______________________________________<br>'.parse_signature($cur_post['signature']).'<br><br>';
        $signatures[$cur_post['poster_id']] = true;
    }
    else
        $signature = NULL;

#
#---------[ 4. SAVE / UPLOAD ]------------------------------------------------
#

I fixed a typo and added a !isset() so that it won't complain about the element not being initialized /Kennel

Re: Sig once per topic

Works Great thx!

Re: Sig once per topic

How can I do this with version 1.2.5?

Re: Sig once per topic

1 sig/user/page for 1.2.5:

#
#---------[ 1. OPEN ]---------------------------------------------------------
#

    viewtopic.php

#
#---------[ 2. FIND ]---------------------------------------------
#
    // Do signature parsing/caching
    if ($cur_post['signature'] != '' && $pun_user['show_sig'] != '0')
    {
        if (isset($signature_cache[$cur_post['poster_id']]))
            $signature = $signature_cache[$cur_post['poster_id']];
        else
        {
            $signature = parse_signature($cur_post['signature']);
            $signature_cache[$cur_post['poster_id']] = $signature;
        }
    }

#
#---------[ 3. REPLACE WITH ]------------------------------------------------------
#
    // Do signature parsing/caching
    if ($cur_post['signature'] != '' && $pun_user['show_sig'] != '0')
    {
        if (!isset($signature_cache[$cur_post['poster_id']]))
        {
            $signature = parse_signature($cur_post['signature']);
            $signature_cache[$cur_post['poster_id']] = $signature;
        }
    }

10

Re: Sig once per topic

So simple, and it works great!

Thanks for finding this

Re: Sig once per topic

Cheers people... Just done this on 1.2.10... works lovely...

12

Re: Sig once per topic

Cool, its workd! smile

PunBB, Simplicity has been easier than before
Smart is Simple. Fast is Smart. Think Fast, You'll be Smart..

regards,
PunBB & SMF Fans

Re: Sig once per topic

Hi !

Is there a solution to make this in Punbb 1.3 ?

Thanks.

14

Re: Sig once per topic

Just FYI (whoever wants to make this extension) this is what the code looks like now; maybe you (progent) could post a feature/extension request referencing this post...

    // Do signature parsing/caching
    if ($cur_post['signature'] != '' && $forum_user['show_sig'] != '0' && $forum_config['o_signatures'] == '1')
    {
        if (!isset($signature_cache[$cur_post['poster_id']]))
            $signature_cache[$cur_post['poster_id']] = parse_signature($cur_post['signature']);

        $forum_page['message']['signature'] = '<div class="sig-content"><span class="sig-line"><!-- --></span>'.$signature_cache[$cur_post['poster_id']].'</div>';
    }

    ($hook = get_hook('vt_row_pre_display')) ? eval($hook) : null;