vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   User setable default BB code formatting for each post (https://vborg.vbsupport.ru/showthread.php?t=74169)

carpefile 02-02-2005 02:42 AM

Works great ! Thanx! My users love it. Any way to limit this to certain usergroups?

skinny 02-07-2005 10:34 PM

This works very well on 3.0.6. Thanks for the hack, only takes a few minutes to install also :)

carpefile 02-14-2005 12:09 AM

Is there a way to make this an option rather than a requirement once installed?
I am having a problem with new people joining and that they must choose a default bbcode when registering. Some of them have no clue even what bbcode is, so its throwing a wrench into my board growing.

Many of my existing users love it to death, so I am hoping something can be done besides uninstalling it.

Darth Cow 02-14-2005 01:49 AM

Quote:

Originally Posted by carpefile
Is there a way to make this an option rather than a requirement once installed?
I am having a problem with new people joining and that they must choose a default bbcode when registering. Some of them have no clue even what bbcode is, so its throwing a wrench into my board growing.

Many of my existing users love it to death, so I am hoping something can be done besides uninstalling it.

Yes, edit the option and set "Field Required" to "No."

Limiting it to certain usergroups is beyond the scope of the built in vBulletin options for profile fields.

However, you can only choose to make it actual works for certain usergroups easilly.

Change the line at the end of my code:

PHP Code:

          $post['message'] = $auto_bb_opentag $post['message'] . $auto_bb_closetag

To:

PHP Code:

if (is_member_of($bbuserinfo123))
{
          
$post['message'] = $auto_bb_opentag $post['message'] . $auto_bb_closetag;


That should work. Just change 123 to the appropriate usergroup you want to enable it for.

As for not accepting hex values, let me fix that. Replace the regular expression with the updated one in the first post.

Creed 02-19-2005 10:44 AM

This is what I did with mine, works like a charm, and is much easier on the end user:

I created two User Profile Fields:

Type: Single-Line Text Box
Title: Font Color
Description: Enter your preferred font color for each post
Private Field: Yes
Field Searchable on Members List: No
Show on Members List: No

Type: Singe Selection Menu
Title: Font Face
Description: Select your preferred font face for each post
Options:
{
Arial
Arial Black
Arial Narrow
Book Antiqua
Century Gothic
Comic Sans MS
Courier New
Fixedsys
Franklin Gothic Medium
Garamond
Georgia
Impact
Lucida Console
Lucida Sans Unicode
Microsoft Sans Serif
Palatino Linotype
System
Tahoma
Times New Roman
Trebuchet MS
Verdana
}
Private Field: Yes
Field Searchable on Members List: No
Show on Members List: No

Then in your functions_newpost file edit do this (where fieldx is the field number for font color, and fieldx2 is the field number for font face):

Code:

// Darth Cow's auto BB code hack
          if ($bbuserinfo['fieldx'] != "" && $bbuserinfo['fieldx2'] != "")
        {
        $auto_bb_opentag = "[color=" . $bbuserinfo['fieldx'] . "]" . "[FONT=" . $bbuserinfo['fieldx2'] . "]";
        }
                else if ($bbuserinfo['fieldx'] != "")
        {
        $auto_bb_opentag = "[color=" . $bbuserinfo['fieldx'] . "]";
        }
                else if ($bbuserinfo['field16'] != "")
        {
        $auto_bb_opentag = "[font=" . $bbuserinfo['fieldx2'] . "]";
        }
                else
        {
        $auto_bb_opentag ;
        }
   
    preg_match_all("/\[(\w+)(\=\"?\'?(\w+\s*)+\"?\'?)?\]/",$auto_bb_opentag, $auto_bb_tags, PREG_SET_ORDER);
          $auto_bb_closetags = array_reverse($auto_bb_tags);
          $auto_bb_closetag = "";
          foreach ($auto_bb_closetags as $auto_bb_tag)
          {
              $auto_bb_closetag .= "[/" . $auto_bb_tag[1] . "]";
          }
     
          $post['message'] = $auto_bb_opentag . $post['message'] . $auto_bb_closetag;
      // End hack

It is working absolutely flawlessly for me :)

antialiasis 03-27-2006 05:19 PM

Could this be converted to 3.5.4?


All times are GMT. The time now is 07:06 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.01156 seconds
  • Memory Usage 1,739KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete