Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 01-24-2004, 08:55 AM
djnoz's Avatar
djnoz djnoz is offline
 
Join Date: May 2003
Location: UK
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In case anyone asks, to make it work for [ you ] instead, replace the appropriate line with this:

PHP Code:
    $replacementvars['/\[you\]/i'] = $bbuserinfo['username']; 
Reply With Quote
  #12  
Old 01-24-2004, 11:08 AM
fly fly is offline
 
Join Date: Oct 2003
Posts: 1,215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks guys!!!

I know I may be getting picky now but...

In the vB2 version I had, the [you] code was left in the reply. This made it easy to see if someone typed really your name, or used the [you] code. In this version, the [you] code is replaced w/ my name in the reply. Anyway to keep the [you] in there when replying instead?

Did that even make sense? Previously, when hitting reply, one could see if a person was really talking to you or using the [you] code.
Reply With Quote
  #13  
Old 01-24-2004, 02:15 PM
djnoz's Avatar
djnoz djnoz is offline
 
Join Date: May 2003
Location: UK
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you wanted to do this, it would require removal of the original [ you ] hack and modifications to the bbcodeparse php file. However, the you hack would no longer work in thread titles if you did this. If you want people to know the difference, you could try formatting... eg:

$replacementvars['/\[you\]/i'] = "<i>$bbuserinfo['username']</i>";

or something

BTW, NTLDR, thanks for sharing. It was quite a fun prank =)
Reply With Quote
  #14  
Old 01-24-2004, 02:18 PM
Link14716's Avatar
Link14716 Link14716 is offline
 
Join Date: Jun 2002
Location: Georgia, USA
Posts: 2,519
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by flypaper
Thanks guys!!!

I know I may be getting picky now but...

In the vB2 version I had, the [you] code was left in the reply. This made it easy to see if someone typed really your name, or used the [you] code. In this version, the [you] code is replaced w/ my name in the reply. Anyway to keep the [you] in there when replying instead?

Did that even make sense? Previously, when hitting reply, one could see if a person was really talking to you or using the [you] code.
Try this.
Find:
PHP Code:
    $replacementvars['/{bbusername}/i'] = $bbuserinfo['username']; 
Replace with:
PHP Code:
    if (THIS_SCRIPT != "editpost") {
        
$replacementvars['/{bbusername}/i'] = $bbuserinfo['username']; 
    } 
EDIT: I just tested it and it works perfectly.
Reply With Quote
  #15  
Old 01-24-2004, 03:28 PM
fly fly is offline
 
Join Date: Oct 2003
Posts: 1,215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Link: I don't think that worked, but it may be because I can't explain it.

Is it possible that when someone quotes another person, they see the [you] in the quote instead of their own name?

EDIT: and it looks like it only works in the thread title once. When I post a thread, my name is in the title. Other users only see my name too.
Reply With Quote
  #16  
Old 01-24-2004, 06:37 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 assassingod
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;
    } 
Thanks, Steve. I ended up going with this and it seems to work.

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;
 static 
$replacementvars;
 if (
connection_status())
 {
  exit;
 }
 
// do vBulletin 3 replacement variables
  
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;

Reply With Quote
  #17  
Old 01-24-2004, 06:56 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 flypaper
Link: I don't think that worked, but it may be because I can't explain it.

Is it possible that when someone quotes another person, they see the [you] in the quote instead of their own name?

EDIT: and it looks like it only works in the thread title once. When I post a thread, my name is in the title. Other users only see my name too.
I just tried it and the title goes with whoever is looking at the thread on my site. I posted 2 messages in there and logged out and viewed the thread as Unregistered and that is what showsed up in both mesages and the thread title.
Reply With Quote
  #18  
Old 01-24-2004, 07:03 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It should replace it on any page, anywhere as long as the page goes through process_replacement_vars(), which all the main vB (forum) pages that output something do.

@flypaper, I'm a bit confused as to how you'd like this to work.
Reply With Quote
  #19  
Old 01-24-2004, 07:23 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyway to fix it so you won't see {bbusername} in the email that gets sent if you are subscribed to the thread?
Reply With Quote
  #20  
Old 01-24-2004, 07:46 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Untested as usual, in includes/functions.php find:

PHP Code:
$touser['languageid'] = iif($touser['languageid'] == 0$vboptions['languageid'], $touser['languageid']); 
Add after:

PHP Code:
        $temptext $pagetext;
        
$pagetext preg_replace('/{bbusername}/i'$touser['username'], $pagetext); 
Find:

PHP Code:
vbmail($touser['email'], $subject$message); 
Add after:

PHP Code:
$pagetext $temptext
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 08:52 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.04300 seconds
  • Memory Usage 2,289KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (9)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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