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
  #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
  #47  
Old 03-06-2003, 01:27 AM
dnd dnd is offline
 
Join Date: Jan 2002
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hi boofo

i mean the navbar which shows above the posts in showthrad.php
Reply With Quote
  #48  
Old 03-06-2003, 08:53 PM
DaveRobbo's Avatar
DaveRobbo DaveRobbo is offline
 
Join Date: Nov 2002
Location: Berkshire, UK
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sheeeeeesh ... this thread is getting hard to read ... are all these extras from page 2 onwards being added back into the original hack txt file? Or do I have to install the hack and then trawl through a kazillion pages of extras?

Davie
Reply With Quote
  #49  
Old 03-06-2003, 09:09 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 dnd
hi boofo

i mean the navbar which shows above the posts in showthrad.php
Here you go.

Quote:
For the forum navbar replacement:

In functions.php, find:
-------------------

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


-------------------
REPLACE it with:
--------------------

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

-------------------
Find:
-------------------

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

-------------------
AFTER it add:
--------------------

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

--------------------
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]);
}
Reply With Quote
  #50  
Old 03-06-2003, 10:09 PM
dnd dnd is offline
 
Join Date: Jan 2002
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Boofo

i did that but it only shows the user name in titles on forumsdisplay.php but inside the thread the navbar or the title of the first post shows the code [you] !!
Reply With Quote
  #51  
Old 03-06-2003, 10:26 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

dnd, this you do this yet?

Quote:
For the forum navbar replacement:

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

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


-------------------
REPLACE it with:
--------------------

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

-------------------
Find:
-------------------

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

-------------------
AFTER it add:
--------------------

if ($bbuserinfo['userid']>0) {
$nav_title = trim(preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $nav_title));
} else {
$nav_title = trim(preg_replace("/(\[)(you)(])/siU", "you", $nav_title));
}
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 05:21 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.08952 seconds
  • Memory Usage 2,368KB
  • Queries Executed 25 (?)
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
  • (9)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
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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