PDA

View Full Version : 2 Hacks, 1 piece of code


globalwin
06-17-2002, 10:46 PM
$findwords=array(0 => '{getmicrostats}');
$replacewords=array(0 => $microstats);
$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,$new text);





$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,$new text);

I have these pieces of code from the vBMicroStats Hack and the Readers Username hack, I need to merge them some how, can anyone help me?

Sparkz
06-18-2002, 02:24 PM
Check out this post: https://vborg.vbsupport.ru/showthread.php?postid=257200#post257200

globalwin
06-18-2002, 02:29 PM
thanks you so much :D

globalwin
06-18-2002, 02:39 PM
still doesnt work :(

Sparkz
06-18-2002, 03:03 PM
Proper errordescriptions usually helps when trying to debug a problem ;)

globalwin
06-18-2002, 03:22 PM
there is no error, just the hack doesnt work. :(


// ###################### Start dovars #######################
function dovars($newtext,$sendheader=1) {
// parses replacement vars

global $DB_site,$replacementsetid,$gzipoutput,$gziplevel, $newpmmsg,$fullpm,$microstats,$bbuserinfo;
static $vars;

if (connection_status()) {
exit;
}

if (!isset($vars)) {
$vars=$DB_site->query("SELECT findword,replaceword FROM replacement WHERE replacementsetid IN(-1,'$replacementsetid') ORDER BY replacementsetid DESC,replacementid DESC");
} else {
$DB_site->data_seek(0,$vars);
}

$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,$new text);


this is the code, and surrounding code of the hack.