vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=236)
-   -   Show Thread Enhancements - Hide Signature and Avatar in specific forum (https://vborg.vbsupport.ru/showthread.php?t=205469)

ArbStar 02-14-2009 10:00 PM

Hide Signature and Avatar in specific forum
 
1 Attachment(s)
Hello everybody,

This is my first modification I post in vBulletin.org, and I hope it will be a good start for me and I keep posting new modifications for you.

Today's post is about hiding signature or/and avatars in threads in specific forum, its very easy and simple.
  • Hiding signatures
First, open your postbit, or postbit_legacy template.


Find:

Code:

<if condition="$post['signature']">

Replace it with:

Code:

<if condition="$post['signature'] AND !in_array($thread['forumid'],array(2,47))">
IMPORTANT NOTICE: Replace 2 & 47 with the forum id you want to hide signatures from it, if you want to add more forum numbers add comma between them.

You're done ! :D

  • Hiding Avatars
Now we will do the same thing with avatars, its also easy like the signature hiding.
Open your postbit, or postbit_legacy template.


Find:

Code:

<if condition="$show['avatar']">

Replace it with:

Code:

<if condition="$show['avatar'] AND !in_array($thread['forumid'],array(2,47))">

IMPORTANT NOTICE: Replace 2 & 47 with the forum id you want to hide avatars from it, if you want to add more forum numbers add comma between them.



I hope this modification would be useful for everyone.


Regards,
Ibrahim Mohammed

Diana Notacat 02-16-2009 08:28 PM

Wonderfully useful!

I'm using this if you want to exclude avatars and siggies in multiple forums.

ArbStar 02-17-2009 09:29 AM

Quote:

Originally Posted by Diana Notacat (Post 1746239)
Wonderfully useful!

I'm using this if you want to exclude avatars and siggies in multiple forums.

ThnX for ur reply & Installation

Jasem 04-04-2009 02:28 PM

great work, thank you!

Installed

tafreeh 04-10-2009 12:12 AM

if we want to hide sigg in multiple forums... can we just add comma and put next forum id? would that work?
coz when i try to add, multiple forums. i get this error
Code:

The following error occurred when attempting to evaluate this template:

Parse error:  syntax error, unexpected ',' in /8888/8888/888888/includes/adminfunctions_template.php(3939) : eval()'d code on line 167

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.

this is my code
PHP Code:

        <if condition="$post['signature'] AND $thread['forumid']  != 231, 257, 331, 348, 349, 355, 258, 471, 282">
        <!-- 
sig --> 


down.low 04-11-2009 02:39 AM

any way to change this to hide the member names as well?

TheLastSuperman 04-11-2009 02:49 AM

Quote:

Originally Posted by down.low (Post 1788639)
any way to change this to hide the member names as well?

Yes, find (Or Similar):

Code:

                                        <if condition="$show['profile']">
                                        <a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
                                        $post[onlinestatus]
                                        <script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script>
                                        <else />
                                        $post[musername]
                                        </if>

Replace with:

Code:

                                        <if condition="$show['profile']" AND $thread['forumid']  != 2">
                                        <a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
                                        $post[onlinestatus]
                                        <script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script>
                                        <else />
                                        $post[musername]
                                        </if>

Now don't forget to follow this mod authors directions regarding the forum ID.

that should do it as when I removed that code the names were gone from my forums. I did not trick it via the forum id I simplt removed, saved, viewed, then corrected it back to original.

S-MAN

TheLastSuperman 04-11-2009 02:52 AM

Quote:

Originally Posted by tafreeh (Post 1787818)
if we want to hide sigg in multiple forums... can we just add comma and put next forum id? would that work?
coz when i try to add, multiple forums. i get this error
Code:

The following error occurred when attempting to evaluate this template:

Parse error:  syntax error, unexpected ',' in /8888/8888/888888/includes/adminfunctions_template.php(3939) : eval()'d code on line 167

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.

this is my code
PHP Code:

        <if condition="$post['signature'] AND $thread['forumid']  != 231, 257, 331, 348, 349, 355, 258, 471, 282">
        <!-- 
sig --> 


Take out all the extra spaces and try it ;)

