Results 1 to 1 of 1

Thread: Related Posts with images

  1. #1
    Thread Starter
    Newbie
    Not a Verified Customer
    csilva's Avatar
    Join Date
    Oct 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Related Posts with images

    Hello,


    I'm trying to make a plugin to work in related articles.
    The plugin uses this code to search for images in the articles:
    Code:
    // Image extraction
            $image = '';
            $x = stripos($content, '<img');
    
            if ($x !== false) {
                $x = stripos($content, 'src="', $x);
                if ($x !== false) {
                    $x += 5;
                    $y = strpos($content, '"', $x);
                    $image = substr($content, $x, $y-$x);
                }
            }
    
            if ($image == '') $image = get_option('siteurl') . '/wp-content/plugins/best-related-posts/empty.gif';
    Does anyone know how to change your images to search [img1] in articles ClassiPress?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)