vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   $username in posts? (https://vborg.vbsupport.ru/showthread.php?t=204684)

Killeglass 02-08-2009 09:51 PM

$username in posts?
 
Hi folks

I am trying to personalize some stickied posts in our forum

I would like to add $username to bring up each members name

This way the post would be to their attention

Any help or direction would be greatly appreciated.

:)

Mark.B 02-08-2009 09:57 PM

Depends exactly what you're trying to do.

If you just want the name of the person who is viewing the page it's $bbuserinfo[username].

If you want it showing as part of a thread title you would probably have to use some sort of conditional to avoid things showing to guests:

Code:

<if condition="$bbuserinfo['userid']">FAO $bbuserinfo[username]: </if>
would probably work, depending on where you use it.

Killeglass 02-08-2009 10:06 PM

I would just like to add it to the body of the post

In the subject title it's not needed

Thanks again!!

JoeBOBBillyTed 02-08-2009 10:06 PM

I am not sure how to do it, but what he is wanting is similar to a hack that phpbb has where if you put the following text in a thread.

/user

it would instead of displaying that, replace that with the persons username.

Mark.B 02-08-2009 10:09 PM

Quote:

Originally Posted by JoeBOBBillyTed (Post 1738092)
I am not sure how to do it, but what he is wanting is similar to a hack that phpbb has where if you put the following text in a thread.

/user

it would instead of displaying that, replace that with the persons username.

There is a hack that does that somewhere....I did have it running once, but I cannot remember what it is called.

--------------- Added [DATE]1234138325[/DATE] at [TIME]1234138325[/TIME] ---------------

Hmmm....this is how my site used to do it...

Create a plugin at global_complete with the following code:
Code:

$output = str_replace('[username]', $vbulletin->userinfo['username'], $output);
Now anywhere you type:
Code:

[username]
it will display the name of the person reading it.

Killeglass 02-08-2009 10:12 PM

I see there was mod called "/you"

that may have been it.

--------------- Added [DATE]1234139149[/DATE] at [TIME]1234139149[/TIME] ---------------

Quote:

Originally Posted by Mark.B (Post 1738093)
There is a hack that does that somewhere....I did have it running once, but I cannot remember what it is called.

--------------- Added [DATE]1234138325[/DATE] at [TIME]1234138325[/TIME] ---------------

Hmmm....this is how my site used to do it...

Create a plugin at global_complete with the following code:
Code:

$output = str_replace('[username]', $vbulletin->userinfo['username'], $output);
Now anywhere you type:
Code:

[username]
it will display the name of the person reading it.

Thank you!!


All times are GMT. The time now is 09:54 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.01598 seconds
  • Memory Usage 1,731KB
  • 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
  • (5)bbcode_code_printable
  • (2)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