PHP Code:

        <if condition="$post['signature'] AND $thread['forumid']  != 231,257,331, 348,349,355, 258,471,282">
        <!-- 
sig --> 

Let us all know if it worked, not tested but it should as I believe it was not reading the code correctly due to all the extra spaces but then again it could be due to the AND and it only NEEDING one forum ID to work with the first part of the IF i.e. the if condition equals to post signature ;)

S-MAN

q8manar 04-18-2009 09:42 AM

Quote:

Originally Posted by TheLastSuperman (Post 1788646)
Take out all the extra spaces and try it ;)

PHP Code:

        <if condition="$post['signature'] AND $thread['forumid']  != 231,257,331, 348,349,355, 258,471,282">
        <!-- 
sig --> 

Let us all know if it worked, not tested but it should as I believe it was not reading the code correctly due to all the extra spaces but then again it could be due to the AND and it only NEEDING one forum ID to work with the first part of the IF i.e. the if condition equals to post signature ;)

S-MAN


this is not working

this is working good
:
<if condition="$show['avatar'] AND ($thread['forumid'] != 3 and $thread['forumid'] != 58 and $thread['forumid'] != 34 )">

trotskid 04-29-2009 12:13 PM

Quote:

Originally Posted by q8manar (Post 1793824)
this is not working

this is working good
:
<if condition="$show['avatar'] AND ($thread['forumid'] != 3 and $thread['forumid'] != 58 and $thread['forumid'] != 34 )">

Interesting addon for some forums (private mainly or closed), but doesn?t work with multiple forums on postbit template with v3.8.2 :/

down.low 05-09-2009 08:23 PM

Quote:

Originally Posted by TheLastSuperman (Post 1788645)
Yes, find (Or Similar):

Code:

                    <if condition="$show['profile']">
                    <a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
                    $post[onlinestatus]
                    <script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script>
                    <else />
                    $post[musername]
                    </if>

Replace with:

Code:

                    <if condition="$show['profile']" AND $thread['forumid']  != 2">
                    <a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
                    $post[onlinestatus]
                    <script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script>
                    <else />
                    $post[musername]
                    </if>

Now don't forget to follow this mod authors directions regarding the forum ID.

that should do it as when I removed that code the names were gone from my forums. I did not trick it via the forum id I simplt removed, saved, viewed, then corrected it back to original.

S-MAN

Thanks for the help- It didn't work quite right for me but I ended up figuring something else out for my problems.





I need help from someone on 2 last issues-

Removing the "last post" user name (or even the column)
Removing the "user name" for the thread starter.

https://vborg.vbsupport.ru/

IF someone could help me out in any kind of way it would be greatly appreciated.

down.low 05-09-2009 08:35 PM

Quote:

Originally Posted by q8manar (Post 1793824)
this is not working

this is working good
:
<if condition="$show['avatar'] AND ($thread['forumid'] != 3 and $thread['forumid'] != 58 and $thread['forumid'] != 34 )">



Use it as this: (there was to many spaces in the previous example):

Code:

<if condition="$post['signature'] AND $thread['forumid']  != x,x,x,x,x">

Another route at the problem/s:

Code:

<if condition="in_array($forum[forumid], array(x,x,x,x,x))">

Something you want to hide

</if>

