News:

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

Main Menu

How to remove signature from some of the boards?

Started by warezjasz, February 16, 2011, 11:25:26 AM

Previous topic - Next topic

warezjasz

Hello, I wish to remove user's signature from part of the boards, but not competly.

Where should I start my research to do that?

Suki

I couldn't understand you clearly, do you want to hide the signatures only in certain boards?

you can do that by modifying your theme's display.template.php

search for this:

// Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
echo '
<div class="signature" id="msg_', $message['id'], '_signature">', $message['member']['signature'], '</div>';




and replace with this:


// Show the member's signature?
$boards_to_show = array(1,2,3,4,5);
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'] && in_array($board_info['id'], $boards_to_show))
echo '
<div class="signature" id="msg_', $message['id'], '_signature">', $message['member']['signature'], '</div>';




where 1,2,3,4,5   are the board ids where you want to show the signature.   

it can be done in sources files but I'm not sure if $board_info  is already loaded in Load.php
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

warezjasz

That's exactly what I meant, I'll try to do it, gonna tell when I'm done.

Suki

Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

warezjasz

Hold on a sec ;p

It was working, but i made some new topics in empty boards to check it, and now its seems not to working anymore, I mean now non of board has signature.

How to check board ID?

Suki

the board id is the number you see in links like this:   http://www.simplemachines.org/community/index.php?board=147.0

for example, this board, SMF 2.x Support has an id 147

you need to put all the ids of all the boards where you want to show the signature, I just typed 1,2,3,4,5 as an example, you should need to replace those with your own board's IDs
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

warezjasz

hmm I can not see those ID, because I have Pretty URL's mod, what then?


Suki

go to admin/  boards  and hover or click the modify link, there you will see the board ID
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

warezjasz

Okey, boards ID is numeric, still your solution is not working.

Suki

  of course its numeric :)

how is not working?


did you replace the 1,2,3,4,5 for the board you want to show?


can you post here the ids do you want to use and attach your theme's display.template.php
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

cicka

If it does not work, can you define $board_info as global and then check if that would help?

warezjasz

I want to remove signatures from boards with ID: 8,11,23,24


Here's the link to my SMF gseo.pl [nofollow]

Suki

Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

warezjasz


samborabora

Hate the necrobump, but I'd like to just have signatures on one board and not worry about the working solution of removing them from a bunch of boards. Is there a working version of boardstoshow, since that code isn't working?

samborabora

I did it for one board with // Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'] && $context['current_board']=='3')
echo '
<div class="signature" id="msg_', $message['id'], '_signature">', $message['member']['signature'], '</div>';


Should I want to do this with multiple boards, what is a working way doing the array?

Advertisement: