vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   change usercp settings when specific style is set (https://vborg.vbsupport.ru/showthread.php?t=326027)

martin1 01-25-2018 01:03 PM

change usercp settings when specific style is set
 
I would love to change some user cp display settings when specific forum style is set, for example when style2 is selected, forum options under user control panel :

Visible Post Elements: all three options( show signatures, show avatars, show images) to be deactivated.

Is it somehow possible to set that?

MarkFL 01-25-2018 03:51 PM

You could do that with some CSS in the additional.css template for that particular style. For example, try:

Code:

.signaturecontainer, .postuseravatar {
        display: none !important;
}

This will disable signatures and avatars...I'm not sure what images you are wanting to disable. :)

martin1 01-25-2018 07:46 PM

thanks, exactly what I was looking for!

The images in the threads recognized by IMG tags , that's the third option in USER CP by those two you typed.

MarkFL 01-26-2018 12:24 AM

Okay, try this:

Code:

.signaturecontainer, .postuseravatar, .content img:not(.inlineimg) {
        display: none !important;
}

This will disable all images except smilies. :)

martin1 01-26-2018 05:48 AM

yes, it's removing the image content completely :up:

can you make it just to leave a link or code to original image external location, without actually showing the bbcode thumbnail?

LOL I was trying to find that variable whole evening!

MarkFL 01-26-2018 06:48 AM

Quote:

Originally Posted by martin1 (Post 2592434)
yes, it's removing the image content completely :up:

can you make it just to leave a link or code to original image external location, without actually showing the bbcode thumbnail?

LOL I was trying to find that variable whole evening!

That would require some actual coding. The CSS I provided is just masking things, instructing it not to be displayed, but they are still in the DOM.

Here's what I would do instead. Remove the CSS you added to the "additional.css" template. Now, create a plugin hooked at "postbit_display_complete" with the following code:

PHP Code:

if (STYLEID == XX)
{
    
$show['avatar'] = 0;
    
$post['signature'] = 0;
    require_once(
DIR '/includes/class_bbcode.php');
    
$bbcode_parser = new vB_BbCodeParser($vbulletinfetch_tag_list());
    
$post['pagetext'] = $bbcode_parser->parse($post['pagetext'], $post['forumid'], 1);
    
$post['pagetext'] = html_entity_decode($post['pagetext']); 
    
$post['message'] = $post['pagetext'];


Replace XX with the id of the style you wish to affect. :)


All times are GMT. The time now is 06:05 PM.

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.01474 seconds
  • Memory Usage 1,735KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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