vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   vB3 [you] Code Hack (https://vborg.vbsupport.ru/showthread.php?t=62682)

aranthorn 08-19-2004 06:05 PM

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

andrew67 11-01-2004 09:06 AM

Nope there's not.
Also does this work for thread titles? Assuming it worked for vb3.0.3

aranthorn 11-01-2004 05:03 PM

<a href="https://vborg.vbsupport.ru/showthread.php?t=68832" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=68832</a>

Boofo 11-01-2004 08:55 PM

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

andrew67 11-01-2004 09:14 PM

I've actually got similar code to that at the moment but it doesn't work on thread titles.

Boofo 11-01-2004 09:21 PM

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

eXtremeTim 01-01-2005 06:11 AM

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.

Boofo 01-01-2005 07:33 AM

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

eXtremeTim 01-01-2005 02:51 PM

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;



Tipi 01-20-2005 08:28 PM

This was the hack i was looking for when i installed the /me hack. :nervous: Very nice hack, Boofo! And I clicked install too. ;)


All times are GMT. The time now is 05:06 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.01426 seconds
  • Memory Usage 1,772KB
  • 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
  • (6)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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