Show thumb from news in another section

Hi, sorry for my english, i'm from Spain.
First I create a new with an image with tinyZenpage button from a gallery. Then I need to use these image in another section, for example to show a list of news with image and title.

I see in Mysql that image is inside "content": "<p><img class="zenp" .....". So, I can using some PHP function (substr, ...) to cut the "content" and take the piece with "<img ... />" tag.

But there's any esay way to get the image from a new?

Thanks

Comments

  • When you insert an image using tinyZenpate you have selected an album, then an image. If you know those two critical bits of information, you can create an image object in your normal scripts by using the `newImage(NULL, array('folder'=>album, 'filename'=>image)` function. But to use this you will have to become familiar with the Zenphoto object model and the various supporting functions.
  • Thanks for reply. I need to do something like this, so I need to create a function called "printNewsImage".

    <div class="image"><?php printNewsImage(); ?></div>

    <div class="text">
    <h3><?php printNewsTitle(); ?></h3>
    <p><?php printNewsContent(); ?></p>
    </div>

    You can help me?

    Thanks.
  • acrylian Administrator, Developer
    So you basically want to attach an image from the gallery to an article? That is not possible this way. Images inserted by tinyZenpage are static links and the article does not "know" about that.

    You cannot find out what image that is unless you want to do some complicated content parsing of the news article content. probably should use the codeblocks to store an array or the names of the album and image you wish to use this way.
Sign In or Register to comment.