Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
[you] vbcode Details »»
[you] vbcode
Version: 1.00, by Mutt Mutt is offline
Developer Last Online: Mar 2013 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 02-27-2003 Last Update: Never Installs: 38
 
No support by the author.

<a href="https://vborg.vbsupport.ru/showthread.php?s=&threadid=38069&highlight=vbcode" target="_blank">Inspired by FireFly's /me vB Code</a>

When reading the /me hack thread I started laughing at the idea of a [you] tag. This isn't much of a hack, but it was fun. Put [you] in the thread and it is replaced by the person's name who is reading the thread. if it is a guest, [you] is simply replace by the word you.

I had to change this to a text file to avoid problems. Should be fine now

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 03-04-2003, 09:23 PM
Mutt's Avatar
Mutt Mutt is offline
 
Join Date: Nov 2001
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thats why I didn't want to touch the subject. just way to many places to miss something and with little payback.

as for fixing the quote, yeah it's do-able and might be funny but quoting the message is sortof how people figure out it's not about them. I think I like it though and will do it. I made this forum controlable (on in some of in others like the IMG tag) and when I finish the cp I'll re-post. (right now, I just set the var via phpmyadmin so I could turn it off everywhere except our prank forum.)
Reply With Quote
  #33  
Old 03-04-2003, 09:27 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have about every base covered for this in vbulletin. If you want to check the file out, let me know, It's about 20K.

Being able to turn it off and on per forum would be great!
Reply With Quote
  #34  
Old 03-04-2003, 09:32 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a way to have this set up so only certain usergroups can use it? I can edit the code in functions.php, I suppose.
Reply With Quote
  #35  
Old 03-04-2003, 09:34 PM
chr@nox chr@nox is offline
 
Join Date: Nov 2001
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

first of all, great hack! thanx alot

second..

isn't it easy to make it so to use the forum stuff?

so $forum[useyou] for example?

if you want i can post the changes for it

Greetings,

Chratnox
Reply With Quote
  #36  
Old 03-04-2003, 09:37 PM
sonic3d's Avatar
sonic3d sonic3d is offline
 
Join Date: Jan 2002
Location: Chicago
Posts: 301
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can u send me the file or upload it somewhere so i can download it. thanx.

l8er
sonic
Reply With Quote
  #37  
Old 03-04-2003, 10:47 PM
chr@nox chr@nox is offline
 
Join Date: Nov 2001
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Boofo
Is there a way to have this set up so only certain usergroups can use it? I can edit the code in functions.php, I suppose.
u can use if ($bbusergroup == 6 or $bbusergroup == 5) right?
Reply With Quote
  #38  
Old 03-04-2003, 11:00 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by chr@nox


u can use if ($bbusergroup == 6 or $bbusergroup == 5) right?
If you mean if ($bbuserinfo[usergroupid] == 6 or $bbuserinfo[usergroupid]== 5), I thought about doing that but the idea to allow it in certain forums sounds better though.
Reply With Quote
  #39  
Old 03-05-2003, 08:09 PM
Mutt's Avatar
Mutt Mutt is offline
 
Join Date: Nov 2001
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hey people, I finished the cp so you can turn it on/off but it is working and I'll get directions written asap.

just wanted to throw out a couple other ideas/mods to you

these also work if you wanted to get real crazy
PHP Code:
            $bbcode preg_replace("/(\[)(youemail)(])/siU"$bbuserinfo[email], $bbcode);
            
$bbcode preg_replace("/(\[)(youhome)(])/siU"$bbuserinfo[homepage], $bbcode);
            
$bbcode preg_replace("/(\[)(youtitle)(])/siU"$bbuserinfo[usertitle], $bbcode);
            
$bbcode preg_replace("/(\[)(youbday)(])/siU"$bbuserinfo[birthday], $bbcode);
            
$bbcode preg_replace("/(\[)(youarea)(])/siU"$bbuserinfo[field2], $bbcode);
            
$bbcode preg_replace("/(\[)(yousex)(])/siU"$bbuserinfo[field7], $bbcode);
            
$bbcode preg_replace("/(\[)(youint)(])/siU"$bbuserinfo[field3], $bbcode); 
you'd have to modify the custom fields to fit your site, but this should give you the basic idea. All profile fields including custom fields can be used!!

if you'd like to give your staff a little help

you can change this line
PHP Code:
$bbcode preg_replace("/(\[)(you)(])/siU"$bbuserinfo[username], $bbcode); 
to this
PHP Code:
if ($bbuserinfo[usergroupid]==|| $bbuserinfo[usergroupid]==|| $bbuserinfo[usergroupid]==7) {
                
$bbcode preg_replace("/(\[)(you)(])/siU""<b><i><a title=\"[you] code\">".$bbuserinfo[username]."</a></i></b>"$bbcode);
            } else {
                
$bbcode preg_replace("/(\[)(you)(])/siU"$bbuserinfo[username], $bbcode);
            } 
that way mods and admins will see the name in bold and mousing over gives you notice that it's the [you] code

PS - if you wanted to restrict usage to certain usergroups, bbuserinfo wouldn't do it. you'd need to check the usergroupid of the person who posted. bbuserinfo is for the person reading the post
Reply With Quote
  #40  
Old 03-05-2003, 08:15 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Be looking forward to the update.

If you use all of these, wouldn't you have to go through all of the places to parse it out like with the first code? And I take it this goes in the functions.php with the first code, right?

Quote:
$bbcode = preg_replace("/(\[)(youemail)(])/siU", $bbuserinfo[email], $bbcode);
$bbcode = preg_replace("/(\[)(youhome)(])/siU", $bbuserinfo[homepage], $bbcode);
$bbcode = preg_replace("/(\[)(youtitle)(])/siU", $bbuserinfo[usertitle], $bbcode);
$bbcode = preg_replace("/(\[)(youbday)(])/siU", $bbuserinfo[birthday], $bbcode);
$bbcode = preg_replace("/(\[)(youarea)(])/siU", $bbuserinfo[field2], $bbcode);
$bbcode = preg_replace("/(\[)(yousex)(])/siU", $bbuserinfo[field7], $bbcode);
$bbcode = preg_replace("/(\[)(youint)(])/siU", $bbuserinfo[field3], $bbcode);
Reply With Quote
  #41  
Old 03-05-2003, 08:22 PM
Mutt's Avatar
Mutt Mutt is offline
 
Join Date: Nov 2001
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

just add those line right after

$bbcode = preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $bbcode);

thats it

now for you it might be a ton more because you added it to subjects as well.
Reply With Quote
  #42  
Old 03-05-2003, 08:32 PM
Kars10's Avatar
Kars10 Kars10 is offline
 
Join Date: Jun 2002
Location: Germany/Franken
Posts: 748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
that way mods and admins will see the name in bold and mousing over gives you notice that it's the [you] code
Thats cool!!
Thank you very much!!
Reply With Quote
  #43  
Old 03-05-2003, 09:31 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Mutt
just add those line right after

$bbcode = preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $bbcode);

thats it


Thank you.

Quote:
now for you it might be a ton more because you added it to subjects as well.
You created a Monster with this hack. LOL
Reply With Quote
  #44  
Old 03-05-2003, 10:38 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ran into a snag with the replacements that allows for the admins and mods to mouseover the code. Now, if you put [you] between another vbcode (like in the spoiler vbcode hack, it parses the code but makes it go outside the button. Like this code:

[DISABLE][SPOILER=Change this to whatever you like]And it still works. What do you think, [you]? Do you like it?[/SPOILER][/DISABLE]

This part:

Boofo? Do you like it?')">

is outside the spoiler tag now. It parsed the [you] ok (the Boofo part) but throws that and everything after it outside the spoiler tag button. Here is the code I am using in the functions.php:

PHP Code:
    if (in_array($bbuserinfo[usergroupid], array(567))) {
       
$bbcode preg_replace("/(\[)(you)(])/siU""<b><i><a title=\"[you] vbcode\">".$bbuserinfo[username]."</a></i></b>"$bbcode);
    } else if (
$bbuserinfo[userid]>0) {
       
$bbcode preg_replace("/(\[)(you)(])/siU"$bbuserinfo[username], $bbcode);
    } else {
       
$bbcode preg_replace("/(\[)(you)(])/siU""you"$bbcode);
    } 
Any ideas how to fix that? I like the mouseover and would like to keep it.
Reply With Quote
  #45  
Old 03-05-2003, 11:07 PM
dnd dnd is offline
 
Join Date: Jan 2002
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi

great hack but regarding the addon of the titles the [you] code if only working for the post titles

whin i create a new thread with the title [you] it doesn't show the user name

ex: vb > sports > [you]


any help?

Quote:
Originally posted by Boofo
Ok, here they are. The edits for the thread titles and the post titles. If I forgot to post any other needed areas here, let me know. I also have code needed if you have Logician's Download thread hack, PPN's vb Last title hack and the threadintro hack (by nicksaunders) if anyone needs those fixes.

In functions.php, find:

PHP Code:
    // do posts from ignored users
    
if (($ignore[$post[userid]] and $post[userid] != 0)) {
        eval(
"\$retval = \"".gettemplate("postbit_ignore")."\";");
    } else {
        eval(
"\$retval = \"".gettemplate("postbit")."\";");
    }
    return 
$retval;

Add this code ABOVE it:

PHP Code:
    if ($bbuserinfo[userid]>0) {
        
$post[title] = preg_replace("/(\[)(you)(])/siU"$bbuserinfo[username], $post[title]);
    } else {
        
$post[title] = preg_replace("/(\[)(you)(])/siU""you"$post[title]);
    } 
In forumdisplay.php, find:

PHP Code:
eval("\$forumdisplaybits .= \"".gettemplate('forumdisplaybit')."\";"); 
ABOVE it add:

PHP Code:
    if ($bbuserinfo[userid]>0) {
    
$thread[title] = preg_replace("/(\[)(you)(])/siU"$bbuserinfo[username], $thread[title]);
        
$thread[description] = preg_replace("/(\[)(you)(])/siU"$bbuserinfo[username], $thread[description]);
    } else {
    
$thread[title] = preg_replace("/(\[)(you)(])/siU""you"$thread[title]);
        
$thread[description] = preg_replace("/(\[)(you)(])/siU""you"$thread[description]);
    } 
In search.php, find:

PHP Code:
      if ($searchresult[attach]>0) {
        
$paperclip="<img src=\"https://vborg.vbsupport.ru/images/paperclip.gif\" alt=\"$searchresult[attach] Attachment(s)\" border=\"0\">";
      } else {
        unset(
$paperclip);
      } 
BELOW it add:

PHP Code:
    if ($bbuserinfo[userid]>0) {
    
$searchresult[pagetext] = preg_replace("/(\[)(you)(])/siU"$bbuserinfo[username], $searchresult[pagetext]);
        
$searchresult[posttitle] = preg_replace("/(\[)(you)(])/siU"$bbuserinfo[username], $searchresult[posttitle]);
        
$searchresult[threadtitle] = preg_replace("/(\[)(you)(])/siU"$bbuserinfo[username], $searchresult[threadtitle]);
    } else {
    
$searchresult[pagetext] = preg_replace("/(\[)(you)(])/siU""you"$searchresult[pagetext]);
        
$searchresult[posttitle] = preg_replace("/(\[)(you)(])/siU""you"$searchresult[posttitle]);
        
$searchresult[threadtitle] = preg_replace("/(\[)(you)(])/siU""you"$searchresult[threadtitle]);
    } 
For the Profile page:

In member.php, find:

PHP Code:
      $getperms=getpermissions($getlastpost[forumid]);
      if (
$getperms[canview]) {
        
$lastposttitle=$getlastpost[title]; 
BELOW it add:

PHP Code:
    if ($bbuserinfo[userid]>0) {
        
$lastposttitle preg_replace("/(\[)(you)(])/siU"$bbuserinfo[username], $lastposttitle);
    } else {
        
$lastposttitle preg_replace("/(\[)(you)(])/siU""you"$lastposttitle);
    } 
Reply With Quote
  #46  
Old 03-05-2003, 11:15 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is only a small listing of the changes to make to catch all of the places it can pop up. I am still finding them one by one. Are you referring to the navbar?

Here are the ones for the forumdisplay:

--------------------
In forumdisplay.php, find:
--------------------

eval("\$forumdisplaybits .= \"".gettemplate('forumdisplaybit')."\";");

--------------------
ABOVE it add:
--------------------

if ($bbuserinfo[userid]>0) {
$thread[title] = preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $thread[title]);
$thread[description] = preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $thread[description]);
} else {
$thread[title] = preg_replace("/(\[)(you)(])/siU", "you", $thread[title]);
$thread[description] = preg_replace("/(\[)(you)(])/siU", "you", $thread[description]);
}

--------------------
Still in forumdisplay.php, find:
--------------------

eval("\$forumbits .= \"".gettemplate("forumdisplay_forumbit_level$depth $tempext")."\";");

--------------------
ABOVE it add:
--------------------

if ($bbuserinfo[userid]>0) {
$forum[title] = preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $forum[title]);
$forum[description] = preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $forum[description]);
} else {
$forum[title] = preg_replace("/(\[)(you)(])/siU", "you", $forum[title]);
$forum[description] = preg_replace("/(\[)(you)(])/siU", "you", $forum[description]);
}

--------------------
Still in forumdisplay.php (for the <title>), find:
--------------------

eval("dooutput(\"".gettemplate('forumdisplay')."\" );");

--------------------
ABOVE it add:
--------------------

if ($bbuserinfo[userid]>0) {
$foruminfo[title] = preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $foruminfo[title]);
} else {
$foruminfo[title] = preg_replace("/(\[)(you)(])/siU", "you", $foruminfo[title]);
}[/QUOTE]
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 06:38 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.05339 seconds
  • Memory Usage 2,447KB
  • Queries Executed 30 (?)
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
  • (12)bbcode_php
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (16)post_thanks_box
  • (16)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (16)post_thanks_postbit_info
  • (15)postbit
  • (16)postbit_onlinestatus
  • (16)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete