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

Reply
 
Thread Tools
vB3 [you] Code Hack Details »»
vB3 [you] Code Hack
Version: 1.00, by Boofo Boofo is offline
Developer Last Online: Jun 2012 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 03-19-2004 Last Update: Never Installs: 59
 
No support by the author.

vB3 [you] Code Hack
Version 1.1
(By Boofo)

What does this hack do?
This hack will take the [you] code and replace it with the user's name who is veiwing the thread, forum or archive on your site.

Credits:
A big thanks goes out to Mutt for his original idea and version of this hack for vB2. I would also like to thank NTLDR for his invaluable help with the main core of this code.

Version Information:
Version 1.0 --Initial release
Version 1.1 --Fixed bug where the archive/global.php code would not parse until $bbuserinfo was added to the global statement.

Installation overview:
Files to edit: (4)
--includes/functions.php
--includes/functions_newpost.php
--archive/index.php
--archive/global.php

NOTE: Support will only be provided to those who click the install button.

Show Your Support

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

Comments
  #62  
Old 08-19-2004, 06:05 PM
aranthorn's Avatar
aranthorn aranthorn is offline
 
Join Date: Jun 2004
Location: Chicago
Posts: 137
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

doesn't work on 3.0.3. As far as I can tell, there is no
PHP Code:
echo print_archive_navigation($foruminfo); 
in 3.0.3 index.php
Reply With Quote
  #63  
Old 11-01-2004, 09:06 AM
andrew67 andrew67 is offline
 
Join Date: Dec 2001
Posts: 157
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nope there's not.
Also does this work for thread titles? Assuming it worked for vb3.0.3
Reply With Quote
  #64  
Old 11-01-2004, 05:03 PM
aranthorn's Avatar
aranthorn aranthorn is offline
 
Join Date: Jun 2004
Location: Chicago
Posts: 137
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="https://vborg.vbsupport.ru/showthread.php?t=68832" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=68832</a>
Reply With Quote
  #65  
Old 11-01-2004, 08:55 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 aranthorn
You'd better check to make sure that is going to work everywhere. I was going to do it that way in my version but there were too many places that you can't catch with the way you are doing it.
Reply With Quote
  #66  
Old 11-01-2004, 09:14 PM
andrew67 andrew67 is offline
 
Join Date: Dec 2001
Posts: 157
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've actually got similar code to that at the moment but it doesn't work on thread titles.
Reply With Quote
  #67  
Old 11-01-2004, 09:21 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 andrew67
I've actually got similar code to that at the moment but it doesn't work on thread titles.
Mine works on thread, forum and archive titles. True, I haven't updated it for 3.0.3 yet as I am not running that version and don't plan to upgrade until new versions stop coming out so frequently.

It should be very easily adaptable though.
Reply With Quote
  #68  
Old 01-01-2005, 06:11 AM
eXtremeTim eXtremeTim is offline
 
Join Date: Jun 2002
Location: eXtremewebtech.com
Posts: 1,201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I used the following code in functions.php instead of the code you provided.

PHP Code:
        if (THIS_SCRIPT != editpost) {
            global 
$bbuserinfo;
            
$replacementvars['/\[you\]/i'] = $bbuserinfo['username'];

        }
            
$replacementvars['/\[test\]/i'] = "This is just a test."
Reason I did this is so that its not parsed on editpost so that when you edit a post that contains it you dont have that nice problem of it locking in on your name. Also so you can tell when other users are using it faster and easier. The reason for the [test] code is since that it will allways be looking for something to parse out so on edit post you would get an error becuase there would be nothing to parse out since the error checking code was removed when this hack was installed.
Reply With Quote
  #69  
Old 01-01-2005, 07:33 AM
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 eXtremeTim
I used the following code in functions.php instead of the code you provided.

PHP Code:
        if (THIS_SCRIPT != editpost) {
            global 
$bbuserinfo;
            
$replacementvars['/\[you\]/i'] = $bbuserinfo['username'];
 
        }
            
$replacementvars['/\[test\]/i'] = "This is just a test."
Reason I did this is so that its not parsed on editpost so that when you edit a post that contains it you dont have that nice problem of it locking in on your name. Also so you can tell when other users are using it faster and easier. The reason for the [test] code is since that it will allways be looking for something to parse out so on edit post you would get an error becuase there would be nothing to parse out since the error checking code was removed when this hack was installed.
Exactly what part of the code did you replace with this in functions.php? There is a big block of code there.
Reply With Quote
  #70  
Old 01-01-2005, 02:51 PM
eXtremeTim eXtremeTim is offline
 
Join Date: Jun 2002
Location: eXtremewebtech.com
Posts: 1,201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you have the hack installed replace the following with the code I posted above:

PHP Code:
            global $bbuserinfo;
            
$replacementvars['/\[you\]/i'] = $bbuserinfo['username']; 
If you are doing a fresh install replace the following
PHP Code:
function process_replacement_vars($newtext$sendheader 1)
{
    
// parses replacement vars

    
global $DB_site$vboptions$style$stylevar$newpmmsg$_SERVER$debug;
    static 
$replacementvars;

    if (
connection_status())
    {
        exit;
    }

    
// do vBulletin 3 replacement variables
    
if (!empty($style['replacements']))
    {
        if (!isset(
$replacementvars))
        {
            
$replacementvars unserialize($style['replacements']);
        }

        
// this is WAY too slow!
        //$newtext = strtr($newtext, $replacementvars);

        // using str_replace() has case-sensitivity issues...
        //$newtext = str_replace(array_keys($replacementvars), $replacementvars, $newtext);

        // this is slower than str_replace() but is case-insensitive, so we'll use it.
        
$newtext preg_replace(array_keys($replacementvars), $replacementvars$newtext);
    }

    return 
$newtext;

with
PHP Code:
function process_replacement_vars($newtext$sendheader 1)
{
    
// parses replacement vars

    
global $DB_site$vboptions$style$stylevar$newpmmsg$_SERVER$debug;
    static 
$replacementvars;

    if (
connection_status())
    {
        exit;
    }

    
// do vBulletin 3 replacement variables
    
if (!isset($replacementvars))
    {
            
$replacementvars unserialize($style['replacements']);
        }
if (
THIS_SCRIPT != editpost) { 
            global 
$bbuserinfo
            
$replacementvars['/\[you\]/i'] = $bbuserinfo['username']; 

        } 
            
$replacementvars['/\[test\]/i'] = "This is just a test."


        
// this is WAY too slow!
        //$newtext = strtr($newtext, $replacementvars);

        // using str_replace() has case-sensitivity issues...
        //$newtext = str_replace(array_keys($replacementvars), $replacementvars, $newtext);

        // this is slower than str_replace() but is case-insensitive, so we'll use it.
        
$newtext preg_replace(array_keys($replacementvars), $replacementvars$newtext);

    return 
$newtext;

Reply With Quote
  #71  
Old 01-20-2005, 08:28 PM
Tipi's Avatar
Tipi Tipi is offline
 
Join Date: Jun 2004
Location: Norway
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This was the hack i was looking for when i installed the /me hack. :nervous: Very nice hack, Boofo! And I clicked install too.
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:43 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.04596 seconds
  • Memory Usage 2,341KB
  • 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
  • (6)bbcode_php
  • (3)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