Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Details »»

Version: 1.00, by Admin (Coder) Admin is offline
Developer Last Online: Nov 2024 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 02-18-2002 Last Update: Never Installs: 35
 
No support by the author.

Note: This hack will only work on PHP 4.0.5 and higher. Sorry for all the others (anyone still using these old versions?!).

Anyhow, this is a great little hack, and most importantly very very fun for the masses.
It gives your users the ability to use {bbusername} in their post, and it will mysteriously be changed into the viewer's username when he reads the page.

Demo:
FireFly <!-- auto name hack -->


You can detect this hack is in action by viewing the HTML source of the page. You will see <!-- auto name hack --> next to the name in the source.

You can this hack used in action here as well:
https://vborg.vbsupport.ru/showthrea...threadid=35192

This hack also contains a small optimization to vBulletin, which removes a lot of calls to str_replace() and replaces that with only one (which is why this hack only works with PHP 4.0.5 and up).

Have fun, I know you will.

Show Your Support

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

Comments
  #92  
Old 04-09-2002, 09:33 PM
Steve Machol's Avatar
Steve Machol Steve Machol is offline
 
Join Date: Nov 2001
Posts: 1,896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes I'm absolutely sure. I did exactly as I said and it worked. It sounds like another hack of yours is causing the problem. I don't have any other hacks so that may be the difference.
Reply With Quote
  #93  
Old 04-10-2002, 02:50 PM
Hwulex's Avatar
Hwulex Hwulex is offline
 
Join Date: Mar 2002
Location: Manchester, UK
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent.
It didn't work to start with, but I made the changes pointed out by Zaphod (here) and it works a treat.

Be interesting to see how the guys react (here)
Reply With Quote
  #94  
Old 04-10-2002, 06:27 PM
CeleronXL's Avatar
CeleronXL CeleronXL is offline
 
Join Date: Nov 2001
Posts: 146
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah ha, I found it. Ok, here it is:

PHP Code:
  $findwords=array(=> '{bbusername}');
  
$replacewords=array(=> "$bbuserinfo[username]");
  
$i=1;

  
$findwords=array(=> '{getmicrostats}');
  
$replacewords=array(=> $microstats);
  
$i=1;

  while (
$var=$DB_site->fetch_array($vars) and $i++) {
    if (
$var['findword']!="") {
      
$findwords[$i]=$var['findword'];
      
$replacewords[$i]=$var['replaceword'];
    }
  } 
The microstats and the bbusername hack interfere with eachother. To fix this, what should I do? Should I change the $i=; value on them or something? I'm not very good with this, but someone should know a way to set them each as their own thing.
Reply With Quote
  #95  
Old 04-10-2002, 06:34 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Replace this:
Code:
  $findwords=array(0 => '{bbusername}');
  $replacewords=array(0 => "$bbuserinfo[username]");
  $i=1;

  $findwords=array(0 => '{getmicrostats}');
  $replacewords=array(0 => $microstats);
  $i=1;
With this:
Code:
	$findwords = array(
		0 => '{bbusername}',
		1 => '{getmicrostats}'
	);
	$replacewords = array(
		0 => $bbuserinfo['username'],
		1 => $$microstats
	);
	$i = 2;
Reply With Quote
  #96  
Old 04-10-2002, 06:45 PM
CeleronXL's Avatar
CeleronXL CeleronXL is offline
 
Join Date: Nov 2001
Posts: 146
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice response time, man! That area of the code now looks like this:

PHP Code:
    $findwords = array(
        
=> '{bbusername}',
        
=> '{getmicrostats}'
    
);
    
$replacewords = array(
        
=> $bbuserinfo['username'],
        
=> $microstats
    
);
    
$i 2;

  while (
$var=$DB_site->fetch_array($vars) and $i++) {
    if (
$var['findword']!="") {
      
$findwords[$i]=$var['findword'];
      
$replacewords[$i]=$var['replaceword'];
    }
  }
  
$newtext=str_replace($findwords,$replacewords,$newtext); 
So the Microstats works again, but the {bbusername} just shows up as a blank space in the post..... =/ Is there anything I need to change in the lower portion of the code (beginning with "while ($var=.....").

Btw, I also had to get rid of one of the $'s before microstats....
Reply With Quote
  #97  
Old 04-10-2002, 06:52 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Make sure $bbuserinfo is still in the global line in dovars().
Reply With Quote
  #98  
Old 04-10-2002, 06:55 PM
CeleronXL's Avatar
CeleronXL CeleronXL is offline
 
Join Date: Nov 2001
Posts: 146
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks!! You are a bloody genius! Works now! W000000t!
Reply With Quote
  #99  
Old 04-10-2002, 10:35 PM
CeleronXL's Avatar
CeleronXL CeleronXL is offline
 
Join Date: Nov 2001
Posts: 146
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Waait a second. It only works in the title, not in the post itself.... It doesn't show up in the post, but if you click Edit then it has the username inserted there.... But it still doesn't work in the post.
Reply With Quote
  #100  
Old 04-11-2002, 10:10 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

See the thread by smachol in this forum "Fix replacement" thing.
Reply With Quote
  #101  
Old 04-17-2002, 11:31 AM
Slynderdale Slynderdale is offline
 
Join Date: Mar 2002
Location: New York State
Posts: 576
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

would it be possible to make it work in certain forums for example forumid 57 and 58?
Reply With Quote
Reply

Thread Tools

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:41 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.04822 seconds
  • Memory Usage 2,316KB
  • 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
  • (2)bbcode_code
  • (2)bbcode_php
  • (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