Dr.CustUmz
03-17-2016, 05:05 PM
so i have been playing with this for a couple days, and i still cant get it. im trying to replace the avatar img in postbit to be a div instead.
this is the line to be changed:
<img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" />
im hooking into postbit_display_complete
some methods i have used with no results:
$search = '<img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" />';
$replace = '<div id="drcltrav" style="background-color:'.$color.';"><span>'.strtoupper($drcltrav_lgth).'</span></div>';
$vbulletin->templatecache['postbit'] = str_replace($search, $replace, $vbulletin->templatecache['postbit']);
$show['avatar'] = true;
using for my search:
$search = '<img src="' . $post[avatarurl] . '" ' . $post[avwidth] . ' ' . $post[avheight] . 'alt="<phrase 1="' . $post[username] . '">' . $vbphrase[xs_avatar] . '</phrase>" border="0" />';
this method seemed the most promising since it wouldnt matter if the site has a custom template:
$pattern = '/<img src="'.$post['avatarurl'].'"(.*?)>/';
$replacement = '<div id="myDiv">content</div>';
echo preg_replace($pattern, $replacement, $vbulletin->templatecache['postbit']);
and they're about 50 other ways I have tried this. the ONLY time i get a result is when i use
$post['avatarurl'] = '" class="someClass';
but i dont just want to add a class to it i want to replace it completely
this is the line to be changed:
<img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" />
im hooking into postbit_display_complete
some methods i have used with no results:
$search = '<img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" />';
$replace = '<div id="drcltrav" style="background-color:'.$color.';"><span>'.strtoupper($drcltrav_lgth).'</span></div>';
$vbulletin->templatecache['postbit'] = str_replace($search, $replace, $vbulletin->templatecache['postbit']);
$show['avatar'] = true;
using for my search:
$search = '<img src="' . $post[avatarurl] . '" ' . $post[avwidth] . ' ' . $post[avheight] . 'alt="<phrase 1="' . $post[username] . '">' . $vbphrase[xs_avatar] . '</phrase>" border="0" />';
this method seemed the most promising since it wouldnt matter if the site has a custom template:
$pattern = '/<img src="'.$post['avatarurl'].'"(.*?)>/';
$replacement = '<div id="myDiv">content</div>';
echo preg_replace($pattern, $replacement, $vbulletin->templatecache['postbit']);
and they're about 50 other ways I have tried this. the ONLY time i get a result is when i use
$post['avatarurl'] = '" class="someClass';
but i dont just want to add a class to it i want to replace it completely