vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Seems like an easy bbCode mod? (https://vborg.vbsupport.ru/showthread.php?t=295109)

Lord KoT 02-14-2013 03:28 AM

Seems like an easy bbCode mod?
 
Back in my earlier installs, I had this mod which basically replaces the code "you" (in square brackets, not quotes) with the name of the logged in user. I wasn't able to figure out how to do this with vb3.x and I've just upgraded to 4.x and still cannot figure it out. Can anyone point me in the right direction, or better yet, show me how it's done?

Much thanks =)

kh99 02-14-2013 10:35 AM

I don't know if it exists or not, but the reason it's not so easy to do with bbcodes is that posts are cached after the bbcodes are processed, so you'd need some way to prevent a post from being cached if it contained a "you" bbcode.

I haven't tried it, but you might be able to cheat by creating a plugin using hook postbit_display_start and code like:

Code:

$post['message'] = str_ireplace('[you]', htmlspecialchars_uni($this->registry->userinfo['username']), $post['message']);

Lord KoT 02-18-2013 08:38 AM

When you describe it that way, I can see why it might not be so easy. Originally I dont think it was a BB code mod and so your suggestion may have been the way it was done. I just don't have the expertise to delve where the new spots to add the magic code in the files has run off to. Thanks for the help =)


All times are GMT. The time now is 03:08 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.01704 seconds
  • Memory Usage 1,710KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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