vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Reader's name inside post (+) (https://vborg.vbsupport.ru/showthread.php?t=35220)

Steve Machol 04-09-2002 09:33 PM

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.

Hwulex 04-10-2002 02:50 PM

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 :D (here)

CeleronXL 04-10-2002 06:27 PM

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.

Admin 04-10-2002 06:34 PM

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;


CeleronXL 04-10-2002 06:45 PM

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

Admin 04-10-2002 06:52 PM

Make sure $bbuserinfo is still in the global line in dovars().

CeleronXL 04-10-2002 06:55 PM

Thanks!! You are a bloody genius! Works now! W000000t! :D

CeleronXL 04-10-2002 10:35 PM

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.

Admin 04-11-2002 10:10 AM

See the thread by smachol in this forum "Fix replacement" thing.

Slynderdale 04-17-2002 11:31 AM

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


All times are GMT. The time now is 03:18 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.01143 seconds
  • Memory Usage 1,752KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_php_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