Any forum id not listing here (The x's need to be replaced)- would not see something in particular.

nomoreturn 05-09-2009 09:22 PM

Not working even in single forum in 3.8.2

down.low 05-10-2009 02:07 AM

http://i472.photobucket.com/albums/r...ction/help.jpg


Could someone help me with:

Removing the "last post" user name (or even the column)
Removing the "user name" for the thread starter.

Could someone point me in a direction- it would be really helpful.

trotskid 05-10-2009 10:48 AM

Quote:

Originally Posted by down.low (Post 1807689)
Use it as this: (there was to many spaces in the previous example):

Code:

<if condition="$post['signature'] AND $thread['forumid']  != x,x,x,x,x">

Another route at the problem/s:

Code:

<if condition="in_array($forum[forumid], array(x,x,x,x,x))">

Something you want to hide

</if>

Any forum id not listing here (The x's need to be replaced)- would not see something in particular.

For the first code appears this error:

Parse error: syntax error, unexpected ',' in /var/www/vhosts/"my forum"/httpdocs/foros/includes/adminfunctions_template.php(3939) : eval()'d code on line 163

For the second code I don?t understand what it means
Code:

Something you want to hide
Regards

down.low 05-11-2009 03:54 AM

Quote:

Originally Posted by trotskid (Post 1807938)
For the first code appears this error:

Parse error: syntax error, unexpected ',' in /var/www/vhosts/"my forum"/httpdocs/foros/includes/adminfunctions_template.php(3939) : eval()'d code on line 163

For the second code I don?t understand what it means
Code:

Something you want to hide
Regards

The error I don't know--

For the second code I'll explain:

Example- you wanted to hide your user name and user title in a specific forum- but not all forums.

You would open up you postbit_legacy and find the following (or similar):

Code:

<div id="postmenu_$post[postid]">
                <if condition="$show['profile']">
                <a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
                <script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script>
                <else />
                $post[musername]
                </if>
            </div>

            <if condition="$post['usertitle']"><div class="smallfont" align="center">$post[usertitle]</div></if>
            <if condition="$post['rank']"><div class="smallfont">$post[rank]</div></if>

Then before it you would add:
Code:

<if condition="in_array($forum[forumid], array(42,26,25,9,8))">
The forums with an Id of 42,26,25,9,8 would see their user names & titles but anything not listed in the array()) would not...

Then After it you would add:
Code:

</if>
I've done this in a whole sub-forum removing: (making it a anonymous sub-forum)

User Name
User Title
Post Count (if you know what you're doing you can pull a username off of the postcount # alone)
Location
Msn/yahoo/skype
Reputation
Add Rep
Infractions
Quote
Thanks
Signatures
Avatars


(Side Note: I'm running Vbulletin 3.8.1 pl1)

creative-friend 07-22-2009 12:23 PM

how can i hide signature in more than 1 forum....i have tried but giving me error..

alloutvb 07-23-2009 01:33 PM

is there a way to have this for a user to turn on and off for the hole board like is a user is on a iphone or on 56k so the site loads faster ? please let me know thanks for this mod

apiasto 07-27-2009 10:12 AM

its not working on multiple forums

ArbStar 07-28-2009 10:20 AM

Quote:

Originally Posted by trotskid (Post 1807938)
For the first code appears this error:

Parse error: syntax error, unexpected ',' in /var/www/vhosts/"my forum"/httpdocs/foros/includes/adminfunctions_template.php(3939) : eval()'d code on line 163

For the second code I don?t understand what it means
Code:

Something you want to hide
Regards

You should put ( ! ) Before ( in_array(); ) ;)

trotskid 08-03-2009 02:01 AM

Quote:

Originally Posted by ArbStar
Code:

<if condition="$post['signature'] AND !in_array($thread['forumid'],array(2,47))">

Now works PERFECT on multiple forums! :up:

Many thanks ;)

Feanor_87 08-05-2009 06:57 AM

Very useful, thanks!! :)

Bolthaven 08-07-2009 02:29 AM

How would I hide this for unregistered users? What I want to do is hide avatar, signature, and membernames from unregistered users while still letting them view some thread content.

My guess is that I would replace the condition !in_array($thread['forumid'],array(2,47)) with in_array(*whatever variable for group membership*)

love. 08-08-2009 02:18 PM

thank u

Phaedrus 08-09-2009 09:26 PM

Quote:

Originally Posted by alloutvb (Post 1854168)
is there a way to have this for a user to turn on and off for the hole board like is a user is on a iphone or on 56k so the site loads faster ? please let me know thanks for this mod

