vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   [you] hack (https://vborg.vbsupport.ru/showthread.php?t=60633)

wrongful 01-23-2004 04:28 PM

[you] hack
 
Is there a chance of someone being able to port over this hack or the original author doing it. Also maybe with the option to limit its use by usergroup.

https://vborg.vbsupport.ru/showthrea...8&page=1&pp=15

fly 01-23-2004 04:52 PM

LOL. Weird. I was just coming here to request that.

NTLDR 01-23-2004 08:02 PM

In includes/functions.php find:

PHP Code:

    // 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

Replace with:

PHP Code:

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

    
// 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

Then use {bbusername} in your posts etc

wrongful 01-23-2004 09:03 PM

Great! Thank You.

eXtremeTim 01-23-2004 09:59 PM

Thanks saved me the trouble of making it :)

eXtremeTim 01-23-2004 10:09 PM

Now anyway so you can edit a post and it not get all screwed up? As in not lock in your username instead of {bbusername}

Boofo 01-24-2004 03:14 AM

Where will this all work at? Just in posts? Any way to get it to work in thread titles, too?

wrongful 01-24-2004 03:25 AM

Quote:

Originally Posted by Boofo
Where will this all work at? Just in posts? Any way to get it to work in thread titles, too?

It does work in thread titles too

Boofo 01-24-2004 03:43 AM

Great! How about the seach page? ;)


NTLDR, how would I add this code to this? It has the microstats hack in it.

// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// ! MicroStats Hack for vB 3.0 Gamma By: Apoco !
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
function process_replacement_vars($newtext, $sendheader = 1)
{
// parses replacement vars
global $DB_site, $vboptions, $style, $stylevar, $newpmmsg, $_SERVER, $microstats;
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);
}
$newtext = str_replace(('{microstats}'), $microstats, $newtext);
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
return $newtext;
}

assassingod 01-24-2004 08:07 AM

Try using:
PHP Code:

    // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    // ! MicroStats Hack for vB 3.0 Gamma By: Apoco !
    // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    
function process_replacement_vars($newtext$sendheader 1)
    {
    
// parses replacement vars
    
global $DB_site$vboptions$style$stylevar$newpmmsg$_SERVER$microstats$bbuserinfo;
    if (
connection_status())
    {
    exit;
    }
    
// do vBulletin 3 replacement variables
    
if (!empty($style['replacements']))
    {
    if (!isset(
$replacementvars))
    {
    
$replacementvars unserialize($style['replacements']);
    }
        
$replacementvars['/{bbusername}/i'] = $bbuserinfo['username']; 
    
// 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);
    }
    
$newtext str_replace(('{microstats}'), $microstats$newtext);
    
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    
return $newtext;
    } 



All times are GMT. The time now is 07:21 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.01444 seconds
  • Memory Usage 1,758KB
  • 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
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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