Support » Plugin: HTML Import 2 » [Plugin: HTML Import 2] Import Images Fails – html-importer.php line 961

  • Resolved mmmonkey


    This plugin has already saved me some time, and I’d like to use it to its full potential and import html and images en-masse.

    I can only get it to work importing html only, I’ve got it cleaning up the formatting exactly how I want it, and I’d like to import images too.

    when I try I get the following error.

    Warning: strrpos() expects parameter 3 to be long, string given in /home/mmmonkey/public_html/wordpress/wp-content/plugins/import-html-pages/html-importer.php on line 961
    Could not find the right path to snes-rgb-nocap.jpg (tried /snes-rgb-nocap.jpg). It could not be imported. Please upload it manually.

    Originally my jpg files were in a separate directory, so I took a couple of pages, made the structure completely flat and did a quick edit on the html to reflect the flattened structure, but as you can see from the error above it doesn’t like that either.

    So I look in html-importer.php for line 961

    953 – // in case this server doesn’t have php_mbstring enabled in php.ini…
    954 – if (!function_exists(‘mb_strlen’)) {
    955 – function mb_strlen($string) {
    956 – return strlen(utf8_decode($string));
    957 – }
    958 – }
    959 – if (!function_exists(‘mb_strrpos’)) {
    960 – function mb_strrpos($haystack, $needle, $offset = 0) {
    961 – return strrpos(utf8_decode($haystack), $needle, $offset);
    962 – }
    963 – }

    Unfortunately that doesn’t mean anything to me, way above my head. But I know I don’t have access to edit php.ini. Is having that enabled the only way for it to work, or am I missing something obvious?

    Many thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • Just wondering if I have missed off some info which could help resolve this problem, of it there was anyone who could offer any suggestions?

    EDIT – just found this which has some of the same initial error message, anyone know if it was resolved?


    I searched a lot on the internet for a way to import static HTML webpage with images and attachments into a wordpress post and found that yours is the only plugin that is anywhere close.

    The issue is I spent over 6 hours trying to make this work with WordPress 3.2.1 installation on my home pc.

    I have a static page which has around 10 images with sub headings describing the event photos and three word document attachments. Your plugin is not importing the images and attachments, to the media section.

    Just so that I am clear, the images and the attachments and the html file all are in the same folder.

    Please help…I am willing to buy you a CASE OF COFFEE…This is for a charity website, which I am trying to build…

    Thanks in advance,

    Plugin Author Stephanie Leary


    Pete: the strrpos() error isn’t related to the problem with your image paths (I think). Can you post a bit of your HTML file containing the img tags and a (partial) outline of your directory structure? Or contact me, and I’ll reply so you can attach some example files. (In that case, you can ignore the stern warning on the contact form about plugin support!)

    PK, do you get any errors? How are the images and documents linked in your HTML?


    Thanks for your time and response. I have posted the sample format of my html files in the link below.

    You may download the zip file to look at how the html file accesses images from the same folder. I am looking at creating posts in this blog.

    The post title and post permalink look good, but no text is extracted, no .doc file link is extracted and also the images are left out.


    Plugin Author Stephanie Leary


    Oh, it’s not getting the content at all? That’s why the attachments are missing. If the importer can’t find any content to begin with, it can’t scan that content for links!

    What content tag settings are you using? Judging by the sample page, I would use the td tag with the valign attribute and the top value, but you could also go with the body tag (no attribute or value).

    It is working now when I changed it. Thanks so much. The content looks to be extracted all good. The page title and permalinks also generated perfectly well.

    I am looking at the post date, which shows today’s date and I am not sure why it was not picking the HTML creation date, but instead picking the last modified date…

    Again, thanks for the pointer…


    Plugin Author Stephanie Leary


    That’s the date the plugin uses unless you choose to set the date to now. If you want to change it to creation date, open up html-importer.php, find filemtime(), and change it to filectime().

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: HTML Import 2] Import Images Fails – html-importer.php line 961’ is closed to new replies.