WordPress.org

Ready to get started?Download WordPress

Forums

zenphoto press and graphpaper press theme (3 posts)

  1. Kingpatzer
    Member
    Posted 3 years ago #

    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="http://zenphoto_server.com/zp-core/i.php?a=album&i=imagfilename.jpg" 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?

  2. Kingpatzer
    Member
    Posted 3 years ago #

    So, thinking about this some more, I think the key to making this work is that I need the variable $matchurl to change from a value of: http://zenphoto_server.com/zp-core/i.php?a=album&i=imagfilename.jpg to http://zenphoto_server.com/albums/<album>/<imagefilename.jpg&gt; and things will work.

    Can anyone tell me how to do that?

  3. Kingpatzer
    Member
    Posted 3 years ago #

    Anyone?

Topic Closed

This topic has been closed to new replies.

About this Topic