Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter urbanxlab

    (@urbanxlab)

    Here is the feed at your reference. Thanks.

    https://urbanxlab.com/blog/?feed=pagefrog_instant_articles

    Same problem here, still searching why…

    I’ve found where the error is appearing, but I can’t figure out how to correct it. The problem appears when more than 2 pictures appears in the articles, they can be in a gallery or not, doesn’t matter. So 2 continuous pictures is OK, more is wrong. The code of page frog is here :

    $image_nodes = array();
            for ($index = 0; $index < $node->childNodes->length; $index += 1) {
                $child = $node->childNodes->item($index);
    
                // if it's not an element node, continue past
                if ($child->nodeType != XML_ELEMENT_NODE)
                    continue;
    
                if ($child->nodeName == 'figure' && $this->getFirstDecendantByNodeName($child, 'img') != NULL)
                    array_push($image_nodes, $child);
                else {
                    if (count($image_nodes) > 1) {
                        $slideshow_node = $this->dom->createElement("figure");
                        $slideshow_node->setAttribute("pagefrog-ignore", "true");
                        $slideshow_node->setAttribute("class", "op-slideshow");
                        foreach ($image_nodes as $image_node)
                            $slideshow_node->appendChild($image_node);
                        $node->insertBefore($slideshow_node, $child);
                        $image_nodes = array();
                    }
                    else {
                        $image_nodes = array();
                    }
                }
            }

    have no idea why the $image_nodes always have 2 pictures when it could have more (value got through count($images_nodes).

    Anybody have an idea ?

    This code is in class_pagefrog_instant_articles_parser.php

    I’ve found where the error is appearing, but I can’t figure out how to correct it. The problem appears when more than 2 pictures appears in the articles, they can be in a gallery or not, doesn’t matter. So 2 continuous pictures is OK, more is wrong.

    I changed the value of ‘image_nodes’ to 10 and it fixed. However, this is not an awesome solution coz it will cause error with more than 10 continuous images I guess.

    Anyway, let’s give it a try (20,50, etc. if you have more images).

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Duplicate error for’ is closed to new replies.