The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
yet another replace issue php, img to div
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: Code:
<img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /> some methods i have used with no results: PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
#2
|
||||
|
||||
Your playing around with regular expressions so you need to escape every non-standard character otherwise they all have particular meanings for the regular expression engine other than their plain text characters.
So your search string would need to be something like: Code:
'\<img src=\"\$post\[avatarurl\]\" \$post\[avwidth\] \$post\[avheight\] alt=\"\<phrase 1=\"\$post\[username\]\"\>\$vbphrase\[xs_avatar\]\<\/phrase\>\" border=\"0\" \/\>' |
Благодарность от: | ||
MarkFL |
#3
|
||||
|
||||
Quote:
PHP Code:
|
#4
|
||||
|
||||
Try <img src\="\$post\[avatarurl\]".*/> as the pattern.
|
#5
|
||||
|
||||
PHP Code:
|
#6
|
||||
|
||||
Try the pattern:
PHP Code:
|
#7
|
||||
|
||||
again nothing, lol this is becoming such a headache for such a little task =(
--------------- Added [DATE]1458277099[/DATE] at [TIME]1458277099[/TIME] --------------- just for popped in my head so i tried. postbit_display_complete Code:
$search = 'img'; $replace = 'a'; $vbulletin->templatecache['postbit'] = preg_replace($search, $replace, $vbulletin->templatecache['postbit']); --------------- Added [DATE]1458322966[/DATE] at [TIME]1458322966[/TIME] --------------- seems postbit isnt cached in the hook i was using using Code:
$vbulletin->templatecache['postbit'] = str_replace('<img src=\"$post[avatarurl]', 'SHIT', $vbulletin->templatecache['postbit']); example in red: Code:
str_replace('<img src=\"$post[avatarurl]'\"*/>, ...... |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|