Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-24-2007, 05:50 AM
MariahMan MariahMan is offline
 
Join Date: Jun 2007
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Calling out users in thread titles/announcements

I want to announce some features to my member and was wondering how i could do something like:
"Hey ____! Are you on the member map?"

With the blank being their username to catch their attention. I thought i could do it using the vbulletin phrases and did "Hey $username! Are you on the member map?" but i got exactly that. Could you guys let me know the proper way to do this?

Thanks in advance,

-Ryan
Reply With Quote
  #2  
Old 11-24-2007, 11:53 AM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I doubt you can actually set it in a thread title, since they are stored as in the database and not parsed by any sort of code. There are a number of ways that you may be able to do this, one option would be to:
  1. Create the new thread with the content and title of whatever you would like. (Note: The thread title will be show to guests so make sure it is appropriate)
  2. View the thread and make a note of the threadid it will be the number at the end of the showthread.php URL. (For example: https://vborg.vbsupport.ru/showthread.php?t=163489 it is the number in bold)
  3. Go to the Plugin Manager in the AdminCP and create a new plugin for "threadbit_display" and use the following PHP code:
    PHP Code:
    if(intval($thread['threadid']) == && $vbulletin->userinfo['userid'])
    {
        
    $thread['threadtitle'] = 'Hey '$vbulletin->userinfo['username'] .'! Are you on the member map?';

  4. Remember to change the number 8 to your threadid which you found in step 2
  5. I'm not sure how this will affect performance though since you will be running this check quite often, I don't know if there is a more efficient way to do this.
Reply With Quote
  #3  
Old 11-24-2007, 12:03 PM
Mark.B Mark.B is offline
Senior Member
 
Join Date: Feb 2004
Posts: 1,354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Unduly complex.....there *is* a way to do it easily with a plugin.

*This code is NOT my own, it is posted elsewhere on vbulletin.org, but I have not managed to find it again.

Create a new plugin as follows:

Product: vBulletin
Hook Location: global_complete
Title: Whatever you want to call it
Code:
$output = str_replace('[username]', $vbulletin->userinfo['username'], $output);
Now you simply start a thread with [username] in the title and everyone who views it will see their own username there.
Reply With Quote
  #4  
Old 11-24-2007, 12:21 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Won't that also leave it open for people to use wherever they please? For example signatures/posts/threads. I know there isn't much harm in letting other people use the markup but I'd think it would be better to restrict it somewhat.
Reply With Quote
  #5  
Old 11-24-2007, 12:34 PM
Mark.B Mark.B is offline
Senior Member
 
Join Date: Feb 2004
Posts: 1,354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, that is true, it works anywhere and for anyone.

I daresay there will be ways of easily adapting that code to work only in specific circumstances, but I'm no coder so I can't do that.

Of course, other users would need to know the code that generates it, and you can easily amend it from [username] to something completely different just by changing the code I posted.

I used it on my forums a couple of times as a complete joke. It's quite tricky for an average user to suss it out, as it doesn't even show the tag if you quote or edit something. Nobody from my site sussed it, although I cannot say how much anyone was really that bothered!
Reply With Quote
  #6  
Old 11-24-2007, 06:14 PM
MariahMan MariahMan is offline
 
Join Date: Jun 2007
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks guys for your responses. I went ahead and used your method Mark B because it was the simplest and did the job, but thanks anyways Osperty. Thanks for helping me out, that did the job perfectly in both announcements and thread titles.

Osperty does bring up an important point that this feature can now be utilized by everyone on your board. I personally am not worried about it because my board is an owners club for a specific boat brand and most of them have had troubles just figuring out how to add photos to the gallery let alone figuring this out.

Thanks guys!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:03 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07070 seconds
  • Memory Usage 2,214KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete