vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   [you] vbcode (https://vborg.vbsupport.ru/showthread.php?t=49458)

Mutt 02-27-2003 10:00 PM

[you] vbcode
 
<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

Rose 02-28-2003 12:41 AM

*lol* A brilliant mix of the "/me" hack and the "{bbusername}" hack - it sounds. :D


[high]* Rose installs
[/high]
[you] grins

Link14716 02-28-2003 01:05 AM

This seems to function almost identically to the {bbusername} hack, but still fun nevertheless. ;)

gameplanetz 02-28-2003 02:25 AM

very nice, indeed. :)

Vivi Ornitier 02-28-2003 04:14 AM

this si good, the bbusername one didn't work on the newer forums for some reason but this does! hella nice!

Erwin 02-28-2003 04:20 AM

Hey! Nice! :)

Slynderdale 02-28-2003 05:15 AM

Quote:

Originally posted by Vivi Ornitier
this si good, the bbusername one didn't work on the newer forums for some reason but this does! hella nice!

I had that problem, but I changed it to [bbusername] instead and it works fine.

Kars10 02-28-2003 07:21 AM

Don?t works here!!
First of all, can?t find that line on 2.2.9:

PHP Code:

$bbcode=str_replace("'""'"$bbcode); 

- i have only this line:

PHP Code:

$bbcode=str_replace("'""\'"$bbcode); 

- and that line:

PHP Code:

$bbcode=str_replace("\\'""'"$bbcode); 

The [you] won?t work when i place your code under that lines... :(

Kars10 02-28-2003 07:24 AM

Ahhh, there is the problem. Your code gets parsed here. My first line looks like " /" , and my second line " //" ...
Please place your instruction in a textfile.

Steve123 02-28-2003 08:36 AM

dont work here..

it just shows [you]

Mutt 02-28-2003 09:27 AM

I text filed it up, let me know if that does it for you

how do I edit the directions in the hack DB? I don't see an edit button

Kars10 02-28-2003 09:39 AM

Brilliant!! Works like a charm!!

[high]* Kars10 klicks install! :)[/high]

afterlab 02-28-2003 10:19 AM

Just in time for April Fools jokes too. ;)

Automated 02-28-2003 11:05 AM

LOL, very cool idea :p

Xenon 02-28-2003 11:10 AM

@Mutt: there should be an editbutton beside the new post and new thread button on the top of the thread :)

Boofo 02-28-2003 11:19 AM

Great hack. ;)

2 questions:

How can we add color to the name?
Is there a way to get this to work with thread titles?

Aaron1 02-28-2003 12:50 PM

This is great!
Although many users on my board are getting paranoid with it.
I really needed to explain whenever i post:

Hey [you] where's my money?

ps: No i, haven't received any addtional money with it :)

Mutt 02-28-2003 07:56 PM

My god, I made this yesterday and all hell has broken out on my board. there has been more posting today than ever before. all the lurkers came out to find out why everyone is flaming them. :) it's the funiiest thing. I recieved all inds of emails and phone calls. My site is a Howard Stern Fan Site and High Pitch Eric called today very upset because Joey Boots was talking ++++ about him all night and everyone is picking on him. It was too much. I had tears in my eyes trying to explain the whole thing to him. It was too damn funny. I hope I don't lose members over this.

I'll be playing with it and giving it some options. I'm going to set it so you can limit the [you] tag to just mods/admin plus make it so you can limit it to specific forums. I have a prank forum that this will be perfect for. I'm going to look into adding profile field info also. didn't even look at the code yet, but something like [you]user title[/you] or [you]birthday[/you]. If it's reasonable, I'll be sure to include custom profile fields and limit the working field to just those viewable in the profile.

this hack is evil. ;)

I've also been asked to get it working for thread titles. I'll look into it. Would be fun, but not sure it would be worth it. thread titles are used in so many places like your profile, the search page, etc. Seems like alot of edits would be necessary.

PS - with so many people upset about the recent flaming against [you] I've started a poll to see you will be banned. Joey Boots or [you]. Maybe I'm going to far, but it's so funny.

Boofo 02-28-2003 11:59 PM

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);
    } 


Dean C 03-02-2003 10:47 AM

Wow thanks for that piece of code Boofo. Didn't realise you know so much PHP :)

- miSt

Chris M 03-02-2003 05:57 PM

Heh...

Seems like a cool hack!:)

I'll be sure to install it and check it out when I get my machine back up and running!:)

Satan

Steve123 03-02-2003 10:19 PM

yeh..

how would u get it to work in the navbar..

it shows [you] in the navbar :)

Boofo 03-02-2003 10:25 PM

Quote:

Originally posted by Steve123
yeh..

how would u get it to work in the navbar..

it shows [you] in the navbar :)

I've got a partial fix for it where it will show you (or whatever word you change it to in the second preg-replace statement) instead of [you], but I can't get it to replace it with the username yet. I am working on it and will release the fix as soon as I come up with it. ;)

Steve123 03-02-2003 10:27 PM

yeh i was about to go in and have a look myself..

if i figure it out ill tell ya :P

whats ya partial fix?

Boofo 03-02-2003 10:43 PM

Completed working code for the forum navbar (if you make a forum with the [you] in it (like "[you]'s Personal Forum"). Thanks to Xenon for pointing out something I missed, that was really, really stupid of me. ;)

In admin/functions.php, find:

PHP Code:

function makenav($id,$idtype="forum",$highlightlast=1) {
  global 
$DB_site,$nav_url,$nav_title,$session,$threadcache

and replace it with:

PHP Code:

function makenav($id,$idtype="forum",$highlightlast=1) {
  global 
$DB_site,$nav_url,$nav_title,$session,$threadcache,$bbuserinfo

then find:

PHP Code:

      $nav_url="forumdisplay.php?s=$session[sessionhash]&forumid=$id";
      
$nav_title=$foruminfo[title]; 

and BELOW it add:

PHP Code:

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


traekwon 03-02-2003 11:13 PM

Is there anyway to make it so when the user quotes your post it doesn't show up as [you]?

I believe in FireFly's /me hack when you quoted a post it didn't come up as /me.

Steve123 03-02-2003 11:20 PM

hhahahaa..

ive had the remove the damn thing..

with 25 ppl online... as soon as i added all hell broke loose..

o wells... its an evil hack..

Boofo 03-03-2003 12:01 AM

Quote:

Originally posted by traekwon
Is there anyway to make it so when the user quotes your post it doesn't show up as [you]?

I believe in FireFly's /me hack when you quoted a post it didn't come up as /me.

Simple fix.

In the newreply.php, find:

PHP Code:

    eval("\$message = \"".gettemplate("quotereply",1,0)."\";"); 

and ABOVE it add:

PHP Code:

    if ($bbuserinfo[userid]>and $bbuserinfo[usergroupid]!=6) {
        
$pagetext trim(preg_replace("/(\[)(you)(])/siU"$bbuserinfo[username], $pagetext));
    } else if (
$bbuserinfo[usergroupid]!=6) {
        
$pagetext trim(preg_replace("/(\[)(you)(])/siU""you"$pagetext));
    } 

I did it this way so the Admin could still see it as [you] in case there was ever any question about it.

Boofo 03-03-2003 03:54 AM

Mutt, you were right, there are almost too many changes to make to make this not show up in all of the places it can show up. :) I just got through spending the last 2 hours finding all of the places it can show up. I think I have them all nailed now. The only place left is the forum navbar. Still working on that one. Here is a list of all the files that need to be edited.

functions.php - 4 edits
showthread.php - 3 edits
index.php - 2 edits
usercp.php - 1 edit
forumdisplay.php - 3 edits
newreply.php - 1 edit
search.php - 1 edit
member.php - 1 edit
private.php - 3 edits
private2.php - 1 edit

Boofo 03-03-2003 01:44 PM

The navbar fix is working now in the post below if anyone is still interested. ;)

https://vborg.vbsupport.ru/showthrea...&postid=360359

Mutt 03-04-2003 09:23 PM

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.)

Boofo 03-04-2003 09:27 PM

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! :)

Boofo 03-04-2003 09:32 PM

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. ;)

chr@nox 03-04-2003 09:34 PM

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

sonic3d 03-04-2003 09:37 PM

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

l8er
sonic

chr@nox 03-04-2003 10:47 PM

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?

Boofo 03-04-2003 11:00 PM

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. :)

Mutt 03-05-2003 08:09 PM

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

Boofo 03-05-2003 08:15 PM

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);

Mutt 03-05-2003 08:22 PM

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.


All times are GMT. The time now is 04:43 PM.

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.01470 seconds
  • Memory Usage 1,904KB
  • 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
  • (20)bbcode_php_printable
  • (6)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
  • (40)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