The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
Can anyone plaese help me with the following code? I had microstats installed and working and when I installed the username in posts hack, microstats quit working. I know the problem in the code, just not how to fix it so both of them will work. I know it can be done because they both work here.
Code:
$findwords=array(0 => '{getmicrostats}'); $replacewords=array(0 => $microstats); $i=1; $findwords=array(0 => '{bbusername}'); $replacewords=array(0 => "$bbuserinfo[username]<!-- auto name hack -->"); $i=1; 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); |
#2
|
||||
|
||||
![]() Code:
$findwords=array(0 => '{getmicrostats}', 1 => '{bbusername}'); $replacewords=array(0 => $microstats, 1 => "$bbuserinfo[username]<!-- auto name hack -->"); $i=1; 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); |
#3
|
||||
|
||||
![]()
That did the trick, Chen. Works great! Thank you very much!
![]() ![]() ![]() Could you just add more arrays to it as you need to then? This could come in handy. Gives me a few ideas. ![]() Quote:
|
#4
|
||||
|
||||
![]()
Yes you can, but make sure you increment $i every time you add a new variable.
|
#5
|
||||
|
||||
![]()
You mean the $i=1;, right? Ok, I can do that. Just for learning sake here, why didn't you increment it when you put both of them together then? Or does the 0 and 1 basically mean the same?
![]() Quote:
|
#6
|
||||
|
||||
![]()
It could have been $i=0; before, don't know why it was set to 1.
|
#7
|
||||
|
||||
![]()
You could use something like this for an Easter Egg sort of thing, couldn't you? Like if you do the word {Boofo} it could put almost anything in the message post (from the postbit variables). For instance you could do {location} and have it bring up their location variable. Am I going in the right direction on this or am I way off track again?
![]() |
#8
|
||||
|
||||
![]()
I think that might have been from the microstats code and when I added the user name in post hack, it also had the 1 in it. At least I got to the point I knew what piece of code was messing up.
![]() ![]() Quote:
|
#9
|
||||
|
||||
![]()
I just noticed something that I'm not sure has anything to do with the code you gave me, but if I delete a message with the username in post hack in it, it gives me the errorid message. It goes ahead and deletes it, I just get the error after it says the message was successfully deleted. Any idea what might be causing that? Or how I can fix it?
|
#10
|
||||
|
||||
![]()
I don't think my hack is causing that.
|
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|