• First, I’m not a programmer, so I’m already in way over my head. Sorry if this appears to be a stupid question.

    I’m trying to get things working between my wordpress and zenphoto installs.

    I am trying to make use of a graphpaper press theme (F8) which pulls an image from a post and uses that for a thumbnails to display the posts.

    It works great if the image is embedded using an <img> tag that points to a particular file, but because I’m using zenphoto and the WP plugin zenphoto press, my <img> aren’t really in the post, they hare there with short code that looks like this:

    <img title=”Image Title” src=”https://zenphoto_server.com/zp-core/i.php?a=album&i=imagfilename.jpg&#8221; alt=”Alt Image Text” />

    I dug around and I think I found the code in the modularity theme that gets the thumbnail, and it looks like this:

    function image_by_scan( $args = array() ) {

    /* Search the post’s content for the <img /> tag and get its URL. */
    preg_match_all( ‘|<img.*?src=[\'”](.*?)[\'”].*?>|i’, get_post_field( ‘post_content’, $args[‘post_id’] ), $matches );

    /* If there is a match for the image, return its URL. */

    if ( isset( $matches ) && $matches[1][0] ) {
    $scan_finds_image = true;
    $matchset = array( ‘url’ => $matches[1][0] );
    $matchurl = $matchset[‘url’];
    $height = $args[‘height’];
    $width = $args[‘width’];
    $timthumbprefix = get_bloginfo(‘template_url’).”/includes/timthumb.php?src=”;
    $timthumbsuffix = “&h=$height&w=$width&zc=1”;
    $timthumbimage = “<img src=’$timthumbprefix$matchurl$timthumbsuffix’ alt=” height=’$height’ width=’$width’ class=’timthumbnail’ />”;
    $link_to_post = $args[‘link_to_post’]; if ( $link_to_post ) {
    echo ” . $timthumbimage . ”;
    } else { echo $timthumbimage; } }
    return $scan_finds_image;
    }

    What I think his happening is that the URL is being built to include a call to more php code, so php code is being sent php code, not a link to an image URL, and the result is that no image is displayed. But being as I’m not a programmer, I don’t know how to alter things so that the image_by_scan function will return a valid img url?
    Any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘zenphoto press and graphpaper press theme’ is closed to new replies.