Results 1 to 5 of 5

Thread: PHP Code to Create and Use Thumbnails

  1. #1

    Default PHP Code to Create and Use Thumbnails

    In our system Typolight is used to manage most parts of the webpage. However, there are some scripts which are out of the scope of Typolight (e.g., Perl scripts managing incoming emails etc.) Some of these Perl scripts put image files in the tl_files folder of Typolight. I would like to know the PHP code to create thumbnails of these images.

    I would like to program some custom PHP code which reads from an SQL database and creates portions of the webpage rendered by Typolight. My custom code should create thumbnail images, display thumbnail images, and link to the original (big) images.

    But how do I create thumbnails and how do I retrieve them? I searched a bit through the sources of Typolight but couldn't find the parts where Typolight does exaclty this.

    Thanks

  2. #2
    User
    Join Date
    06-19-09.
    Location
    Kosice, Slovakia
    Posts
    61

    Default Re: PHP Code to Create and Use Thumbnails

    The code to resize images is in system/libraries/Controller.php - function name is getImage

    However if you want to display your content through TL, you may simply use image insert tag and TL will automatically create thumbnails for you.
    S.C.A.R.E

  3. #3

    Default Re: PHP Code to Create and Use Thumbnails

    Thanks for your reply, I will check the code.

    Quote Originally Posted by scare
    However if you want to display your content through TL, you may simply use image insert tag and TL will automatically create thumbnails for you.
    Sorry, I might find this in the user manual also. Just wanted to ask, how the image insert tag works. My content needs some more PHP though, will have to query a MySQL database as well.

    Best regards

  4. #4
    User
    Join Date
    06-19-09.
    Location
    Kosice, Slovakia
    Posts
    61

    Default Re: PHP Code to Create and Use Thumbnails

    I don't know what precisely do you aim for, but it looks like building custom module is the way to go Here is a tutorial http://dev.typolight.org/wiki/TutorialsExtension - you may need to create frontend module only, if you already have data in db table.

    As for image insert tag, you basically create output of your module as follows:
    Then TL takes the output and creates required thumbnail and generates correct image tag.
    http://dev.typolight.org/wiki/EnglishIn ... ram2value2
    S.C.A.R.E

  5. #5

    Default Re: PHP Code to Create and Use Thumbnails

    Cool, thanks a lot for your help. Nice forum here

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •