Development > Bugs

blocks showing user avatars

<< < (2/2)

Chen Zhen:
No, there is something wack about the SMF modification installer.
Their regexp option is not working and a search & replace of multiple instances of the same search is not working properly either.
You will have to do your own edits.

Use an editor such as notepad++ (notepad plus plus ... not MS notepad)
located here: https://notepad-plus-plus.org/


Open ../Sources/Subs-Portal.php with notepad++
hit CTRL-F

find what:

--- Code: ---function sp_loadCalendarData($type, $low_date, $high_date = false)

--- End code ---

add BEFORE above code:

--- Code: ---function sp_stripos_array($string, $array)
{
$array = !is_array($array) ? array($array) : $array;
foreach ($array as $find)
if (stripos($string, $find) !== false)
return true;

return false;
}

--- End code ---

save changes and close file


Open ../Sources/PortalBlocks.php with notepad++
hit CTRL-F
Click on "replace"

find what:

--- Code: ---stristr($row['avatar'], 'http://')

--- End code ---

replace with:

--- Code: ---sp_stripos_array($row['avatar'], array('http://', 'https://'))

--- End code ---

Use "replace all"
save changes and close file


Open ../Sources/PortalArticles.php with notepad++
hit CTRL-F
Click on "replace"

find what:

--- Code: ---stristr($row['avatar'], 'http://')

--- End code ---

replace with:

--- Code: ---sp_stripos_array($row['avatar'], array('http://', 'https://'))

--- End code ---

Use "replace all"
save changes and close file


The first edit is not a replacement, just add above the code I said to search for.
Make sure to use "replace all" for the 2nd & third edits because there are multiple replacements for those.

hulapyk:
Thanks a ton Chen Zhen :)
I'll give it a go later :)

Navigation

[0] Message Index

[*] Previous page

Go to full version