User CP, three checkmark boxes in the User Options allow a user to choose to do this for the whole board.

alloutvb 08-11-2009 02:36 AM

k thanks for the help just must have over looked it

ArbStar 09-03-2009 10:08 AM

Quote:

Originally Posted by Bolthaven (Post 1862888)
How would I hide this for unregistered users? What I want to do is hide avatar, signature, and membernames from unregistered users while still letting them view some thread content.

My guess is that I would replace the condition !in_array($thread['forumid'],array(2,47)) with in_array(*whatever variable for group membership*)

If you want to show something only to members, use this code:

Code:

<if condition="$show['member']">
Some thing you want to hide from guests
</if>



and if you have many user groups that you want to hide from them, use this one:

Code:

<if condition="!is_member_of($vbulletin->userinfo, array('1','2','3'))">
Some thing you want to hide from some groups
</if>

Note: Replace 1,2,3 with the groups you want to hide a content from them:)

ArbStar 09-03-2009 10:12 AM

Quote:

Originally Posted by creative-friend (Post 1853492)
how can i hide signature in more than 1 forum....i have tried but giving me error..

Please use the new code in the thread, I've updated it :)

Quote:

Originally Posted by alloutvb (Post 1854168)
is there a way to have this for a user to turn on and off for the hole board like is a user is on a iphone or on 56k so the site loads faster ? please let me know thanks for this mod

You can make additional user profile fields from the ACP,
and then use this code:

Code:

<if condition="$member['field6']=='show'">
$post['signature'];
</if>

Note: Replace field6 with the field name/number that will appear in the ACP after adding it.

Alucard^ 10-25-2009 02:26 AM

Good, i like this... installed.

Also, I added an "else":

PHP Code:

<if condition="$post['signature'] AND !in_array($thread['forumid'],array(97))">
        <!-- 
sig -->
            <
div>
                
__________________<br />
                
$post[signature]
            </
div>
        <!-- / 
sig -->

<else />

        <!-- 
sig -->
            <
div>
                
__________________<br />
                
In this subforum the signatures are disabled.
            </
div>
        <!-- / 
sig -->

        </if> 

Work perfect but I am noob in PHP, so I don't know... maybe the code can be more optimized?

gbechtel 11-19-2009 03:24 PM

Just an FYI

I did not want to display signatures or avatars to unregistered users, but there are also three forums that I did not want them to display to members. so I used the following...

In case anyone was looking to do the same...

PHP Code:

<if condition="$post['signature'] AND $show['member'] AND !in_array($thread['forumid'],array(36,107,108))">
 
HIDE THIS
 
</if> 


Pakblogger 07-18-2010 12:39 PM

not working in VB 3.8.6 any idea?

oldengine 07-25-2010 04:22 AM

Hide Signature and Avatar in specific forums

Great idea, but this thread has turned into chaos and confusion. :mad:

Edit: ----

Actually, the mod works excellently! Version 3.8.6 PL1

Thank you ArbStar! :up: Marks Installed!

Harley D 08-19-2010 01:01 PM

Thanks everyone, I finally got this to work.

creative-friend 01-27-2011 05:59 PM

How can i do this in VB4??

Phaedrus 02-28-2011 11:06 PM

Does this work in 4.x?

ArbStar 02-28-2011 11:18 PM

Quote:

Originally Posted by Phaedrus (Post 2168037)
Does this work in 4.x?

I'm not sure tbh, haven't tried it.
You could use the same concept but edit the codes to match with VB4 codes format.

letsjoy 08-16-2011 12:36 AM

Quote:

Originally Posted by ArbStar (Post 2168040)
I'm not sure tbh, haven't tried it.
You could use the same concept but edit the codes to match with VB4 codes format.

ArbStar, please make it work for vB 4.x

Thanks in Advance :-)


All times are GMT. The time now is 05:32 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01575 seconds
  • Memory Usage 1,872KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (24)bbcode_code_printable
  • (6)bbcode_php_printable
  • (17)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (37)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete